
Description
zustand is an agent skill from the LobeHub repository with the conventions for Zustand stores. It covers state shapes and where their types come from, the state-only store pattern that is now the default for new and migrated stores, replica-backed list and detail data, and selectors. The rules are specific. Shared store types are imported from @lobechat/types rather than from the database package. Lightweight list-item types are kept separate from full detail types, so a list type never extends a heavy detail type. Details are cached by id in maps such as xxxDetailMap, and a single currentDetail object is never held. Components read through selector aggregates in a selectors file instead of repeating ad-hoc selector functions. In the state-only pattern, the store holds state and nothing else. A separate private action file holds the replica slices and write helpers, and a public action file exposes the API as a singleton. The skill points to a reference on data structures for choosing list and detail shapes, and it notes that domains whose reads go through @lobechat/replica keep their data in id-keyed views with a bookkeeping field per view. It is for contributors adding or migrating a store in the LobeHub app. The skill passes Gen Agent Trust Hub, Socket and Snyk on skills.sh. Install it with npx skills add https://github.com/lobehub/lobehub --skill zustand.…
Highlights
- State-only store pattern as the default for new stores
- Detail data cached by id instead of one current object
- Selector aggregates in a selectors file
- Replica-backed list and detail data through @lobechat/replica
Ratings & Reviews
No ratings yet
Be the first to rate zustand.
People also visit

webapp-testing
Test local web applications using Playwright for UI verification and debugging

click-path-audit
Trace every user-facing button/touchpoint through its full state change sequence

dart-flutter-patterns
Production-ready Dart and Flutter patterns covering null safety
zustand FAQ
What is the state-only store pattern?
The store holds state only, and actions live in separate action classes. It is the default for new and migrated stores.
Where do shared store types come from?
From @lobechat/types, not from @lobechat/database.
How should detail data be cached?
By id, in maps such as xxxDetailMap, and never as one currentDetail object.
How do I install it?
Run npx skills add https://github.com/lobehub/lobehub --skill zustand.
Which security audits does it have?
On skills.sh, Gen Agent Trust Hub, Socket and Snyk all pass.
What are the best zustand alternatives?
Popular alternatives to zustand include frontend-patterns, modal and react. See all zustand alternatives





