zustand-store-scaffold

Scaffold class-based Zustand stores with flattenActions and generated TypeScript files.

2|Updated Feb 19, 2026
One-click install
npx skills add https://github.com/Adonis0123/adonis-skills --skill zustand-store-scaffold
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: zustand-store-scaffold
Source: https://github.com/Adonis0123/adonis-skills/tree/main/.agents/skills/zustand-store-scaffold
Command: npx skills add https://github.com/Adonis0123/adonis-skills --skill zustand-store-scaffold

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Scaffold type-safe class-based Zustand stores with flattenActions for prototype-safe slice composition.

Core Features & Use Cases

  • Web Pattern: component-level store with React Context + Provider.
  • Core Pattern: slice-based store capable of multiple slices via flattenActions.
  • Generated files: types.ts, utils/flattenActions.ts, index.ts, and per-slice files; supports single or multi-slice setups.

Quick Start

Run the scaffold script with --pattern web or --pattern core, supply a store name and a target path, and optionally specify slices to generate all required files.

Frequently Asked Questions about zustand-store-scaffold

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I scaffold a class-based Zustand store with TypeScript?

You scaffold a class-based Zustand store by running the script with a store name and target path. It generates types.ts, utils/flattenActions.ts, index.ts, and per-slice files while enforcing PascalCase store names and camelCase slice names.

What is the difference between web pattern and core pattern for Zustand stores?

The web pattern creates a component-level Zustand store utilizing React Context and a Provider. The core pattern generates a slice-based store that composes multiple slices via flattenActions for prototype-safe state management.

How does flattenActions improve Go-to-Definition in Zustand slice composition?

flattenActions improves Go-to-Definition by flattening class-based slice actions into a single accessible object during store composition. This prototype-safe mechanism enables direct IDE navigation from component calls to the exact action implementation.

Can I configure multiple slices when generating a Zustand store?

Yes, you can configure multiple slices when generating a Zustand store. The scaffolding supports both interactive and explicit slice configurations, allowing you to define multiple slices for the core pattern or a single slice setup.

What files are generated when scaffolding a Zustand store?

Scaffolding a Zustand store generates a types.ts file for type definitions, a utils/flattenActions.ts file for action composition, an index.ts entry file, and individual per-slice files for modular state management.

Do I need to manually write React Context Providers for component-level Zustand stores?

No, you do not need to manually write React Context Providers. Using the web pattern automatically handles component-level store generation by scaffolding the necessary React Context and Provider integration files.