/project-toolkit:adr-generatorfrom project-toolkit
Creates Architectural Decision Records (ADRs) in multiple formats (MADR, Nygard, Alexandrian). Detects existing conventions, numbers ADRs sequentially, and validates completeness.
Ships in project-toolkit. 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.
Create well-structured Architectural Decision Records that document technical decisions with clear context, rationale, consequences, and alternatives.
| Trigger Phrase | Operation |
|---|---|
write an ADR | Full ADR generation workflow |
write an architecture decision record | Full ADR generation workflow |
create an ADR | Full ADR generation workflow |
generate ADR for | Full ADR generation workflow |
document these design choices | Capture rationale for durable architecture or design decisions |
# These all work:
write an ADR for the event model
write an architecture decision record for database selection
create an ADR for database selection
new ADR for authentication strategy
document this architecture decision about event sourcing
generate ADR for switching from REST to gRPC
document these design choices for future us to revisit as models change
record why we chose this instruction-file structure for future maintainers
| Situation | Use This Skill? |
|---|---|
| New architectural decision needs documenting | Yes |
| Durable design choices or rationale need capturing for future readers | Yes |
| Changing an existing system or pattern | Yes (includes Prior Art Investigation) |
| Reviewing or validating an existing ADR | No, use adr-review skill |
| Minor implementation detail, not architectural | No |
Collect required information from the user:
If any required information is missing, ask the user before proceeding.
Significance check: Before proceeding, quickly assess whether the decision warrants an ADR using the ASR Test. If the decision is trivially reversible, purely local, and has no stakeholder concern, suggest skipping the ADR.
Readiness check: Verify the decision passes the START Definition of Ready: Stakeholders known, Time (Most Responsible Moment) has come, Alternatives exist, Requirements understood, Template will be determined in G2.
If the decision changes an existing system, trigger Prior Art Investigation using the chestertons-fence skill or manually gather: what exists, why it was built that way, and why change now.
Discover the ADR destination, naming convention, numbering, and template by exploring the codebase.
Explore the codebase to find where ADRs live. Do not assume a fixed location.
ADR-*.md, adr-*.md, 0*-*.md in directories named decisions, adr, architecture).project-toolkit/architecture/, docs/adr/, docs/architecture/, docs/decisions/, architecture/decisions/.adr-dir files (used by adr-tools) or ADR references in README, CONTRIBUTING, or project documentationNote: .project-toolkit/architecture/, docs/adr/, docs/architecture/, docs/decisions/, and architecture/decisions/ are monitored by adr-review for auto-triggered review when the platform honors file triggers. Invoke adr-review manually if automatic review does not fire.
If the directory contains existing ADRs:
ADR-NNN-slug.md vs 0NNN-slug.md), and section structureadr-review auto-triggers only match uppercase ADR-*.md patterns. If existing ADRs use lowercase, warn the user that auto-review will not triggerADR-TEMPLATE.md, template.md) in the same directory or a parentIf no ADRs or template files exist anywhere in the codebase:
.project-toolkit/architecture/ADR-TEMPLATE.md exists) or MADR as a widely-adopted alternativeFor this repo's canonical .project-toolkit/architecture/ location, use the
deterministic helper instead of eyeballing the directory (it also accounts
for the allowlist of pre-existing duplicates):
python3 scripts/validation/check_adr_uniqueness.py --print-next
The same script is enforced as a merge-time CI gate
(.github/workflows/validate-adr-number-uniqueness.yml), so a
PR that picked a number which has since been merged by another branch will
fail with a remediation message naming the next free value. Re-run
--print-next and rename the file, the # ADR-NNN: heading, and any
references before pushing.
Populate the detected template with gathered content:
Lifecycle frontmatter (ADR-073, Phase 1): when the destination uses this
repo's canonical template (.project-toolkit/architecture/ADR-TEMPLATE.md), emit the
machine-readable YAML frontmatter block above the # ADR-NNN: heading with
these safe defaults:
---
id: ADR-NNN # match the number chosen in Step 4
status: proposed # always proposed on a new ADR (never accepted)
date: YYYY-MM-DD # today, last-updated
decision-makers: []
supersedes: [] # ADR ids this record supersedes, if any
superseded-by: null
explainer: null # display-only link; NEVER auto-fetch (CWE-918 SSRF)
implemented: false # flips true at the first merged change
---
Rules the generator MUST honor:
status is always proposed on a new ADR. Only adr-review consensus
changes it (see Phase G5 and the Anti-Patterns table).implemented is always false on a new ADR; it flips at first merged change.superseded-by defaults to null; supersedes defaults to [].explainer defaults to null. If the author supplies one, record the literal
string only. MUST NOT fetch, resolve, or follow the URL (it is a poisoning and
SSRF surface, CWE-918). It is display-only metadata for human click-through.status enum is authoritative for tooling. A prose ## Status
section is optional: add it only for nuance the enum cannot carry, never to
restate the enum (ADR-073, amended 2026-09-29).Self-check against the quality checklist before saving. All structural and content checks must pass.
Write the file to the destination directory determined in Phase G2:
| Rule | Example |
|---|---|
| Match existing naming convention | ADR-053-authentication-strategy.md or 0053-authentication-strategy.md |
| Zero-pad number to match existing pattern | ADR-001, 0001, etc. |
| Lowercase kebab-case slug (3-5 words) | database-selection, event-sourcing-pattern |
Status always set to Proposed | Changed only after adr-review debate |
Frontmatter status: proposed, implemented: false, explainer: null | Phase 1 defaults (ADR-073); explainer never auto-fetched (CWE-918) |
Delegation on each host. "Delegate to the X agent" means the host's subagent tool: Claude Code Task with subagent_type="X"; Copilot CLI task with agent_type="project-toolkit:X"; Codex spawn_agent with agent_type="X", plus fork_turns="none" when the agent reviews or judges work (the default hands it your whole history); Muse Code subagent_spawn with role="X" and an objective, plus worktree_isolation: true for an agent that writes files. If the host has no subagent tool, or no X agent is installed, run the step yourself in this session.
Run these five gates in order against the saved draft before handing it to
adr-review. They are a measured pilot, not a permanent policy: use one fixed
ADR cohort before and after the pilot, then retain them only when avoided writer
rework exceeds maintenance and runtime cost. Record factual-finding share in
round one, rounds to consensus, writer correction time, total model cost, false
blocks, gate escapes, model, harness version, and wall time. The abort condition
is false blocks or gate escapes increasing without lower writer correction time.
Every gate result is VERIFIED, NOT RUN, UNAVAILABLE, or FAILED. Do not
invent a correction when evidence is unavailable or a claim remains uncertain.
Claims ledger. Create one row for every factual claim: claim text, kind
(path, count, absence, behavior, or quote), command, and result.
Store it as .project-toolkit/critique/ADR-NNN-claims-ledger.md beside the debate log.
An absence row needs a whole-repository search. For each path:line row,
read the cited range directly from the working tree and record the observed
text. Do not use check_citation_freshness.py; it checks only citations on
lines added between committed revisions.
Documentation accuracy. Run skill: "doc-accuracy" Phase 4 with
the saved ADR as the documentation file and its mapped source files as the
source input. Do not use --diff-base; it scans committed changes and cannot
select this uncommitted ADR.
Self-consistency. Compare every Decision item with every other Decision
item and with Consequences. Record contradictions or the VERIFIED result.
Refuting seat. Run one seat, not the panel:
delegate to the analyst agent with the prompt "Refute only the claims ledger
against the repository tree. Return factual findings and evidence." (Claude
Code: model="haiku").
The outcome is VERIFIED only when no factual findings remain. Do not invoke
adr-review while this seat reports a factual finding; record unavailable
evidence as UNAVAILABLE, never as a fabricated correction.
The seat is a bounded experiment, not independent proof. It may use a different
failure mode or externally grounded evidence; record its cost and wall time.
ADR review hand-off. Pass the ledger path and contents with the ADR to
adr-review. In Phase 1, record the path in the new debate log before
evaluating findings. A factual finding already covered by the ledger is a
gate escape, not proof that the writer must fabricate a same-pass correction.
After the gates pass, refresh the ADR index, then hand the ADR and its claims
ledger to adr-review for multi-agent validation.
The ADR index (.project-toolkit/architecture/README.md) is generated from the
ADR corpus. It lists each record's status, title, and decision
summary. The gates above can edit the title and decision summary; status stays
proposed until adr-review reaches consensus. Run the generator after the
gates so the index shows the post-gate draft instead of drifting until the next
unrelated build. Status changes after hand-off need another run.
Run it only in the rjmurillo/ai-agents repository. Check first:
git remote get-url origin | grep -Eq '^((https|ssh)://([^@/]+@)?|[^@/]+@)github\.com[:/]rjmurillo/ai-agents(\.git)?/?$' \
&& test -f build/scripts/generate_adr_index.py \
&& uv run python build/scripts/generate_adr_index.py
If the check fails, skip the refresh: either this is another repository (a fork
clone included), or build/scripts/generate_adr_index.py does not exist in this
checkout. Another repository's script of that name is that repository's code, and
running it here would execute whatever its branch supplied. The index has not
shipped in a consumer checkout, so nothing needs regenerating. A fork clone of
this repository, or an origin that is a mirror or proxy URL of it, fails the check
too: the index stays stale until the next build_all.py run regenerates it, so tell
the user to run that. The check
keeps an agent from running an unknown repository's script by accident. It scopes by
repository, not by script content: a branch checked out in this repository runs
its own copy of the script, as pytest or build_all.py would.
Avoid these when creating ADRs. Full catalog with 11+ creation and 7 review anti-patterns in AD Quality Frameworks.
| Avoid | Why | Instead |
|---|---|---|
| Skipping alternatives section | Decisions without alternatives lack rigor | Document at least 2 alternatives with pros/cons |
Setting status to Accepted | ADRs require review before acceptance | Always use Proposed, let adr-review change it |
| Duplicating an existing ADR | Causes governance confusion | Scan existing ADRs in G2, supersede if needed |
| Context that describes the solution | Context should explain the problem | Keep context focused on forces and constraints |
| Omitting negative consequences | Dishonest trade-off analysis ("Free Lunch Coupon") | Include at least 1 negative consequence |
| Skipping Prior Art when changing systems | Risk of removing structures without understanding | Use chestertons-fence skill |
| Sales Pitch language | Marketing language erodes trust | Use precise, quantifiable language |
| Dummy alternatives | Fake options to make preferred choice shine | Present genuine alternatives with honest pros/cons |
| Ignoring the template at the destination | Inconsistent ADR log | Detect template from existing ADRs in Phase G2 |
Before delivering, confirm all items in the quality checklist pass:
Proposedrjmurillo/ai-agents repository, build/scripts/generate_adr_index.py ran after the gates (Phase G6); in any other checkout it was skipped| Skill | Responsibility |
|---|---|
adr-generator | Creates a new ADR from scratch (Phases G1-G5) |
adr-review | Validates an existing ADR via 6-agent debate |
chestertons-fence | Investigates historical context before changing existing systems |
What SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (rjmurillo/ai-agents) — no native marketplace selected
npx claudepluginhub p/rjmurillo-copilot-cli-agents-src-copilot-cli104 skills in this plugin
/adr-reviewMulti-agent debate orchestration for Architecture Decision Records. Automatically triggers on ADR create/edit/delete. Coordinates architect, critic, independent-thinker, security, analyst, and high-level-advisor agents in structured debate rounds until consensus. Use when you say "review this ADR", when an ADR is created/edited/deleted, or when reviewing, accepting, or updating a decision file under .project-toolkit/architecture/, docs/architecture/, docs/decisions/, docs/adr/, or architecture/decisions/, including intent like "review this decision record" or "check this rationale for future maintainers". Do NOT use to author a new ADR (use adr-generator)./agent-harness-referenceField reference for Claude Code and GitHub Copilot CLI hook contracts. Covers hook locations, events, matchers, payloads, decisions, exit codes, timeouts, plugin roots, and cloud limits with official URLs and versioned probes. Use for `harness contract`, `copilot cli hook behavior`, `hook payload format`, `stale plugin root`, `Errno 2 _dispatch.py`, or before changing cross-harness hooks. Do NOT use to run the porting campaign (in the ai-agents repository, use `ai-agents-portability-campaign`).Other plugins' skills for the same job