pcliangx/agf-writing-adr
Use when tech-lead is about to record an architecture decision (new tech stack member, deviation from baseline, deployment / observability / auth scheme choice). Provides ADR structure, version-audit appendix format, and "what NOT to ADR" guidance. Replaces ad-hoc copy from ADR-000.
npx skills add https://github.com/pcliangx/AppGenesisForge --skill agf-writing-adr
Use this skill when:
Do NOT write an ADR for:
If unsure → write it. ADR cost is low; the "why" memory is what disappears.
docs/adr/NNN-[slug-kebab-case].md — sequential, zero-padded 3 digits. Examples:
001-jwt-vs-session-auth.md002-llm-caching-policy.md003-deploy-target-fly-io.mdADR-000 is reserved for the system architecture baseline. Never reuse a number; if abandoned, mark Status: Superseded by ADR-NNN.
Proposed → Accepted → (later) Superseded by ADR-NNN / Deprecated. Once Accepted, do not edit decisions; supersede with a new ADR.
Allowed in-place edits on Accepted ADRs:
## 版本与查证 rows when a deferred row resolvesAnything else → new ADR.
# ADR-NNN: [Title]
- 状态:Proposed / Accepted / Superseded by ADR-NNN / Deprecated
- 日期:YYYY-MM-DD
- 决策者:tech-lead [+ co-decider role if any]
- 影响范围:[模块/全栈/单服务]
## 上下文
为什么现在需要这个决策?1–3 段:业务驱动、技术约束、当前痛点、不做这个决策会出什么问题。
## 决策
| 维度 | 选型 | 理由 |
|---|---|---|
| ... | ... | 为什么是它,而不是 [备选] |
或者用文字描述(如果不是结构化对比)。**关键:必须列出至少一个备选方案 + 为什么否决它。**
## 备选方案
- **A. [备选 1]** — pros / cons / 否决理由
- **B. [备选 2]** — pros / cons / 否决理由
如果没列备选 = 你没真正决策,只是默认接受。回去补。
## 影响
- 对现有代码:哪些模块会变 / 不变
- 对团队:谁需要学新东西
- 对成本:每月预估增量(CNY 或 token)
- 对运维:新增监控点 / 告警 / 备份策略
## 本 ADR 不覆盖的决策
明确列出"相关但留给未来 ADR"的内容,避免读者期待落空。
## 后续工作
- [ ] 谁 / 什么时间 / 做什么(具体到角色 + 触发条件)
## 版本与查证
> tech-lead 行事原则 #3「先查最新版再决策」的回填段。新增技术或大版本升级时必填。
**查证基线日期**:YYYY-MM-DD
| 选型 | 选定版本 | 最新稳定版 | 与最新版差距 | 维护状态 | 信息来源(含原文摘录) |
|---|---|---|---|---|---|
| ... | x.y.z | a.b.c | 1 个 minor 落后 | Active | [官方 changelog URL] — "原文..." |
**回填规则**:执行层在落地时(write lockfile / pyproject.toml)回填本表对应行,commit message 加 `docs(adr): backfill ADR-NNN verification for [pkg]`。
ADR 不是事后总结,是决策前的工具:
resolve-library-id → query-docs)拉当前版本官方文档;未收录或版本信息不足再 WebFetch 官方 changelog / release notes。记录"今天最新稳定版 + 维护状态 + 已知 breaking change"做完 1 + 2 但跳过 3,未来一定会被问"当时为啥选这个"——答不了就是组织记忆缺失。
TaskCreate 跟踪「后续工作」中的事项(如有)?ADR 落盘后:
Take pcliangx/agf-writing-adr from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.