Architecture Decision Records (ADR) management. Creates, updates, and tracks architectural decisions with templates and linting.
架构决策记录管理,创建、更新、追踪架构决策,提供模板和检查。
版本: 1.0
功能: ADR 创建、决策索引、模板管理、过期检查
bash
bash
bash
| 命令 | 说明 | 示例 |
|---|---|---|
| create | 创建 ADR | create 标题 |
| list |
自动生成的 ADR 遵循 MADR 格式:
markdown
日期: 2026-04-01
状态: proposed
决策者: [你的名字]
需要为应用选择缓存方案来提升性能。
选择方案: Redis
proposed → accepted → deprecated
↓ ↓
rejected superseded ←── 被新决策替代
docs/adr/
├── 0001-use-redis-for-caching.md
├── 0002-adopt-postgresql-as-primary-db.md
├── 0003-implement-microservices.md
└── index.md # 自动生成的索引
bash
$ python3 scripts/main.py create 迁移到微服务架构
✅ 已创建: docs/adr/0004-migrate-to-microservices.md
下一步:
bash
$ python3 scripts/main.py list
📋 架构决策记录
================================
已接受:
[0002] 采用 PostgreSQL 作为主数据库
[0003] 实现 API 网关
提议中:
[0004] 迁移到微服务架构
已被替代:
[0001] 使用本地缓存 → 被 0002 替代
bash
$ python3 scripts/main.py lint
🔍 ADR 检查结果
===================
✅ 0001-use-redis-for-caching.md
✅ 0002-adopt-postgresql.md
⚠️ 0003-microservices.md
- 缺少决策驱动因素部分
- 标题中没有日期
.adr.json:
json
{
adr_dir: docs/adr,
template: madr,
default_status: proposed,
required_sections: [
Context,
Decision,
Consequences
]
}
yaml
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: 检查 ADR
run: python3 skills/adr/scripts/main.py lint
- name: 更新索引
run: python3 skills/adr/scripts/main.py index --update
skills/adr/
├── SKILL.md # 本文件
└── scripts/
├── main.py # ⭐ 统一入口
└── templates/
└── madr.md # MADR 模板
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 openclaw-adr-1775888891 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 openclaw-adr-1775888891 技能
skillhub install openclaw-adr-1775888891
文件大小: 5.42 KB | 发布时间: 2026-4-12 10:48