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 skills add existential-birds/beagle --skill zustand-stategit clone --depth 1 https://github.com/existential-birds/beagleWrote 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/skills/existential-birds/beagle/zustand-state)<a href="https://agentmods.dev/skills/existential-birds/beagle/zustand-state"><img src="https://agentmods.dev/badge/skills/existential-birds/beagle/zustand-state/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/existential-birds/beagle/zustand-state"><img src="https://agentmods.dev/badge/skills/existential-birds/beagle/zustand-state.svg" alt="Reviewed on agentmods" width="80" 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.00061 | $0.01084 |
| Opus 5.5 | $0.00024 | $0.00434 |
| Sonnet 5.5 | $0.00012 | $0.00217 |
| Haiku 4.5 | $0.00006 | $0.00108 |
Grade A, and why
zustand-state 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 4d 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 — 121 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Zustand State Management (v5)
Minimal state management — named exports only (v5 removed default exports), React 18/19 compatible, and no global providers required.
Quick Reference
import { create } from 'zustand'
interface BearState {
bears: number
increase: (by: number) => void
}
const useBearStore = create<BearState>()((set) => ({
bears: 0,
increase: (by) => set((state) => ({ bears: state.bears + by })),
}))
// In component - select only what you need
const bears = useBearStore((state) => state.bears)
const increase = useBearStore((state) => state.increase)
State Updates
// Flat updates (auto-merged at one level)
set({ bears: 5 })
set((state) => ({ bears: state.bears + 1 }))
// Nested objects (manual spread required without immer)
set((state) => ({
nested: { ...state.nested, count: state.nested.count + 1 }
}))
// Replace entire state (no merge)
set({ bears: 0 }, true)
Selectors & Performance (v5 useShallow)
In Zustand v5, base create no longer accepts a custom equality function as a 2nd argument. Returning a fresh object or array literal from a selector without useShallow causes infinite re-renders (Maximum update depth exceeded):
import { useShallow } from 'zustand/react/shallow'
// Good - subscribes only to bears
const bears = useBearStore((state) => state.bears)
// Bad - rerenders on any state change
const state = useBearStore()
// Bad in v5 - new object every render triggers infinite loop!
// const { bears, fish } = useBearStore((s) => ({ bears: s.bears, fish: s.fish }))
// Good - multiple values with useShallow
const { bears, fish } = useBearStore(
useShallow((state) => ({ bears: state.bears, fish: state.fish }))
)
// Array destructuring with useShallow
const [bearsVal, fishVal] = useBearStore(
useShallow((state) => [state.bears, state.fish])
)
If you need createWithEqualityFn, import it from 'zustand/traditional' (requires use-sync-external-store as a peer dependency in v5).
What ships with it
3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 4d ago Changed · +2 lines · -4 tokens per session 1528334e99d9
- 2mo ago First seen · 119 lines · 65 tokens per session scan A bb1ea5fdc406
zustand-state is a skill published in the GitHub repository existential-birds/beagle (91 stars, last pushed 4d ago), licensed Apache-2.0. It adds 61 tokens to every session and 1,084 once invoked, about $0.0002 per session on Opus 5.5. 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-09-16.
zustand-state compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| zustand-stateexistential-birds/beagle | Skill | 91 | 4d ago | Apache-2.0 | A | 61 | Claude Code, Codex |
| isolating-product-facade-contractsPostHog/posthog | Skill | 41k | today | none | A | 76 | Claude Code, Codex |
| qa-frontendPostHog/posthog | Skill | 41k | today | none | A | 216 | Claude Code |
| reviewing-personhog-protocolPostHog/posthog | Skill | 41k | today | none | A | 111 | Claude Code, Codex |
| splitting-oversized-modulesPostHog/posthog | Skill | 41k | today | none | A | 197 | Claude Code, Codex |
| establishing-code-ownershipPostHog/posthog | Skill | 41k | today | none | A | 94 | Claude Code, Codex |
| writing-code-commentsPostHog/posthog | Skill | 41k | today | none | A | 173 | Claude Code, Codex |