Install
openclaw skills install state-managementDeep workflow for client (and hybrid) state—modeling domain vs UI state, server cache vs client store, async and consistency, DevTools, persistence, and testing. Use when choosing Redux/Zustand/Recoil/Context, fixing stale UI, or designing data flow in React/Vue/Svelte apps.
openclaw skills install state-managementMost “state bugs” are ownership and lifecycle bugs: who writes, when it syncs, and what happens on failure. Guide users to explicit models instead of ad-hoc globals.
Trigger conditions:
Initial offer:
Use six stages: (1) inventory state kinds, (2) assign ownership, (3) server vs client boundaries, (4) async & updates, (5) persistence & URLs, (6) testing & DevTools. Confirm framework and data fetching approach.
Goal: Classify what state exists before picking tools.
Exit condition: Table of state slices → source of truth → consumers.
Goal: One writer per piece of truth (or strict reducer pattern).
Exit condition: For each slice: who sets, who reads, invalidation story.
Goal: Prefer server-state libraries for remote data; use client stores for true client concerns.
Exit condition: Remote data has defined cache keys, stale time, and mutation flow.
Goal: Loading, error, empty, and retry are first-class; optimistic updates are safe or scoped.
Exit condition: User-visible failure modes handled; no silent stale success.
Goal: Decide what survives refresh, what is shareable, and security.
Exit condition: Sensitive data never persisted client-side inappropriately.
Goal: State logic is unit-testable; time-travel/debug when needed.