ADR(架构决策记录)

diegosouzapw2026-10-28查看 1691复制 493

按照一致的模板创建和维护架构决策记录

Download (.md)

📘如何使用这个技能

  1. 1
    复制技能内容·点击上方「Copy SKILL.md」复制全部内容,或 Download 下载到本地
  2. 2
    打开你的 AI 客户端·支持 Claude Code、Trae、Cursor、ChatGPT、DeepSeek、Kimi 等任意 AI 助手
  3. 3
    粘贴为系统提示/知识文件·Claude Code:放入 .claude/skills/ 目录;普通对话:作为首条消息发送并说「请严格按这份技能文档执行」
  4. 4
    直接提出你的需求·AI 会按技能定义的工作流、格式和约束来处理,无需再解释背景

💡 提示:技能生效后,每次对话只需一句需求,AI 会按 SKILL.md 的流程执行。

SKILL.md2362 chars
---
name: ADR (Architecture Decision Record)
description: Create and maintain Architecture Decision Records following a consistent template
category: architecture
version: 1.0.0
triggers:
  - architecture-decision
  - adr-supersede
  - document-decision
globs: "**/docs/adr/**,**/architecture/**"
---

# ADR (Architecture Decision Record) Skill

Create and maintain Architecture Decision Records following a consistent template.

## Trigger Conditions
- A new architecture decision needs to be documented
- An existing ADR needs to be superseded or updated
- User invokes with "create ADR" or "document decision"

## Input Contract
- **Required:** Decision context (what problem are we solving?)
- **Required:** Options considered (at least 2 alternatives)
- **Optional:** Constraints, evaluation criteria, stakeholders

## Output Contract
- ADR document in markdown format with: Status, Date, Context, Decision, Consequences, Alternatives Considered
- Numbered sequentially (ADR-NNN) in the `docs/adr/` directory
- Links to related ADRs (supersedes, relates-to)

## Tool Permissions
- **Read:** All project files, existing ADRs, architecture docs
- **Write:** `docs/adr/` directory
- **Search:** Codebase for implementation evidence

## Execution Steps
1. Gather the decision context from user or triggering event
2. Search existing ADRs for related decisions
3. Determine the next ADR number
4. Draft the ADR using the standard template
5. Link to related ADRs and relevant code/config
6. Write the ADR file to `docs/adr/ADR-NNN-<title>.md`

## Success Criteria
- ADR has all required sections filled in
- Status is set (Proposed, Accepted, Deprecated, Superseded)
- Consequences section includes both positive and negative impacts
- File is written to the correct location with proper naming

## Escalation Rules
- Escalate if the decision has >$1K/month cost implications
- Escalate if the decision affects regulatory compliance
- Escalate if no clear winner among alternatives

## Example Invocations

**Input:** "We need to decide between PostgreSQL and DynamoDB for the order service"

**Output:** ADR-005-order-service-database.md with context (high write volume, need transactions), decision (PostgreSQL for ACID guarantees), consequences (operational overhead, need connection pooling), alternatives (DynamoDB rejected due to transaction limitations).
来源:skillsdirectory

评论0

登录后参与评论

还没有评论,来抢沙发吧