跳到正文
cccskills
免费在 GitHub 公开

adr-writer

Write effective Architecture Decision Records. Use when: (1) Creating a new ADR, (2) Recording a design decision, (3) User mentions ADR, decision, trade-off, or alternatives

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(1)

  • SKILL.md6.8 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

ADR Writer

Write ADRs that clearly capture context, decisions, and consequences.

Invocation Mode

This helper skill may be used standalone or by /discuss, /gov, /spec, or /migrate. It is responsible for ADR content structure and quality, not ADR lifecycle verbs. Use /spec or /gov for govctl adr accept, reject, or supersede.

Quick Reference

govctl adr new "<title>"
govctl adr set <ADR-ID> context --stdin <<'EOF'
context text
EOF
govctl adr set <ADR-ID> decision --stdin <<'EOF'
decision text
EOF
govctl adr set <ADR-ID> consequences --stdin <<'EOF'
consequences text
EOF
govctl adr add <ADR-ID> alternatives "Option: Description"
govctl adr add <ADR-ID> refs RFC-NNNN

ADR Structure

Every ADR has three required fields and two optional fields:

1. Context (required)

Explain the situation that requires a decision. Structure:

Do NOT include ## Context heading — the renderer adds it automatically.

[1-2 sentence summary of the situation]

### Problem Statement

What specific issue are we addressing?

### Constraints

What existing RFCs, ADRs, or technical limitations restrict our options?

### Options Considered

Brief overview (details go in the alternatives field).

Key principle: A reader 6 months from now must understand why this decision was needed without asking anyone.

2. Decision (required)

State what was decided and why. Structure:

Do NOT include ## Decision heading — the renderer adds it automatically.

We will **[action]** because:

1. **Reason one:** Explanation
2. **Reason two:** Explanation

### Implementation Notes

Specific guidance for implementing this decision.

Key principle: Lead with the decision, then justify. Don't bury the answer.

3. Consequences (required)

Honest accounting of trade-offs. Structure:

Do NOT include ## Consequences heading — the renderer adds it automatically.

### Positive

- Benefit one
- Benefit two

### Negative

- Trade-off one (mitigation: ...)
- Trade-off two (mitigation: ...)

### Neutral

- Side effect that is neither positive nor negative

Key principle: Every decision has downsides. If your Negative section is empty, you haven't thought hard enough.

4. Alternatives (recommended)

Document options considered. Future readers need to know what was not chosen and why.

Extended structure per ADR-0027:

[[content.alternatives]]
text = "Option A: Description"
status = "rejected"
pros = ["Advantage 1", "Advantage 2"]
cons = ["Disadvantage 1"]
rejection_reason = "Why this was not chosen"

Field semantics:

  • text (required): Description of the alternative
  • status: considered (default) | accepted | rejected
  • pros: List of advantages
  • cons: List of disadvantages
  • rejection_reason: If rejected, explains why

CLI commands:

# Simple alternative
govctl adr add <ADR-ID> alternatives "Option A: Use PostgreSQL"

# With pros, cons, and rejection reason
govctl adr add <ADR-ID> alternatives "Option B: Use Redis" \
  --pro "Fast caching" --pro "Simple API" \
  --con "Additional infrastructure" \
  --reject-reason "Overkill for our scale"

# Edit nested fields after creation
govctl adr tick <ADR-ID> alternatives --at 0 -s rejected
govctl adr add <ADR-ID> alt[0].pros "New advantage"
govctl adr remove <ADR-ID> alt[0].cons "Outdated disadvantage"

When to add pros/cons:

  • For significant decisions with multiple options
  • When trade-offs are non-obvious
  • To help future readers understand the evaluation process

5. References (recommended)

govctl adr add <ADR-ID> refs RFC-0001
govctl adr add <ADR-ID> refs ADR-0005

Link to artifacts that constrained or informed the decision. Use plain IDs (not [[...]] syntax) in the refs field.

Validation and Handoff

  • Run govctl check after substantive ADR edits
  • Use adr-reviewer before acceptance or handoff
  • Use /spec for ADR acceptance without implementation
  • Use /gov when the ADR accompanies implementation-bearing work

Writing Rules

Quality Checklist

  • Context is complete. Problem statement, constraints, and options are all present.
  • Decision is decisive. Starts with "We will..." — not "We might..." or "We could...".
  • Consequences are honest. Negative section is non-empty with mitigations.
  • Alternatives are documented. For new decisions, include at least one rejected option with reason. For historical backfills, document rejected options when known; otherwise state that they were not recoverable.
  • References link to related artifacts. Use [[artifact-id]] in content fields.

Content Field Formatting

Use markdown within content fields. Wrap code/technical terms in backticks:

# Good
decision = "Use `HashMap<String, Vec<ClauseSpec>>` for clause storage"

# Bad — angle brackets break mdbook rendering
decision = "Use HashMap<String, Vec<ClauseSpec>> for clause storage"

Rendering Rules

The renderer auto-generates structural elements from TOML metadata. Do NOT include these in content fields:

  • ## Context, ## Decision, ## Consequences headings — auto-generated for each section
  • ## Alternatives Considered heading — auto-generated if alternatives exist
  • ### Option Name (status) headings — auto-generated from alternatives[].text + status
  • - **Pros:**, - **Cons:**, - **Rejected because:** — auto-generated from structured fields
  • ADR title (# ADR-NNNN: Title) — auto-generated from metadata

Content fields should contain only the body prose and [[...]] references.

Common Mistakes

MistakeFix
## Context in content fieldDon't — the renderer adds section headings automatically
Empty Negative sectionEvery decision has trade-offs — document them
No alternatives for a new ADRAdd at least one rejected option
Historical ADR lacks rejected optionsState that alternatives were not recoverable
Vague context: "We need to decide"Specific: "RFC-0002 requires X but doesn't specify how"
Decision buried in proseLead with "We will action"
Missing refsLink to RFCs/ADRs that constrain the decision

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

commit

免费

Commit changes with govctl integration — check work item status, update journal or notes, and run govctl check

中文简介正在准备中。当前显示原文说明。

lucifer1004/typub352026年7月11日 更新

Stress-test a design decision with premortem/backcast analysis, then produce a risk-calibrated recommendation that maps to ADR fields. Use when: (1) Multiple competing architecture options, (2) Irreversible or high-risk design choices, (3) /discuss identifies a complex trade-off

中文简介正在准备中。当前显示原文说明。

lucifer1004/typub352026年7月11日 更新

discuss

免费

Facilitate design discussion — research context, clarify requirements, draft RFC/ADR

中文简介正在准备中。当前显示原文说明。

lucifer1004/typub352026年7月11日 更新

gov

免费

Execute governed implementation workflow with work items, RFC/ADR checks, phase gates, testing, and closure. Use when: (1) User invokes /gov, (2) A non-trivial change needs work item tracking, (3) Implementation may require RFC/ADR handling

中文简介正在准备中。当前显示原文说明。

lucifer1004/typub352026年7月11日 更新

Write well-structured Verification Guards. Use when: (1) Creating a new guard, (2) Editing guard check commands or patterns, (3) User mentions guard, verification, or check

中文简介正在准备中。当前显示原文说明。

lucifer1004/typub352026年7月11日 更新

migrate

免费

Adopt govctl in an existing project. Discovers undocumented decisions, backfills ADRs/RFCs, annotates source code. Use when: (1) Project has no governance yet, (2) User mentions migrate, adopt, onboard, or brownfield

中文简介正在准备中。当前显示原文说明。

lucifer1004/typub352026年7月11日 更新

查看 lucifer1004 的全部技能

报告此技能的问题