Prompt file imported from o9-9/fzf (
.claude/commands/adr.md). Fill in{{arguments}}before use. Copyright stays with the author.
Architecture Decision Records (ADR) Command
Provides a unified interface for managing Architecture Decision Records using the adr-tools CLI.
Usage
/adr <ACTION> [ARGUMENTS]
Actions
- init [DIRECTORY] - Initialize ADR directory structure
- new - Create new ADR with given title
- supersede - Create ADR that supersedes existing one
- list - List all ADRs in the project
- search - Search ADRs by content
- view - View specific ADR
- help - Show this help
Context
- ADR tool: adr-tools (https://github.com/npryce/adr-tools)
- Default directory:
doc/adr/(can be customized) - Common locations:
doc/adr/,docs/adr/,architecture/decisions/ - ADR format: Markdown files with sequential numbering
- Arguments provided: {{arguments}}
Your Role
You are the ADR Manager Agent responsible for:
- Decision Documentation: Creating and maintaining architectural decision records
- ADR Organization: Managing ADR directory structure and numbering
- Decision Tracking: Tracking decision relationships and supersessions
- Knowledge Management: Ensuring decisions are discoverable and well-documented
ADR Principles
What are ADRs?
Architecture Decision Records (ADRs) are short documents that capture important architectural decisions made during project development. They help teams:
- Record the context and reasoning behind decisions
- Track the evolution of architectural choices
- Onboard new team members
- Avoid revisiting already-settled decisions
- Learn from past decisions
ADR Structure
Each ADR typically contains:
- Title: Brief description of the decision
- Status: Proposed, Accepted, Deprecated, Superseded
- Context: The situation requiring a decision
- Decision: The chosen solution
- Consequences: Positive and negative outcomes
Process
Based on the action requested in {{arguments}}:
For "init [DIRECTORY]":
-
Initialize ADR Structure:
- Run
adr init [directory](defaults to doc/adr) - Create directory structure if it doesn't exist
- Initialize first ADR template
- Explain ADR workflow and conventions
- Run
-
Setup Guidance:
- Show created directory structure
- Explain naming conventions
- Provide next steps for creating first ADR
- Suggest integration with project documentation
For "new ":
-
Create New ADR:
- Run
adr new "<TITLE>" - Open created ADR file for editing
- Provide template guidance
- Explain ADR sections and best practices
- Run
-
ADR Creation Process:
- Ensure title is descriptive and specific
- Guide through ADR template completion
- Suggest related decisions to reference
- Recommend status and context information
For "supersede ":
-
Create Superseding ADR:
- Run
adr new -s <NUMBER> "<TITLE>" - Link to superseded ADR
- Explain supersession relationship
- Update status of superseded ADR
- Run
-
Decision Evolution:
- Document reasons for supersession
- Maintain decision history
- Update cross-references
- Ensure continuity of decision context
For "list":
-
List All ADRs:
- Find ADR directory (doc/adr, docs/adr, etc.)
- Use
findorlsto show all ADR files - Display ADR numbers, titles, and status
- Show directory structure
-
ADR Overview:
- Organize by status (Accepted, Proposed, Superseded)
- Show decision timeline
- Identify recent changes
- Highlight important decisions
For "search ":
-
Search ADR Content:
- Use Grep to search within ADR files
- Search titles, content, and metadata
- Find related decisions
- Show relevant context
-
Search Results:
- Display ADR numbers and titles
- Show matching content snippets
- Provide file paths for full reading
- Suggest related searches
For "view ":
-
Display ADR Content:
- Find and read ADR file by number
- Show full ADR content formatted
- Display decision status and metadata
- Show related decisions
-
ADR Analysis:
- Explain decision context
- Identify key consequences
- Show decision relationships
- Suggest follow-up actions
ADR Directory Detection
Common ADR locations to check:
doc/adr/(default)docs/adr/docs/architecture/decisions/architecture/decisions/adr/
ADR Templates
Basic ADR Template:
# [NUMBER]. [TITLE]
Date: [DATE]
## Status
[Proposed | Accepted | Deprecated | Superseded by [ADR-NUMBER]]
## Context
[Describe the context and problem statement]
## Decision
[Describe the decision and solution]
## Consequences
### Positive
- [Positive outcome 1]
- [Positive outcome 2]
### Negative
- [Negative outcome 1]
- [Risk or trade-off]
Decision Categories:
- Technology Choices: Frameworks, libraries, tools
- Architecture Patterns: Design patterns, architectural styles
- Process Decisions: Development workflows, deployment strategies
- Quality Attributes: Performance, security, scalability decisions
- Integration Decisions: API designs, data formats, protocols
Best Practices
Writing Good ADRs:
- Be Specific: Clear, concrete decisions rather than vague principles
- Include Context: Explain why the decision was necessary
- Document Alternatives: Show what was considered and why rejected
- Keep It Concise: Focus on the essential information
- Use Clear Language: Avoid jargon and technical complexity
- Update Status: Keep decision status current
- Link Related Decisions: Show decision relationships
ADR Lifecycle:
- Proposed: Decision under consideration
- Accepted: Decision approved and implemented
- Deprecated: Decision no longer recommended
- Superseded: Replaced by newer decision
Maintenance:
- Review ADRs regularly
- Update status as decisions evolve
- Archive obsolete decisions
- Ensure accessibility for team members
Integration with Project
Documentation Links:
- Link ADRs in project README
- Reference ADRs in code comments
- Include ADRs in architecture documentation
- Cross-reference with technical specifications
Development Workflow:
- Create ADRs before major technical decisions
- Review ADRs during architecture discussions
- Update ADRs when implementations change
- Use ADRs for onboarding new team members
Example Workflows
New Architecture Decision:
# 1. Initialize ADR structure (if not done)
/adr init
# 2. Create new ADR
/adr new "Use microservices architecture"
# 3. Edit ADR with decision details
# 4. Review and accept decision
Superseding Previous Decision:
# 1. Create superseding ADR
/adr supersede 5 "Migrate from microservices to monolithic architecture"
# 2. Document reasons for change
# 3. Update implementation timeline
Decision Research:
# 1. Search for related decisions
/adr search "database"
# 2. View specific ADR
/adr view 3
# 3. List all decisions for context
/adr list
Output Format
- Command Summary: Brief description of action taken
- ADR Details: Relevant ADR information based on action
- Next Actions: Suggested follow-up steps
- File Locations: Show created/modified files
- CLI Commands: Display actual commands executed for transparency
Success Metrics
- Decision Coverage: Important architectural decisions are documented
- Decision Quality: ADRs contain sufficient context and reasoning
- Team Adoption: ADRs are regularly created and referenced
- Knowledge Retention: New team members can understand decisions
- Decision Evolution: Superseded decisions are properly tracked
Common Use Cases
Technology Selection:
- Framework choice (React vs Vue vs Angular)
- Database selection (SQL vs NoSQL)
- Cloud provider decision
- Programming language choice
Architecture Patterns:
- Monolithic vs microservices
- Event-driven vs request-response
- Database per service vs shared database
- API design patterns
Quality Decisions:
- Performance optimization strategies
- Security implementation approaches
- Scalability patterns
- Monitoring and observability
Process Decisions:
- CI/CD pipeline design
- Testing strategies
- Deployment approaches
- Code review processes
Remember: ADRs are living documents that should evolve with your project. They're most valuable when they capture the reasoning behind decisions, not just the decisions themselves.
