Decision Record (ADR)
An ADR captures why a decision was made so nobody has to re-derive or re-litigate it
later. Record the decision and its rejected alternatives — the alternatives are often the
most valuable part, because they stop the same debate from recurring.
This skill is portable: it discovers paths instead of assuming them, and it is
idempotent — re-running never reuses or overwrites a number.
Inputs
- Decisions directory — default
docs/decisions/. Accept an override argument
(e.g. decision-record dir=architecture/adr). If the default is absent and no override
is given, ask whether to create docs/decisions/.
- Fields — gather from the invocation args/context; only ask for what's missing, and
ask concisely:
- Title (required)
- Status — default
Accepted; allow Proposed
- Context (required) — why the decision is needed
- Decision (required) — what was decided
- Why — rationale, including
Why not <alternative> where relevant
- Consequences — follow-ups, tradeoffs, what this enables or constrains
Never invent content for a required field. If it's missing, ask — briefly.
Procedure
Locate the directory. Use the override if given, else docs/decisions/. If it
doesn't exist, create it (after confirming, unless an override path was explicitly
passed).
Compute the next number. Scan for files matching NNNN-*.md, take the maximum
4-digit prefix, add 1, zero-pad to 4 digits. Handle gaps with max+1 — never reuse a
number even if earlier ones are missing. If no ADRs exist, start at 0001.
Build the slug. Kebab-case the title (lowercase, spaces/punctuation → single
hyphens, trim). Filename = NNNN-<slug>.md.
Guard against collisions.
- If
NNNN-<slug>.md already exists, refuse to overwrite — stop and report.
- If a different-numbered file with a near-identical slug exists, warn (possible
duplicate decision) and ask whether to continue.
Write the file using EXACTLY this template (wrap prose at ~100 columns):
# NNNN — <Title>
**Status:** <Status>
## Context
<why this decision is needed>
## Decision
<what was decided — bullet points are fine>
## Why
<rationale; include "Why not <alternative>" where relevant>
## Consequences
<follow-ups, trade-offs, what this enables or constrains>
Keep a blank line after each heading and around any list so the file passes common
Markdown linters (markdownlint MD022/MD032).
Offer to cross-link (only if the target files already exist — never create them
just to link):
docs/roadmap.md — add a one-line pointer to the new ADR.
- the relevant entry in
docs/pain-points.md — add a one-line pointer.
- Never duplicate an existing link — check before adding.
Print the created file path. Do not commit — leave that to the user.
Acceptance checklist
- Numbering: with
0001, 0002 present → next is 0003. With 0001, 0003 present
(gap) → next is 0004 (max+1), not 0002. Empty dir → 0001.
- Re-running with the same title does not overwrite; it refuses and reports.
- The written file matches the template headings exactly.
- Cross-links are added only to pre-existing files and are never duplicated.
Related: pairs with [[changelog]] when a decision also ships a user-facing change.
1---2name: decision-record3description: Use when recording an architecture/design decision — scaffolds the next-numbered ADR in docs/decisions/ from the project's template and cross-links it.4---56# Decision Record (ADR)78An ADR captures *why* a decision was made so nobody has to re-derive or re-litigate it9later. Record the decision and its rejected alternatives — the alternatives are often the10most valuable part, because they stop the same debate from recurring.1112This skill is **portable**: it discovers paths instead of assuming them, and it is13**idempotent** — re-running never reuses or overwrites a number.1415## Inputs1617- **Decisions directory** — default `docs/decisions/`. Accept an override argument18 (e.g. `decision-record dir=architecture/adr`). If the default is absent and no override19 is given, ask whether to create `docs/decisions/`.20- **Fields** — gather from the invocation args/context; only ask for what's missing, and21 ask concisely:22 - **Title** (required)23 - **Status** — default `Accepted`; allow `Proposed`24 - **Context** (required) — why the decision is needed25 - **Decision** (required) — what was decided26 - **Why** — rationale, including `Why not <alternative>` where relevant27 - **Consequences** — follow-ups, tradeoffs, what this enables or constrains2829Never invent content for a required field. If it's missing, ask — briefly.3031## Procedure32331. **Locate the directory.** Use the override if given, else `docs/decisions/`. If it34 doesn't exist, create it (after confirming, unless an override path was explicitly35 passed).362. **Compute the next number.** Scan for files matching `NNNN-*.md`, take the **maximum**37 4-digit prefix, add 1, zero-pad to 4 digits. **Handle gaps with max+1 — never reuse a38 number even if earlier ones are missing.** If no ADRs exist, start at `0001`.393. **Build the slug.** Kebab-case the title (lowercase, spaces/punctuation → single40 hyphens, trim). Filename = `NNNN-<slug>.md`.414. **Guard against collisions.**42 - If `NNNN-<slug>.md` already exists, **refuse to overwrite** — stop and report.43 - If a *different-numbered* file with a near-identical slug exists, **warn** (possible44 duplicate decision) and ask whether to continue.455. **Write the file** using EXACTLY this template (wrap prose at ~100 columns):4647 ```markdown48 # NNNN — <Title>4950 **Status:** <Status>5152 ## Context5354 <why this decision is needed>5556 ## Decision5758 <what was decided — bullet points are fine>5960 ## Why6162 <rationale; include "Why not <alternative>" where relevant>6364 ## Consequences6566 <follow-ups, trade-offs, what this enables or constrains>67 ```6869 Keep a blank line after each heading and around any list so the file passes common70 Markdown linters (markdownlint MD022/MD032).71726. **Offer to cross-link** (only if the target files already exist — never create them73 just to link):74 - `docs/roadmap.md` — add a one-line pointer to the new ADR.75 - the relevant entry in `docs/pain-points.md` — add a one-line pointer.76 - **Never duplicate an existing link** — check before adding.777. **Print the created file path.** Do **not** commit — leave that to the user.7879## Acceptance checklist8081- Numbering: with `0001`, `0002` present → next is `0003`. With `0001`, `0003` present82 (gap) → next is `0004` (max+1), **not** `0002`. Empty dir → `0001`.83- Re-running with the same title does **not** overwrite; it refuses and reports.84- The written file matches the template headings exactly.85- Cross-links are added only to pre-existing files and are never duplicated.8687Related: pairs with `[[changelog]]` when a decision also ships a user-facing change.