state-management-design
Installation
SKILL.md
State Management Design
Designs comprehensive state management architectures for frontend applications, backend services, and the synchronization layer between them, selecting appropriate patterns for each state category.
Guiding Principle
"State is the root of all complexity. Minimize it, isolate it, and make its flow explicit."
Procedure
Step 1 — State Taxonomy
- Classify all application state into categories:
- Server State: Data from APIs (users, products, orders). Source of truth is the server.
- Client State: UI-only state (modals, form inputs, theme). Source of truth is the client.
- URL State: Route params, query strings, filters. Source of truth is the URL.
- Session State: Auth tokens, user preferences. Source of truth is the session store.
- Derived State: Computed from other state (totals, filtered lists). No independent source of truth.
- Map each state category to its lifecycle (ephemeral, session, persistent).
- Identify shared state vs. local state boundaries.