What problem does it solve? Stateful code often accumulates scattered booleans, repeated shape assumptions, and branching spread across files, creating accidental complexity and invalid states that are hard to maintain. ## Core Features & Use Cases - Domain Structure Selection: Guides choosing state machines, typed models, lookup tables, discriminated unions, reducers, or command/event models to replace scattered conditionals. - Anti-Pattern Detection: Identifies tells like growing if/else chains, booleans that must stay in sync, and phase-named modules that repeat domain rules. - Restraint Guidance: Advises against forcing abstractions when the current shape is already clear, local, and unlikely to grow. - Use Case: When adding a feature that extends an existing if/else chain or introduces a second boolean tied to a first, apply this principle to encode the domain in a structure that makes invalid states unrepresentable. ## Quick Start Ask the AI to apply the model-the-domain principle when reviewing or writing stateful logic that branches heavily or repeats shape assumptions across files.