adr-create
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCreate ADR
创建ADR
Create a new Architecture Decision Record with the next sequential number, register it in the AgentDB graph, and link it to related ADRs.
创建带有下一个连续编号的新架构决策记录(ADR),将其注册到AgentDB图中,并关联至相关ADR。
When to use
使用场景
When a significant architectural decision needs to be recorded -- new technology adoption, API design choices, data model changes, infrastructure decisions, or any cross-cutting concern that affects multiple components.
当需要记录重大架构决策时——例如采用新技术、API设计选择、数据模型变更、基础设施决策,或任何影响多个组件的跨领域问题。
Steps
步骤
-
Find next number --for
Globand parse existing numbers to determine the next sequential ID (ADR-001, ADR-002, etc.). Createdocs/adr/ADR-*.mdif it does not exist.docs/adr/ -
Slugify title -- Convert the title argument to a lowercase, hyphen-separated slug (e.g., "Use PostgreSQL for persistence" becomes).
use-postgresql-for-persistence -
Create ADR file --the file at
Writeusing the standard template:docs/adr/ADR-NNN-<slug>.mdmarkdown# ADR-NNN: <Title> - **Status**: proposed - **Date**: <today's date YYYY-MM-DD> - **Deciders**: <leave blank for author to fill> - **Tags**: <leave blank> ## Context <!-- What is the issue that motivates this decision? --> ## Decision <!-- What is the change that we are proposing? --> ## Consequences ### Positive - ### Negative - ### Neutral - ## Links -
Store in AgentDB -- Callwith:
mcp__claude-flow__agentdb_hierarchical-store- path:
adr/ADR-NNN - value:
{ "id": "ADR-NNN", "title": "<title>", "status": "proposed", "date": "<today>", "file": "docs/adr/ADR-NNN-<slug>.md" }
- path:
-
Find related ADRs -- Callwith the title as query in namespace
mcp__claude-flow__memory_searchto find related decisions. If matches found, add them to the Links section and create causal edges with relationadr-patterns.depends-on -
Store pattern -- Callin namespace
mcp__claude-flow__memory_storewith keyadr-patternsand the title + context as value for future semantic search.ADR-NNN -
Report -- Output the created file path, ADR number, and any related ADRs found.
-
确定下一个编号——通过匹配
Glob文件,解析现有编号以确定下一个连续ID(如ADR-001、ADR-002等)。若docs/adr/ADR-*.md目录不存在则创建该目录。docs/adr/ -
生成标题短标识(Slugify)——将标题参数转换为小写、连字符分隔的短标识(例如,"Use PostgreSQL for persistence"转换为)。
use-postgresql-for-persistence -
创建ADR文件——使用标准模板在路径下
docs/adr/ADR-NNN-<slug>.md文件:Writemarkdown# ADR-NNN: <Title> - **Status**: proposed - **Date**: <today's date YYYY-MM-DD> - **Deciders**: <leave blank for author to fill> - **Tags**: <leave blank> ## Context <!-- What is the issue that motivates this decision? --> ## Decision <!-- What is the change that we are proposing? --> ## Consequences ### Positive - ### Negative - ### Neutral - ## Links -
存储至AgentDB——调用,参数如下:
mcp__claude-flow__agentdb_hierarchical-store- path:
adr/ADR-NNN - value:
{ "id": "ADR-NNN", "title": "<title>", "status": "proposed", "date": "<today>", "file": "docs/adr/ADR-NNN-<slug>.md" }
- path:
-
查找相关ADR——以标题为查询词,在命名空间下调用
adr-patterns查找相关决策。若找到匹配项,将其添加至Links部分,并创建mcp__claude-flow__memory_search关联的因果边。depends-on -
存储模式——在命名空间下调用
adr-patterns,以mcp__claude-flow__memory_store为键,标题+上下文为值进行存储,用于未来的语义搜索。ADR-NNN -
生成报告——输出已创建的文件路径、ADR编号以及找到的所有相关ADR。