domain-modeling
它能做什么
它为项目使用的术语保留一份清晰的列表,并在做出重要设计决定时将其记录下来。它适合希望名称保持一致、并留有选择理由记录的开发者。
适用场景
- ✓你的团队对某个术语的使用混乱或不一致的时候。
- ✓你做出了一项应当记录下来的重要设计决定的时候。
- ✓你正在更新项目术语表或其决定记录的时候。
技能链接
https://github.com/mattpocock/skills/blob/main/skills/engineering/domain-modeling/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我们团队把 account 和 customer 用来指同一件事。请帮我们统一为一个清晰的术语,并把它记录下来。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会指出与术语表冲突的词语,并帮助确定每个术语的含义。然后它把确定下来的术语和决定,保存到你项目中的简单文件里。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
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 GLOSSARY.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:
/
├── GLOSSARY.md
├── docs/
│ └── adr/
│ ├── 0001-event-sourced-orders.md
│ └── 0002-postgres-for-write-model.md
└── src/
If a GLOSSARY-MAP.md exists at the root, the repo has multiple contexts. The map points to where each one lives:
/
├── GLOSSARY-MAP.md
├── docs/
│ └── adr/ ← system-wide decisions
├── src/
│ ├── ordering/
│ │ ├── GLOSSARY.md
│ │ └── docs/adr/ ← context-specific decisions
│ └── billing/
│ ├── GLOSSARY.md
│ └── docs/adr/
Create files lazily: only when you have something to write. If no GLOSSARY.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 GLOSSARY.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 GLOSSARY.md inline
When a term is resolved, update GLOSSARY.md right there. Don't batch these up: capture them as they happen. Use the format in GLOSSARY-FORMAT.md.
GLOSSARY.md should be totally devoid of implementation details. Do not treat GLOSSARY.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:
- Hard to reverse: the cost of changing your mind later is meaningful
- Surprising without context: a future reader will wonder "why did they do it this way?"
- 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.
常见问题
术语表和决定记录保存在哪里?
保存在 GLOSSARY.md 文件和 docs/adr 文件夹中,只有在有内容需要记录时才会创建。
它适用于包含多个部分的大型项目吗?
适用。技能描述了一种布局,使项目的每个部分都可以拥有自己的术语表。
什么是 ADR?
ADR 即架构决策记录,是一份简短的文件,说明某项设计选择以及做出该选择的原因。
详情
作者的原始描述
Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.
repo: mattpocock/skills
热度
- GitHub 星标
- 310k
- 排名
- #102
- 许可证
- MIT
- 更新时间
- 2026/11/1
评论
- …