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 - Structure Selection Guidance: Recommends state machines, typed models, lookup tables, discriminated unions, reducers, and other structures matched to the domain. - 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 Criteria: 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 conditional chain or introduces a second lifecycle flag, apply this principle to replace the branches with a state machine or registry 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.