Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/farzannajipour/cursor-react-rules/setup-zustand-storegit clone --depth 1 https://github.com/Farzannajipour/cursor-react-rulesWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/farzannajipour/cursor-react-rules/setup-zustand-store)<a href="https://agentmods.dev/commands/farzannajipour/cursor-react-rules/setup-zustand-store"><img src="https://agentmods.dev/badge/commands/farzannajipour/cursor-react-rules/setup-zustand-store.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.01276 |
| Opus 5 | $0.00000 | $0.00638 |
| Sonnet 5 | $0.00000 | $0.00255 |
| Haiku 4.5 | $0.00000 | $0.00128 |
Grade A, and why
setup-zustand-store scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 210 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Setup Zustand Store
Overview
Create a Zustand store for state management with TypeScript, persist middleware, and dev tools.
Steps
-
Define store interface
- Define state shape
- Define actions (mutations)
- Add proper TypeScript types
-
Create store
- Use Zustand create function
- Add middleware (persist, devtools)
- Implement actions
-
Use in components
- Import and use hooks
- Select only needed state
- Call actions to update state
Template
Basic Store
import { create } from 'zustand';
interface CounterStore {
count: number;
increment: () => void;
decrement: () => void;
reset: () => void;
}
export const useCounterStore = create<CounterStore>((set) => ({
count: 0,
increment: () => set((state) => ({ count: state.count + 1 })),
decrement: () => set((state) => ({ count: state.count - 1 })),
reset: () => set({ count: 0 }),
}));
Store with Persist
import { create } from 'zustand';
import { persist } from 'zustand/middleware';
interface AuthStore {
user: User | null;
token: string | null;
login: (user: User, token: string) => void;
logout: () => void;
updateUser: (user: Partial<User>) => void;
}
export const useAuthStore = create<AuthStore>()(
persist(
(set) => ({
user: null,
token: null,
login: (user, token) => set({ user, token }),
logout: () => set({ user: null, token: null }),
updateUser: (updates) =>
set((state) => ({
user: state.user ? { ...state.user, ...updates } : null,
})),
}),
{
name: 'auth-storage', // localStorage key
}
)
);
Store with DevTools
import { create } from 'zustand';
import { devtools, persist } from 'zustand/middleware';
interface CartStore {
items: CartItem[];
addItem: (item: CartItem) => void;
removeItem: (id: string) => void;
updateQuantity: (id: string, quantity: number) => void;
clearCart: () => void;
total: () => number;
}
export const useCartStore = create<CartStore>()(
devtools(
persist(
(set, get) => ({
items: [],
addItem: (item) =>
set((state) => ({
items: [...state.items, item],
})),
removeItem: (id) =>
set((state) => ({
items: state.items.filter((item) => item.id !== id),
})),
updateQuantity: (id, quantity) =>
set((state) => ({
items: state.items.map((item) =>
item.id === id ? { ...item, quantity } : item
),
})),
clearCart: () => set({ items: [] }),
total: () => {
const { items } = get();
return items.reduce((sum, item) => sum + item.price * item.quantity, 0);
},
}),
{
name: 'cart-storage',
}
)
)
);
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago First seen · 210 lines · 0 tokens per session scan A 9dd18de616ef
setup-zustand-store is a command published in the GitHub repository Farzannajipour/cursor-react-rules (3 stars, last pushed 7mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,276 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other commands, from other repositories
frontend
Injects context of all relevant cli files.
component
Scaffold a new React component grounded in the paper-mono primitives. Requires explicit kind or a nearest-existing-component match. No empty divs, no speculative scaffolding.
replan-remaining-work
Command "replan-remaining-work" from udecode/plate, covering command: re-plan remaining work, when to run, hard rule, invocation and refresh afterward.
speckit-gaia-plan-close
Close a plan after implementation+merge. Offers wiki-promote for the plan's consolidated SUMMARY.md, cold-consolidates an out-of-band merge, then early-reaps the local plan folder once cost is represented in cost.jsonl.
prototype-loop
Enter leveraged-prototype focus mode — focus marker plus normal watch/rebuild loop for visual-parity work and batch upstream framework gap-fixes.
review-arch
Review the current branch for code quality, TypeScript, and React/Next.js patterns. Supports whole-branch review or scoped review by path, feature, or base branch.