agentleFS
daniel-kindldaniel-kindl/dkstack/skills/model-domain/SKILL.md

model-domain

Skill1 starsChanged 19 days agoMITView on GitHub

Use when a task designs, models or specifies a domain that has rules. Finds the bounded contexts first, then the aggregates, value objects and events, and writes a Domain model block. Triggers: domain model, ddd, bounded context, aggregate

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

12 rules. About 0 are common, 10 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use when you design or specify a domain.

    line 8
  2. Very specific:

    Run domain-glossary. Read CONTEXT.md and use its terms.

    line 13
  3. Distinctive:

    Write the context map for the contexts that the task touches.

    line 15
  4. Distinctive:

    Write the Domain model block.

    line 19
  5. Distinctive:

    When a boundary is hard to reverse and meets the ADR test, use write-adr.

    line 20
  6. Distinctive:

    Do steps 3 and 4 before steps 5 to 7.

    line 22
  7. Very specific:

    Write none for a part that the task does not need.

    line 34
  8. Distinctive:

    If you can start subagents, use one code reader to map the model that exists, before step 3.

    line 38
  9. Distinctive:

    Start each subagent with the setting below.

    line 45
  10. Distinctive:

    If you cannot start subagents, do the steps one at a time in the order of this skill.

    line 51
  11. Distinctive:

    Do not add a repository, a factory or another pattern that the page does not give.

    line 55
  12. Distinctive:

    Do not put the model in code before the owner agrees on the contexts.

    line 56

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Model domain

Use when you design or specify a domain. A person or an agent can start this skill. It applies domain modeling. Do not copy that page. It runs domain-glossary as a building block.

Steps

  1. Decide whether to model. Skip this skill for a CRUD change. Skip this skill for a change that uses the model and does not change it. Then only domain-glossary applies. Follow the when to model rules.
  2. Run domain-glossary. Read CONTEXT.md and use its terms. If a term has two meanings, ask the owner.
  3. Find the bounded contexts that the task touches. The owner decides each boundary.
  4. Write the context map for the contexts that the task touches. For each relation, name the upstream context, the downstream context and where the data is translated.
  5. For each context, find the aggregates. State the invariants of each aggregate and its root.
  6. Find the value objects and the rules that each one checks.
  7. Find the domain events. Name each in the past tense.
  8. Write the Domain model block. Put the block in the issue.
  9. When a boundary is hard to reverse and meets the ADR test, use write-adr.

Do steps 3 and 4 before steps 5 to 7. Do not model an aggregate before you know its context.

Domain model

## Domain model
Contexts: <the contexts that the task touches, and the relation of each pair>
Aggregates: <each aggregate, its root and its invariants>
Value objects: <each value object and its rules>
Events: <each event, who raises it and who receives it>

Write none for a part that the task does not need.

Subagents

If you can start subagents, use one code reader to map the model that exists, before step 3. The reader does not draw boundaries or write the block. Give it a brief that is complete without your context:

  • The task, and the paths where the domain code is.
  • What to report: the contexts, aggregates, value objects and events that the code has now, each with file and line. Also each place where one word has two meanings.
  • A word limit, for example 400 words.
  • This line: "Report to me only. Do not change files, commit, push, post, approve or merge."

Start each subagent with the setting below. The subagent guide maps each tier to a model.

  • Code reader: tier medium, effort medium.

The report is a claim. Check each file and line that you use. The owner decides each boundary.

If you cannot start subagents, do the steps one at a time in the order of this skill.

Boundaries

  • Do not add a repository, a factory or another pattern that the page does not give. See yagni.md.
  • Do not put the model in code before the owner agrees on the contexts.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.