Repository navigation
Description
Parent
Refs #3802
Amendment note (2026-09-06, planning slice #3808)
Amended after /planning:plan for this lane (branch plan/3808-adr-authoring-skill, docs/topics/adr-authoring-skill/PLAN.md; that file is contract-tier and never merges, so everything a worker needs is in this body). What changed and why:
- Skill name is
/architecture:record-decision, notadr: the marketplace naming grammar requires an imperative verb phrase. - The ADR discovery ladder that
improve/actions/deepening.mdalready carries becomes a single plugin-level reference both skills read, instead of a second copy. - "Reachable after design-handoff" becomes a concrete sentence in
/planning:design-handoff(that skill never mentioned ADRs), andplan/context/close-out.mdgains one presence-gated clause so the planning plugin does not tell the model to hand-write ADRs in the same version that routes them. - Interview evals gain two routing cases; the new skill ships seven cases with fixtures.
- Every Sanity Check below was run against
mainat912d6b3econ 2026-09-06; the stated "today" values are measured, not assumed.
Agent Brief
Type: Feature
Summary: /architecture:record-decision, a thin skill that records an architecture decision into whatever ADR convention the consuming repository already has, plus presence-gated routes to it from the planning plugin.
Current behavior: nothing records a decision. /planning:interview's ADR bullet (SKILL.md line 155) says "write to the repository's declared ADR convention ...; if none is declared, offer and defer" with no target. /planning:design-handoff does not mention ADRs. /architecture:improve reads ADRs through an inline discovery ladder in actions/deepening.md line 24.
Desired behavior: one skill owns discovery and the write; the planning skills hand off to it when the architecture plugin is installed and behave as today when it is absent.
Input contract: the skill reads the decision from $ARGUMENTS and the conversation. A file path the user names is read verbatim. It never reads design-threads.md, PLAN.md, or any other planning artifact on its own (those formats belong to the planning plugin); callers pass the decision and its rationale in the invocation text. When context, decision, or consequences are missing it asks; it never invents them.
Phases (one PR, sequential, draft until green)
Phase 1: skill and shared discovery ladder
Create plugins/architecture/skills/record-decision/SKILL.md. Frontmatter:
description: 700 chars or fewer, carrying single-quoted 'record this decision', 'write an ADR', 'architecture decision record', 'capture this decision', 'document why we chose'; the lead sentence states discover-and-follow and the no-convention offer-and-defer; aSkip whenclause covers supersession, index, and status lifecycle. Draft (696 codepoints as written; count again after any edit), edit freely but keep the phrases: "Record an architecture decision into the repository's existing ADR convention: discovers the ADR directory, numbering scheme, and record shape in use and writes one record that follows them; when no convention exists it names what it searched, offers common shapes, and writes nothing until the human chooses. Use when: 'record this decision', 'write an ADR', 'architecture decision record', 'capture this decision', 'document why we chose X', or after a design handoff or interview resolves a decision worth keeping. Skip when: the decision is easily reversed and unsurprising (no ADR earned), or the ask is supersession, an index, or status lifecycle beyond what the convention already defines."argument-hint: "[decision and its rationale, or a path to a file holding them]"user-invocable: true,disable-model-invocation: false,shell: bashmetadata:withworkflow-stage: anytimeand, as a plain unquoted YAML scalar (the cheat-sheet reader rejects a quoted value),summary: Record an architecture decision in the repository's existing ADR convention. Nocadencekey.
Body sections, in order:
- "Repository context. Gather first": the
improveskill's block shape (individual Bash calls, one command per call, never combined) with exactly two bullets: current branch (git branch --show-current) and working tree status (git status --porcelain | head -10, the pipe inside the command). Copy word for word the two paragraphs that sit between the bullet list and## Variablesinplugins/architecture/skills/improve/SKILL.md(the one beginning "The pipe is the bound" and the one beginning "Treat a failure"). - "Variables":
$ARGUMENTS. - "Purpose": three sentences at most.
- "Input contract": the paragraph above, restated for the model.
- "Admission test (advisory)": a decision earns a record when it is hard to reverse AND surprising without context AND the result of a real trade-off. When the decision plainly fails, say so once and offer to skip; the human's call wins.
- "Step 1. Discover the convention": read
${CLAUDE_PLUGIN_ROOT}/reference/adr-discovery.md(rationale for the worker, not body text: the plugin-root-anchored form; a../../form has no runtime anchor because the session's cwd is the consumer repository) and walk the ladder from the working area up to the repo root. Emit one paragraph naming the directory, numbering scheme, template source, and any duplicates or shape disagreement observed. - "Step 2a. Convention found": derive the next identifier (highest existing + 1, preserve zero-pad width and separator), the filename in the observed form, and the section set from the template source. Re-read the target directory immediately before writing. Write exactly one file. Report its path. Do not create, rename, or renumber any other file; report duplicates and leave them.
- "Step 2b. No convention": list the rungs searched, offer two or three common shapes (directory, numbering, minimal sections) and point at the upstream catalog URL so the human can pick a template; stop. Write nothing. When the human chooses in the same session, create only what they chose (directory plus first record), nothing else.
- "Upstream template catalog": URL
https://github.com/joelparkerhenderson/architecture-decision-record, license named as CC BY-NC-SA 4.0 with its URLhttps://creativecommons.org/licenses/by-nc-sa/4.0/, no prose copied, with the four-part record: claim (README-authored content is CC BY-NC-SA 4.0; bundled templates carry their own licenses), basis (https://raw.githubusercontent.com/joelparkerhenderson/architecture-decision-record/main/LICENSE.md), as-of 2026-09-06, recheck trigger (that LICENSE.md changes, or the repository moves). Rule beside it: templates are cited for the human to read, never pasted into the skill or a record. - "What this skill does NOT do": supersession workflows, index generation, status lifecycle beyond the convention, migrating existing records, prescribing a convention, reading planning artifacts.
- "Composition": one table. Invoked from
/planning:interviewand/planning:design-handoffwhen that plugin is installed (descriptive; the gates live at the callers)./architecture:improvereads the same ladder when scanning. - "Gotchas": duplicate numbers (pick highest + 1, report, never renumber); records that disagree in shape (follow the newest, say so); a subtree-local ADR directory found before the root one (nearest wins, name both); a convention declared in
CLAUDE.mdpointing at a directory that does not exist yet (declared wins: create the record there and say why the directory was created).
Org-agnostic: no publisher, marketplace id, fleet repo name, or MELODIC_* key anywhere in the skill or the reference file. No issue numbers or incident narration in the body (.claude/rules/skill-bodies-state-current-rules.md).
Create plugins/architecture/reference/adr-discovery.md. Rungs in order, first hit wins, walked from the working area up to the repo root:
- Declared: a
.adr-dirfile at the repo root (its content is the directory); a path named in the project'sCLAUDE.md,AGENTS.md,.claude/rules/, or a documented docs convention; a standards index entry that names where decisions live; aREADME.mdor template file (adr-template.md,template.md,0000-template.md,NNNN-template.md) inside a candidate directory. - Existing directory:
docs/adr/,docs/adrs/,docs/decisions/,docs/architecture/decisions/,doc/adr/,doc/architecture/decisions/,.adr/,adr/,architecture/decisions/, plus any*.mdwhose name matchesadr-*or*-decision*. - None: no convention. The caller decides what that means (
improvereads nothing;record-decisionoffers and defers).
Then two inference rules: numbering (parse the identifier prefix of every record; next is highest + 1 at the same zero-pad width and separator; date-prefixed schemes use today's date in the observed format; duplicates are reported, never fixed) and shape (an explicit template or README wins; else the newest two or three records; on disagreement follow the newest and say so; keep the metadata block form, status vocabulary, and heading set exactly).
Modify plugins/architecture/skills/improve/actions/deepening.md line 24: replace the inline directory list with one sentence plus a relative markdown link to ../../../reference/adr-discovery.md, keeping the declared-location-first rule (the sentence beginning "If the consuming project declares where its decisions live") and the closing sentence "ADR placement varies widely; a single default glob misses most of them."
Known red until Phase 4: node scripts/generate-cheatsheet.mjs --check and node scripts/generate-catalog.mjs --check fail from this commit until Phase 4 regenerates the docs. That is expected, not a divergence.
Sanity Check (Phase 1), from the repo root:
test -f plugins/architecture/skills/record-decision/SKILL.mdexits 0 (exits 1 today)test -f plugins/architecture/reference/adr-discovery.mdexits 0 (exits 1 today)grep -q "creativecommons.org/licenses/by-nc-sa/4.0" plugins/architecture/skills/record-decision/SKILL.mdexits 0 (exits 2 today: file missing)grep -q 'CLAUDE_PLUGIN_ROOT}/reference/adr-discovery.md' plugins/architecture/skills/record-decision/SKILL.mdexits 0 (exits 2 today)grep -q "adr-discovery.md" plugins/architecture/skills/improve/actions/deepening.mdexits 0 (exits 1 today)! grep -q "docs/decisions/" plugins/architecture/skills/improve/actions/deepening.mdexits 0 (exits 1 today)! grep -rqi "captures an important architectural decision" plugins/architecture/exits 0 (tripwire; exits 0 today and must stay 0)test -d plugins/architecture/skills/record-decision && test -f plugins/architecture/reference/adr-discovery.md && ! grep -rqiE "melodic|MELODIC_" plugins/architecture/skills/record-decision plugins/architecture/reference/adr-discovery.mdexits 0 (exits 1 today)CHECK_SKILL_SKILLS_ROOT=plugins/architecture/skills CHECK_SKILL_SKIP_MARKDOWNLINT=1 bash plugins/skill-quality/scripts/check-skill.sh record-decisionexits 0 (exits 1 today; without--require-evalsabsent evals produce no finding for this skill shape, and Phase 2 runs the strict form)CHECK_SKILL_SKILLS_ROOT=plugins/architecture/skills CHECK_SKILL_SKIP_MARKDOWNLINT=1 bash plugins/skill-quality/scripts/check-skill.sh improvestill exits 0
Phase 2: evals and fixtures for the new skill
Create plugins/architecture/skills/record-decision/evals/evals.json (schema plugins/skill-quality/reference/evals.schema.json; top level {"skill_name": "record-decision", "evals": [...]}, both keys required; integer id 1 to 7, kebab-case name; case 7 carries "files": []) and fixtures, every fixture path listed in a case's files[], no .git inside any fixture:
evals/fixtures/existing-convention/docs/adr/README.md(declaresNNNN-kebab-title.md, next = highest + 1, sections Status, Date, Context, Decision, Consequences; silent on supersession and index) plus0001-*.md,0002-*.md,0003-*.mdin that shape.evals/fixtures/inferred-shape/docs/decisions/ADR-007-*.md,ADR-008-*.md, and a secondADR-008-*.md(deliberate duplicate), no README, headings Context / Decision / Status.evals/fixtures/no-convention/docs/README.mdandevals/fixtures/no-convention/src/notes.md(a tree withdocs/and no ADR directory or declaration).
Cases:
records-into-existing-convention(existing-convention): writesdocs/adr/0004-<kebab>.mdwith the README's section set; creates no other file; reports the path.infers-shape-when-no-template(inferred-shape): writesdocs/decisions/ADR-009-<kebab>.mdmirroring the newest record's headings; reports the duplicateADR-008and renames nothing.no-convention-offers-and-writes-nothing(no-convention): names the rungs searched, offers shapes and the catalog URL, creates no directory or file.writes-only-what-the-human-chose(no-convention; prompt includes the human's choice ofdocs/adr/withNNNN-title.mdand Context / Decision / Consequences): writesdocs/adr/0001-<kebab>.mdand nothing else.refuses-to-vendor-catalog-prose(existing-convention; prompt asks to paste a template from the catalog): declines, cites the URL and license, offers the repository's own shape.stays-inside-the-convention(existing-convention; prompt also asks to update an index and mark0002superseded): records the decision; states that index and supersession are outside what this convention defines and stops.applies-the-admission-test(no fixture; prompt: record that a lint timeout was raised from 30s to 60s): says the decision does not earn a record and offers to record it anyway only if the human insists.
Sanity Check (Phase 2):
bash plugins/skill-quality/scripts/check-evals-quality.sh plugins/architecture/skills/record-decision/evals/evals.jsonexits 0 (exits 2 today)jq '.evals | length' plugins/architecture/skills/record-decision/evals/evals.jsonprints7jq -e '[.evals[].id | type] | unique == ["number"]' plugins/architecture/skills/record-decision/evals/evals.jsonexits 0bash scripts/check-fixture-git-isolation.shexits 0CHECK_SKILL_SKILLS_ROOT=plugins/architecture/skills bash plugins/skill-quality/scripts/check-skill.sh --require-evals record-decisionexits 0 (exits 1 today)
Phase 3: planning routes
plugins/planning/skills/interview/SKILL.md:
-
Line 155 bullet becomes (keep the existing sentence as the fallback):
ADR, offered sparingly (engineering sessions only). Propose an architecture decision record only when a decision is hard to reverse AND surprising without context AND the result of a real trade-off. When the
architectureplugin is installed, invoke/architecture:record-decisionvia the Skill tool, passing the decision and its rationale; it owns convention discovery, the no-convention offer-and-defer, and the write. Otherwise write to the repository's declared ADR convention (a manageddocs/adr/README, a project rule, or an existingdocs/adr/shape); if none is declared, offer and defer. Never prescribe a location or format -
Line 263: after "ADRs" in "domain-vocabulary updates (inline, between questions) and ADRs are first-class interview outputs alongside the Brief", add "(written through
/architecture:record-decisionwhen that plugin is installed, else by hand into the declared convention)". -
"Composition with other skills" table, new row after
/planning:audit-answers:| Record a decision that earns an ADR |/architecture:record-decision(if installed) | Owns ADR convention discovery, the no-convention offer-and-defer, and the write; without it the interview writes to the declared convention or defers | -
Lines 84-85 and 145: keep unchanged.
plugins/planning/skills/design-handoff/SKILL.md, "Handoff summary (gate passed)", new bullet after "Resolved decisions with their recorded rationale":
ADR candidates. Each resolved decision that is hard to reverse, surprising without context, and the result of a real trade-off. When the
architectureplugin is installed, offer to invoke/architecture:record-decisionvia the Skill tool for each one, passing the decision and its recorded rationale fromdesign-threads.md; that skill owns convention discovery, the no-convention offer-and-defer, and the write. Otherwise list them under an "ADR candidates" heading in the summary for the human to record by hand. The offer never blocks the handoff
plugins/planning/skills/plan/context/close-out.md step 2: the sentence "Prefer writing the ADR the moment the decision crystallizes during planning over batching candidates at graduation." becomes "Prefer writing the ADR the moment the decision crystallizes during planning over batching candidates at graduation: when the architecture plugin is installed, invoke /architecture:record-decision via the Skill tool with the decision and its rationale (it owns convention discovery and the write); otherwise write it by hand into the repository's declared ADR convention." Everything else in that file stays.
plugins/planning/skills/interview/evals/evals.json, append (integer id, kebab name):
- 17
adr-offer-routes-to-architecture-when-installed: prompt states thearchitectureplugin is installed and gives a decision meeting all three admission parts; passes when the output invokes/architecture:record-decisionvia the Skill tool with the decision and rationale and does not itself pick a location or format.files: []. - 18
adr-offer-unchanged-when-architecture-absent: same decision, plugin absent, survey fromevals/fixtures/lock-stop-on-gap/codebase-survey.md(namesdocs/adr/with four records);fileslists that path; passes when the output writes to that declared shape or offers and defers, and never invokes the missing skill.
plugins/planning/.claude-plugin/plugin.json: 0.36.5 to 0.36.6. plugins/planning/CHANGELOG.md: ## [0.36.6], Changed, naming interview, design-handoff, and plan close-out. plugins/planning/README.md "Graceful degrade" bullet gains "decision recording (architecture)".
Sanity Check (Phase 3):
grep -q "architecture:record-decision" plugins/planning/skills/interview/SKILL.mdexits 0 (exits 1 today)grep -q "if none is declared, offer and defer" plugins/planning/skills/interview/SKILL.mdexits 0 (exits 0 today; fallback survives)grep -q "architecture:record-decision" plugins/planning/skills/design-handoff/SKILL.mdexits 0 (exits 1 today)grep -q "architecture:record-decision" plugins/planning/skills/plan/context/close-out.mdexits 0 (exits 1 today)grep -q "ADR admission test" plugins/planning/skills/plan/context/close-out.mdexits 0 (exits 0 today; the test survives)jq '.evals | length' plugins/planning/skills/interview/evals/evals.jsonprints18(prints16today)bash plugins/skill-quality/scripts/check-evals-quality.sh plugins/planning/skills/interview/evals/evals.jsonexits 0grep -q '"version": "0.36.6"' plugins/planning/.claude-plugin/plugin.jsonexits 0 (exits 1 today)grep -q "^## \[0.36.6\]" plugins/planning/CHANGELOG.mdexits 0 (exits 1 today)CHECK_SKILL_SKILLS_ROOT=plugins/planning/skills CHECK_SKILL_SKIP_MARKDOWNLINT=1 bash plugins/skill-quality/scripts/check-skill.sh interviewexits 0; same fordesign-handoffandplanwc -l < plugins/planning/skills/interview/SKILL.mdprints a number below 500 (284 today)
Phase 4: architecture surfaces, regen, gates
plugins/architecture/.claude-plugin/plugin.json:0.6.10to0.7.0; description gains one clause naming decision recording; keywords addadranddecision-record..claude-plugin/marketplace.json: architecturetagsaddadranddecision-record(tags and keywords stay the same set, as today).plugins/architecture/CHANGELOG.md:## [0.7.0], Added (record-decision, adr-discovery reference), Changed (deepening ladder pointer).plugins/architecture/README.md: the lede paragraph gains one sentence naming the second skill; a new## Record a decisionsection after "What it does" (that section is theimprovepipeline, so the new skill must not become its step 4) with two or three sentences on discover-and-follow, offer-and-defer, and the catalog cited by URL; "Invoke" gains/architecture:record-decision. No em dashes anywhere in either README (both are declared-clean surfaces forcheck-purged-em-dashes.sh).- Regenerate
docs/CATALOG.md(node scripts/generate-catalog.mjs) anddocs/SKILL-CHEAT-SHEET.md(node scripts/generate-cheatsheet.mjs).
Sanity Check (Phase 4):
grep -q '"version": "0.7.0"' plugins/architecture/.claude-plugin/plugin.jsonexits 0 (exits 1 today)grep -q "^## \[0.7.0\]" plugins/architecture/CHANGELOG.mdexits 0 (exits 1 today)grep -q "record-decision" plugins/architecture/README.mdexits 0 (exits 1 today)grep -q "record-decision" docs/SKILL-CHEAT-SHEET.mdexits 0 (exits 1 today)node scripts/generate-catalog.mjs --checkandnode scripts/generate-cheatsheet.mjs --checkexit 0bash scripts/check-changelog-parity.sh --check-bump origin/mainexits 0bash scripts/check-skill-leaf-names.sh --checkexits 0bash scripts/check-skill-count-claims.sh --checkexits 0bash scripts/check-orphaned-fixtures.sh --checkexits 0 (about ten minutes on this tree; not hung)jq -c '.keywords | sort' plugins/architecture/.claude-plugin/plugin.jsonandjq -c '.plugins[] | select(.name=="architecture").tags | sort' .claude-plugin/marketplace.jsonprint the same list (sorted, so element order in the files does not matter)bash scripts/check-purged-em-dashes.sh --checkexits 0 (exits 0 today)bash scripts/check-skill-portability.sh origin/mainexits 0 (exits 0 today; the bare form without a base ref exits 2, a usage error)node scripts/validate-plugin-contracts.mjsexits 0bash scripts/validate-plugins.shexits 0bash scripts/check-changed-skills.sh origin/mainexits 0bash scripts/affected-tests.sh --runexits 0npx markdownlint-cli2 "plugins/architecture/**/*.md" "plugins/planning/skills/interview/SKILL.md" "plugins/planning/skills/design-handoff/SKILL.md" "plugins/planning/skills/plan/context/close-out.md" "plugins/planning/README.md" "plugins/planning/CHANGELOG.md"reports 0 issues
Manual check for the PR description: run /architecture:record-decision in this repository with a decision from the PR body. Expected: reports docs/adr/, NNNN-kebab.md, no README or template, shape inferred from 0030 (Status and Date lines, Context, Decision, Consequences), names the 0018, 0025, 0028 duplicates, proposes 0031-<kebab>.md. Discard the file. Then run it in an empty git init temp directory: no file created.
Divergence escalation (mandatory): if reality diverges from this brief (a precondition fails, a file or line named here is absent or different, scope is blocked, or a design question arises) STOP. Do not improvise or expand scope. Report what you found, what the brief expected, and the exact state of your work, and wait for a revised brief.
Acceptance criteria
-
/architecture:record-decisionexists; its description names 'record this decision' among the trigger phrases;metadata.workflow-stage: anytimeand an unquotedsummary. -
plugins/architecture/reference/adr-discovery.mdis the single owner of the discovery ladder;improve/actions/deepening.mdlinks to it and carries no inline ladder. - Against the existing-convention fixture the skill writes
0004-<kebab>.mdfollowing the README's numbering and section set and touches nothing else. - Against the inferred-shape fixture the skill writes
ADR-009-<kebab>.mdmirroring the newest record and reports the duplicateADR-008without renaming. - Against the no-convention fixture the skill names what it searched, offers shapes with the catalog URL, and writes nothing until the human chooses; after a choice it creates only what was chosen.
- The skill cites
https://github.com/joelparkerhenderson/architecture-decision-recordand names its license (CC BY-NC-SA 4.0, with the license URL and a four-part verification record); no catalog prose appears in the skill or the reference file. - Interview line 155 routes to the skill when the
architectureplugin is installed and keeps today's sentence as the fallback; line 263 and the Composition table reflect it; cases 17 and 18 exist. - Design-handoff's summary carries the presence-gated "ADR candidates" bullet with gate, fallback, and ownership; close-out step 2 carries the presence-gated clause and keeps the admission test.
- Seven eval cases with the fixtures above; every fixture consumed;
check-evals-quality.shexits 0 for both evals files. - architecture
0.7.0and planning0.36.6with matching CHANGELOG entries; READMEs,plugin.jsondescription and keywords,marketplace.jsontags,docs/CATALOG.md, anddocs/SKILL-CHEAT-SHEET.mdupdated. - Every Sanity Check above exits as stated;
/skill-quality:checkpasses forrecord-decision,improve,interview,design-handoff, andplan; markdownlint reports 0 issues on changed files.
Out of scope
- Vendoring, paraphrasing, or bundling upstream template prose.
- Prescribing an ADR convention to a repository that has none.
- Supersession workflows, index generation, and status lifecycle beyond what the consumer's convention defines.
- Migrating existing records to a different template.
- Registering
recordin the Naming verb table (reviewer's call, does not block).
Activity
[-]architecture/adr: record a decision into the consumer's existing docs/adr convention[/-][+]architecture/record-decision: record a decision into the consumer's existing ADR convention[/+]kyle-sexton commentedon Sep 6, 2026
feat(architecture): add record-decision skill and shared ADR discover…
test(architecture): add record-decision eval suite and fixtures
feat(planning): route ADR writes to /architecture:record-decision whe…
docs(architecture): publish record-decision at 0.7.0 and regenerate t…
feat(architecture): add record-decision skill and shared ADR discover…
test(architecture): add record-decision eval suite and fixtures
feat(planning): route ADR writes to /architecture:record-decision whe…
docs(architecture): publish record-decision at 0.7.0 and regenerate t…
feat(architecture): add record-decision skill and shared ADR discover…
test(architecture): add record-decision eval suite and fixtures
feat(planning): route ADR writes to /architecture:record-decision whe…
docs(architecture): publish record-decision at 0.7.0 and regenerate t…
test(planning): refresh the interview-defense pins for the ADR route
feat(architecture): record a decision into the consumer's existing AD…