adr-create

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Create 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

步骤

  1. Find next number --
    Glob
    for
    docs/adr/ADR-*.md
    and parse existing numbers to determine the next sequential ID (ADR-001, ADR-002, etc.). Create
    docs/adr/
    if it does not exist.
  2. Slugify title -- Convert the title argument to a lowercase, hyphen-separated slug (e.g., "Use PostgreSQL for persistence" becomes
    use-postgresql-for-persistence
    ).
  3. Create ADR file --
    Write
    the file at
    docs/adr/ADR-NNN-<slug>.md
    using the standard template:
    markdown
    # 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
  4. Store in AgentDB -- Call
    mcp__claude-flow__agentdb_hierarchical-store
    with:
    • path:
      adr/ADR-NNN
    • value:
      { "id": "ADR-NNN", "title": "<title>", "status": "proposed", "date": "<today>", "file": "docs/adr/ADR-NNN-<slug>.md" }
  5. Find related ADRs -- Call
    mcp__claude-flow__memory_search
    with the title as query in namespace
    adr-patterns
    to find related decisions. If matches found, add them to the Links section and create causal edges with relation
    depends-on
    .
  6. Store pattern -- Call
    mcp__claude-flow__memory_store
    in namespace
    adr-patterns
    with key
    ADR-NNN
    and the title + context as value for future semantic search.
  7. Report -- Output the created file path, ADR number, and any related ADRs found.
  1. 确定下一个编号——通过
    Glob
    匹配
    docs/adr/ADR-*.md
    文件,解析现有编号以确定下一个连续ID(如ADR-001、ADR-002等)。若
    docs/adr/
    目录不存在则创建该目录。
  2. 生成标题短标识(Slugify)——将标题参数转换为小写、连字符分隔的短标识(例如,"Use PostgreSQL for persistence"转换为
    use-postgresql-for-persistence
    )。
  3. 创建ADR文件——使用标准模板在
    docs/adr/ADR-NNN-<slug>.md
    路径下
    Write
    文件:
    markdown
    # 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
  4. 存储至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" }
  5. 查找相关ADR——以标题为查询词,在
    adr-patterns
    命名空间下调用
    mcp__claude-flow__memory_search
    查找相关决策。若找到匹配项,将其添加至Links部分,并创建
    depends-on
    关联的因果边。
  6. 存储模式——在
    adr-patterns
    命名空间下调用
    mcp__claude-flow__memory_store
    ,以
    ADR-NNN
    为键,标题+上下文为值进行存储,用于未来的语义搜索。
  7. 生成报告——输出已创建的文件路径、ADR编号以及找到的所有相关ADR。