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**: Compare version-specific JSON, full-text and spatial capabilities against measured requirements; MySQL includes full-text indexes and spatial features.
### Option 3: MongoDB
- **Pros**: Flexible schema, native JSON, horizontal scaling
- **Cons**: Multi-document transactions are supported on qualifying modern deployments; assess their overhead and topology constraints,
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. **Capabilities** (built-in full-text search/JSONB plus the PostGIS extension) 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`
1---2name: architecture-decision-records3description: Comprehensive patterns for creating, maintaining, and managing Architecture Decision Records (ADRs) that capture the context and rationale behind significant technical decisions. 4category: Document Processing5source: antigravity6tags: [typescript, react, markdown, api, ai, automation, template, design, document, security]7url: https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/architecture-decision-records8metadata:9 source: https://skillmd.com/skills/ranbot-ai/architecture-decision-records10---111213# Architecture Decision Records1415Comprehensive patterns for creating, maintaining, and managing Architecture Decision Records (ADRs) that capture the context and rationale behind significant technical decisions.1617## Use this skill when1819- Making significant architectural decisions20- Documenting technology choices21- Recording design trade-offs22- Onboarding new team members23- Reviewing historical decisions24- Establishing decision-making processes2526## Do not use this skill when2728- You only need to document small implementation details29- The change is a minor patch or routine maintenance30- There is no architectural decision to capture3132## Instructions33341. 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.3839## Core Concepts4041### 1. What is an ADR?4243An Architecture Decision Record captures:44- **Context**: Why we needed to make a decision45- **Decision**: What we decided46- **Consequences**: What happens as a result4748### 2. When to Write an ADR4950| 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 |5758### 3. ADR Lifecycle5960```61Proposed → Accepted → Deprecated → Superseded62 ↓63 Rejected64```6566## Templates6768### Template 1: Standard ADR (MADR Format)6970```markdown71# ADR-0001: Use PostgreSQL as Primary Database7273## Status7475Accepted7677## Context7879We need to select a primary database for our new e-commerce platform. The system80will handle:81- ~10,000 concurrent users82- Complex product catalog with hierarchical categories83- Transaction processing for orders and payments84- Full-text search for products85- Geospatial queries for store locator8687The team has experience with MySQL, PostgreSQL, and MongoDB. We need ACID88compliance for financial transactions.8990## Decision Drivers9192* **Must have ACID compliance** for payment processing93* **Must support complex queries** for reporting94* **Should support full-text search** to reduce infrastructure complexity95* **Should have good JSON support** for flexible product attributes96* **Team familiarity** reduces onboarding time9798## Considered Options99100### Option 1: PostgreSQL101- **Pros**: ACID compliant, excellent JSON support (JSONB), built-in full-text102 search, PostGIS for geospatial, team has experience103- **Cons**: Slightly more complex replication setup than MySQL104105### Option 2: MySQL106- **Pros**: Very familiar to team, simple replication, large community107- **Cons**: Compare version-specific JSON, full-text and spatial capabilities against measured requirements; MySQL includes full-text indexes and spatial features.108109### Option 3: MongoDB110- **Pros**: Flexible schema, native JSON, horizontal scaling111- **Cons**: Multi-document transactions are supported on qualifying modern deployments; assess their overhead and topology constraints,112 team has limited experience, requires schema design discipline113114## Decision115116We will use **PostgreSQL 15** as our primary database.117118## Rationale119120PostgreSQL provides the best balance of:1211. **ACID compliance** essential for e-commerce transactions1222. **Capabilities** (built-in full-text search/JSONB plus the PostGIS extension) reduce123 infrastructure complexity1243. **Team familiarity** with SQL databases reduces learning curve1254. **Mature ecosystem** with excellent tooling and community support126127The slight complexity in replication is outweighed by the reduction in128additional services (no separate Elasticsearch needed).129130## Consequences131132### Positive133- Single database handles transactions, search, and geospatial queries134- Reduced operational complexity (fewer services to manage)135- Strong consistency guarantees for financial data136- Team can leverage existing SQL expertise137138### Negative139- Need to learn PostgreSQL-specific features (JSONB, full-text search syntax)140- Vertical scaling limits may require read replicas sooner141- Some team members need PostgreSQL-specific training142143### Risks144- Full-text search may not scale as well as dedicated search engines145- Mitigation: Design for potential Elasticsearch addition if needed146147## Implementation Notes148149- Use JSONB for flexible product attributes150- Implement connection pooling with PgBouncer151- Set up streaming replication for read replicas152- Use pg_trgm extension for fuzzy search153154## Related Decisions155156- ADR-0002: Caching Strategy (Redis) - complements database choice157- ADR-0005: Search Architecture - may supersede if Elasticsearch needed158159## References160161- [PostgreSQL JSON Documentation](https://www.postgresql.org/docs/current/datatype-json.html)162- [PostgreSQL Full Text Search](https://www.postgresql.org/docs/current/textsearch.html)163- Internal: Performance benchmarks in `/docs/benchmarks/database-comparison.md`164```