zustand

Define and implement Zustand actions on store slices with naming conventions.

1|Updated Apr 14, 2026
One-click install
npx skills add https://github.com/andershi666/lobehub-hr-demo --skill zustand-andershi666
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: zustand
Source: https://github.com/andershi666/lobehub-hr-demo/tree/main/lobehub/.agents/skills/zustand
Command: npx skills add https://github.com/andershi666/lobehub-hr-demo --skill zustand-andershi666

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Zustand state management guide helps developers structure and implement robust store patterns for complex UI state, actions, and slices. It targets Zustand store development tasks and action implementation questions.

Core Features & Use Cases

  • Action Type Hierarchy: Public Actions, Internal Actions (internal_), and Dispatch Methods (internal_dispatch).
  • Optimistic Update pattern: guidance on optimistic updates for create/update flows and when to avoid them for deletes.
  • Naming Conventions: Public, Internal, and Dispatch naming patterns.
  • Detailed Guides: action patterns and slice organization docs.
  • Class-Based Action Implementation: patterns for class-based slices and composition with flattenActions.
  • Store-Organization: guidance on multi-slice store composition and patterns for scalable state.
  • Slice Organization: structure of slices and shared store architecture.

Quick Start

Create a Zustand store slice following the public/internal action naming patterns and implement an optimistic create flow as described.

Frequently Asked Questions about zustand

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

FAQPage Schema
How do I structure Zustand store slices for scalable React state management?

Zustand store slices structure scalable React state by organizing state into modular slices using defined public and internal action naming patterns. This composition approach separates concerns while maintaining a shared store architecture.

What is the naming convention for public and internal actions in a Zustand store?

Zustand store naming conventions separate Public Actions, Internal Actions prefixed with internal_, and Dispatch Methods prefixed with internal_dispatch. This hierarchy organizes action visibility and execution flow within store slices.

How do I implement optimistic updates for create and update flows in Zustand?

Implement optimistic updates in Zustand by applying action patterns that immediately reflect state changes before server confirmation during create and update flows. Avoid using optimistic update patterns for delete operations.

Can I implement class-based action slices and compose them in Zustand?

Yes, you can implement class-based action slices in Zustand and compose them using the flattenActions pattern. This approach allows structured object-oriented action implementation within your store slices.

When should I avoid optimistic update patterns in Zustand state management?

You should avoid optimistic update patterns in Zustand state management when performing delete operations. Optimistic updates are specifically recommended for create and update flows, not for data removal.