ADR 的格式规范 — 属于 domain-modeling 技能
ADRs live in docs/adr/ and use sequential numbering: 0001-slug.md, 0002-slug.md, etc.
ADR 存放在 docs/adr/ 目录下,使用顺序编号:0001-slug.md、0002-slug.md,以此类推。
Create the docs/adr/ directory lazily — only when the first ADR is needed.
docs/adr/ 目录惰性创建——只在需要第一个 ADR 时才创建。
# {Short title of the decision}
{1-3 sentences: what's the context, what did we decide, and why.}# {决策的简短标题}
{1-3 句话:背景是什么、我们决定了什么、为什么。}That's it. An ADR can be a single paragraph. The value is in recording that a decision was made and why — not in filling out sections.
就这样。一个 ADR 可以只是一个段落。价值在于记录做了决策以及为什么——而不是填满各个章节。
Only include these when they add genuine value. Most ADRs won't need them.
只在对理解决策确实有价值时才包含这些。大部分 ADR 不需要它们。
proposed | accepted | deprecated | superseded by ADR-NNNN) — useful when decisions are revisitedproposed | accepted | deprecated | superseded by ADR-NNNN)—— 当决策会被重新审视时有用Scan docs/adr/ for the highest existing number and increment by one.
扫描 docs/adr/ 目录找到现有最高编号,加一。
All three of these must be true:
以下三个条件必须全部满足:
If a decision is easy to reverse, skip it — you'll just reverse it. If it's not surprising, nobody will wonder why. If there was no real alternative, there's nothing to record beyond "we did the obvious thing."
如果一个决策很容易撤销,跳过它——你将来会把它改掉的。如果不令人意外,没人会追问为什么。如果没有真正的备选方案,除了"我们做了显而易见的事"之外没什么可记录的。