adr-drafting
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseADR Drafting
ADR 起草
Creates new Architecture Decision Record (ADR) documents for major architectural choices so teams can keep a clear history of why important technical decisions were made.
为重大架构选择创建新的架构决策记录(ADR)文档,以便团队能够清晰留存重要技术决策的制定原因。
Overview
概述
This skill helps create a new ADR from discovery to final markdown file. It confirms the decision details, inspects the repository for any existing ADR conventions, and drafts a new ADR with the standard sections , , , , and .
TitleStatusContextDecisionConsequencesWhen the repository does not already have an ADR convention, default to storing ADRs in and use a zero-padded filename such as .
docs/architecture/adr0001-use-postgresql-for-primary-database.mdSee for the default ADR template and for example ADRs and naming patterns.
references/template.mdreferences/examples.md本技能可辅助完成从信息收集到最终生成markdown文件的全流程ADR创建工作。它会确认决策详情,检查代码仓库中现有的ADR规范,并按照标准章节 、、、、 起草新的ADR。
TitleStatusContextDecisionConsequences如果仓库中尚未制定ADR规范,默认将ADR存储在 路径下,并使用补零的文件名格式,例如 。
docs/architecture/adr0001-use-postgresql-for-primary-database.md默认ADR模板可查看 ,ADR示例和命名模式可查看 。
references/template.mdreferences/examples.mdWhen to Use
适用场景
Use this skill when a user or agent has decided on a meaningful architectural change and needs to document the rationale, chosen direction, and trade-offs in a new Architecture Decision Record. It fits requests such as creating an ADR, documenting an architecture decision, writing a decision record, or preserving the project history behind an important technical choice.
当用户或Agent已经确定要进行一项重要的架构变更,需要在新的架构决策记录中记录决策依据、选定方案以及权衡因素时使用本技能。适用于以下类型的请求:创建ADR、记录架构决策、编写决策记录、留存重要技术选择背后的项目历史。
Instructions
使用说明
Phase 1: Confirm the ADR inputs
阶段1:确认ADR输入信息
Ask the user for the minimum information needed to draft a new ADR:
- Decision title
- Decision status (by default if not yet finalized)
Proposed - Context: the problem, constraints, or forces driving the decision
- Decision: the chosen approach
- Consequences: what becomes easier, harder, riskier, or more expensive
- Confirm that this request is for a new ADR, not for editing an existing ADR
- Confirm the desired repository language if documentation language is unclear
- Confirm whether any existing ADR naming convention must be preserved
If the user actually wants to update an existing ADR, change statuses in older ADRs, or manage supersession links, explain that this skill only drafts new ADR documents and ask whether they want to proceed with a new record instead.
向用户询问起草新ADR所需的最少信息:
- 决策标题
- 决策状态(如果尚未最终确定,默认为 )
Proposed - 上下文:驱动该决策的问题、约束或影响因素
- 决策:选定的实现方案
- 影响:哪些工作会变得更简单、更困难、风险更高或是成本更高
- 确认本次请求是要创建新ADR,而非编辑现有ADR
- 如果文档语言不明确,确认期望的仓库文档语言
- 确认是否需要遵守任何现有的ADR命名规范
如果用户实际想要更新现有ADR、修改旧ADR的状态,或是管理替代关系链接,请说明本技能仅负责起草新ADR文档,并询问用户是否改为创建新的记录。
Phase 2: Discover ADR conventions in the repository
阶段2:探查仓库中的ADR规范
Inspect the repository before drafting:
- Search for likely ADR locations such as:
docs/architecture/adrdocs/adradrarchitecture/adr
- If ADR files already exist, read one to three examples to infer:
- numbering format
- filename pattern
- title format
- language and tone
- If no ADR directory exists, recommend
docs/architecture/adr - Determine the next ADR number from existing files when possible
- If no prior ADR exists, start with
0001
Preferred default naming when no convention exists:
- Directory:
docs/architecture/adr - Filename:
NNNN-short-kebab-title.md - Title:
# ADR-NNNN: <Decision Title>
起草前先检查代码仓库:
- 搜索可能的ADR存放路径,例如:
docs/architecture/adrdocs/adradrarchitecture/adr
- 如果已经存在ADR文件,读取1-3个示例以推断:
- 编号格式
- 文件名模式
- 标题格式
- 语言和措辞风格
- 如果不存在ADR目录,推荐使用
docs/architecture/adr - 尽可能根据现有文件确定下一个ADR编号
- 如果此前没有ADR,从 开始编号
0001
没有现有规范时的首选默认命名规则:
- 目录:
docs/architecture/adr - 文件名:
NNNN-short-kebab-title.md - 标题:
# ADR-NNNN: <Decision Title>
Phase 3: Draft the ADR
阶段3:起草ADR
Create a draft using the standard structure:
markdown
undefined使用标准结构创建草稿:
markdown
undefinedADR-NNNN: Decision Title
ADR-NNNN: Decision Title
Status
Status
Proposed
Proposed
Context
Context
What problem, constraints, or trade-offs led to this decision?
What problem, constraints, or trade-offs led to this decision?
Decision
Decision
What architectural choice was made?
What architectural choice was made?
Consequences
Consequences
What becomes easier, harder, riskier, or more expensive because of this decision?
Drafting rules:
- Keep the title specific and decision-oriented
- Capture enough context to explain *why* the decision was needed
- Record the chosen direction clearly and directly
- Include both positive and negative consequences when known
- Do not invent rationale, constraints, or outcomes that the user did not provide
- If critical information is missing, insert concise placeholders or ask follow-up questions before finalizingWhat becomes easier, harder, riskier, or more expensive because of this decision?
起草规则:
- 标题要具体,以决策为导向
- 留存足够的上下文以说明*为什么*需要做出该决策
- 清晰直接地记录选定的方案
- 已知的正面和负面影响都要包含
- 不要虚构用户未提供的决策依据、约束或结果
- 如果缺少关键信息,插入简洁的占位符,或是在最终定稿前询问后续问题补充信息Phase 4: Review the draft with the user
阶段4:与用户一起审核草稿
Before writing files, present:
- proposed file path
- proposed title
- ADR status
- a concise preview of the drafted sections
Ask for approval before creating the file. If the user wants adjustments, revise the draft first.
写入文件前,先展示以下内容:
- 建议的文件路径
- 建议的标题
- ADR状态
- 已起草章节的简明预览
创建文件前先征求用户同意,如果用户需要调整,先修改草稿。
Phase 5: Create the ADR file
阶段5:创建ADR文件
After approval:
- Create the ADR directory if it does not exist
- Write the ADR markdown file using the repository's established pattern when available
- Preserve the user's wording for decision rationale as much as possible while keeping the document concise
- Report the final file path and summarize what was created
- Stop after creating the new ADR file so the skill remains focused on a single new decision record
获得批准后:
- 如果ADR目录不存在则创建该目录
- 尽可能遵循仓库已有的模式写入ADR markdown文件
- 在保持文档简洁的同时,尽可能保留用户对决策依据的原始表述
- 告知最终的文件路径,总结已创建的内容
- 创建完新ADR文件后即终止流程,确保本技能专注于单条新决策记录的创建
Examples
示例
Example 1: New database decision
示例1:新数据库决策
User request: "Create an ADR for moving from SQLite to PostgreSQL"
Expected flow:
- Confirm the title, status, reasons for the change, and expected consequences
- Check whether the repository already has ADR files
- Draft a new ADR in the existing convention or default to
docs/architecture/adr/0001-move-to-postgresql.md - Ask for approval before writing the file
用户请求: "Create an ADR for moving from SQLite to PostgreSQL"
预期流程:
- 确认标题、状态、变更原因和预期影响
- 检查仓库是否已有ADR文件
- 按照现有规范起草新ADR,没有规范则默认生成
docs/architecture/adr/0001-move-to-postgresql.md - 写入文件前征求用户同意
Example 2: New service boundary
示例2:新服务边界
User request: "Document the decision to split billing into a dedicated service"
Expected flow:
- Ask for the architectural context and why the current design is insufficient
- Confirm the chosen boundary and the operational consequences
- Draft a new ADR with the standard sections
- Create the file only after user approval
See for longer ADR examples.
references/examples.md用户请求: "Document the decision to split billing into a dedicated service"
预期流程:
- 询问架构上下文以及当前设计不足的原因
- 确认选定的边界和运营影响
- 按照标准章节起草新ADR
- 仅在获得用户批准后创建文件
更长的ADR示例可查看 。
references/examples.mdBest Practices
最佳实践
- Keep each ADR focused on one architectural decision
- Match existing repository naming, numbering, and writing style when ADRs already exist
- Prefer concise explanations over long narratives
- Capture trade-offs honestly, including downsides and new risks
- Default the status to unless the user confirms another state
Proposed - Use the repository's preferred documentation language when it is clear
- 每条ADR仅聚焦于一项架构决策
- 如果仓库中已有ADR,要匹配现有命名、编号和写作风格
- 优先使用简洁的解释而非长篇叙述
- 如实记录权衡因素,包括缺点和新增风险
- 除非用户确认其他状态,否则默认状态为
Proposed - 明确的情况下使用仓库偏好的文档语言
Constraints and Warnings
约束和注意事项
- This skill is for new ADR creation only
- Do not update existing ADR files, status histories, or supersession chains
- Do not fabricate missing rationale or consequences
- Do not force if the repository already uses another ADR location
docs/architecture/adr - Ask clarifying questions whenever the decision, context, or consequences are too vague to document responsibly
- 本技能是仅用于创建新ADR
- 不要更新现有ADR文件、状态历史或替代关系链
- 不要虚构缺失的决策依据或影响
- 如果仓库已经使用其他ADR存放路径,不要强制使用
docs/architecture/adr - 当决策、上下文或影响过于模糊无法可靠记录时,询问澄清问题