use-class-for-state
Installation
SKILL.md
use-class-for-state
When to Use
- Multiple related state variables
- State needs to be copied/restored
- Complex state transitions
- Backtracking algorithms
- State machine implementations
When NOT to Use
- Simple single value
- Stateless algorithm
- Closure is simpler
The Pattern
Encapsulate state in a class with methods for transitions.