Guide decision-making using principles and trade-off analysis frameworks. Use when making technical decisions, evaluating alternatives, designing solutions, or choosing between options...
Guide systematic decision-making and establish principles that automate future decisions.
Instead of making individual decisions repeatedly, establish principles that automate future decisions.
Your day is filled with decisions:
But: Most decisions you make shouldn't require your judgment every time.
One principle can guide a thousand decisions.
ā Repeated Decision: "Should we use library X?"
(Asked every time a new library is needed)
ā
Principle Established: "Use libraries with:
- 1000+ GitHub stars
- Active maintenance (commit in last 3 months)
- Compatible license (MIT/Apache2)
- Clear documentation"
(Applies to all future library choices automatically)
| Short-term Decision | Long-term Principle |
|---|---|
| "What should this variable be named?" | "Naming convention: camelCase for variables, PascalCase for classes" |
| "What should this API return?" | "API design principle: Always return consistent format {data, error, meta}" |
| "How to refactor this code?" | "Refactoring principle: Refactor when complexity >10 or duplication >3" |
One decision ā Thousand judgments automated
Questions to answer:
Template:
## Decision Context
**Decision**: [What we need to decide]
**Why**: [Problem or opportunity]
**Constraints**:
- Budget: [amount]
- Timeline: [deadline]
- Resources: [team, skills]
- Compliance: [regulations]
**Stakeholders**: [who is affected]
**Lifespan**: [how long this matters]
List all viable options (minimum 2, ideally 3-5):
## Alternatives
1. **Option A**: [name and brief description]
2. **Option B**: [name and brief description]
3. **Option C**: [name and brief description]
4. **Status Quo**: [do nothing / keep current]
Example:
1. PostgreSQL (RDBMS with ACID)
2. MongoDB (Document store, flexible schema)
3. DynamoDB (Managed NoSQL, AWS-specific)
4. Status Quo (Current MySQL setup)
Common criteria:
Assign weights: High (3), Medium (2), Low (1)
## Evaluation Criteria
| Criterion | Weight | Why Important |
|-----------|--------|---------------|
| Performance | High | Customer SLA: <200ms response |
| Maintainability | High | Team of 5 must maintain |
| Cost | Medium | Budget: $5K/month |
| Time to market | High | 2-month deadline |
Score 0-10 for each criterion with rationale.
## Trade-off Analysis
| Criterion | Weight | PostgreSQL | MongoDB | DynamoDB |
|-----------|--------|-----------|---------|----------|
| Performance | High (3) | 8/10 | 6/10 | 9/10 |
| Maintainability | High (3) | 6/10 | 9/10 | 5/10 |
| Cost | Medium (2) | 7/10 | 5/10 | 6/10 |
| Time to market | High (3) | 8/10 | 7/10 | 9/10 |
**Weighted Scores**:
- PostgreSQL: (8Ć3 + 6Ć3 + 7Ć2 + 8Ć3) / (3+3+2+3) = 7.3
- MongoDB: (6Ć3 + 9Ć3 + 5Ć2 + 7Ć3) / 11 = 6.8
- DynamoDB: (9Ć3 + 5Ć3 + 6Ć2 + 9Ć3) / 11 = 7.5
For each score, explain why:
## Detailed Evaluation
### PostgreSQL
**Performance: 8/10**
- Handles 10K writes/sec (requirement: 5K)
- P95 latency 50ms (requirement: <200ms)
- Proven at scale
**Maintainability: 6/10**
- Team has 3 years experience ā
- Mature ecosystem ā
- BUT: Complex replication setup
- BUT: Requires DBA expertise
**Cost: 7/10**
- RDS: $1200/mo + backups $300/mo = $1500/mo
- Over budget ($1000/mo) but justified by reliability
[Continue for all criteria...]
## Recommendation
**Recommended**: PostgreSQL
**Rationale**:
1. Meets critical performance requirements with margin
2. Team familiarity reduces implementation risk
3. Cost overrun ($500/mo) justified by:
- Reduced downtime risk (current: $5K/incident)
- Faster development (saves 1 month = $50K labor)
4. ACID compliance critical for financial data
**Trade-offs Accepted**:
- Higher cost than alternatives
- More complex operations
- **Mitigation**: Train 2 team members on PostgreSQL
**Next Steps**:
1. Prototype with RDS PostgreSQL (1 week)
2. Load testing with production data
3. Team training on best practices
4. Final decision by [date]
If this decision represents a broader pattern, establish a principle:
## Principle: [Short, Memorable Name]
**Context**: [When does this apply?]
**Statement**: [Clear, actionable principle]
**Rationale**: [Why this principle exists]
**Application**:
1. [How to apply in practice]
2. [Decision criteria]
**Examples**:
ā
**Good**: [Concrete example following principle]
ā **Bad**: [Concrete example violating principle]
**Exceptions**: [When NOT to apply]
**Related Principles**: [Other relevant principles]
## Principle: Database Selection for OLTP
**Context**: Choosing database for transactional workloads with ACID requirements
**Statement**: Use PostgreSQL as default unless specific requirements dictate otherwise
**Rationale**:
- Team expertise (5 years experience)
- ACID compliance
- Proven at scale
- Rich ecosystem
- Avoid decision fatigue
**Application**:
1. Start with PostgreSQL
2. Switch only if:
- Write throughput >50K/sec ā Cassandra
- Document-heavy, flexible schema ā MongoDB
- Time-series data ā TimescaleDB
- Simple key-value ā Redis
**Examples**:
ā
**Good**: User service needs ACID + complex joins ā PostgreSQL
ā **Bad**: Analytics with time-series data ā Should use TimescaleDB
**Exceptions**:
- Greenfield project with no ACID requirements
- Team has no PostgreSQL experience
- Graph queries needed ā Neo4j
**Related Principles**:
- "Choose boring technology"
- "Optimize for team expertise"
See FRAMEWORKS.md for detailed templates.
Systematically compare alternatives with weighted criteria.
Decision tree for build vs buy decisions:
Evaluate new technologies:
Guide for optimization decisions:
Quantify and prioritize risks:
After making a decision, document it:
Use doc-templates skill to create an ADR for this decision
User: "I'm choosing between PostgreSQL and MongoDB for a new service"
Skill response:
Let's use the decision framework to guide this choice.
## Step 1: Decision Context
What are your requirements?
- ACID compliance needed?
- Query complexity (simple key-value vs complex joins)?
- Expected scale (reads/writes per second)?
- Team expertise?
## Step 2: Evaluation Criteria
Based on typical database decisions, key criteria:
- ACID compliance (if needed)
- Query capabilities
- Scale requirements
- Team expertise
- Operational complexity
[Guide through steps 3-6...]
User: "Should we build custom authentication or use Auth0?"
Skill response:
This is a classic Build vs Buy decision. Let's apply the framework:
## Core Competency Check
- Is authentication your core business value? [ ] Yes [ ] No
- Does custom auth provide competitive advantage? [ ] Yes [ ] No
- Do you have deep security expertise in-house? [ ] Yes [ ] No
If mostly "No", lean toward Buy (Auth0).
## Available Solutions
| Solution | Pros | Cons | Cost |
|----------|------|------|------|
| Auth0 | Proven security, low maintenance | Vendor lock-in | $200/mo |
| AWS Cognito | AWS integration, cheap | Limited features | $50/mo |
| Build Custom | Full control | High maintenance, security risk | $50K initial + $10K/mo |
[Continue analysis...]
## Recommendation
**Buy** (Auth0) because:
- Not core competency (unless you're an auth company)
- Security-critical (don't build yourself)
- Cost justified by reduced risk
Common principles for quick reference:
Choose Boring Technology
Optimize for Team Expertise
Measure Before Optimizing
Fail Fast, Fail Loudly
Test First
Review Everything
Automate Toil
Loose Coupling, High Cohesion
Data at Rest, Logic in Code
Explicit Over Implicit
A well-guided decision includes:
After making a decision:
doc-templates