write-adr

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Write ADR Skill

编写ADR技能

Create a well-structured Architecture Decision Record.
创建结构清晰的架构决策记录(ADR)。

Step 1 — Gather Information

步骤1 — 收集信息

Ask the user (if not already provided):
  1. What decision was made?
  2. What was the context or problem that prompted it?
  3. What alternatives were considered?
  4. What are the trade-offs or consequences of this decision?
询问用户(若未提供相关信息):
  1. 做出了什么决策?
  2. 促使该决策产生的背景或问题是什么?
  3. 考虑过哪些替代方案?
  4. 该决策的权衡或影响是什么?

Step 2 — Determine the ADR Number

步骤2 — 确定ADR编号

List existing ADRs in
docs/adr/
and increment the highest number. If the directory does not exist, create it and start at
0001
.
列出
docs/adr/
目录下已有的ADR,将最高编号加1。如果该目录不存在,则创建它并从
0001
开始编号。

Step 3 — Write the ADR

步骤3 — 编写ADR

Use the template from
adr-template.md
. Fill every section:
  • Title: short, imperative phrase describing the decision
  • Status:
    Accepted
    for a new decision
  • Date: today's date in YYYY-MM-DD format
  • Context: the situation that made a decision necessary — be specific about constraints
  • Decision: what was decided — use active voice ("We will use X")
  • Consequences: both positive and negative outcomes; what becomes easier and harder
The ADR must stand alone — a reader unfamiliar with the decision must understand it fully from the ADR text without needing to ask follow-up questions.
使用
adr-template.md
中的模板。填写所有部分:
  • 标题:简短的祈使句,描述决策内容
  • 状态:新决策填
    Accepted
  • 日期:今日日期,格式为YYYY-MM-DD
  • 背景:需要做出决策的具体场景——明确说明约束条件
  • 决策:最终做出的决定——使用主动语态(“我们将使用X”)
  • 影响:包括积极和消极的结果;哪些事情会变得更简单,哪些会更困难
ADR必须独立成篇——不了解该决策的读者仅通过ADR文本就能完全理解内容,无需进一步提问。

Step 4 — Write the File

步骤4 — 保存文件

Save to
docs/adr/NNNN-{kebab-case-title}.md
.
Example:
docs/adr/0003-use-postgresql-as-primary-store.md
保存至
docs/adr/NNNN-{kebab-case-title}.md
示例:
docs/adr/0003-use-postgresql-as-primary-store.md