What problem does it solve? Stateful logic often grows into 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 the choice of state machines, typed models, lookup tables, discriminated unions, reducers, and command/event models to replace ad hoc conditionals. - Anti-Pattern Detection: Identifies tells such as 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 would extend an existing if/else chain or introduce a second boolean tied to a first, apply this principle to model the domain as a state machine or discriminated union so invalid states become unrepresentable. ## Quick Start Apply the model-the-domain principle to refactor this stateful logic into a structure that makes invalid states unrepresentable.