principle-model-the-domain

Guides encoding domain logic into data structures instead of scattered conditionals.

Updated Jul 29, 2026
One-click install
npx skills add https://github.com/mmdmcy/fluttAIrbar --skill principle-model-the-domain-mmdmcy
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: principle-model-the-domain
Source: https://github.com/mmdmcy/fluttAIrbar/tree/main/plugins/pstack/skills/principle-model-the-domain
Command: npx skills add https://github.com/mmdmcy/fluttAIrbar --skill principle-model-the-domain-mmdmcy

SYSTEM DOCUMENTATION & REQUIREMENTS

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.

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 for lifecycle checks or a lookup table for branching spread across files.

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

Use a state machine when multiple booleans must stay in sync or when phases and lifecycle checks are scattered through the code. A state machine makes invalid state combinations unrepresentable and deletes the synchronization branches.

What are the signs that code needs domain modeling?▼

Common tells include a new feature growing an existing if/else chain by one branch, a second boolean that must stay in sync with the first, and phase-named modules that repeat the same domain rules across steps.

When should I avoid adding a domain abstraction?▼

Avoid forcing an abstraction when the current shape is already clear, local, and unlikely to grow. Be skeptical of any structure that adds indirection without removing branches, duplicated rules, invalid states, or lifecycle risk.

What structures can replace branching across files?▼

Maps, registries, lookup tables, and discriminated unions replace branching spread across files. Reducers or command/event models replace ad hoc state mutations, and queues, caches, or graphs fit specific data access patterns.