create-adr

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

ADR Creator

ADR 生成器

You are an expert in creating Architecture Decision Records (ADRs) — concise, durable documents that capture the context, decision, and consequences of significant architectural choices so future team members understand why things are the way they are.
你是创建架构决策记录(ADRs)的专家——这类文档简洁且持久,记录重要架构选择的背景、决策内容及其影响,以便团队后续成员理解事情为何是当前的状态。

When to Use This Skill

何时使用此技能

Use this skill when:
  • User asks to "write an ADR", "create an ADR", "add an architecture decision record"
  • User wants to "document why we chose X", "record this decision", "capture this architectural choice"
  • A significant technical decision has been made (or is being finalized) and needs to be recorded
  • The team wants to preserve the reasoning behind a choice for future engineers
  • User asks "why did we choose X" and the answer should be written down permanently
Do NOT use for:
  • Decisions not yet made — use
    create-rfc
    to drive the decision process first
  • Implementation planning after the decision — use
    technical-design-doc-creator
  • Simple configuration choices or trivial code decisions
  • Meeting notes or general documentation
在以下场景使用此技能:
  • 用户要求“编写ADR”、“创建ADR”、“添加架构决策记录”
  • 用户希望“记录我们选择X的原因”、“记录此决策”、“记录此架构选择”
  • 重要技术决策已制定(或即将最终确定),需要被记录下来
  • 团队希望留存选择背后的推理,供未来工程师参考
  • 用户询问“我们为何选择X”,且答案需要被永久记录
请勿在以下场景使用:
  • 决策尚未制定——请使用
    create-rfc
    来推动决策流程
  • 决策后的实施规划——请使用
    technical-design-doc-creator
  • 简单的配置选择或琐碎的代码决策
  • 会议记录或一般性文档编写

ADR vs RFC — Critical Distinction

ADR 与 RFC 的关键区别

AspectADRRFC
TimingDecision already made (or being finalized)Before the decision (seeking input)
PurposeRecord for future team membersProposal seeking approval
AudienceEngineers joining months or years laterCurrent stakeholders
LengthShort — 200–500 wordsLong — thorough comparison
MutabilityImmutable — superseded, never editedIterative — evolves during review
ToneHistorical recordDeliberative proposal
If the user says "I need to decide whether to do X" → use
create-rfc
. If the user says "We decided to do X, let me document it" → use this skill.
维度ADRRFC
时间节点决策已制定(或即将最终确定)决策制定前(征集意见)
目的为团队后续成员留存记录用于征集批准的提案
受众数月或数年后加入的工程师当前相关利益方
篇幅简短——200-500词较长——包含全面对比
可修改性不可变——仅可被替代,绝不编辑可迭代——在评审过程中逐步完善
语气历史记录审慎的提案
如果用户说“我需要决定是否做X”→ 使用
create-rfc
。 如果用户说“我们已决定做X,帮我记录下来”→ 使用此技能。

Language Adaptation

语言适配

CRITICAL: Always generate the ADR in the same language as the user's request. Detect the language automatically.
  • Keep technical terms in English when appropriate (e.g., "ADR", "API", "microservices")
  • All section headers and content should be in the user's language
  • Company/product names remain in original form
重要提示:始终使用与用户请求相同的语言生成ADR,自动检测语言。
  • 适当保留英文技术术语(如“ADR”、“API”、“microservices”)
  • 所有章节标题和内容均使用用户的语言
  • 公司/产品名称保留原形式

ADR Format Selection

ADR 格式选择

Three formats are widely used. Detect the right one from context, or ask:
FormatBest ForLength
MADR (Markdown ADR)Teams that want structured options comparisonMedium
Nygard (original)Minimal, fast recording; obvious decisionsShort
Y-StatementInline documentation, very compact contextsOne paragraph
Default to MADR unless the user specifies otherwise or the decision is very simple.

目前有三种广泛使用的格式,根据上下文检测合适的格式,或主动询问:
格式适用场景篇幅
MADR(Markdown ADR)需要结构化选项对比的团队中等
Nygard(原始格式)极简、快速记录;决策内容明确的场景简短
Y-Statement内联文档,场景非常紧凑的情况一段文字
除非用户指定其他格式或决策内容非常简单,否则默认使用MADR格式。

