domain-model

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
Interview me relentlessly about every aspect of this plan until we reach a shared understanding. Walk down each branch of the design tree, resolving dependencies between decisions one-by-one. For each question, provide your recommended answer.
Ask the questions one at a time, waiting for feedback on each question before continuing.
If a question can be answered by exploring the codebase, explore the codebase instead.
请针对该方案的各个方面对我进行全面提问,直到我们达成共识。逐一梳理设计树的每个分支,逐个解决决策之间的依赖关系。对于每个问题,请提供你的推荐答案。
每次只提出一个问题,等待反馈后再继续下一个问题。
如果某个问题可以通过探索代码库找到答案,请直接探索代码库。

Domain awareness

领域感知

During codebase exploration, also look for existing documentation:
在探索代码库时,同时查找现有文档:

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.
大多数代码库只有一个上下文:
/
├── CONTEXT.md
├── docs/
│   └── adr/
│       ├── 0001-event-sourced-orders.md
│       └── 0002-postgres-for-write-model.md
└── src/
如果根目录下存在
CONTEXT-MAP.md
,则该代码库包含多个上下文。该文件会指明每个上下文的位置:
/
├── CONTEXT-MAP.md
├── docs/
│   └── adr/                          ← 系统级决策文档
├── src/
│   ├── ordering/
│   │   ├── CONTEXT.md
│   │   └── docs/adr/                 ← 特定上下文的决策文档
│   └── billing/
│       ├── CONTEXT.md
│       └── docs/adr/
延迟创建文件——仅在有内容可写时创建。如果不存在
CONTEXT.md
,则在第一个术语明确时创建它。如果不存在
docs/adr/
目录,则在需要创建首个ADR时创建该目录。

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?"
当用户使用的术语与
CONTEXT.md
中的现有术语冲突时,立即指出:“你的术语表将‘cancellation’定义为X,但你似乎指的是Y——到底是哪一个?”

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."
当用户使用模糊或多义术语时,建议使用精确的标准术语:“你提到了‘account’——你指的是Customer还是User?这两者是不同的概念。”

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?"
当用户说明某事物的工作方式时,检查代码是否与之相符。如果发现矛盾,指出问题:“你的代码会取消整个Order,但你刚才说可以部分取消——哪个是正确的?”

Update CONTEXT.md inline

同步更新CONTEXT.md

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
。不要批量处理——在决策确定时就记录下来。使用CONTEXT-FORMAT.md中的格式。

Offer ADRs sparingly

谨慎创建ADR

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.
仅当满足以下全部三个条件时,才创建ADR:
  1. 难以逆转——后续改变决策的成本很高
  2. 无上下文时难以理解——未来的读者会疑惑“他们为什么要这么做?”
  3. 是权衡后的结果——存在真正的替代方案,且你因特定原因选择了其中一个
如果缺少任意一个条件,则跳过ADR。使用ADR-FORMAT.md中的格式。