Agent skill

Zustand Patterns

by yonatangross in yonatangross/orchestkit

Reference for Zustand 5.x state management including slices, middleware, Immer, useShallow, persistence, selectors, and devtools integration.

MITAuto-check passedFrontend & Design

Install Zustand Patterns

skills CLI
$ npx skills add yonatangross/orchestkit --skill zustand-patterns -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install yonatangross/orchestkit zustand-patterns --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/yonatangross/orchestkit.git skills-src && mkdir -p .claude/skills && cp -r skills-src/src/skills/zustand-patterns .claude/skills/zustand-patterns && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
zustand-patterns
GitHub stars
290
Token cost
~1.6k tokens
SKILL.md length
392 words
Files
11 (incl. scripts, references)
Skills in repo
108
Repo updated
First seen
Licence
MIT

At a glance

Reference for Zustand 5.x state management including slices, middleware, Immer, useShallow, persistence, selectors, and devtools integration.

  • Building React state management with Zustand instead of Redux
  • SKILL.md covers Overview, Upstream coverage (do not…, Quick Reference and Key Decisions, plus 4 more sections
  • Runs TypeScript scripts from its folder
  • Tasks that involve State management

What it does

Zustand Patterns is an agent skill from yonatangross/orchestkit. Reference for Zustand 5.x state management including slices, middleware, Immer, useShallow, persistence, selectors, and devtools integration. Documents 7 core patterns with TypeScript examples and anti-patterns. Use when building React state management with Zustand instead of Redux.

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 14 other files, including scripts and reference files (for example `checklists/zustand-checklist.md`, `references/anti-patterns-and-integration.md` and `references/ork-delta.md`). Compatibility notes: Claude Code 2.1.277+.

It sits in Frontend & Design, covering State management. It works with Zustand, TypeScript, Redux and TanStack. The repository describes itself as: The Complete AI Development Toolkit for Claude Code. 106 skills, 36 agents, 171 hooks. Install ork for stable (v9.x), or ork-alpha for the v10 line, which ships daily. The licence is MIT.

When your agent uses it

  • Building React state management with Zustand instead of Redux
  • Tasks that involve State management

Example prompts

  • “/zustand-patterns”

Requirements

  • Node.js
  • Compatibility (from SKILL.md): Claude Code 2.1.277+.
  • Pre-approved tools (allowed-tools): Read, Write, Grep, Glob

What it can do on your machine

Read from SKILL.md and the folder at commit 02bbf9a. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Grep
    • Glob

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (TypeScript), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com
    • tanstack.com
    • react-hook-form.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Claude Code 2.1.277+.

    From compatibility in the SKILL.md frontmatter.

Context cost

Zustand Patterns loads about 1.6k tokens when it runs, and up to ~2.7k if it reads all its reference files. Until then it costs about 75 tokens; SKILL.md has 392 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~75
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from yonatangross/orchestkit at commit 02bbf9a, republished under its MIT licence (© yonatangross). 392 words, ~1,630 tokens.

Download SKILL.mdSave it as .claude/skills/zustand-patterns/SKILL.md (or your agent's skills folder). This skill also uses 10 other files; get the full folder from GitHub.
name
zustand-patterns
description
Reference for Zustand 5.x state management including slices, middleware, Immer, useShallow, persistence, selectors, and devtools integration. Documents 7 core patterns with TypeScript examples and anti-patterns. Use when building React state management with Zustand instead of Redux.
allowed-tools
Read, Write, Grep, Glob
compatibility
Claude Code 2.1.277+.
license
MIT
context
inherit
user-invocable
false
disable-model-invocation
true
effort
low
model
haiku
metadata.category
document-asset-creation
metadata.version
1.0.0
metadata.author
OrchestKit
metadata.complexity
low

Zustand Patterns

Modern state management with Zustand 5.x - lightweight, TypeScript-first, no boilerplate.

Overview

  • Global state without Redux complexity
  • Shared state across components without prop drilling
  • Persisted state with localStorage/sessionStorage
  • Computed/derived state with selectors
  • State that needs middleware (logging, devtools, persistence)

Upstream coverage (do not restate)

Zustand's own docs are the source for the mechanics. This skill carries only the OrchestKit delta on top of them, in references/ork-delta.md, the rules/ files, and the checklist.

TopicFirst-party source
Basic store, create<State>()(), actions, async actionshttps://github.com/pmndrs/zustand/blob/main/docs/reference/apis/create.md
Slices pattern (splitting and combining stores)https://github.com/pmndrs/zustand/blob/main/docs/learn/guides/slices-pattern.md
Typing slices and middleware mutator tupleshttps://github.com/pmndrs/zustand/blob/main/docs/learn/guides/advanced-typescript.md
Immer middleware (draft mutations)https://github.com/pmndrs/zustand/blob/main/docs/reference/middlewares/immer.md
persist: partialize, version, migrate, onRehydrateStorage, storage adaptershttps://github.com/pmndrs/zustand/blob/main/docs/reference/middlewares/persist.md
devtools: action names, enabled, serialize, tracehttps://github.com/pmndrs/zustand/blob/main/docs/reference/middlewares/devtools.md
subscribeWithSelector and non-React subscriptionshttps://github.com/pmndrs/zustand/blob/main/docs/reference/middlewares/subscribe-with-selector.md
Selectors and useShallow re-render controlhttps://github.com/pmndrs/zustand/blob/main/docs/learn/guides/prevent-rerenders-with-use-shallow.md
v4 to v5 migration (createWithEqualityFn, React 18 floor)https://github.com/pmndrs/zustand/blob/main/docs/reference/migrations/migrating-to-v5.md
SSR and hydrationhttps://github.com/pmndrs/zustand/blob/main/docs/learn/guides/ssr-and-hydration.md
Store testing and resethttps://github.com/pmndrs/zustand/blob/main/docs/learn/guides/testing.md
Server-state ownership (use TanStack Query, not Zustand)https://tanstack.com/query/latest/docs/framework/react/guides/does-this-replace-client-state

Quick Reference

typescript
// ✅ Create typed store with double-call pattern
const useStore = create<State>()((set, get) => ({ ... }));

// ✅ Use selectors for all state access
const count = useStore((s) => s.count);

// ✅ Use useShallow for multiple values (Zustand 5.x)
const { a, b } = useStore(useShallow((s) => ({ a: s.a, b: s.b })));

// ✅ Middleware order: immer → subscribeWithSelector → devtools → persist
create(persist(devtools(immer((set) => ({ ... })))))

// ❌ Never destructure entire store
const store = useStore(); // Re-renders on ANY change

// ❌ Never store server state (use TanStack Query instead)
const useStore = create((set) => ({ users: [], fetchUsers: async () => ... }));

Key Decisions

DecisionOption AOption BRecommendation
State structureSingle storeMultiple storesSlices in single store - easier cross-slice access
Nested updatesSpread operatorImmer middlewareImmer for deeply nested state (3+ levels)
PersistenceManual localStoragepersist middlewarepersist middleware with partialize
Multiple valuesMultiple selectorsuseShallowuseShallow for 2-5 related values
Server stateZustandTanStack QueryTanStack Query - Zustand for client-only state
DevToolsAlways onConditionalConditional - enabled: process.env.NODE_ENV === 'development'
Show full SKILL.md (164 more words)Show less

Anti-Patterns & Integration

Forbidden patterns (store destructuring, derived state, server state, direct mutation) and React Query integration guidance.

Load Read("references/anti-patterns-and-integration.md") for anti-pattern examples and TanStack Query separation patterns.

Capability Details

store-creation

Keywords: zustand, create, store, typescript, state Solves: Setting up type-safe Zustand stores with proper TypeScript inference

slices-pattern

Keywords: slices, modular, split, combine, StateCreator Solves: Organizing large stores into maintainable, domain-specific slices

middleware-stack

Keywords: immer, persist, devtools, middleware, compose Solves: Combining middleware in correct order for immutability, persistence, and debugging

selector-optimization

Keywords: selector, useShallow, re-render, performance, memoization Solves: Preventing unnecessary re-renders with proper selector patterns

persistence-migration

Keywords: persist, localStorage, sessionStorage, migrate, version Solves: Persisting state with schema migrations between versions

References

Load on demand with Read("references/<file>"):

FileContent
ork-delta.mdOrchestKit-specific rules: the corrected zustand/shallow label, the v5 floor, secret handling, graded slice typing
anti-patterns-and-integration.mdForbidden patterns and React Query integration

Other resources:

  • Load: Read("scripts/store-template.ts") - Production-ready store template
  • Load: Read("checklists/zustand-checklist.md") - Implementation checklist

© yonatangross, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 10 other files (scripts, references) in src/skills/zustand-patterns of yonatangross/orchestkit.

  • SKILL.md
  • checklists/zustand-checklist.md
  • references/anti-patterns-and-integration.md
  • references/ork-delta.md
  • rules/_sections.md
  • rules/_template.md
  • rules/zustand-middleware-order.md
  • rules/zustand-middleware-pitfalls.md
  • rules/zustand-slice-pattern.md
  • scripts/store-template.ts
  • test-cases.json

Open the folder on GitHubat commit 02bbf9a

Compare with similar skills

Zustand Patterns next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Zustand Patterns compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Zustand Patterns this skillyonatangross/orchestkit290—~1.6kAutomated safety check: PassMIT
React ExpertJeffallan/claude-skills12k—~1.4kAutomated safety check: PassMIT
React State Managementinvolvex/youtube-music-cli45613 repos~3kAutomated safety check: PassMIT
Nextjs15 Initbear2u/my-skills933—~2.4kAutomated safety check: PassNone
Frontend Review Statemizchi/skills359—~1.4kAutomated safety check: PassNone
npm Package Comparatortinyfish-io/tinyfish-cookbook2.2k—~2kAutomated safety check: PassMIT

Similar skills

  • React Expert

    Jeffallan/claude-skills

    Builds React 19 components in TypeScript with Server Components, useActionState forms, custom hooks and state libraries, checked with tsc and React Testing Library.

    12k GitHub stars~1.4k tokensUpdated 5 days ago
    Frontend & DesignAuto-check passed
  • React State Management

    involvex/youtube-music-cli

    Master modern React state management with Redux Toolkit, Zustand, Jotai, and React Query.

    456 GitHub starsUsed in 13 repos~3k tokens
    Frontend & DesignAuto-check passed
  • Nextjs15 Init

    bear2u/my-skills

    A skill your agent uses when user wants to create a new Next.js 15 project (Todo/Blog/Dashboard/E-commerce/Custom domain) with App Router, ShadCN, Zustand, Tanstack Query, and modern Next.js stack

    933 GitHub stars~2.4k tokensUpdated 3 mo ago
    Frontend & DesignAuto-check passed
  • A skill your agent uses when reviewing state management architecture — classifying state types (server/URL/form/UI), checking for over-globalization, Jotai/Zustand/Redux patterns, derived state, and…

    359 GitHub stars~1.4k tokensUpdated 7 days ago
    Frontend & DesignAuto-check passed
  • npm Package Comparator

    tinyfish-io/tinyfish-cookbook

    Compare two or more npm packages side by side using live data — downloads, bundle size, GitHub stars, last update, known vulnerabilities, and community sentiment.

    2.2k GitHub stars~2k tokensUpdated today
    Frontend & DesignAuto-check passed
  • Zustand State Management

    secondsky/claude-skills

    Zustand state management for React with TypeScript. An agent skill from secondsky/claude-skills.

    227 GitHub stars~2.5k tokensUpdated 10 days ago
    Frontend & DesignAuto-check passed

More from yonatangross/orchestkit

All 108 skills in this repo
  • API Design

    yonatangross/orchestkit

    API contract design for REST and GraphQL, covering resource shape, URL and header versioning with deprecation windows, RFC 9457 Problem Details error handling, and OpenAPI specs.

    290 GitHub stars~2.9k tokensUpdated today
    Auto-check passed
  • Architecture Decision Record

    yonatangross/orchestkit

    ADR templates in the Nygard format with context, decision, consequences, and alternatives.

    290 GitHub stars~2k tokensUpdated today
    Auto-check passed
  • Audit Full

    yonatangross/orchestkit

    Single-pass codebase analysis leveraging a 1M-token context window for comprehensive security scanning, architecture review, and dependency auditing.

    290 GitHub stars~3.5k tokensUpdated today
    Auto-check: notes
  • Code Review Playbook

    yonatangross/orchestkit

    Structured review processes, conventional comments, language-specific checklists, and feedback templates.

    290 GitHub stars~2.2k tokensUpdated today
    Auto-check passed
  • Create PR

    yonatangross/orchestkit

    Creates GitHub pull requests with pre-flight validation, conventional title formatting, and structured summary generation.

    290 GitHub stars~4.5k tokensUpdated today
    Auto-check: notes
  • Explore

    yonatangross/orchestkit

    Multi-angle codebase exploration spawning 3-5 parallel agents for code structure, data flow, architecture patterns, and health assessment.

    290 GitHub stars~3.9k tokensUpdated today
    Auto-check: notes

Questions about Zustand Patterns

What does Zustand Patterns do?

Reference for Zustand 5.x state management including slices, middleware, Immer, useShallow, persistence, selectors, and devtools integration. Zustand Patterns is an agent skill from yonatangross/orchestkit.x state management including slices, middleware, Immer, useShallow, persistence, selectors, and devtools integration.

When should I use Zustand Patterns?

Zustand Patterns fits situations like: building React state management with Zustand instead of Redux; tasks that involve State management.

How do I install Zustand Patterns in Claude Code?

Run `npx skills add yonatangross/orchestkit --skill zustand-patterns -a claude-code`. Or copy the skill folder (src/skills/zustand-patterns in yonatangross/orchestkit) into .claude/skills/zustand-patterns in your project. Claude Code loads it when a task matches its description.

How do I install Zustand Patterns in Codex?

Run `npx skills add yonatangross/orchestkit --skill zustand-patterns -a codex`. Or copy the skill folder (src/skills/zustand-patterns in yonatangross/orchestkit) into .agents/skills/zustand-patterns in your project. Codex loads it when a task matches its description.

Can I use Zustand Patterns in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add yonatangross/orchestkit --skill zustand-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/zustand-patterns, .gemini/skills/zustand-patterns, .github/skills/zustand-patterns and .opencode/skills/zustand-patterns in your project.

What does Zustand Patterns need to run?

Going by SKILL.md and its folder, Zustand Patterns needs TypeScript for the scripts in its folder. Our summary lists: Node.js. Its frontmatter pre-approves these tools: Read, Write, Grep, Glob. Compatibility (from SKILL.md): Claude Code 2.1.277+..

Does Zustand Patterns access the network?

SKILL.md names 3 domains. As links in the text: github.com, tanstack.com and react-hook-form.com. This is read from the text; nothing was executed.

Is Zustand Patterns safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Zustand Patterns use?

Zustand Patterns is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Zustand Patterns use?

About 1.6k tokens (SKILL.md is roughly 6.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1k tokens, read only when the agent opens those files.

What are the alternatives to Zustand Patterns?

Skills that share tags, products or a category with Zustand Patterns: React Expert (Jeffallan/claude-skills, 12k stars), React State Management (involvex/youtube-music-cli, 456 stars), Nextjs15 Init (bear2u/my-skills, 933 stars) and Frontend Review State (mizchi/skills, 359 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Zustand Patterns?

yonatangross (a GitHub user) maintains it in yonatangross/orchestkit, which has 290 GitHub stars. The repository holds 108 skills in this directory. The repository was last updated on October 9, 2026.

Source: yonatangross/orchestkit on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.