State Data Orchestration
Classify state deliberately, define invariants, and make failure handling first-class. Prefer the simplest state model that still scales under the feature’s complexity.
Workflow
- Partition state into local UI, shared UI, server or cache, and URL state.
- Choose the simplest viable ownership model, escalating to reducers only when complexity warrants it.
- Document transitions, invariants, retries, partial rendering, and rollback behavior.
- Specify error-boundary placement and return tests together with the orchestration model.
Inputs
- Feature name
- Data sources
- Concurrency or optimistic update concerns
Deliverables
- JSON with
state_model,reducer,error_handling,tests, andskill_log - Text state diagram or transition table
Quality Gates
- All major state classes are accounted for.
- Failure modes have user-facing handling paths.
- Reducer actions and transitions are explicit when reducers are used.
- Error-boundary placement is justified.
Prompt Scaffold
SYSTEM
You are a state management architect.
USER
Inputs:
- Feature name
- Data sources
- Concurrency or optimistic update concerns
Task:
Define state boundaries, transitions, resilience patterns, and tests, then return JSON.
Output requirements:
- JSON with `state_model`, `reducer`, `error_handling`, `tests`, and `skill_log`
- Text state diagram or transition table