agentleFS
T-miracleT-miracle/codex-skills-zh/skills/planning/domain-modeling/SKILL.md

domain-modeling

Skill5 starsChanged 3 months agoMITView on GitHub

构建并完善项目的 domain model;当用户讨论代码库术语,或编写、修改 GLOSSARY.md 和 ADR 时使用。

195 other projects use a version of this, 5 of them edited.

Adopted by

Most recently taken up by

Used with

Projects with it also use setup-ts-deep-modules, decision-mapping and 8 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • liufeng1976Skill

    setup-ts-deep-modules

    Wire dependency-cruiser into a TypeScript repo so each package is a deep module — implementation hidden in subfolders, reachable only through its entry-point files. User-invoked.

    Also in 43 projects that use this

  • FabienDehopreSkill

    decision-mapping

    Turn a loose idea into a sequenced map of investigation tickets, then drive them to resolution one at a time.

    Also in 8 projects that use this

  • LesaniSkill

    writing-beats

    Shape an article as a journey of beats, choose-your-own-adventure style. The user picks a starting beat from the raw material, you write only that beat, then offer options for where to pivot next, beat by beat, until the article reaches a natural end. Use when the user has raw material and wants to assemble it as a narrative rather than an argument.

    Also in 62 projects that use this

  • RoentekSkill

    loop-me

    Grill me about specs for the workflows I want to build, within this workspace.

    Also in 56 projects that use this

  • AWSSkill

    wizard

    Generate an interactive bash wizard that walks a human through steps only they can perform. Use when provisioning infrastructure, setting up credentials or CI secrets, walking an unfamiliar third-party dashboard, or running a one-off migration or cutover. Don't invoke this for steps the agent can perform itself.

    Also in 134 projects that use this

  • LesaniSkill

    writing-shape

    Take a markdown file of raw material and shape it into an article through a conversational session — drafting candidate openings, growing the piece paragraph by paragraph, arguing about format (lists, tables, callouts, quotes) at each step. Use when the user has a pile of notes, fragments, or a rough draft and wants help turning it into something publishable.

    Also in 60 projects that use this

  • +1 more from Lesani

The file

Files
SKILL.md

领域建模(Domain Modeling)

在设计过程中主动构建并磨砺项目的领域模型(domain model)。这是一项主动实践:质疑术语、构造边缘情形,并在词汇和决策一经明确时立即写入文档。(仅仅读取 GLOSSARY.md 获取词汇不属于本技能:那是任何技能都能做到的一行式习惯。本技能用于改变模型,而不只是使用模型。)

文件结构

大多数仓库只有一个上下文(context):

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

如果根目录存在 GLOSSARY-MAP.md,说明仓库具有多个上下文。该映射文件指出每个上下文所在的位置:

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

按需延迟创建文件:只有真正有内容可写时才创建。如果不存在 GLOSSARY.md,就在第一个术语得到明确解释时创建;如果不存在 docs/adr/,就在第一次需要 ADR 时创建。

会话期间

依据词汇表提出质疑

当用户使用的术语与 GLOSSARY.md 中的现有语言冲突时,立即指出:“你的词汇表将 ‘cancellation’ 定义为 X,但你现在似乎是指 Y:究竟是哪一个?”

磨砺模糊语言

当用户使用含糊或多义的术语时,提出一个精确的规范术语(canonical term):“你说的是 ‘account’:你指的是 Customer 还是 User?它们是不同的概念。”

讨论具体情形

讨论领域关系时,用具体情形进行压力测试(stress-test)。构造能够探查边缘情形的场景,迫使用户准确界定概念之间的边界。

与代码交叉核对

当用户说明某项机制如何工作时,检查代码是否与其一致。如果发现矛盾,明确指出:“你的代码会取消整个 Order,但你刚才说可以部分取消:哪一种才是正确行为?”

就地更新 GLOSSARY.md

术语一经明确,就立即更新 GLOSSARY.md。不要积攒后批量处理:要在术语形成时当场记录。使用 GLOSSARY-FORMAT.md 中的格式。

GLOSSARY.md 中完全不应包含实现细节。不要把 GLOSSARY.md 当作规格(spec)、草稿区(scratch pad)或实现决策存储库。它只是词汇表,除此之外什么都不是。

谨慎建议 ADR

只有同时满足以下三项条件时,才建议创建 ADR:

  1. 难以逆转(Hard to reverse):日后改变决定会产生显著成本
  2. 缺少上下文时令人意外(Surprising without context):未来的读者会疑惑“为什么他们要这样做?”
  3. 真实权衡的结果(Real trade-off):确实存在可选方案,并且你出于具体原因选择了其中一个

缺少其中任何一项,就不要创建 ADR。使用 ADR-FORMAT.md 中的格式。

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.