/adr:update
Update ADR
Section titled “Update ADR”Update an existing Architectural Decision Record’s status, content, or metadata.
Process
Section titled “Process”- Parse arguments to identify ADR and update type
- Find ADR file by ID
- Read current content
- Apply updates based on arguments
- Update index if needed
- Git commit if configured
Argument Parsing
Section titled “Argument Parsing”Supported arguments:
<adr-id>: ADR number (e.g., “0001”, “1”, “ADR-0001”)--status=<status>: Update status (accepted, rejected, deprecated, superseded)--add-driver=<driver>: Add a decision driver--add-consequence=<consequence>: Add a consequence- No status flag: Open interactive update mode
ADR Resolution
Section titled “ADR Resolution”Find ADR by flexible matching:
- “1” → finds 0001-*.md
- “0001” → finds 0001-*.md
- “ADR-0001” → finds 0001-*.md
- “use-postgresql” → finds use-postgresql.md
Status Update
Section titled “Status Update”When updating status:
To “accepted”
Section titled “To “accepted””- Update Status section
- Add acceptance date if not present
- Optionally add decision makers
To “rejected”
Section titled “To “rejected””- Update Status section
- Prompt for rejection reason
- Add rejection date
To “deprecated”
Section titled “To “deprecated””- Update Status section
- Prompt for deprecation reason
- Suggest creating successor ADR
To “superseded”
Section titled “To “superseded””- Require superseding ADR ID
- Update Status section
- Add “Superseded by ADR-XXXX”
- Update superseding ADR with “Supersedes ADR-YYYY”
Content Updates
Section titled “Content Updates”For interactive updates, use AskUserQuestion:
- What section to update?
- What is the new content?
- Any additional changes?
Index Update
Section titled “Index Update”After status change:
- Read README.md index
- Update status in ADR table
- Write updated README.md
Git Integration
Section titled “Git Integration”If git integration enabled:
git add {adr_file}git commit -m "docs(adr): update ADR-{id} status to {status}"Output
Section titled “Output”Report changes made:
- Previous status → New status
- Sections modified
- Related ADRs updated
- Git commit created (if applicable)
Validation
Section titled “Validation”Before updating:
- Verify ADR exists
- Validate status transition is allowed
- Check for missing required fields