Skip to content
Back to skills

Principle Model The Domain

ASecurity

Model the domain. Apply when you write stateful logic, or code branches a lot or repeats an assumption about a shape across files.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 11, 2026
ai-agentsrustgit

Works with

  • cursor

Security analysis

A100/100

Scanned November 11, 2026

npx -y skills add erickb336/sage-stack --skill principle-model-the-domain --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Principle Model The Domain?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Principle Model The Domain
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/erickb336-principle-model-the-domain/badge)](https://www.skillsdirectory.com/skills/erickb336-principle-model-the-domain)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: principle-model-the-domain
description: "Model the domain. Apply when you write stateful logic, or code branches a lot or repeats an assumption about a shape across files."
license: MIT
metadata:
  source: "pstack principle-model-the-domain, MIT, Copyright (c) 2026 Lauren Tan, github.com/cursor/plugins, adapted; checked against pstack 0.15.36 at commit 0bb6f37"
---

<!-- Generated by scripts/build.mjs from the sources; edit the source, then run npm run build. -->

# Model the domain

Encode the domain in a data structure, not in scattered conditionals. A matching structure makes invalid states impossible and deletes branches. Choose it as you write; later it looks like a refactor and gets deferred.

**Use:**
- a state machine, not scattered booleans, phases or lifecycle checks;
- a typed model, not loose parameters or repeated shape assumptions;
- a map, registry, lookup table or discriminated union, not branches across files;
- a reducer or command/event model, not ad hoc state changes;
- a module per body of domain knowledge, not per step (load, validate, transform, save): execution order is not ownership;
- a small module for repeated behaviour, ownership or invariants;
- a queue, cache, index, graph, tree or normalised collection that fits the access pattern;
- any structure that fits; if none does, encode what the code must never allow and how it reads data.

**Do not force an abstraction.** Keep boring code that is clear, local and unlikely to grow. Distrust indirection that removes no branches, duplicate rules, invalid states or lifecycle risk.

**Signs you skipped this:** one more if/else branch, a second boolean synced with the first, or phase-named modules that repeat domain rules.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.