Skill: Craft Model State
"States are not strings. They are behavior."
The Standard
- Abstract Base: One per entity. Defines
config()with transitions. - Concrete States: One class per state. Behavior lives here.
- Custom Transitions: Side effects in transition classes, not models.
- Co-location:
Domain/Entity/States/, notApp/States/.
The Anti-Patterns
| ❌ Don't | ✅ Do | Why |
|---|---|---|
| Enum for stateful behavior | State classes | Behavior belongs with state |
| Transitions in model | Custom transition classes | Single responsibility |
| Fat abstract state | Thin base, behavior in concrete | Each state is unique |
Real-World Examples
See examples.md.