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
The state-management skill teaches coding agents to model, review, and
refactor application state. It keeps source state minimal, computes derived
state instead of synchronizing it, replaces boolean flags with explicit finite
states, and places each value in the right home. It maps the model to a library
only after the model is sound.
npx skills add statelyai/skills --skill state-managementThe Codex stately plugin also includes this skill. The Claude Code plugin
does not. See Install.
Ask about state in any framework or library:
This form component has isLoading, isError, and isSuccess flags. Clean up the state.Review this Zustand store for duplicated and derived state.Design the state for a multi-step checkout wizard.The skill works in one of four modes:
| Mode | Output |
|---|---|
| Design | A new state model built from requirements |
| Review | Invalid states, duplication, synchronization bugs, and misplaced state |
| Refactor | A simpler model with the same behavior and tighter invariants |
| Library mapping | A sound model translated to React, Redux, Zustand, Vue/Pinia, or plain functions |
It classifies every value as source, derived, finite, server, URL, ephemeral, or history state before deciding where it belongs.
| Path | Contents |
|---|---|
SKILL.md | Taxonomy, principles, and workflow |
references/review-checklist.md | Checklist for reviewing existing state code |
references/typescript-modeling.md | Discriminated unions and other TypeScript patterns |
references/async-state.md | Loading, errors, cancellation, and server state |
references/react.md | React state and effects |
references/redux.md | Redux and Redux Toolkit |
references/zustand.md | Zustand |
references/vue-pinia.md | Vue and Pinia |
references/no-library.md | Plain functions and reducers |
evals/ | Evaluation prompts |