Creates Decision Records in MADR v4 format with automatic numbering. Covers architecture and any hard-to-reverse decisions. Supports creating new records or updating existing ones.
Ships in build. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Take the decision title from $ARGUMENTS. If empty, confirm New decision / Update existing via AskUserQuestion. For New decision ask for the title; for Update existing, list recent DRs in the DR archive for selection (§ Updating an Existing DR). The DR archive resolves in the same order as Pre-Check's dr_dir: $DR_HOME/<repo name>/ when DR_HOME is set, otherwise <git-root>/docs/decisions/. Shape a title you are creating into a specific action like "Adopt X for Y", keeping it 5-64 characters and free of /:*?"<>|. The archive defaults to <git-root>/docs/decisions/, and the DR_DIR env var moves it.
Follow ${CLAUDE_SKILL_DIR}/../../rules/conventions/DOCUMENTS.md: check relevant DRs and original conditions and status against the current requirements. Include needed document updates in the agreed scope and pass them through the same evaluation as implementation.
Proceed to the process only when all three conditions below hold. When one is missing, skip the DR and apply the table top to bottom, leaving the decision where the first matching row says.
| Condition | Where it goes when missing |
|---|---|
| Hard to reverse. Changing the decision later carries meaningful cost | A design note in the project, or the commit message body when there is none |
| Surprising without context. A future reader will ask "why this way?" | A design note in the project, or the commit message body when there is none |
| Result of a real trade-off. Genuine alternatives existed and one was picked for specific reasons | The commit message body |
| Step | Stage | Actions |
|---|---|---|
| 1 | Pre-Check | Run ${CLAUDE_SKILL_DIR}/scripts/pre-check.ts "$TITLE". What it consumes from the return is dr_dir and filename (where to write), date (frontmatter), and similar_drs (duplicate check). When stderr says the open pull requests could not be checked, confirm with gh pr list --state open that no pull request adds a DR before using the number |
| 2 | Type | Determine the decision type by the decision's intent and pick its recommended topics (§ Decision Type) |
| 3 | Sources | Gather project docs, issues, external resources |
| 4 | Draft | Copy ${CLAUDE_SKILL_DIR}/templates/madr-template.md into dr_dir under the name filename and fill it from what was gathered (§ YAML Frontmatter). Under each rejected option's Bad, because line and each Decision Drivers line, write one child line that opens with Verified., Not verified., or By policy.. The session that called /dr runs any check, and /dr writes its result. When a rejected option's child line opens with Not verified., set status to proposed and show those lines through AskUserQuestion. The two answers it offers are to verify and rewrite, and to go on with status left at proposed |
| 5 | Critique | Only for a DR that carves an exception into an existing DR's principle or supersedes one, call the critic-design agent with the draft, wait for its result notification, and then record the verdict and the condition it holds under as one line in More Information |
| 6 | Validate | Run ${CLAUDE_SKILL_DIR}/scripts/validate-dr.ts "$DR_FILE". exit 0 passes. What failed lands in errors[], and warnings[] is advisory |
| 7 | Index | Run ${CLAUDE_SKILL_DIR}/scripts/update-index.ts to regenerate dr_dir/README.md |
| 8 | Publish | Read ${CLAUDE_SKILL_DIR}/../_lib/publish.md, move to the dr_dir directory, run its steps there, and open a draft PR with the values in § Publish Values. This makes publish.md's first step, git rev-parse --show-toplevel, point at the repository dr_dir belongs to |
The Publish stage passes publish.md the values below. When the Adoption Gate creates no DR, the process never starts, so nothing is published.
| Value | Contents |
|---|---|
| branch | docs/dr-<filename>, where <filename> is Pre-Check's filename without .md. Editing a proposed DR runs no Pre-Check, so <filename> is the edited DR's file name without .md |
| subject | [Docs] DR-<number> <the DR's H1> |
| body | The "Chosen option" paragraph of Decision Outcome, the number of any DR it supersedes, the DR file's path relative to the repository dr_dir belongs to |
| files | The DR file, the regenerated README.md, the old DR whose status changed |
The decision type only affects which recommended More Information topics to include. Per-section guidance is common to all types: Context states the problem and why it had to be decided, each option carries what separates it from the others, and Consequences lists every loss the decision accepts. Reassessment Triggers goes into More Information whatever the type, which makes it an h3 in a new DR.
| Decision type | Use Case | Recommended topics |
|---|---|---|
| technology-selection | Library, framework choices | Migration Strategy, Rollback Plan, Success Criteria |
| architecture-pattern | Structure, design policy | Architecture Diagram, Quality Attributes, Trade-offs |
| process-change | Workflow, rule changes | Before / After comparison, Transition Plan, Review Schedule |
| deprecation | Retiring technology | Deprecation Target, Migration Plan, Deprecation Warning Period, Rollback Plan |
The frontmatter is optional. When it is written, it uses the fields below.
| Field | Notes |
|---|---|
| status | Pick from the Status lifecycle in ${CLAUDE_SKILL_DIR}/references/madr-format.md. YAML quotes required; no links |
| date | YYYY-MM-DD of creation; updated only when the DR is superseded |
| decision-makers | List of names or roles. Renamed from deciders in v4 |
| consulted | Subject-matter experts; two-way exchange |
| informed | Stakeholders kept up-to-date; one-way |
When the status is proposed, edit the body directly and run Validate, Index, and Publish. From accepted onward, replace it with a new DR through the steps below. Only status and date change in the old DR; the decision content stays.
Supersedes DR-NNNN)status: to superseded by DR-NNNNdate: to todayEach script reports its failure as JSON or on stderr. Handle them per the table.
| Error | Treatment |
|---|---|
| Reported as outside a git repository | Set DR_DIR to name the archive explicitly |
Reported as DR_HOME set but origin unreadable | Add an origin remote, or set DR_DIR to name the archive |
| Reported as an archive holding SKILL.md | It points at a skill directory, so redirect DR_DIR to the archive |
similar_drs is non-empty | Present the duplicates and confirm whether to proceed or switch to an update (§ Updating an Existing DR) |
errors[] comes back non-empty | Fix what it names and run Validate again |
| What you are unsure of | Resource |
|---|---|
| Whether to keep or drop an optional section | ${CLAUDE_SKILL_DIR}/references/madr-format.md |
| What it takes to explain a decision fully | ${CLAUDE_SKILL_DIR}/references/fowler-adr.md |
State the target repository, objective, and conditions in Context. Retain relative original paths, needed versions, and agreement sources in More Information. Leave a decision proposed/unconfirmed when adoption cannot be verified.
references/fowler-adr.md (opens in a new tab)references/madr-format.md (opens in a new tab)scripts/dr_common.ts (opens in a new tab)scripts/pre-check.ts (opens in a new tab)scripts/update-index.ts (opens in a new tab)scripts/validate-dr.ts (opens in a new tab)templates/madr-template.md (opens in a new tab)tests/_dr-cases.ts (opens in a new tab)tests/dr-common.test.ts (opens in a new tab)tests/fixtures/pre-check-cases.json (opens in a new tab)tests/fixtures/update-index-cases.json (opens in a new tab)tests/fixtures/validate-dr-cases.json (opens in a new tab)tests/pre-check.test.ts (opens in a new tab)tests/script-contract.test.js (opens in a new tab)tests/update-index.test.ts (opens in a new tab)tests/validate-dr.test.ts (opens in a new tab)tests/verification-lines.test.ts (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
DR作成, ADR作成, 技術決定, アーキテクチャ決定, decision record
Three short reads, in order
decision-record, adr, architecture-decision-record, madr, documentation
7 skills in this plugin
/implementCarry an agreed GitHub Issue through launch.ts to implementation, verification, and review, then publish a draft PR, confirm CI, and switch it to ready. Do NOT use to settle requirements (use /scoping) or for a review-only request./outcomeGenerates and updates .claude/OUTCOME.md interactively. When the file is absent or empty (Behavior blank or TBD only), collects content via AskUserQuestion and writes the stub; when present, shows the current state and applies updates./scopingSettle requirements, done conditions, and verification methods, and turn the agreed scope into a GitHub Issue. Do NOT use to implement an agreed Issue (use /implement)./sweepSweep the whole codebase through one lens, fix what is certain, and return the rest as a file:line list./use-cli-recallSearch past Claude Code/Codex sessions via recall CLI./use-cli-scoutWeb search, page fetch, and GitHub repo exploration via scout CLI./build:dr [decision title]from build
npx claudepluginhub thkt/dotclaude --plugin buildOther plugins' skills for the same job