Domain Modeling

作者 mattpocockc55ee46073ed无许可证收录于 2026年10月8日更新于 2026年10月8日

Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a CONTEXT.md, or recording or editing an ADR.

AI 生成的概览

通过维护 CONTEXT.md 词汇表和记录 ADR,构建并打磨项目的领域模型。

功能
该技能指导智能体在设计过程中主动构建项目的领域模型。它会质疑冲突或含糊的术语,用具体的边界场景压力测试领域关系,并将用户陈述的行为与代码进行交叉核对。它会产出并更新记录规范术语的 CONTEXT.md 词汇表,并在必要时按随附的格式参考在 docs/adr 下撰写架构决策记录(ADR)。
适用场景
适用于讨论或厘清代码库术语、编写或编辑 CONTEXT.md 词汇表,以及记录或编辑 ADR 的场景。它适合正在修改而非仅仅阅读领域模型的会话。
运行要求
无需脚本,仅为说明性内容。它引用随附的格式文档(CONTEXT-FORMAT.md、ADR-FORMAT.md)和一份智能体配置文件,并会读写 CONTEXT.md、docs/adr 等项目文件。

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.

来源与署名

来源:mattpocock/skills位于skills/engineering/domain-modeling提交c55ee46

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架