plugins/avanti/skills/adr/SKILL.md
Draft a new ADR (Architecture Decision Record) from the avanti template into project/adrs/
npx skillsauth add acostanzo/quickstop adrInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are the /avanti:adr orchestrator. When the user runs /avanti:adr <slug>, mint the next zero-padded ADR number, copy templates/adr.md into project/adrs/<NNN>-<slug>.md with status: proposed, and walk the user through an interactive authoring pass over context, decision, and consequences.
ADRs live in a flat folder — the status field in frontmatter is authoritative, not the folder. See ${CLAUDE_PLUGIN_ROOT}/references/sdlc-conventions.md for the reasoning and for the supersession rules.
Extract the slug from $ARGUMENTS.
^[a-z][a-z0-9]*(-[a-z0-9]+)*$. Re-prompt on failure.Store as SLUG.
Run git rev-parse --show-toplevel 2>/dev/null. Abort if this fails. Store as REPO_ROOT.
ADRS_DIR = ${REPO_ROOT}/project/adrs/. If the directory does not exist, create it with mkdir -p via Bash and continue — the destination is deterministic and cheap to create on demand.
Glob for project/adrs/*-${SLUG}.md under REPO_ROOT. If any file matches, abort:
An ADR with slug "${SLUG}" already exists at <path>.
Pick a different slug. ADR numbers are shared across all slugs, so a
naming collision is a content-level conflict worth resolving explicitly.
Glob for project/adrs/*.md under REPO_ROOT. From each filename, extract the leading numeric prefix (the part before the first -, parsed as an integer).
Store the max as MAX_ID (default 0 if no ADRs exist).
NEW_NUM = MAX_ID + 1, zero-padded to 3 digits (e.g., MAX_ID=2 → NEW_NUM="003").
Glob for project/adrs/${NEW_NUM}-*.md. If any match (should never happen, but guard against races), abort — something is out of sync; the user should re-scan and retry.
Read ${CLAUDE_PLUGIN_ROOT}/templates/adr.md as TEMPLATE. Run date +%Y-%m-%d as TODAY.
Use AskUserQuestion to collect:
Store as TITLE, CONTEXT, DECISION, CONSEQUENCES.
Produce RENDERED by applying these substitutions to TEMPLATE:
id: TODO → id: ${NEW_NUM}updated: TODO → updated: ${TODAY}# ADR TODO — <decision title> → # ADR ${NEW_NUM} — ${TITLE}## Context → ${CONTEXT}## Decision → ${DECISION}### Positive with the CONSEQUENCES bullets (keep the remaining subsections — Negative, Neutral — with their TODO bullets intact for the author).Leave status: proposed and superseded_by: null as-is — that's the correct initial state.
Leave the ## Alternatives considered section's TODO blocks intact — the author fleshes those out.
Write RENDERED to ${ADRS_DIR}${NEW_NUM}-${SLUG}.md.
Tell the user:
ADR drafted: project/adrs/${NEW_NUM}-${SLUG}.md
Status: proposed
Next:
- Flesh out the remaining consequences (negative, neutral).
- Fill in alternatives considered.
- Promote to accepted with /avanti:promote adr:${NEW_NUM}-${SLUG}.
mkdir -p and proceed. The directory is deterministic and avanti's destination — cheap to create on demand.documentation
Surface (and optionally fix) doc-tree drift — duplicates, dead links, stale docs, template non-compliance, missing `## Related` blocks. Read-only by default; `--apply` does mechanical fixes; `--apply-semantic` emits diffs for human review.
documentation
Full-text search over the repo's `docs/` tree (FTS5-backed). Returns ranked hits with file paths, tags, and matching snippets.
testing
Retrieval-augmented Q&A over the repo's `docs/` tree. Returns a one-paragraph synthesis plus citations (doc path + heading anchor) and per-citation corroboration verdicts. Field shape and ordering are locked at M3; M5 populates the verdicts.
documentation
Scaffold a new doc under `docs/` from a Diátaxis template, or update an existing one and bump its `updated:` date. Suggests `## Related` candidates and refreshes the FTS5 index on write.