cursor avatar

Principle Model The Domain

Encodes domain rules in data structures so invalid states become unrepresentable and branching shrinks.

CCM score
58 of 100
skills.sh installs
5.7K
GitHub stars
19.4K
last updated
Nov 25, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers modeling stateful logic with state machines, typed models, maps, registries, discriminated unions, reducers, and normalized collections
  • Replaces scattered booleans, phase checks, and if/else chains spread across files with one explicit structure
  • Warns against over-abstraction: keeps simple, local, slow-growing code as is when indirection would not remove branches
  • Designed for stateful logic and code that branches heavily or repeats a shape assumption across files

Install

$ npx -y skills add cursor/plugins --skill principle-model-the-domain -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

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 distrust an abstraction that adds indirection without removing branches or invalid states.

The sign that you skipped this: a feature that grows an if/else chain by one more branch, or a second boolean that must stay in sync with the first.

Details

Repository
github.com/cursor/plugins
First seen
Nov 25, 2026

More from cursor/plugins

All 93

Similar to Principle Model The Domain