What problem does it solve? Designing Zustand stores for a large TypeScript application often leads to inconsistent state shapes, tangled actions, and broken optimistic updates. This Skill encodes the LobeChat conventions for structuring stores so state stays predictable, cacheable, and type-safe. ## Core Features & Use Cases - State Shape Design: Separate lightweight list-item types from heavy detail types, use arrays for lists and id-keyed maps for cached details with per-item loading states. - Action Hierarchy: Enforces a three-layer action model of public actions, internal_* business logic, and internal_dispatch* reducer calls, plus guidance on when to use a reducer versus a simple set. - Optimistic Updates & Class-Based Slices: Provides the standard optimistic update flow (dispatch, service call, refresh) and the migration pattern from plain StateCreator objects to class-based actions composed with flattenActions. - Use Case: When adding a new entity store (e.g., a benchmark evaluation store), follow the references to define Detail/ListItem types, a detail map with a typed reducer, SWR-based fetching, and selectors. ## Quick Start Use the zustand skill to design a new store slice for my entity with list and detail state, optimistic updates, and class-based actions.