domain-modeling
Agent skill fromvinvcn/mattpocock-skills-zh-CN
构建并打磨项目的领域模型。适用于讨论 codebase 术语、编写或编辑 GLOSSARY.md,或记录或编辑 ADR。
How to install domain-modeling
install domain-modeling
# install the mattpocock-skills-zh-CN pack with the skills CLI
npx skills add vinvcn/mattpocock-skills-zh-CN# or add only this skill to Claude Code: copy the folder
skills/engineering/domain-modeling/
# into
~/.claude/skills/domain-modeling/ (all projects)
.claude/skills/domain-modeling/ (one project)
1# 领域建模23在设计过程中主动构建并打磨项目的 domain model。这是 *active* discipline:挑战术语、发明 edge-case scenarios,并在概念成形的当下写入 glossary 和 decisions。45## 文件结构67多数 repos 只有一个 context:89```text10/11|- GLOSSARY.md12|- docs/13| `- adr/14| |- 0001-event-sourced-orders.md15| `- 0002-postgres-for-write-model.md16`- src/17```1819如果 root 有 `GLOSSARY-MAP.md`,说明 repo 有多个 contexts。map 指向每个 context 的位置:2021```text22/23|- GLOSSARY-MAP.md24|- docs/25| `- adr/ -> system-wide decisions26`- src/27 |- ordering/28 | |- GLOSSARY.md29 | `- docs/adr/ -> context-specific decisions30 `- billing/31 |- GLOSSARY.md32 `- docs/adr/33```3435按需懒创建文件:只有在有内容要写时才创建。如果没有 `GLOSSARY.md`,当第一个 term 被解决时创建它。如果没有 `docs/adr/`,当第一个 ADR 需要出现时创建它。3637## Session 期间3839### 对照术语表质询4041当用户使用的术语与 `GLOSSARY.md` 中既有语言冲突时,立即指出。"Your glossary defines 'cancellation' as X, but you seem to mean Y - which is it?"4243### 打磨模糊用语4445当用户使用模糊或过载术语时,提出一个精确的 canonical term。"You're saying 'account' - do you mean the Customer or the User? Those are different things."4647### 讨论具体场景4849讨论 domain relationships 时,用具体场景做压力测试。发明能探测 edge cases 的场景,迫使用户精确定义概念之间的 boundaries。5051### 与代码交叉对照5253当用户描述某事如何工作时,检查代码是否同意。如果发现矛盾,要指出:"Your code cancels entire Orders, but you just said partial cancellation is possible - which is right?"5455### 就地更新 GLOSSARY.md5657当一个 term 被解决时,立刻更新 `GLOSSARY.md`。不要批量攒到最后;随着概念出现就捕获。使用 [GLOSSARY-FORMAT.md](./GLOSSARY-FORMAT.md) 中的格式。58…
Excerpt shown under the repository's MIT license.
