zustand — zustand state management zustand, tele-crm-frontend, community, zustand state management, ide skills, zustand action type hierarchy, zustand public actions, zustand internal actions, Claude Code, Cursor, Windsurf

v1.0.0
GitHub

About this Skill

Ideal for Frontend Agents requiring efficient state management for complex UI component interactions. zustand is a state management system that utilizes an Action Type Hierarchy, comprising public actions, internal actions, and dispatch methods to manage application state.

Features

Utilizes a hierarchical Action Type structure for organized state management
Supports public actions for UI component interactions with verb form naming conventions
Employs internal actions with an `internal_` prefix for core business logic implementation
Enables optimistic updates and service calls through internal actions
Provides dispatch methods for efficient state updates

# Core Topics

lildibbb lildibbb
[0]
[0]
Updated: 2/24/2026

Agent Capability Analysis

The zustand skill by lildibbb is an open-source community AI agent skill for Claude Code and other IDE workflows, helping agents execute tasks with better context, repeatability, and domain-specific guidance. Optimized for zustand state management, zustand action type hierarchy, zustand public actions.

Ideal Agent Persona

Ideal for Frontend Agents requiring efficient state management for complex UI component interactions.

Core Value

Empowers agents to manage hierarchical state structures with optimistic updates, parameter validation, and flow orchestration using Zustand's action type hierarchy, including public actions, internal actions, and dispatch methods.

Capabilities Granted for zustand

Orchestrating UI component interactions with public actions like createTopic and sendMessage
Implementing core business logic with internal actions like internal_createTopic
Dispatching actions with optimistic updates and error handling

! Prerequisites & Limits

  • Requires understanding of Zustand's action type hierarchy
  • Limited to state management use cases
  • May require additional setup for complex UI component interactions
Labs Demo

Browser Sandbox Environment

⚡️ Ready to unleash?

Experience this Agent in a zero-setup browser environment powered by WebContainers. No installation required.

Boot Container Sandbox

zustand

Install zustand, an AI agent skill for AI agent workflows and automation. Works with Claude Code, Cursor, and Windsurf with one-command setup.

SKILL.md
Readonly

LobeHub Zustand State Management

Action Type Hierarchy

1. Public Actions

Main interfaces for UI components:

  • Naming: Verb form (createTopic, sendMessage)
  • Responsibilities: Parameter validation, flow orchestration

2. Internal Actions (internal_*)

Core business logic implementation:

  • Naming: internal_ prefix (internal_createTopic)
  • Responsibilities: Optimistic updates, service calls, error handling
  • Should not be called directly by UI

3. Dispatch Methods (internal_dispatch*)

State update handlers:

  • Naming: internal_dispatch + entity (internal_dispatchTopic)
  • Responsibilities: Calling reducers, updating store

When to Use Reducer vs Simple set

Use Reducer Pattern:

  • Managing object lists/maps (messagesMap, topicMaps)
  • Optimistic updates
  • Complex state transitions

Use Simple set:

  • Toggling booleans
  • Updating simple values
  • Setting single state fields

Optimistic Update Pattern

