New to Claude Skills? Learn how to install them →

mattpocock on GitHub

Domain Modeling

Free

Refine your project's domain model actively.

by mattpocock212.7k stars on mattpocock/skills
1 views
Updated Aug 6, 2026
Get this skill

Free · Opens the source repo

What Domain Modeling does

Domain Modeling is a skill designed for developers and designers who want to actively engage in shaping their project's domain model. This skill emphasizes the importance of not just passively consuming domain terminology but actively challenging and refining it during the design process. By facilitating discussions around ambiguous terms and edge-case scenarios, it ensures that the language used within the project is precise and well-defined. This is particularly valuable in collaborative environments where clarity and shared understanding are crucial.

The skill operates by monitoring the terms used in conversations and cross-referencing them with the existing glossary in CONTEXT.md. If a term conflicts with the established definitions, it prompts the user to clarify their intent, thereby preventing misunderstandings. Additionally, it encourages users to explore concrete scenarios that test the boundaries of domain relationships, fostering a deeper understanding of the model and its implications.

As users work through their project, the skill allows for real-time updates to the domain glossary. Whenever a term is resolved, it is documented immediately in CONTEXT.md, ensuring that the glossary remains current and reflective of the latest decisions. This immediate documentation practice helps maintain an accurate and up-to-date reference for all team members, enhancing collaboration and reducing the risk of miscommunication.

Moreover, the skill offers guidance on when to create Architectural Decision Records (ADRs), helping teams document significant choices that may impact the project long-term. By focusing on decisions that are hard to reverse or surprising without context, it aids in creating a robust historical record of the project's evolution, which can be invaluable for future reference.

When to use it

Use this skill when actively designing or refining a project's domain model and when precise language is critical for collaboration.

When not to use it

This skill is not suitable for passive reading or when you need a simple glossary without engaging in active discussions.

What you can build with it

Clarifying Ambiguous Terms

When discussing project requirements, use this skill to challenge vague terms and ensure precise definitions are established.

Documenting Architectural Decisions

As you make significant design choices, this skill helps you determine when to document those decisions in an ADR.

Refining Domain Relationships

Use this skill to stress-test domain relationships by discussing edge cases and ensuring the model is robust.

How to install Domain Modeling

View source

1. Install with the skills CLI

npx skills add mattpocock/skills/domain-modeling --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by mattpocock

Domain Modeling

Actively build and sharpen the project's domain model as you design. This is the active discipline — challenging terms, inventing edge-case scenarios, and writing the glossary and decisions down the moment they crystallise. (Merely reading CONTEXT.md for vocabulary is not this skill — that's a one-line habit any skill can do. This skill is for when you're changing the model, not just consuming it.)

File structure

Most repos have a single context:

/
├── CONTEXT.md
├── docs/
│   └── adr/
│       ├── 0001-event-sourced-orders.md
│       └── 0002-postgres-for-write-model.md
└── src/

If a CONTEXT-MAP.md exists at the root, the repo has multiple contexts. The map points to where each one lives:

/
├── CONTEXT-MAP.md
├── docs/
│   └── adr/                          ← system-wide decisions
├── src/
│   ├── ordering/
│   │   ├── CONTEXT.md
│   │   └── docs/adr/                 ← context-specific decisions
│   └── billing/
│       ├── CONTEXT.md
│       └── docs/adr/

Create files lazily — only when you have something to write. If no CONTEXT.md exists, create one when the first term is resolved. If no docs/adr/ exists, create it when the first ADR is needed.

During the session

Challenge against the glossary

When the user uses a term that conflicts with the existing language in CONTEXT.md, call it out immediately. "Your glossary defines 'cancellation' as X, but you seem to mean Y — which is it?"

Sharpen fuzzy language

When the user uses vague or overloaded terms, propose a precise canonical term. "You're saying 'account' — do you mean the Customer or the User? Those are different things."

Discuss concrete scenarios

When domain relationships are being discussed, stress-test them with specific scenarios. Invent scenarios that probe edge cases and force the user to be precise about the boundaries between concepts.

Cross-reference with code

When the user states how something works, check whether the code agrees. If you find a contradiction, surface it: "Your code cancels entire Orders, but you just said partial cancellation is possible — which is right?"

Update CONTEXT.md inline

When a term is resolved, update CONTEXT.md right there. Don't batch these up — capture them as they happen. Use the format in CONTEXT-FORMAT.md.

CONTEXT.md should be totally devoid of implementation details. Do not treat CONTEXT.md as a spec, a scratch pad, or a repository for implementation decisions. It is a glossary and nothing else.

Offer ADRs sparingly

Only offer to create an ADR when all three are true:

  1. Hard to reverse — the cost of changing your mind later is meaningful
  2. Surprising without context — a future reader will wonder "why did they do it this way?"
  3. The result of a real trade-off — there were genuine alternatives and you picked one for specific reasons

If any of the three is missing, skip the ADR. Use the format in ADR-FORMAT.md.

Frequently asked questions about Domain Modeling

Similar skills