Agent skill · software engineering · aiskillstore

superpower-zustand

MANDATORY for creating Zustand stores. This skill is required when users request state management, creating stores, or mention Zustand. Do NOT create Zustand stores without this skill - all stores must use the required StoreBuilder pattern with immer middleware and factory pattern separation

Why this skill is useful

Adds a standardized StoreBuilder pattern for Zustand state management that ensures type safety and separation of concerns, which the AI wouldn't reliably generate on its own.

What it needs

About 3k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.

What this skill does

Zustand StoreBuilder Pattern <CRITICAL> DO NOT create Zustand stores using standard patterns (create with inline actions). ALL Zustand stores in this project MUST use the StoreBuilder pattern defined below. This is a required architectural standard, not a suggestion. </CRITICAL> Purpose Enforce a standardized, type-safe approach to creating Zustand stores that: Separates state definition from actions using the factory pattern Integrates immer middleware for convenient immutable updates Supports optional persistence with fine-grained control Exposes both reactive (useStore hook) and non-reactive (get/set) access Maintains consistent patterns across the codebase When to Use This Skill Use this skill when: Creating new Zustand stores for state management User requests state management solutions in a React application Implementing stores for any feature requiring client-side state Required Pattern All Zustand stores MUST use the StoreBuilder utility located in assets/storebuilder.ts. Core Implementation Steps 1. Copy the StoreBuilder utility (if not already in the project) Source: skills/superpower-zustand/assets/storebuilder.ts Destination: src/lib/storebuilder.ts (or similar location in the project) 2. Define state type separately from actions Create a type for the full store (state + actions) Use Omit to exclude action methods when passing to StoreBuilder 3. Initialize the store with StoreBuilder Pass initial state as first argument Optionally pass PersistConfig as second argument for persistence 4. Separate actions using createFactory Define all actions as methods in the createFactory argument Actions access set from the StoreBuilder closure Use immer-style mutations within set callbacks 5. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills aiskillstore/superpower-zustand

View the source on GitHub

Browse the @skills marketplace