Interactive Workflow

交互式流程

Step 1: Gather Context (if not provided)

步骤1:收集背景信息(若未提供)

If the user provides minimal context, use AskQuestion to collect essential information:
json
{
  "title": "ADR Information",
  "questions": [
    {
      "id": "adr_decision",
      "prompt": "What was the decision made? (e.g., 'Use PostgreSQL for primary storage')",
      "options": [
        { "id": "free_text", "label": "I'll describe it in my next message" }
      ]
    },
    {
      "id": "adr_format",
      "prompt": "Which ADR format would you like to use?",
      "options": [
        { "id": "madr", "label": "MADR — structured, with options comparison (recommended)" },
        { "id": "nygard", "label": "Nygard — minimal: Context / Decision / Consequences" },
        { "id": "y_statement", "label": "Y-Statement — single paragraph, very compact" }
      ]
    },
    {
      "id": "adr_status",
      "prompt": "What is the current status of this decision?",
      "options": [
        { "id": "accepted", "label": "Accepted — decision is final" },
        { "id": "proposed", "label": "Proposed — decision is being finalized" },
        { "id": "deprecated", "label": "Deprecated — this approach is no longer recommended" },
        { "id": "superseded", "label": "Superseded — replaced by a newer decision" }
      ]
    },
    {
      "id": "adr_supersedes",
      "prompt": "Does this ADR supersede a previous decision?",
      "options": [
        { "id": "yes", "label": "Yes — I'll provide the ADR number/title" },
        { "id": "no", "label": "No — this is a new decision" }
      ]
    }
  ]
}
如果用户提供的背景信息极少,使用AskQuestion收集必要信息:
json
{
  "title": "ADR 信息收集",
  "questions": [
    {
      "id": "adr_decision",
      "prompt": "已制定的决策内容是什么?(例如:'使用PostgreSQL作为主存储')",
      "options": [
        { "id": "free_text", "label": "我将在后续消息中描述" }
      ]
    },
    {
      "id": "adr_format",
      "prompt": "你希望使用哪种ADR格式?",
      "options": [
        { "id": "madr", "label": "MADR — 结构化,包含选项对比(推荐)" },
        { "id": "nygard", "label": "Nygard — 极简:背景 / 决策 / 影响" },
        { "id": "y_statement", "label": "Y-Statement — 单段文字,非常紧凑" }
      ]
    },
    {
      "id": "adr_status",
      "prompt": "此决策的当前状态是什么?",
      "options": [
        { "id": "accepted", "label": "已通过 — 决策已最终确定" },
        { "id": "proposed", "label": "已提议 — 决策即将最终确定" },
        { "id": "deprecated", "label": "已弃用 — 此方法不再被推荐" },
        { "id": "superseded", "label": "已被替代 — 被新决策取代" }
      ]
    },
    {
      "id": "adr_supersedes",
      "prompt": "此ADR是否替代了之前的决策?",
      "options": [
        { "id": "yes", "label": "是 — 我将提供被替代ADR的编号/标题" },
        { "id": "no", "label": "否 — 这是一个新决策" }
      ]
    }
  ]
}

Step 2: Validate Mandatory Fields

步骤2:验证必填字段

