Architecture Decision Records
Comprehensive patterns for creating, maintaining, and managing Architecture Decision Records (ADRs) that capture the context and rationale behind significant technical decisions.
Use this skill when
- Making significant architectural decisions
- Documenting technology choices
- Recording design trade-offs
- Onboarding new team members
- Reviewing historical decisions
- Establishing decision-making processes
Do not use this skill when
- You only need to document small implementation details
- The change is a minor patch or routine maintenance
- There is no architectural decision to capture
Instructions
- Capture the decision context, constraints, and drivers.
- Document considered options with tradeoffs.
- Record the decision, rationale, and consequences.
- Link related ADRs and update status over time.
Core Concepts
1. What is an ADR?
An Architecture Decision Record captures:
- Context: Why we needed to make a decision
- Decision: What we decided
- Consequences: What happens as a result
2. When to Write an ADR
| Write ADR |
Skip ADR |
| New framework adoption |
Minor version upgrades |
| Database technology choice |
Bug fixes |
| API design patterns |
Implementation details |
| Security architecture |
Routine maintenance |
| Integration patterns |
Configuration changes |
3. ADR Lifecycle
Proposed → Accepted → Deprecated → Superseded
↓
Rejected
Templates
Template 1: Standard ADR (MADR Format)
# ADR-0001: Use PostgreSQL as Primary Database
## Status
Accepted
## Context
We need to select a primary database for our new e-commerce platform. The system
will handle:
- ~10,000 concurrent users
- Complex product catalog with hierarchical categories
- Transaction processing for orders and payments
- Full-text search for products
- Geospatial queries for store locator
The team has experience with MySQL, PostgreSQL, and MongoDB. We need ACID
compliance for financial transactions.
## Decision Drivers
* **Must have ACID compliance** for payment processing
* **Must support complex queries** for reporting
* **Should support full-text search** to reduce infrastructure complexity
* **Should have good JSON support** for flexible product attributes
* **Team familiarity** reduces onboarding time
## Considered Options
### Option 1: PostgreSQL
- **Pros**: ACID compliant, excellent JSON support (JSONB), built-in full-text
search, PostGIS for geospatial, team has experience
- **Cons**: Slightly more complex replication setup than MySQL
### Option 2: MySQL
- **Pros**: Very familiar to team, simple replication, large community
- **Cons**: Weaker JSON support, no built-in full-text search (need
Elasticsearch), no geospatial without extensions
### Option 3: MongoDB
- **Pros**: Flexible schema, native JSON, horizontal scaling
- **Cons**: No ACID for multi-document transactions (at decision time),
team has limited experience, requires schema design discipline
## Decision
We will use **PostgreSQL 15** as our primary database.
## Rationale
PostgreSQL provides the best balance of:
1. **ACID compliance** essential for e-commerce transactions
2. **Built-in capabilities** (full-text search, JSONB, PostGIS) reduce
infrastructure complexity
3. **Team familiarity** with SQL databases reduces learning curve
4. **Mature ecosystem** with excellent tooling and community support
The slight complexity in replication is outweighed by the reduction in
additional services (no separate Elasticsearch needed).
## Consequences
### Positive
- Single database handles transactions, search, and geospatial queries
- Reduced operational complexity (fewer services to manage)
- Strong consistency guarantees for financial data
- Team can leverage existing SQL expertise
### Negative
- Need to learn PostgreSQL-specific features (JSONB, full-text search syntax)
- Vertical scaling limits may require read replicas sooner
- Some team members need PostgreSQL-specific training
### Risks
- Full-text search may not scale as well as dedicated search engines
- Mitigation: Design for potential Elasticsearch addition if needed
## Implementation Notes
- Use JSONB for flexible product attributes
- Implement connection pooling with PgBouncer
- Set up streaming replication for read replicas
- Use pg_trgm extension for fuzzy search
## Related Decisions
- ADR-0002: Caching Strategy (Redis) - complements database choice
- ADR-0005: Search Architecture - may supersede if Elasticsearch needed
## References
- [PostgreSQL JSON Documentation](https://www.postgresql.org/docs/current/datatype-json.html)
- [PostgreSQL Full Text Search](https://www.postgresql.org/docs/current/textsearch.html)
- Internal: Performance benchmarks in `/docs/benchmarks/database-comparison.md`
Template 2: Lightweight ADR
# ADR-0012: Adopt TypeScript for Frontend Development
**Status**: Accepted
**Da
1---
2name: architecture-decision-records
3description: Comprehensive patterns for creating, maintaining, and managing Architecture Decision Records (ADRs) that capture the context and rationale behind significant technical decisions.
4category: Document Processing
5source: antigravity
6tags: [typescript, react, markdown, api, ai, automation, template, design, document, security]
7url: https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/architecture-decision-records
8metadata:
9 source: https://skillmd.com/skills/sickn33/architecture-decision-records
10---
11
12
13# Architecture Decision Records
14
15Comprehensive patterns for creating, maintaining, and managing Architecture Decision Records (ADRs) that capture the context and rationale behind significant technical decisions.
16
17## Use this skill when
18
19- Making significant architectural decisions
20- Documenting technology choices
21- Recording design trade-offs
22- Onboarding new team members
23- Reviewing historical decisions
24- Establishing decision-making processes
25
26## Do not use this skill when
27
28- You only need to document small implementation details
29- The change is a minor patch or routine maintenance
30- There is no architectural decision to capture
31
32## Instructions
33
341. Capture the decision context, constraints, and drivers.
352. Document considered options with tradeoffs.
363. Record the decision, rationale, and consequences.
374. Link related ADRs and update status over time.
38
39## Core Concepts
40
41### 1. What is an ADR?
42
43An Architecture Decision Record captures:
44- **Context**: Why we needed to make a decision
45- **Decision**: What we decided
46- **Consequences**: What happens as a result
47
48### 2. When to Write an ADR
49
50| Write ADR | Skip ADR |
51|-----------|----------|
52| New framework adoption | Minor version upgrades |
53| Database technology choice | Bug fixes |
54| API design patterns | Implementation details |
55| Security architecture | Routine maintenance |
56| Integration patterns | Configuration changes |
57
58### 3. ADR Lifecycle
59
60```
61Proposed → Accepted → Deprecated → Superseded
62 ↓
63 Rejected
64```
65
66## Templates
67
68### Template 1: Standard ADR (MADR Format)
69
70```markdown
71# ADR-0001: Use PostgreSQL as Primary Database
72
73## Status
74
75Accepted
76
77## Context
78
79We need to select a primary database for our new e-commerce platform. The system
80will handle:
81- ~10,000 concurrent users
82- Complex product catalog with hierarchical categories
83- Transaction processing for orders and payments
84- Full-text search for products
85- Geospatial queries for store locator
86
87The team has experience with MySQL, PostgreSQL, and MongoDB. We need ACID
88compliance for financial transactions.
89
90## Decision Drivers
91
92* **Must have ACID compliance** for payment processing
93* **Must support complex queries** for reporting
94* **Should support full-text search** to reduce infrastructure complexity
95* **Should have good JSON support** for flexible product attributes
96* **Team familiarity** reduces onboarding time
97
98## Considered Options
99
100### Option 1: PostgreSQL
101- **Pros**: ACID compliant, excellent JSON support (JSONB), built-in full-text
102 search, PostGIS for geospatial, team has experience
103- **Cons**: Slightly more complex replication setup than MySQL
104
105### Option 2: MySQL
106- **Pros**: Very familiar to team, simple replication, large community
107- **Cons**: Weaker JSON support, no built-in full-text search (need
108 Elasticsearch), no geospatial without extensions
109
110### Option 3: MongoDB
111- **Pros**: Flexible schema, native JSON, horizontal scaling
112- **Cons**: No ACID for multi-document transactions (at decision time),
113 team has limited experience, requires schema design discipline
114
115## Decision
116
117We will use **PostgreSQL 15** as our primary database.
118
119## Rationale
120
121PostgreSQL provides the best balance of:
1221. **ACID compliance** essential for e-commerce transactions
1232. **Built-in capabilities** (full-text search, JSONB, PostGIS) reduce
124 infrastructure complexity
1253. **Team familiarity** with SQL databases reduces learning curve
1264. **Mature ecosystem** with excellent tooling and community support
127
128The slight complexity in replication is outweighed by the reduction in
129additional services (no separate Elasticsearch needed).
130
131## Consequences
132
133### Positive
134- Single database handles transactions, search, and geospatial queries
135- Reduced operational complexity (fewer services to manage)
136- Strong consistency guarantees for financial data
137- Team can leverage existing SQL expertise
138
139### Negative
140- Need to learn PostgreSQL-specific features (JSONB, full-text search syntax)
141- Vertical scaling limits may require read replicas sooner
142- Some team members need PostgreSQL-specific training
143
144### Risks
145- Full-text search may not scale as well as dedicated search engines
146- Mitigation: Design for potential Elasticsearch addition if needed
147
148## Implementation Notes
149
150- Use JSONB for flexible product attributes
151- Implement connection pooling with PgBouncer
152- Set up streaming replication for read replicas
153- Use pg_trgm extension for fuzzy search
154
155## Related Decisions
156
157- ADR-0002: Caching Strategy (Redis) - complements database choice
158- ADR-0005: Search Architecture - may supersede if Elasticsearch needed
159
160## References
161
162- [PostgreSQL JSON Documentation](https://www.postgresql.org/docs/current/datatype-json.html)
163- [PostgreSQL Full Text Search](https://www.postgresql.org/docs/current/textsearch.html)
164- Internal: Performance benchmarks in `/docs/benchmarks/database-comparison.md`
165```
166
167### Template 2: Lightweight ADR
168
169```markdown
170# ADR-0012: Adopt TypeScript for Frontend Development
171
172**Status**: Accepted
173**Da