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 rungchan2/frontend-skills --skill zustand-storegit clone --depth 1 https://github.com/rungchan2/frontend-skillsWrote 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/rungchan2/frontend-skills/zustand-store)<a href="https://agentmods.dev/skills/rungchan2/frontend-skills/zustand-store"><img src="https://agentmods.dev/badge/skills/rungchan2/frontend-skills/zustand-store/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/rungchan2/frontend-skills/zustand-store"><img src="https://agentmods.dev/badge/skills/rungchan2/frontend-skills/zustand-store.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.00114 | $0.00821 |
| Opus 5 | $0.00057 | $0.00411 |
| Sonnet 5 | $0.00023 | $0.00164 |
| Haiku 4.5 | $0.00011 | $0.00082 |
Grade A, and why
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 11d 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.
What it actually says
Zustand Store 표준 패턴
State와 Actions를 분리한 표준 store 패턴 + 자주 쓰는 user store 1개.
왜 이 패턴인가
| 결정 | 이유 |
|---|---|
| State / Actions 인터페이스 분리 | 타입 hover 시 가독성, 액션만 따로 export 가능 |
| 비동기 액션을 store 안에 둠 | 컴포넌트에서 try/catch + setUser 반복 제거 |
initialState 상수 분리 + reset() |
로그아웃, 테스트 등에서 일관된 초기화 |
| 컴포넌트에서 selector 사용 권장 | 불필요한 리렌더 방지 |
워크플로우
1. 패키지 설치
pnpm add zustand
2. 위치 결정
| 구조 | 폴더 |
|---|---|
src/ |
src/stores/ |
| 루트 | stores/ |
3. 파일 생성
assets/user-store.ts → stores/user-store.ts
전제: lib/supabase/client.ts가 이미 있어야 한다. 없으면 supabase-clients 스킬을 먼저 적용하거나, 사용자에게 인증 방식을 물어 fetchUser/logout 본문을 교체.
4. 사용 예시 안내
스킬 실행 후 사용자에게:
// 컴포넌트에서
import { useUserStore } from "@/stores/user-store"
function Profile() {
const user = useUserStore((s) => s.user)
const fetchUser = useUserStore((s) => s.fetchUser)
// ...
}
// 앱 부팅 시 한 번 (예: app/layout 또는 auth provider)
useEffect(() => { fetchUser() }, [])
5. 추가 store 양산 가이드 (선택)
다른 store 만들 때 같은 패턴:
interface FooState { ... }
interface FooActions { ... }
const initialState: FooState = { ... }
export const useFooStore = create<FooState & FooActions>()((set) => ({
...initialState,
// actions
reset: () => set(initialState),
}))
6. CLAUDE.md 사용 규칙 (선택)
## Zustand 사용 규칙
- store는 항상 State / Actions 인터페이스 분리, `initialState` 상수, `reset()` 포함.
- 컴포넌트에서는 selector 사용: `useFooStore((s) => s.bar)` — store 전체 구독 금지.
- 비동기 로직은 store 내부 액션으로. 컴포넌트에서 `setX(await fetch())` 패턴 금지.
- 인증/세션 관련 상태는 항상 user-store에 모은다 (분산 금지).
산출물
stores/user-store.ts- (선택) CLAUDE.md 사용 규칙
비-목표
- 이 스킬은 persist middleware (localStorage) 를 기본으로 포함하지 않음. 필요하면 사용자가 요청 시 추가.
- 도메인별 store(예:
cart-store,ui-store)는 만들지 않음. 패턴만 깔아둠.
What ships with it
2 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.
- 11d ago First seen · 93 lines · 114 tokens per session scan A c1395e848e54
zustand-store is a skill published in the GitHub repository rungchan2/frontend-skills (2 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 114 tokens to every session and 821 once invoked, about $0.0006 per session on Opus 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-08-31.
Other skills, from other repositories
react-patterns
React 18/19 patterns including hooks discipline, server/client component boundaries, Suspense + error boundaries, form actions, data fetching, state management decision trees, and accessibility-first composition. Use when writing or reviewing React components.
chakra-ui-builder
Build responsive, accessible UI components and layouts using Chakra UI v3, install or configure Chakra UI in new and existing projects, and design scalable themes using tokens, semantic tokens, recipes, and slot recipes. Use this skill whenever a user asks to build, create, or generate any UI component, page, form…
material-ui-tailwind
Integrates Material UI with Tailwind CSS v4 using cascade layers (enableCssLayer, @layer order) and documents Tailwind v3 interoperability (preflight, important, injectFirst, portals). Use when combining MUI with Tailwind utilities, slotProps className, or theme token bridges.
fuzzy-ranking
Rank fuzzy matches with rankItem, filter with RankingInfo.passed, compare saved ranking metadata with compareItems, and configure rankings, thresholds, accessors, min/max bounds, or diacritics. Load for @tanstack/match-sorter-utils itself or fuzzy Table filterMeta wiring.
api-not-found
Diagnose missing TanStack Table v9 exports, options, state slices, and instance methods. Load before inventing an API when code sees a type error, undefined feature method, absent object key, adapter mismatch, or v8-shaped example.
r3f-best-practices
React Three Fiber (R3F) and Poimandres ecosystem best practices. Use when writing, reviewing, or optimizing R3F code. Triggers on tasks involving @react-three/fiber, @react-three/drei, zustand, @react-three/postprocessing, @react-three/rapier, or leva.