MANDATORY fields — ask if missing:
  • Decision title (noun phrase, not a question — e.g., "Use Redis for session storage")
  • Date of the decision (or today's date)
  • Status (Accepted / Proposed / Deprecated / Superseded)
  • Context — the forces, constraints, and situation that made this decision necessary
  • The decision itself — what was chosen and why
  • Consequences — what becomes easier, harder, or different as a result
RECOMMENDED fields:
  • Decision drivers — the key criteria or constraints
  • Options considered — what alternatives were evaluated
  • Pros/cons per option — honest trade-off assessment
  • Decision outcome rationale — why this option over the others
  • Links — related ADRs, RFCs, tickets, or documentation
If any mandatory fields are missing, ask IN THE USER'S LANGUAGE before generating the document.
必填字段 — 缺失则询问
  • 决策标题(名词短语,而非疑问句 — 例如:"使用Redis存储会话")
  • 决策日期(或当前日期)
  • 状态(已通过 / 已提议 / 已弃用 / 已被替代)
  • 背景 — 促使做出此决策的因素、约束条件和场景
  • 决策内容 — 选择了什么以及原因
  • 影响 — 决策后哪些事情变简单、变困难或发生了变化
推荐字段
  • 决策驱动因素 — 关键标准或约束条件
  • 考虑的选项 — 评估过的替代方案
  • 各选项的优缺点 — 客观的权衡评估
  • 决策理由 — 为何选择此方案而非其他
  • 链接 — 相关的ADR、RFC、工单或文档
若有任何必填字段缺失,在生成文档前用用户的语言询问。

Step 3: Assign ADR Number

步骤3:分配ADR编号

Scan the existing ADR directory for the next sequential number:
  1. Check if an ADR directory exists (
    docs/adr/
    ,
    docs/decisions/
    ,
    .adr/
    , or
    adr/
    )
  2. Find the highest existing number
  3. Assign the next number (e.g., if ADR-007 exists, this becomes ADR-008)
  4. If no directory exists, start at ADR-001 and suggest creating the directory
扫描现有ADR目录获取下一个连续编号:
  1. 检查是否存在ADR目录(
    docs/adr/
    docs/decisions/
    .adr/
    adr/
  2. 找到现有最高编号
  3. 分配下一个编号(例如:若ADR-007存在,则新ADR为ADR-008)
  4. 若目录不存在,从ADR-001开始,并建议创建目录

Step 4: Generate the ADR

步骤4:生成ADR

Generate the ADR following the format selected in Step 1.
按照步骤1中选择的格式生成ADR。

Step 5: Offer File Placement

步骤5:提供文件存储建议

After generating, ask where to save it:
ADR Created: "ADR-{NNN}: {Title}"

Suggested file path: docs/adr/{NNN}-{kebab-case-title}.md

Would you like me to:
1. Save it to docs/adr/ (recommended convention)
2. Save it to a different location
3. Just show the content (I'll place it manually)

生成完成后,询问存储位置:
ADR 已生成:"ADR-{NNN}: {Title}"

建议文件路径:docs/adr/{NNN}-{kebab-case-title}.md

你希望我:
1. 保存至docs/adr/(推荐惯例)
2. 保存至其他位置
3. 仅展示内容(我将手动存储)

Document Templates

文档模板

MADR Format (Default)

MADR 格式(默认)

markdown
undefined
markdown
undefined

ADR-{NNN}: {Title}

ADR-{NNN}: {Title}

  • Date: YYYY-MM-DD
  • Status: Accepted | Proposed | Deprecated | Superseded by ADR-NNN
  • Deciders: {who was involved in the decision}
  • Tags: {optional: architecture, security, performance, database, etc.}
  • Date: YYYY-MM-DD
  • Status: Accepted | Proposed | Deprecated | Superseded by ADR-NNN
  • Deciders: {who was involved in the decision}
  • Tags: {optional: architecture, security, performance, database, etc.}

Context and Problem Statement

Context and Problem Statement

{Describe the context and the problem or question that led to this decision. 2–4 sentences. What situation forced this choice?}
{Describe the context and the problem or question that led to this decision. 2–4 sentences. What situation forced this choice?}

Decision Drivers

Decision Drivers

  • {Driver 1 — e.g., "Must support 10k concurrent users"}
  • {Driver 2 — e.g., "Team has no Go experience"}
  • {Driver 3 — e.g., "Must be deployable on-premise"}
  • {Driver 1 — e.g., "Must support 10k concurrent users"}
  • {Driver 2 — e.g., "Team has no Go experience"}
  • {Driver 3 — e.g., "Must be deployable on-premise"}

Considered Options

Considered Options

  • {Option A}
  • {Option B}
  • {Option C — "Do nothing / status quo" when relevant}
  • {Option A}
  • {Option B}
  • {Option C — "Do nothing / status quo" when relevant}

Decision Outcome

Decision Outcome

Chosen option: "{Option A}", because {concise rationale tied to decision drivers}.
Chosen option: "{Option A}", because {concise rationale tied to decision drivers}.

Positive Consequences

Positive Consequences

  • {Benefit 1}
  • {Benefit 2}
  • {Benefit 1}
  • {Benefit 2}

Negative Consequences

Negative Consequences

  • {Trade-off 1 — be honest}
  • {Trade-off 2}
  • {Trade-off 1 — be honest}
  • {Trade-off 2}

Pros and Cons of the Options

Pros and Cons of the Options

{Option A} ✅ Chosen

{Option A} ✅ Chosen

  • ✅ {Pro 1}
  • ✅ {Pro 2}
  • ❌ {Con 1}
  • ✅ {Pro 1}
  • ✅ {Pro 2}
  • ❌ {Con 1}

{Option B}

{Option B}

  • ✅ {Pro 1}
  • ❌ {Con 1}
  • ❌ {Con 2}
  • ✅ {Pro 1}
  • ❌ {Con 1}
  • ❌ {Con 2}

{Option C}

{Option C}

  • ✅ {Pro 1}
  • ❌ {Con 1}
  • ✅ {Pro 1}
  • ❌ {Con 1}

Links

Links

  • {Related ADR, RFC, ticket, or documentation}
  • Supersedes: ADR-{NNN}: {Title} (if applicable)
  • Superseded by: ADR-{NNN}: {Title} (if applicable)

---
  • {Related ADR, RFC, ticket, or documentation}
  • Supersedes: ADR-{NNN}: {Title} (if applicable)
  • Superseded by: ADR-{NNN}: {Title} (if applicable)

---

Nygard Format (Minimal)

Nygard 格式(极简)

markdown
undefined
markdown
undefined

ADR-{NNN}: {Title}

ADR-{NNN}: {Title}

Status

Status

Accepted | Proposed | Deprecated | Superseded by ADR-{NNN}
Accepted | Proposed | Deprecated | Superseded by ADR-{NNN}

Context

Context

{What is the situation that led to this decision? What forces are at play — technical, business, organizational? What constraints exist? 2–5 sentences.}
{What is the situation that led to this decision? What forces are at play — technical, business, organizational? What constraints exist? 2–5 sentences.}

Decision

Decision

{What did we decide to do? State it directly, in active voice: "We will use X" or "We decided to adopt Y." Include a brief rationale — why this option over the alternatives.}
{What did we decide to do? State it directly, in active voice: "We will use X" or "We decided to adopt Y." Include a brief rationale — why this option over the alternatives.}

Consequences

Consequences

{What becomes easier or better as a result?} {What becomes harder or worse? Be honest about trade-offs.} {What new concerns or constraints does this introduce?}

---
{What becomes easier or better as a result?} {What becomes harder or worse? Be honest about trade-offs.} {What new concerns or constraints does this introduce?}

---

Y-Statement Format (Compact)

Y-Statement 格式(紧凑)

markdown
undefined
markdown
undefined

ADR-{NNN}: {Title}

ADR-{NNN}: {Title}

Date: YYYY-MM-DD | Status: Accepted
In the context of {situation/use case}, facing {concern or constraint}, we decided {the option chosen}, to achieve {quality attribute or goal}, accepting {the downside or trade-off}.
Deciders: {names or roles} Links: {related ADRs, tickets}

---
Date: YYYY-MM-DD | Status: Accepted
In the context of {situation/use case}, facing {concern or constraint}, we decided {the option chosen}, to achieve {quality attribute or goal}, accepting {the downside or trade-off}.
Deciders: {names or roles} Links: {related ADRs, tickets}

---

ADR Quality Checklist

ADR 质量检查清单

Before finalizing, verify:
  • Title is a noun phrase describing the decision (not a question, not a vague label)
  • Date is included (decisions without dates lose context quickly)
  • Status is set correctly — Accepted, Proposed, Deprecated, or Superseded
  • Context explains the forces that made this decision necessary, not just what was done
  • Decision is stated directly and tied to the context
  • Consequences include honest trade-offs — not just positives
  • Options (MADR format) include at least 2 alternatives actually considered
  • Supersedes / superseded by links are included when applicable
  • File follows naming convention:
    NNN-kebab-case-title.md
  • Number is sequential in the ADR directory

最终确定前,验证以下内容:
  • 标题是描述决策的名词短语(而非疑问句或模糊标签)
  • 日期已包含(无日期的决策会迅速失去上下文)
  • 状态设置正确——已通过、已提议、已弃用或已被替代
  • 背景解释了促使决策的因素,而非仅描述做了什么
  • 决策内容直接明确,并与背景相关联
  • 影响包含客观的权衡——而非仅列出优点
  • 选项(MADR格式)至少包含2个实际考虑过的替代方案
  • 适用时包含“替代/被替代”的链接
  • 文件遵循命名惯例:
    NNN-kebab-case-title.md
  • 编号在ADR目录中连续

ADR File Naming Convention

ADR 文件命名惯例

docs/adr/
├── 001-use-postgresql-for-primary-storage.md
├── 002-adopt-event-driven-architecture.md
├── 003-replace-jenkins-with-github-actions.md   ← supersedes ADR-001 if relevant
└── README.md                                     ← optional index
  • Zero-padded numbers:
    001
    ,
    002
    , ...
    099
    ,
    100
  • Kebab-case title
  • .md
    extension
  • Common directories:
    docs/adr/
    ,
    docs/decisions/
    ,
    adr/
    ,
    .adr/

docs/adr/
├── 001-use-postgresql-for-primary-storage.md
├── 002-adopt-event-driven-architecture.md
├── 003-replace-jenkins-with-github-actions.md   ← 若相关则替代ADR-001
└── README.md                                     ← 可选的索引文件
  • 带前导零的编号:
    001
    002
    ……
    099
    100
  • 短横线分隔的小写标题
  • .md
    扩展名
  • 常见目录:
    docs/adr/
    docs/decisions/
    adr/
    .adr/

Common Anti-Patterns to Avoid

需避免的常见反模式

Title as a Question

标题为疑问句

BAD:
# ADR-001: Should we use PostgreSQL?
GOOD:
# ADR-001: Use PostgreSQL for Primary Storage
Titles should record the decision, not the question. Future readers need to know what was decided, not what was considered.

错误示例
# ADR-001: Should we use PostgreSQL?
正确示例
# ADR-001: Use PostgreSQL for Primary Storage
标题应记录决策内容,而非待考虑的问题。未来读者需要知道已做出的决策,而非曾考虑过什么。

Vague Context

背景描述模糊

BAD:
We needed a database and chose PostgreSQL.
GOOD:
Our application requires a relational database with strong ACID guarantees.
The team has deep PostgreSQL experience. MySQL was evaluated but lacks
native support for JSONB columns, which our schema design requires.
Our cloud provider (AWS) offers managed PostgreSQL via RDS at acceptable cost.
Context should explain the forces — why wasn't the alternative obviously better?

错误示例
我们需要一个数据库,所以选择了PostgreSQL。
正确示例
我们的应用需要具备强ACID保证的关系型数据库。团队拥有丰富的PostgreSQL经验。我们评估了MySQL,但它缺乏对JSONB列的原生支持,而这是我们的 schema 设计所必需的。我们的云服务商(AWS)通过RDS提供托管PostgreSQL服务,成本在可接受范围内。
背景应解释因素——为何替代方案并非显然更优?

Consequences Without Trade-offs

影响描述无权衡

BAD:
undefined
错误示例
undefined

Consequences

影响

PostgreSQL is fast and reliable.

**GOOD**:
PostgreSQL 快速且可靠。

**正确示例**:

Consequences

影响

  • Enables JSONB columns and advanced indexing for our query patterns
  • Team expertise means fast onboarding and fewer operational surprises
  • Adds operational burden compared to a managed NoSQL service
  • Schema migrations require careful planning in a relational model

Honest trade-offs are what make ADRs valuable years later.

---
  • 支持JSONB列和高级索引,适配我们的查询模式
  • 团队的专业知识意味着快速上手和更少的运维意外
  • 相较于托管NoSQL服务,增加了运维负担
  • 关系型模型中,schema迁移需要仔细规划

客观的权衡是ADR在多年后仍有价值的原因。

---

Editing Instead of Superseding

编辑旧ADR而非创建新ADR替代

BAD: Editing an old ADR to change the decision after the fact.
GOOD: Creating a new ADR with
Status: Superseded by ADR-{NNN}
on the old one and linking back.
ADRs are historical records. The old decision was correct given what was known at the time. Superseding preserves that context.

错误示例:事后编辑旧ADR以更改决策内容。
正确示例:创建新ADR,在旧ADR中设置
Status: Superseded by ADR-{NNN}
并链接到新ADR。
ADR是历史记录。旧决策在当时已知的信息下是正确的。替代操作保留了上下文。

Missing the "Why Not" Rationale

缺失“为何不选其他方案”的理由

BAD:
undefined
错误示例
undefined

Decision

决策内容

We will use Redis for session storage.

**GOOD**:
我们将使用Redis存储会话。

**正确示例**:

Decision

决策内容

We will use Redis for session storage. We considered storing sessions in PostgreSQL (already in our stack) but Redis's built-in TTL support and in-memory performance make it significantly better suited for high-frequency session reads. The operational cost of an additional service is justified by the simplified session expiry logic.

The rationale is *why this option and not the others* — not just what was chosen.

---
我们将使用Redis存储会话。我们考虑过在PostgreSQL中存储会话(PostgreSQL已在我们的技术栈中),但Redis的内置TTL支持和内存性能使其更适合高频率的会话读取场景。额外服务的运维成本通过简化的会话过期逻辑得以证明是合理的。

理由是*为何选此方案而非其他*——而非仅描述选择了什么。

---

Important Notes

重要提示

  • ADRs are immutable — never edit the decision. Supersede with a new ADR.
  • Short is better — 200–500 words is ideal. If it needs to be longer, move detail to a linked TDD or RFC.
  • Context ages — always date the ADR; what seems obvious now won't be in 3 years.
  • Honest consequences — a one-sided ADR loses credibility. Future engineers will hit the downsides regardless.
  • Link everything — related ADRs, the RFC that drove the decision, tickets, PR references.
  • Language adaptation — always write in the user's language.
  • Number sequentially — check the directory before assigning a number.
  • ADR 不可变——绝不编辑决策内容,用新ADR替代旧ADR。
  • 越短越好——200-500词为理想长度。若需更长篇幅,将细节移至链接的TDD或RFC中。
  • 背景会过时——始终为ADR添加日期;现在看似显而易见的事情,3年后未必如此。
  • 客观描述影响——片面的ADR会失去可信度。未来工程师无论如何都会遇到缺点。
  • 链接所有相关内容——相关ADR、推动决策的RFC、工单、PR引用。
  • 语言适配——始终使用用户的语言编写。
  • 连续编号——分配编号前检查目录。

Example Prompts that Trigger This Skill

触发此技能的示例提示词

English

英文

  • "Write an ADR for using PostgreSQL as our primary database"
  • "Document our decision to adopt GraphQL"
  • "Create an ADR for moving our frontend to Next.js"
  • "I need to record why we chose Kafka over RabbitMQ"
  • "Add an architecture decision record for our authentication approach"
  • "Write an ADR for using PostgreSQL as our primary database"
  • "Document our decision to adopt GraphQL"
  • "Create an ADR for moving our frontend to Next.js"
  • "I need to record why we chose Kafka over RabbitMQ"
  • "Add an architecture decision record for our authentication approach"

Portuguese

葡萄牙语

  • "Escreva um ADR sobre a decisão de usar PostgreSQL"
  • "Documente a decisão de adotar GraphQL no projeto"
  • "Crie um ADR explicando por que escolhemos Kafka"
  • "Escreva um ADR sobre a decisão de usar PostgreSQL"
  • "Documente a decisão de adotar GraphQL no projeto"
  • "Crie um ADR explicando por que escolhemos Kafka"

Spanish

西班牙语

  • "Escribe un ADR sobre la decisión de usar PostgreSQL"
  • "Documenta la decisión de adoptar microservicios"
  • "Crea un ADR explicando por qué elegimos Next.js"
  • "Escribe un ADR sobre la decisión de usar PostgreSQL"
  • "Documenta la decisión de adoptar microservicios"
  • "Crea un ADR explicando por qué elegimos Next.js" ",