typescript
1internal_createTopic: async (params) => { 2 const tmpId = Date.now().toString(); 3 4 // 1. Immediately update frontend (optimistic) 5 get().internal_dispatchTopic( 6 { type: 'addTopic', value: { ...params, id: tmpId } }, 7 'internal_createTopic' 8 ); 9 10 // 2. Call backend service 11 const topicId = await topicService.createTopic(params); 12 13 // 3. Refresh for consistency 14 await get().refreshTopic(); 15 return topicId; 16},

Delete operations: Don't use optimistic updates (destructive, complex recovery)

Naming Conventions

Actions:

  • Public: createTopic, sendMessage
  • Internal: internal_createTopic, internal_updateMessageContent
  • Dispatch: internal_dispatchTopic
  • Toggle: internal_toggleMessageLoading

State:

  • ID arrays: messageLoadingIds, topicEditingIds
  • Maps: topicMaps, messagesMap
  • Active: activeTopicId
  • Init flags: topicsInit

Detailed Guides

  • Action patterns: references/action-patterns.md
  • Slice organization: references/slice-organization.md

Class-Based Action Implementation

We are migrating slices from plain StateCreator objects to class-based actions.

Pattern

  • Define a class that encapsulates actions and receives (set, get, api) in the constructor.
  • Use #private fields (e.g., #set, #get) to avoid leaking internals.
  • Prefer shared typing helpers:
    • StoreSetter<T> from @/store/types for set.
    • Pick<ActionImpl, keyof ActionImpl> to expose only public methods.
  • Export a create*Slice helper that returns a class instance.
ts
1type Setter = StoreSetter<HomeStore>; 2export const createRecentSlice = (set: Setter, get: () => HomeStore, _api?: unknown) => 3 new RecentActionImpl(set, get, _api); 4 5export class RecentActionImpl { 6 readonly #get: () => HomeStore; 7 readonly #set: Setter; 8 9 constructor(set: Setter, get: () => HomeStore, _api?: unknown) { 10 void _api; 11 this.#set = set; 12 this.#get = get; 13 } 14 15 useFetchRecentTopics = () => { 16 // ... 17 }; 18} 19 20export type RecentAction = Pick<RecentActionImpl, keyof RecentActionImpl>;

Composition

  • In store files, merge class instances with flattenActions (do not spread class instances).
  • flattenActions binds methods to the original class instance and supports prototype methods and class fields.
ts
1const createStore: StateCreator<HomeStore, [['zustand/devtools', never]]> = (...params) => ({ 2 ...initialState, 3 ...flattenActions<HomeStoreAction>([ 4 createRecentSlice(...params), 5 createHomeInputSlice(...params), 6 ]), 7});

Multi-Class Slices

  • For large slices that need multiple action classes, compose them in the slice entry using flattenActions.
  • Use a local PublicActions<T> helper if you need to combine multiple classes and hide private fields.
ts
1type PublicActions<T> = { [K in keyof T]: T[K] }; 2 3export type ChatGroupAction = PublicActions< 4 ChatGroupInternalAction & ChatGroupLifecycleAction & ChatGroupMemberAction & ChatGroupCurdAction 5>; 6 7export const chatGroupAction: StateCreator< 8 ChatGroupStore, 9 [['zustand/devtools', never]], 10 [], 11 ChatGroupAction 12> = (...params) => 13 flattenActions<ChatGroupAction>([ 14 new ChatGroupInternalAction(...params), 15 new ChatGroupLifecycleAction(...params), 16 new ChatGroupMemberAction(...params), 17 new ChatGroupCurdAction(...params), 18 ]);

Store-Access Types

  • For class methods that depend on actions in other classes, define explicit store augmentations:
    • ChatGroupStoreWithSwitchTopic for lifecycle switchTopic
    • ChatGroupStoreWithRefresh for member refresh
    • ChatGroupStoreWithInternal for curd internal_dispatchChatGroup

Do / Don't

  • Do: keep constructor signature aligned with StateCreator params (set, get, api).
  • Do: use #private to avoid set/get being exposed.
  • Do: use flattenActions instead of spreading class instances.
  • Don't: keep both old slice objects and class actions active at the same time.

FAQ & Installation Steps

These questions and steps mirror the structured data on this page for better search understanding.

? Frequently Asked Questions

What is zustand?

Ideal for Frontend Agents requiring efficient state management for complex UI component interactions. zustand is a state management system that utilizes an Action Type Hierarchy, comprising public actions, internal actions, and dispatch methods to manage application state.

How do I install zustand?

Run the command: npx killer-skills add lildibbb/tele-crm-frontend. It works with Cursor, Windsurf, VS Code, Claude Code, and 19+ other IDEs.

What are the use cases for zustand?

Key use cases include: Orchestrating UI component interactions with public actions like createTopic and sendMessage, Implementing core business logic with internal actions like internal_createTopic, Dispatching actions with optimistic updates and error handling.

Which IDEs are compatible with zustand?

This skill is compatible with Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer. Use the Killer-Skills CLI for universal one-command installation.

Are there any limitations for zustand?

Requires understanding of Zustand's action type hierarchy. Limited to state management use cases. May require additional setup for complex UI component interactions.

How To Install

  1. 1. Open your terminal

    Open the terminal or command line in your project directory.

  2. 2. Run the install command

    Run: npx killer-skills add lildibbb/tele-crm-frontend. The CLI will automatically detect your IDE or AI agent and configure the skill.

  3. 3. Start using the skill

    The skill is now active. Your AI agent can use zustand immediately in the current project.

Related Skills

Looking for an alternative to zustand or another community skill for your workflow? Explore these related open-source skills.

View All

widget-generator

Logo of f
f

f.k.a. Awesome ChatGPT Prompts. Share, discover, and collect prompts from the community. Free and open source — self-host for your organization with complete privacy.

149.6k
0
AI

flags

Logo of vercel
vercel

flags is a Next.js feature management skill that enables developers to efficiently add or modify framework feature flags, streamlining React application development.

138.4k
0
Browser

zustand

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
AI

data-fetching

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
AI