Architecture Decision Framework
"Requirements drive architecture. Trade-offs inform decisions. ADRs capture rationale."
🎯 Selective Reading Rule
Read ONLY files relevant to the request! Check the content map, find what you need.
| File |
Description |
When to Read |
context-discovery.md |
Questions to ask, project classification |
Starting architecture design |
trade-off-analysis.md |
ADR templates, trade-off framework |
Documenting decisions |
pattern-selection.md |
Decision trees, anti-patterns |
Choosing patterns |
examples.md |
MVP, SaaS, Enterprise examples |
Reference implementations |
patterns-reference.md |
Quick lookup for patterns |
Pattern comparison |
🔗 Related Skills
| Skill |
Use For |
@[skills/database-design] |
Database schema design |
@[skills/api-patterns] |
API design patterns |
@[skills/deployment-procedures] |
Deployment architecture |
Core Principle
"Simplicity is the ultimate sophistication."
- Start simple
- Add complexity ONLY when proven necessary
- You can always add patterns later
- Removing complexity is MUCH harder than adding it
📐 System Design Template (Staff Level)
Don't start with boxes. Start with math and requirements.
- Requirements & Constraints
- Functional: "User clips video", "System generates subtitles"
- Non-Functional: "Wait time < 20s", "99.9% Availability", "Budget < $500/mo"
- Back-of-Envelope Math (Capacity)
- Formula: $QPS = DailyActiveUsers \times ActionsPerUser / 86400$
- Formula: $Storage = WritesPerDay \times SizePerWrite \times RetentionDays$
- Example: 10k users, 2GB videos = 20TB storage? -> S3 Cold Storage needed.
- High-Level Design (The "Blob" Phase)
- Client -> API Gateway -> Service -> DB.
- Validate against constraints (Will single DB handle calc QPS? No -> Read Replica).
- Detailed Design (The "Hard Parts")
- "How exactly do we handle the video processing failure?" (Dead Letter Queue + Retry)
- "How do we handle 1 million users?" (Sharding vs Partitioning)
⚖️ Decision Matrix (Trade-off Guide)
| Style |
Good For |
Bad For |
Complexities |
| Monolith |
Speed, Simplicity, small/med teams |
Independent scaling, Large teams |
Tight coupling |
| Microservices |
Independent scaling, Polyglot, 100+ devs |
Complexity, Latency, Data consistency |
Distrib. Tracing, Eventual Consistency |
| Serverless |
Spiky traffic, Low ops, Event-driven |
Long-running tasks, Cold starts |
Vendor lock-in, Debugging |
📊 Capacity Planning Cheatsheet
- QPS to Servers: $Servers = TargetQPS / (SingleCoreQPS \times Cores \times UtilizationFactor)$
- Bandwidth: $Mbps = TotalBytesPerSec * 8 / 1,000,000$
- Database: Read-heavy? Cache/Replica. Write-heavy? Sharding/Queue-buffering.
Validation Checklist
Before finalizing architecture:
1---2name: architecture3description: Architectural decision-making framework. Requirements analysis, trade-off evaluation, ADR documentation. Use when making architecture decisions or analyzing system design.4---56# Architecture Decision Framework78> "Requirements drive architecture. Trade-offs inform decisions. ADRs capture rationale."910## 🎯 Selective Reading Rule1112**Read ONLY files relevant to the request!** Check the content map, find what you need.1314| File | Description | When to Read |15|------|-------------|--------------|16| `context-discovery.md` | Questions to ask, project classification | Starting architecture design |17| `trade-off-analysis.md` | ADR templates, trade-off framework | Documenting decisions |18| `pattern-selection.md` | Decision trees, anti-patterns | Choosing patterns |19| `examples.md` | MVP, SaaS, Enterprise examples | Reference implementations |20| `patterns-reference.md` | Quick lookup for patterns | Pattern comparison |2122---2324## 🔗 Related Skills2526| Skill | Use For |27|-------|---------|28| `@[skills/database-design]` | Database schema design |29| `@[skills/api-patterns]` | API design patterns |30| `@[skills/deployment-procedures]` | Deployment architecture |3132---3334## Core Principle3536**"Simplicity is the ultimate sophistication."**3738- Start simple39- Add complexity ONLY when proven necessary40- You can always add patterns later41- Removing complexity is MUCH harder than adding it4243---4445## 📐 System Design Template (Staff Level)4647**Don't start with boxes. Start with math and requirements.**48491. **Requirements & Constraints**50 - Functional: "User clips video", "System generates subtitles"51 - Non-Functional: "Wait time < 20s", "99.9% Availability", "Budget < $500/mo"522. **Back-of-Envelope Math (Capacity)**53 - *Formula:* $QPS = DailyActiveUsers \times ActionsPerUser / 86400$54 - *Formula:* $Storage = WritesPerDay \times SizePerWrite \times RetentionDays$55 - *Example:* 10k users, 2GB videos = 20TB storage? -> S3 Cold Storage needed.563. **High-Level Design (The "Blob" Phase)**57 - Client -> API Gateway -> Service -> DB.58 - Validate against constraints (Will single DB handle calc QPS? No -> Read Replica).594. **Detailed Design (The "Hard Parts")**60 - "How exactly do we handle the video processing failure?" (Dead Letter Queue + Retry)61 - "How do we handle 1 million users?" (Sharding vs Partitioning)6263## ⚖️ Decision Matrix (Trade-off Guide)6465| Style | Good For | Bad For | Complexities |66|-------|----------|---------|--------------|67| **Monolith** | Speed, Simplicity, small/med teams | Independent scaling, Large teams | Tight coupling |68| **Microservices** | Independent scaling, Polyglot, 100+ devs | Complexity, Latency, Data consistency | Distrib. Tracing, Eventual Consistency |69| **Serverless** | Spiky traffic, Low ops, Event-driven | Long-running tasks, Cold starts | Vendor lock-in, Debugging |7071## 📊 Capacity Planning Cheatsheet7273- **QPS to Servers:** $Servers = TargetQPS / (SingleCoreQPS \times Cores \times UtilizationFactor)$74- **Bandwidth:** $Mbps = TotalBytesPerSec * 8 / 1,000,000$75- **Database:** Read-heavy? Cache/Replica. Write-heavy? Sharding/Queue-buffering.7677## Validation Checklist7879Before finalizing architecture:8081- [ ] Requirements clearly understood82- [ ] Constraints identified83- [ ] Each decision has trade-off analysis84- [ ] Simpler alternatives considered85- [ ] ADRs written for significant decisions86- [ ] Team expertise matches chosen patterns