Skill · Version 1 · Nov 25, 2026
Apply when writing stateful logic, or when code branches a lot or repeats a shape assumption across files.
# Model the Domain Encode the domain in a data structure instead of scattering it across conditionals. The right structure makes invalid states unrepresentable and deletes branches. Reach for a state machine instead of scattered booleans or phase checks, a typed model instead of loose parameters, a map, registry, or discriminated union instead of branching spread across files, a reducer instead of ad hoc mutations, and an index, queue, or normalized collection where the access pattern calls for it. Do not force it. Keep boring code when the shape is clear, local, and unlikely to grow, and d…