Create Architectural Decision Record (ADR)
Creates structured ADRs following the framework's template.
Process
1. Gather Context
Ask if needed:
- What decision is being made?
- What problem does it solve?
- What alternatives were considered?
- What are the trade-offs?
2. Generate ADR Number
# Find highest ADR number
ls .architecture/decisions/adrs/ | grep -E "^ADR-[0-9]+" | sed 's/ADR-//' | sed 's/-.*//' | sort -n | tail -1
New ADR = next sequential number (e.g., if highest is 003, create 004)
3. Validate and Sanitize Input
Security: Sanitize user input to prevent path traversal and injection:
- Remove or replace:
.., /, \, null bytes, control characters
- Convert to lowercase kebab-case: spaces → hyphens, remove special chars
- Limit length: max 80 characters for filename portion
- Validate result: ensure filename contains only [a-z0-9-]
4. Create Filename
Format: ADR-XXX-kebab-case-title.md
Examples:
ADR-001-use-react-for-frontend.md
ADR-002-choose-postgresql-database.md
Valid input: "Use React for Frontend" → use-react-for-frontend
Invalid blocked: "../etc/passwd" → sanitized or rejected
5. Check Configuration
- Read
.architecture/config.yml to check if pragmatic_mode is enabled
- If enabled and applies to ADR creation, include Pragmatic Enforcer analysis
6. Write ADR
Use the template from .architecture/templates/adr-template.md:
Core sections:
- Status, Context, Decision Drivers, Decision, Consequences
- Implementation, Alternatives Considered, Validation, References
If pragmatic_mode is enabled: Add Pragmatic Enforcer Analysis section:
- Necessity Assessment (0-10): Current need, future need, cost of waiting, evidence
- Complexity Assessment (0-10): Added complexity, maintenance, learning curve, dependencies
- Alternative Analysis: Review if simpler alternatives adequately considered
- Simpler Alternative Proposal: Concrete proposal for simpler approach
- Recommendation: Approve / Approve with simplifications / Defer / Recommend against
- Pragmatic Score: Necessity, Complexity, Ratio (target <1.5)
- Overall Assessment: Appropriate engineering vs over-engineering
If deferrals enabled: Track deferred decisions in .architecture/deferrals.md
7. Save ADR
Write to: .architecture/decisions/adrs/ADR-XXX-title.md
8. Report to User
Created ADR-XXX: [Title]
Location: .architecture/decisions/adrs/ADR-XXX-title.md
Status: [Status]
Key Points:
- Decision: [Summary]
- Main benefit: [Key benefit]
- Main trade-off: [Key trade-off]
Next Steps:
- [Immediate action 1]
- [Immediate action 2]
When to Create ADRs
Do create for:
- Technology choices (frameworks, databases, languages)
- Architectural patterns (microservices, event-driven, etc.)
- Infrastructure decisions (cloud provider, deployment)
- Security approaches (authentication, encryption)
Don't create for:
- Implementation details (function names, variable names)
- Temporary decisions
- Minor decisions with limited impact
Status Lifecycle
- Proposed: Documented but not approved
- Accepted: Approved and should be implemented
- Deprecated: No longer best practice
- Superseded: Replaced by newer ADR (reference it)
Related Skills
Before Creating ADR:
- "What's our architecture status?" - Check existing ADRs to avoid duplication
- "List architecture members" - See who should review the decision
After Creating ADR:
- "Ask [specialist] to review [the ADR]" - Get focused expert review
- "Start architecture review for [version]" - Include in comprehensive review
Workflow Examples:
- Create ADR → Ask Security Specialist to review → Revise ADR
- Architecture review → Create ADRs for key decisions → Status check
Notes
- Focus on "why" more than "what"
- Be honest about trade-offs
- Keep it concise but complete
- ADRs can be updated as new information emerges
1---2name: create-adr3description: Creates a NEW Architectural Decision Record (ADR) documenting a specific architectural decision. Use when the user requests "Create ADR for [topic]", "Document decision about [topic]", "Write ADR for [choice]", or when documenting technology choices, patterns, or architectural approaches. Do NOT use for reviews (use architecture-review or specialist-review), checking existing ADRs (use architecture-status), or general documentation.4---5
6# Create Architectural Decision Record (ADR)
7
8Creates structured ADRs following the framework's template.
9
10## Process
11
12### 1. Gather Context
13Ask if needed:
14- What decision is being made?
15- What problem does it solve?
16- What alternatives were considered?
17- What are the trade-offs?
18
19### 2. Generate ADR Number
20```bash
21# Find highest ADR number
22ls .architecture/decisions/adrs/ | grep -E "^ADR-[0-9]+" | sed 's/ADR-//' | sed 's/-.*//' | sort -n | tail -1
23```
24New ADR = next sequential number (e.g., if highest is 003, create 004)
25
26### 3. Validate and Sanitize Input
27**Security**: Sanitize user input to prevent path traversal and injection:
28- Remove or replace: `..`, `/`, `\`, null bytes, control characters
29- Convert to lowercase kebab-case: spaces → hyphens, remove special chars
30- Limit length: max 80 characters for filename portion
31- Validate result: ensure filename contains only [a-z0-9-]
32
33### 4. Create Filename
34Format: `ADR-XXX-kebab-case-title.md`
35
36Examples:
37- `ADR-001-use-react-for-frontend.md`
38- `ADR-002-choose-postgresql-database.md`
39
40**Valid input**: "Use React for Frontend" → `use-react-for-frontend`
41**Invalid blocked**: "../etc/passwd" → sanitized or rejected
42
43### 5. Check Configuration
44- Read `.architecture/config.yml` to check if pragmatic_mode is enabled
45- If enabled and applies to ADR creation, include Pragmatic Enforcer analysis
46
47### 6. Write ADR
48Use the template from `.architecture/templates/adr-template.md`:
49
50**Core sections**:
51- Status, Context, Decision Drivers, Decision, Consequences
52- Implementation, Alternatives Considered, Validation, References
53
54**If pragmatic_mode is enabled**: Add Pragmatic Enforcer Analysis section:
55- Necessity Assessment (0-10): Current need, future need, cost of waiting, evidence
56- Complexity Assessment (0-10): Added complexity, maintenance, learning curve, dependencies
57- Alternative Analysis: Review if simpler alternatives adequately considered
58- Simpler Alternative Proposal: Concrete proposal for simpler approach
59- Recommendation: Approve / Approve with simplifications / Defer / Recommend against
60- Pragmatic Score: Necessity, Complexity, Ratio (target <1.5)
61- Overall Assessment: Appropriate engineering vs over-engineering
62
63**If deferrals enabled**: Track deferred decisions in `.architecture/deferrals.md`
64
65### 7. Save ADR
66Write to: `.architecture/decisions/adrs/ADR-XXX-title.md`
67
68### 8. Report to User
69```
70Created ADR-XXX: [Title]
71
72Location: .architecture/decisions/adrs/ADR-XXX-title.md
73Status: [Status]
74
75Key Points:
76- Decision: [Summary]
77- Main benefit: [Key benefit]
78- Main trade-off: [Key trade-off]
79
80Next Steps:
81- [Immediate action 1]
82- [Immediate action 2]
83```
84
85## When to Create ADRs
86**Do create for**:
87- Technology choices (frameworks, databases, languages)
88- Architectural patterns (microservices, event-driven, etc.)
89- Infrastructure decisions (cloud provider, deployment)
90- Security approaches (authentication, encryption)
91
92**Don't create for**:
93- Implementation details (function names, variable names)
94- Temporary decisions
95- Minor decisions with limited impact
96
97## Status Lifecycle
98- **Proposed**: Documented but not approved
99- **Accepted**: Approved and should be implemented
100- **Deprecated**: No longer best practice
101- **Superseded**: Replaced by newer ADR (reference it)
102
103## Related Skills
104
105**Before Creating ADR**:
106- "What's our architecture status?" - Check existing ADRs to avoid duplication
107- "List architecture members" - See who should review the decision
108
109**After Creating ADR**:
110- "Ask [specialist] to review [the ADR]" - Get focused expert review
111- "Start architecture review for [version]" - Include in comprehensive review
112
113**Workflow Examples**:
1141. Create ADR → Ask Security Specialist to review → Revise ADR
1152. Architecture review → Create ADRs for key decisions → Status check
116
117## Notes
118- Focus on "why" more than "what"
119- Be honest about trade-offs
120- Keep it concise but complete
121- ADRs can be updated as new information emerges