Model, review, and refactor application state so source state stays minimal, derived state is computed instead of synchronized, impossible states are not representable, and each piece of state lives in the right place. Use this whenever the user mentions state management, reducers, stores, Redux, Zustand, React state, Vue state, Pinia, selectors, derived state, duplicated state, boolean flags, invalid states, async status, useEffect soup, forms, wizards, filters, URL state, server state, or confusing UI logic, even if they do not explicitly ask for a "state model."
87%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Use this reference for Zustand stores and selector-driven component access.
status field for mutually exclusive modes.A good Zustand store usually has:
Be careful with giant stores that become a bag of unrelated setters.
Prefer:
startCheckout()submitOrder()retrySubmission()selectItem(id)Over:
setIsLoading(value)setError(error)setSelectedItem(item)The latter tends to make invalid states easier to represent.
Do not store values that can be computed from:
Prefer selectors for:
If a selector returns an object or array assembled from store pieces, consider shallow equality or narrower selection when rerender pressure matters.