Spec to ADR
by @rawc0der
Convert agent execution plans into MADR-format Architecture Decision Records for audit trails and architecture progression. Use when the user asks to create...
clawhub install spec-to-adrπ About This Skill
name: spec-to-adr description: >- Convert agent execution plans into MADR-format Architecture Decision Records for audit trails and architecture progression. Use when the user asks to create an ADR, record an architectural decision, document a plan as a decision record, or convert a spec/plan into an ADR. Supports GSD phase plans, Cursor CreatePlan output, and generic markdown plans.
spec-to-adr
Convert execution plans into numbered MADR Architecture Decision Records stored in docs/adr/.
Workflow
Follow these steps in order:
1. Locate the plan -- identify the source plan using the detection rules below.
2. Extract decisions -- pull structured data from the plan into MADR fields.
3. Generate the ADR -- write the file using the template in references/madr-template.md.
4. Update the index -- append an entry to docs/adr/README.md.
5. Report -- show the user the ADR path, number, and a one-line summary.
Step 1: Locate the Plan
Determine the plan format by checking in this order:
GSD Phase Plan
Present when any of these exist relative to the workspace root:
.planning/phases/*/PLAN.md.planning/ROADMAP.md.planning/phases/*/RESEARCH.mdUse the most recent PLAN.md unless the user specifies a phase. If multiple phases exist, ask which one to record.
Cursor CreatePlan
A .plan.md file (often in .cursor/plans/) with this structure:
name, overview, and todosGeneric Markdown Plan
Any markdown document the user points to that contains:
If the user says "create an ADR" without pointing to a plan, ask: "Which plan or decision should I record? Point me to a file, or describe the decision."
Step 2: Extract Decisions
Map plan content to MADR fields. Not every field will have a direct source -- infer where reasonable, leave blank with a TODO marker where not.
| MADR Field | GSD Plan Source | CreatePlan Source | Generic Source |
|---|---|---|---|
| Title | Phase name / goal | name from frontmatter | First H1 or user-provided |
| Context and Problem | RESEARCH.md problem section, or PLAN.md overview | overview from frontmatter | Opening paragraphs or problem statement |
| Decision Drivers | Constraints, requirements from RESEARCH | Trade-offs discussed in body | Bullet lists of requirements or constraints |
| Considered Options | Alternative approaches in RESEARCH or PLAN | Multiple approaches in body sections | Sections describing different options |
| Decision Outcome | The chosen plan/approach in PLAN.md | The plan body (the chosen path) | The recommended or selected approach |
| Consequences | Risk sections, known trade-offs | Noted risks or caveats | Stated pros/cons of chosen path |
Extraction guidelines
VERIFICATION.md, pull verification criteria into Consequences.Step 3: Generate the ADR
Numbering
1. List existing files in docs/adr/ matching the pattern NNNN-*.md.
2. Find the highest number. If no ADRs exist, start at 0001.
3. Increment by 1. Pad to 4 digits.
Filename
NNNN-kebab-case-title.md where the title is derived from the decision title, lowercased, spaces replaced with hyphens, non-alphanumeric characters removed, truncated to 60 characters.
Content
Read references/madr-template.md and fill in the extracted fields. Rules:
accepted. If the user says the decision is still under review, use proposed.YYYY-MM-DD format.git config user.name) if available, otherwise leave as TODO.TODO unless the user specifies.Output location
Write to docs/adr/NNNN-kebab-case-title.md. Create the docs/adr/ directory if it does not exist.
If the user has a different ADR directory convention (check for existing adr/, doc/adr/, architecture/decisions/), use that instead.
Step 4: Update the Index
Maintain a docs/adr/README.md that lists all ADRs. If it does not exist, create it using the template in assets/adr-index-template.md.
Append a row to the table:
| NNNN | Title | accepted | YYYY-MM-DD |
Step 5: Report
After writing the ADR, tell the user:
docs/adr/0003-use-postgres-for-persistence.md)proposed, deprecated, superseded by ADR-NNNN)Edge Cases
accepted and update the old ADR's status to superseded by ADR-NNNN.. Warn the user the ADR is incomplete.