principle-model-the-domain

Encodes domain logic in data structures instead of scattered conditionals across code.

Updated Aug 28, 2026
One-click install
npx skills add https://github.com/jeremybrasher/grokbot-skills --skill principle-model-the-domain-jeremybrasher
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: principle-model-the-domain
Source: https://github.com/jeremybrasher/grokbot-skills/tree/main/collections/pstack/skills/principle-model-the-domain
Command: npx skills add https://github.com/jeremybrasher/grokbot-skills --skill principle-model-the-domain-jeremybrasher

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Stateful logic often ends up as scattered booleans, repeated shape assumptions, and branching spread across files, which creates accidental complexity and invalid states. This Skill guides you to encode the domain in a structure so invalid states become unrepresentable and branches disappear. ## Core Features & Use Cases - Structure Selection: Replaces scattered conditionals with state machines, typed models, lookup tables, discriminated unions, reducers, or domain-organized modules. - Guarded Application: Requires a concrete situation, trigger evidence, and a decision to change before acting, and returns a HOLD instead of guessing when inputs are missing. - Cut-First Defaults: Prefers the smallest structural change, deletes before adding, and refuses decorative principle citations that change no decision. - Use Case: When a new feature would grow an existing if/else chain by one more branch or add a second boolean that must stay in sync with the first, apply this Skill to model the lifecycle as a state machine instead. ## Quick Start Apply the model-the-domain principle to refactor this module's scattered boolean flags and branching into a single state machine structure.

Frequently Asked Questions about principle-model-the-domain

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I replace scattered conditionals with a domain model?▼

Identify what the code must never allow and how the data gets read, then pick a structure that encodes exactly that, such as a state machine, discriminated union, or lookup table. The goal is making invalid states unrepresentable and deleting branches rather than adding abstraction.

When should I use a state machine instead of booleans?▼

Use a state machine when lifecycle checks, phases, or multiple booleans must stay in sync with each other. A second boolean that must mirror the first is the classic sign that a state machine would remove the coordination burden.

When should I not introduce a domain structure or abstraction?▼

Skip it when the current shape is already clear, local, and unlikely to grow. Be skeptical of any abstraction that adds indirection without removing branches, duplicated rules, invalid states, or lifecycle risk; boring code is preferred in those cases.

What is temporal decomposition in code organization?▼

Temporal decomposition is organizing modules by execution order, such as load, validate, transform, and save, instead of by domain knowledge. It repeats the same domain rules across steps, so the Skill recommends organizing modules around one body of domain knowledge instead.

What happens when the skill lacks enough context to apply the principle?▼

It returns a HOLD naming the missing input, such as the situation object or trigger evidence, instead of guessing. A HOLD is a return value, not a delay before producing a polished guess.