Skip to content
Skill

Principle model the domain

Guides the agent to encode domain logic in data structures instead of branching

Principle model the domain is an open-source agent skill for developer tools. It is available on Claude Code.

Scripts
None
Platforms
Claude Code
GitHub stars
5.1K
Last commit
License
MIT
Listing updated

Similar skills

About Principle model the domain

This skill tells the agent to model a problem's domain in data structures rather than spreading it across conditionals. It names several patterns to reach for: a state machine in place of scattered booleans or phase checks, a typed model in place of loose parameters, a map, registry or discriminated union when branching spans files, a reducer in place of ad hoc mutation, and an index, queue or normalized collection when the access pattern calls for one.

The skill also warns against overusing the approach. Clear, local code that is unlikely to grow should stay simple, and an abstraction that adds indirection without removing branches or invalid states is treated as a mistake. It flags a feature that keeps adding if/else branches, or a second boolean that must stay in sync with another, as signs the approach was skipped.

The skill is a plain instruction file with no scripts. It is written for coding agents working in any language and is marked as not user-invocable, so it loads when a task matches its description.

When your agent uses it

Apply when writing stateful logic, or when code branches a lot or repeats a shape assumption across files.

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 2 files (1 KB) on GitHub on 1 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

This skill ships in the pstack plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

/plugin marketplace add michael-denyer/pstack-claude
/plugin install pstack@pstack-claude

Or copy only this skill to ~/.claude/skills/principle-model-the-domain:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/principle-model-the-domain &&
cp -R "$tmp/plugins/pstack/skills/principle-model-the-domain" ~/.claude/skills/principle-model-the-domain &&
rm -rf "$tmp"

For one project only, put the folder in .claude/skills/principle-model-the-domain inside it instead.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/principle-model-the-domain to use it in every repository:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/principle-model-the-domain &&
cp -R "$tmp/plugins/pstack/skills/principle-model-the-domain" ~/.agents/skills/principle-model-the-domain &&
rm -rf "$tmp"

For one repository only, put the folder in .agents/skills/principle-model-the-domain inside it instead.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/principle-model-the-domain to use it in every project:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/principle-model-the-domain &&
cp -R "$tmp/plugins/pstack/skills/principle-model-the-domain" ~/.cursor/skills/principle-model-the-domain &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/principle-model-the-domain inside it instead.

Cursor docs on skills

Run in a terminal (add --scope workspace to install it for the current workspace only):

gemini skills install https://github.com/michael-denyer/pstack-claude.git --path plugins/pstack/skills/principle-model-the-domain

Or copy the folder to ~/.gemini/skills/principle-model-the-domain yourself.

Gemini CLI docs on skills

For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/principle-model-the-domain:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/principle-model-the-domain &&
cp -R "$tmp/plugins/pstack/skills/principle-model-the-domain" ~/.copilot/skills/principle-model-the-domain &&
rm -rf "$tmp"

For one project only, put the folder in .github/skills/principle-model-the-domain inside it instead.

VS Code docs on skills

Get the folder:

git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git

Then copy pstack-claude/plugins/pstack/skills/principle-model-the-domain into your agent's skills folder as principle-model-the-domain. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

State machine modeling
Replaces scattered booleans and phase checks with explicit states and transitions.
Typed domain models
Favors typed structures over loose parameters to make invalid states unrepresentable.
Discriminated unions and registries
Moves branching spread across files into maps, registries or tagged unions.
Reducer-based updates
Suggests reducers over ad hoc mutations for changing state.
Indexes and normalized collections
Recommends indexes, queues or normalized data where access patterns call for them.
Restraint against over-abstraction
Warns against indirection that removes no branches or invalid states.

Good for

  • Refactor a feature that has grown a long if/else chain
  • Replace several booleans that must stay in sync with a state machine
  • Consolidate branching logic spread across multiple files into one structure
  • Review code for repeated shape assumptions that should become a typed model

Principle model the domain FAQ

When does Principle model the domain trigger?

It applies when the agent is writing stateful logic, or when code branches a lot or repeats a shape assumption across files.

Does Principle model the domain require any scripts or tools?

No. It has no scripts and does not set allowed tools; it is an instruction file only.

Does Principle model the domain force a particular pattern?

No. The skill says to keep simple code when the shape is clear and local, and to avoid abstractions that add indirection without removing branches or invalid states.

How do I install Principle model the domain in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/principle-model-the-domain to use it in all your projects, or to .claude/skills/principle-model-the-domain in one project. Or install the pstack plugin, which includes it: /plugin marketplace add michael-denyer/pstack-claude, then /plugin install pstack@pstack-claude.

Does Principle model the domain run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

Which AI agents can use Principle model the domain?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

What are the best alternatives to Principle model the domain?

The closest alternatives to Principle model the domain are Domain modeling, Principle type system discipline, Principle foundational thinking, TypeScript best practices and Domain modeling.

Where this comes from

  • Description: from the skill's own SKILL.md.

More from michael-denyer/pstack-claude

  1. Makes the agent read pstack's poteto-mode skill first and follow its routing

    • Open source
    • 5.1K GitHub stars
    • Developer tools
  2. Has the agent restate your goals and the problem you're solving in its own words

    • Open source
    • 5.1K GitHub stars
    • Productivity
  3. Sketches types, signatures and module layout before the agent writes code

    • Open source
    • 5.1K GitHub stars
    • Developer tools
  4. Runs parallel candidate attempts at a task, then merges the best parts into one artifact

    • Open source
    • 5.1K GitHub stars
    • Developer tools
  5. Drafts a personal working-style skill from your past agent conversations

    • Open source
    • 5.1K GitHub stars
    • Developer tools