zustand-state-management
Installation
SKILL.md
Zustand State Management
Use this skill for Zustand authoring and review. Start by deciding whether the state should exist in Zustand at all, then choose the smallest store shape, subscription pattern, and middleware stack that solves the problem without introducing avoidable rerenders or framework bugs.
Use This Skill When
- Building or reviewing Zustand stores in React or vanilla TypeScript code
- Deciding whether state belongs in local component state, Zustand, or a server-state tool
- Structuring store state, actions, selectors, slices, and derived values
- Fixing rerender churn, unstable selector outputs, or stale v4 equality patterns
- Adding
persist,devtools,immer,combine, orsubscribeWithSelector - Wiring Zustand into Next.js, SSR, or hydration-sensitive apps
- Modernizing older examples that still rely on
zustand/context, selector equality args oncreate, or other pre-v5 patterns
Out Of Scope
- Server-state fetching, caching, retries, and invalidation beyond explaining why Zustand is not the right primary tool
- UI-library-specific component advice beyond the store integration point
- Generic React performance tuning that is unrelated to Zustand subscriptions