mcpField
C
create-architectural-decision-record

create-architectural-decision-record

github.com/github开发40.5k10.2k 次安装1 天前更新
代码仓库

关于 create-architectural-decision-record

这项编码技能引导 AI 根据决策背景和利益相关者信息编写结构化的架构决策记录(ADR)。它规定标准格式、备选方案与影响,并要求按序号命名文件。

主要功能

  1. 01检查决策信息是否缺失
  2. 02采用标准 ADR 前置信息
  3. 03记录备选方案及其影响
  4. 04多项内容使用编码条目
  5. 05按序号保存命名的 ADR 文件

适用场景

  1. 01记录架构选择及其背景
  2. 02比较选项并说明否决理由
  3. 03记录预期的正面和负面影响

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/github/awesome-copilot --skill create-architectural-decision-record

安装后在 Claude Code 中输入/create-architectural-decision-record确认已加载。

详细介绍

创建架构决策记录

为 ${input:DecisionTitle} 创建一份 ADR 文档,采用针对 AI 消费与人类可读性优化的结构化格式。

输入

  • 上下文:${input:Context}
  • 决策:${input:Decision}
  • 备选方案:${input:Alternatives}
  • 利益相关方:${input:Stakeholders}

输入验证

如果任何必需的输入未提供,或无法从对话历史中确定,请在继续生成 ADR 之前要求用户提供缺失的信息。

要求

  • 使用精确、无歧义的语言
  • 遵循带 front matter 的标准化 ADR 格式
  • 同时包含正面和负面后果
  • 记录备选方案及拒绝理由
  • 结构便于机器解析和人工查阅
  • 对多条目部分使用编码项目符号(3-4 个字母的代码 + 3 位数字)

ADR 必须保存在 /docs/adr/ 目录中,命名规范为:adr-NNNN-[title-slug].md,其中 NNNN 是下一个顺序的 4 位数字(例如 adr-0001-database-selection.md)。

必需的文档结构

文档文件必须遵循以下模板,确保所有部分都得到适当填写。markdown 的 front matter 应按照以下示例正确结构化:

---
title: "ADR-NNNN: [Decision Title]"
status: "Proposed"
date: "YYYY-MM-DD"
authors: "[Stakeholder Names/Roles]"
tags: ["architecture", "decision"]
supersedes: ""
superseded_by: ""
---

# ADR-NNNN: [Decision Title]

## Status

**Proposed** | Accepted | Rejected | Superseded | Deprecated

## Context

[Problem statement, technical constraints, business requirements, and environmental factors requiring this decision.]

## Decision

[Chosen solution with clear rationale for selection.]

## Consequences

### Positive

- **POS-001**: [Beneficial outcomes and advantages]
- **POS-002**: [Performance, maintainability, scalability improvements]
- **POS-003**: [Alignment with architectural principles]

### Negative

- **NEG-001**: [Trade-offs, limitations, drawbacks]
- **NEG-002**: [Technical debt or complexity introduced]
- **NEG-003**: [Risks and future challenges]

## Alternatives Considered

### [Alternative 1 Name]

- **ALT-001**: **Description**: [Brief technical description]
- **ALT-002**: **Rejection Reason**: [Why this option was not selected]

### [Alternative 2 Name]

- **ALT-003**: **Description**: [Brief technical description]
- **ALT-004**: **Rejection Reason**: [Why this option was not selected]

## Implementation Notes

- **IMP-001**: [Key implementation considerations]
- **IMP-002**: [Migration or rollout strategy if applicable]
- **IMP-003**: [Monitoring and success criteria]

## References

- **REF-001**: [Related ADRs]
- **REF-002**: [External documentation]
- **REF-003**: [Standards or frameworks referenced]

评论

支持 Markdown