@wipal/agent-team 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/rules/common/general-rules.md +141 -0
- package/.claude/rules/lessons/lessons.md +91 -0
- package/.claude/rules/role-rules/dev-fe-rules.md +146 -0
- package/.claude/rules/role-rules/sa-rules.md +226 -0
- package/.claude/skills/SKILL-INDEX.md +299 -0
- package/.claude/skills/community/security-validator/SKILL.md +392 -0
- package/.claude/skills/core/agent-creation/SKILL.md +338 -0
- package/.claude/skills/core/code-review/SKILL.md +154 -0
- package/.claude/skills/core/git-automation/SKILL.md +93 -0
- package/.claude/skills/core/retrospect-work/SKILL.md +172 -0
- package/.claude/skills/domain/architecture/adr-writing/SKILL.md +254 -0
- package/.claude/skills/domain/architecture/adr-writing/references/adr-best-practices.md +257 -0
- package/.claude/skills/domain/architecture/adr-writing/references/adr-examples.md +246 -0
- package/.claude/skills/domain/architecture/adr-writing/references/adr-template.md +160 -0
- package/.claude/skills/domain/architecture/architecture-patterns/SKILL.md +316 -0
- package/.claude/skills/domain/architecture/architecture-patterns/references/event-driven.md +393 -0
- package/.claude/skills/domain/architecture/architecture-patterns/references/microservices.md +315 -0
- package/.claude/skills/domain/architecture/architecture-patterns/references/monolith.md +321 -0
- package/.claude/skills/domain/architecture/architecture-patterns/references/serverless.md +457 -0
- package/.claude/skills/domain/architecture/performance-engineering/SKILL.md +227 -0
- package/.claude/skills/domain/architecture/performance-engineering/references/benchmarking.md +336 -0
- package/.claude/skills/domain/architecture/performance-engineering/references/caching-strategies.md +284 -0
- package/.claude/skills/domain/architecture/performance-engineering/references/optimization.md +298 -0
- package/.claude/skills/domain/architecture/security-architecture/SKILL.md +206 -0
- package/.claude/skills/domain/architecture/security-architecture/references/auth-patterns.md +209 -0
- package/.claude/skills/domain/architecture/security-architecture/references/compliance.md +246 -0
- package/.claude/skills/domain/architecture/security-architecture/references/threat-modeling.md +219 -0
- package/.claude/skills/domain/architecture/system-design/SKILL.md +227 -0
- package/.claude/skills/domain/architecture/system-design/references/distributed-systems.md +231 -0
- package/.claude/skills/domain/architecture/system-design/references/resilience.md +344 -0
- package/.claude/skills/domain/architecture/system-design/references/scalability.md +303 -0
- package/.claude/skills/domain/architecture/tech-selection/SKILL.md +192 -0
- package/.claude/skills/domain/architecture/tech-selection/references/build-vs-buy.md +258 -0
- package/.claude/skills/domain/architecture/tech-selection/references/evaluation-framework.md +203 -0
- package/.claude/skills/domain/architecture/tech-selection/references/tech-radar.md +257 -0
- package/.claude/skills/domain/backend/api-design/SKILL.md +121 -0
- package/.claude/skills/domain/backend/database-design/SKILL.md +156 -0
- package/.claude/skills/domain/backend/performance-be/SKILL.md +210 -0
- package/.claude/skills/domain/backend/security/SKILL.md +138 -0
- package/.claude/skills/domain/backend/testing-be/SKILL.md +203 -0
- package/.claude/skills/domain/devops/ci-cd/SKILL.md +188 -0
- package/.claude/skills/domain/devops/containerization/SKILL.md +177 -0
- package/.claude/skills/domain/devops/deployment/SKILL.md +198 -0
- package/.claude/skills/domain/devops/infrastructure-as-code/SKILL.md +178 -0
- package/.claude/skills/domain/devops/monitoring/SKILL.md +163 -0
- package/.claude/skills/domain/frontend/accessibility/SKILL.md +179 -0
- package/.claude/skills/domain/frontend/frontend-design/SKILL.md +138 -0
- package/.claude/skills/domain/frontend/performance-fe/SKILL.md +195 -0
- package/.claude/skills/domain/frontend/state-management/SKILL.md +190 -0
- package/.claude/skills/domain/frontend/testing-fe/SKILL.md +193 -0
- package/.claude/skills/domain/product/requirements-gathering/SKILL.md +136 -0
- package/.claude/skills/domain/product/roadmap-planning/SKILL.md +169 -0
- package/.claude/skills/domain/product/sprint-planning/SKILL.md +151 -0
- package/.claude/skills/domain/product/stakeholder-communication/SKILL.md +162 -0
- package/.claude/skills/domain/product/user-stories/SKILL.md +141 -0
- package/.claude/skills/domain/quality/bug-reporting/SKILL.md +150 -0
- package/.claude/skills/domain/quality/regression-testing/SKILL.md +178 -0
- package/.claude/skills/domain/quality/test-automation/SKILL.md +185 -0
- package/.claude/skills/domain/quality/test-planning/SKILL.md +177 -0
- package/.claude/skills/leadership/code-review-advanced/SKILL.md +167 -0
- package/.claude/skills/leadership/mentoring/SKILL.md +151 -0
- package/.claude/skills/leadership/technical-debt/SKILL.md +166 -0
- package/.claude/skills/leadership/technical-decision/SKILL.md +160 -0
- package/.claude/skills/security-reports/.gitkeep +0 -0
- package/.claude/skills/skills-registry.yaml +441 -0
- package/README.md +232 -0
- package/bin/agent-team.js +107 -0
- package/package.json +51 -0
- package/src/commands/add.js +227 -0
- package/src/commands/init.js +136 -0
- package/src/commands/list.js +66 -0
- package/src/commands/remove.js +71 -0
- package/src/commands/switch.js +53 -0
- package/src/index.js +11 -0
- package/src/interactive/prompts.js +153 -0
- package/src/server/api/agents.js +150 -0
- package/src/server/api/roles.js +97 -0
- package/src/server/api/skills.js +79 -0
- package/src/server/index.js +78 -0
- package/src/ui/agents.html +174 -0
- package/src/ui/css/styles.css +470 -0
- package/src/ui/index.html +107 -0
- package/src/ui/roles.html +371 -0
- package/src/ui/skills.html +332 -0
- package/src/utils/file-utils.js +193 -0
- package/src/utils/skill-resolver.js +594 -0
- package/src/utils/skill-scanner.js +154 -0
- package/templates/CLAUDE.md.tmpl +42 -0
- package/templates/knowledge.md.tmpl +31 -0
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: retrospect-work
|
|
3
|
+
description: |
|
|
4
|
+
Extract patterns and lessons from work sessions for continuous self-improvement.
|
|
5
|
+
Use this skill when: ending a work session, after receiving user corrections,
|
|
6
|
+
after completing a feature, after fixing a bug, at end of day/week, or when
|
|
7
|
+
user says "retrospect", "what did we learn", "update knowledge".
|
|
8
|
+
This skill MUST run before ending any significant work session.
|
|
9
|
+
version: 1.0.0
|
|
10
|
+
category: core
|
|
11
|
+
tags:
|
|
12
|
+
- self-improvement
|
|
13
|
+
- learning
|
|
14
|
+
- knowledge-extraction
|
|
15
|
+
depends_on: []
|
|
16
|
+
recommends: []
|
|
17
|
+
used_by:
|
|
18
|
+
- code-review
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
# Skill: Retrospect Work
|
|
22
|
+
|
|
23
|
+
## Core Principle
|
|
24
|
+
**Learn from every session. If you don't extract lessons, you'll repeat mistakes.**
|
|
25
|
+
|
|
26
|
+
The difference between a junior and senior developer isn't just years of experience—it's how much they learn from each experience.
|
|
27
|
+
|
|
28
|
+
## When to Use
|
|
29
|
+
|
|
30
|
+
| Trigger | Example |
|
|
31
|
+
|---------|---------|
|
|
32
|
+
| End of work session | "That's all for today" |
|
|
33
|
+
| User correction | "No, use X instead" |
|
|
34
|
+
| Feature complete | "Done with the login page" |
|
|
35
|
+
| Bug fixed | "Fixed the null pointer issue" |
|
|
36
|
+
| User request | "/retrospect" or "what did we learn?" |
|
|
37
|
+
|
|
38
|
+
## Hard Rules
|
|
39
|
+
|
|
40
|
+
1. **NEVER auto-commit changes** - Always get user confirmation
|
|
41
|
+
2. **NEVER skip after corrections** - User corrections are gold, extract lessons immediately
|
|
42
|
+
3. **ALWAYS propose specific changes** - Show exactly what to add/update
|
|
43
|
+
4. **ALWAYS explain WHY** - Not just what, but why it matters
|
|
44
|
+
|
|
45
|
+
## Steps
|
|
46
|
+
|
|
47
|
+
### Step 1: Analyze Session (30 seconds)
|
|
48
|
+
Quick scan of what happened:
|
|
49
|
+
- What tasks were completed?
|
|
50
|
+
- What approaches were used?
|
|
51
|
+
- What challenges arose?
|
|
52
|
+
- Any user corrections?
|
|
53
|
+
|
|
54
|
+
### Step 2: Identify Patterns
|
|
55
|
+
Look for these pattern types:
|
|
56
|
+
|
|
57
|
+
| Pattern Type | Signal | Action |
|
|
58
|
+
|--------------|--------|--------|
|
|
59
|
+
| **Success** | Worked well, felt smooth | Add to best practices |
|
|
60
|
+
| **Pitfall** | Caused issues, wasted time | Add to anti-patterns |
|
|
61
|
+
| **Correction** | User said "no, do X" | Extract as rule |
|
|
62
|
+
| **Discovery** | Learned something new | Add to knowledge |
|
|
63
|
+
|
|
64
|
+
### Step 3: Extract Lessons
|
|
65
|
+
For each significant finding:
|
|
66
|
+
|
|
67
|
+
```markdown
|
|
68
|
+
### YYYY-MM-DD: [Lesson Title]
|
|
69
|
+
**What happened:** [1-2 sentences]
|
|
70
|
+
**Context:** [When/where]
|
|
71
|
+
**Lesson:** [What to remember]
|
|
72
|
+
**Rule:** [If applicable, rule to add]
|
|
73
|
+
**Code:** (if applicable)
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Step 4: Propose Updates
|
|
77
|
+
Show specific changes:
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
📁 Proposed Updates:
|
|
81
|
+
|
|
82
|
+
knowledge.md:
|
|
83
|
+
+ ## Pattern: [Name]
|
|
84
|
+
+ [Description]
|
|
85
|
+
|
|
86
|
+
lessons.md:
|
|
87
|
+
+ ### [Date]: [Title]
|
|
88
|
+
+ [Lesson content]
|
|
89
|
+
|
|
90
|
+
Apply? [y/n/edit]:
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Common Mistakes
|
|
94
|
+
|
|
95
|
+
| ❌ Mistake | ✅ Fix |
|
|
96
|
+
|------------|--------|
|
|
97
|
+
| Vague lessons ("be careful") | Specific rules ("always check null") |
|
|
98
|
+
| Auto-committing | Always ask for confirmation |
|
|
99
|
+
| Skipping after easy session | Even easy sessions have learnings |
|
|
100
|
+
| Too many lessons at once | Focus on top 2-3 most impactful |
|
|
101
|
+
| Only capturing failures | Capture successes too |
|
|
102
|
+
|
|
103
|
+
## Output Format
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
═══════════════════════════════════════════════════════════════
|
|
107
|
+
🧠 RETROSPECT: [Session Topic]
|
|
108
|
+
═══════════════════════════════════════════════════════════════
|
|
109
|
+
|
|
110
|
+
📋 Completed:
|
|
111
|
+
- [Task 1]
|
|
112
|
+
- [Task 2]
|
|
113
|
+
|
|
114
|
+
✅ Patterns That Worked:
|
|
115
|
+
1. [Pattern] → [Why it worked]
|
|
116
|
+
|
|
117
|
+
⚠️ Issues & Corrections:
|
|
118
|
+
1. [Issue] → [Resolution]
|
|
119
|
+
|
|
120
|
+
📝 Lessons to Capture:
|
|
121
|
+
1. [Lesson] → [Rule to add]
|
|
122
|
+
|
|
123
|
+
📁 Proposed Updates:
|
|
124
|
+
- knowledge.md: +[pattern name]
|
|
125
|
+
- lessons.md: +[lesson title]
|
|
126
|
+
|
|
127
|
+
Apply these changes? [y/n]:
|
|
128
|
+
═══════════════════════════════════════════════════════════════
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Pattern Promotion Lifecycle
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
Lesson (new finding)
|
|
135
|
+
↓ Used 3+ times
|
|
136
|
+
Pattern (reusable approach)
|
|
137
|
+
↓ High confidence, 5+ uses
|
|
138
|
+
Skill (codified process)
|
|
139
|
+
↓ Proven reliable, 10+ uses
|
|
140
|
+
Rule (hard requirement)
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Example
|
|
144
|
+
|
|
145
|
+
**Session:** Implementing payment form
|
|
146
|
+
|
|
147
|
+
```
|
|
148
|
+
🧠 RETROSPECT: payment-form implementation
|
|
149
|
+
|
|
150
|
+
✅ Patterns That Worked:
|
|
151
|
+
1. Zod + react-hook-form → Type-safe, great DX
|
|
152
|
+
|
|
153
|
+
⚠️ Issues & Corrections:
|
|
154
|
+
1. User corrected: "Add loading state"
|
|
155
|
+
→ Added isSubmitting state
|
|
156
|
+
|
|
157
|
+
📝 Lessons to Capture:
|
|
158
|
+
1. Always add loading state BEFORE async calls
|
|
159
|
+
Rule: "Loading state is not optional"
|
|
160
|
+
|
|
161
|
+
📁 Proposed Updates:
|
|
162
|
+
- knowledge.md: +Zod validation pattern
|
|
163
|
+
- lessons.md: +Loading state lesson
|
|
164
|
+
|
|
165
|
+
Apply? [y/n]:
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## Integration
|
|
169
|
+
|
|
170
|
+
- After **code-review**: Extract review patterns
|
|
171
|
+
- After **debugging**: Document debugging approach
|
|
172
|
+
- After **git-automation**: Commit learning updates
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: adr-writing
|
|
3
|
+
description: |
|
|
4
|
+
Use when documenting architecture decisions. Architecture Decision Records (ADRs)
|
|
5
|
+
capture the context, decision, and consequences of important technical choices.
|
|
6
|
+
version: 1.0.0
|
|
7
|
+
category: documentation
|
|
8
|
+
tags:
|
|
9
|
+
- adr
|
|
10
|
+
- architecture-decisions
|
|
11
|
+
- documentation
|
|
12
|
+
dependencies: []
|
|
13
|
+
references:
|
|
14
|
+
- references/adr-template.md
|
|
15
|
+
- references/adr-examples.md
|
|
16
|
+
- references/adr-best-practices.md
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
# ADR Writing
|
|
20
|
+
|
|
21
|
+
## Core Principle
|
|
22
|
+
**Document decisions, not just code. Every significant choice deserves a record.**
|
|
23
|
+
|
|
24
|
+
## When to Use This Skill
|
|
25
|
+
|
|
26
|
+
### Trigger Conditions
|
|
27
|
+
- Making a significant architectural decision
|
|
28
|
+
- Choosing between technologies
|
|
29
|
+
- Changing an existing decision
|
|
30
|
+
- Evaluating trade-offs
|
|
31
|
+
- Need to justify a decision to stakeholders
|
|
32
|
+
|
|
33
|
+
### Keywords
|
|
34
|
+
- "we decided to"
|
|
35
|
+
- "architecture decision"
|
|
36
|
+
- "why did we choose"
|
|
37
|
+
- "document this decision"
|
|
38
|
+
- "ADR"
|
|
39
|
+
|
|
40
|
+
## What is an ADR?
|
|
41
|
+
|
|
42
|
+
An Architecture Decision Record is a short document that captures:
|
|
43
|
+
1. **Context** - Why are we making this decision?
|
|
44
|
+
2. **Decision** - What is the change?
|
|
45
|
+
3. **Consequences** - What happens as a result?
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
ADR-001: Use PostgreSQL for Primary Database
|
|
49
|
+
|
|
50
|
+
Status: Accepted
|
|
51
|
+
|
|
52
|
+
Context:
|
|
53
|
+
We need a relational database that supports ACID transactions...
|
|
54
|
+
|
|
55
|
+
Decision:
|
|
56
|
+
We will use PostgreSQL as our primary database...
|
|
57
|
+
|
|
58
|
+
Consequences:
|
|
59
|
+
- Team needs PostgreSQL expertise
|
|
60
|
+
- We get strong consistency guarantees
|
|
61
|
+
- Limited horizontal scaling compared to NoSQL...
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## ADR Template
|
|
65
|
+
|
|
66
|
+
```markdown
|
|
67
|
+
# ADR-XXX: [Short Title]
|
|
68
|
+
|
|
69
|
+
## Status
|
|
70
|
+
[Proposed | Accepted | Deprecated | Superseded by ADR-YYY]
|
|
71
|
+
|
|
72
|
+
## Context
|
|
73
|
+
[What is the issue that we're seeing?]
|
|
74
|
+
[What is the business context?]
|
|
75
|
+
[What are the constraints?]
|
|
76
|
+
[What options were considered?]
|
|
77
|
+
|
|
78
|
+
## Decision
|
|
79
|
+
[What is the change that we're proposing/have made?]
|
|
80
|
+
[Be specific and concrete.]
|
|
81
|
+
|
|
82
|
+
## Consequences
|
|
83
|
+
|
|
84
|
+
### Positive
|
|
85
|
+
- [What becomes easier?]
|
|
86
|
+
- [What benefits do we get?]
|
|
87
|
+
|
|
88
|
+
### Negative
|
|
89
|
+
- [What becomes harder?]
|
|
90
|
+
- [What trade-offs are we making?]
|
|
91
|
+
|
|
92
|
+
### Risks
|
|
93
|
+
- [What could go wrong?]
|
|
94
|
+
- [What mitigations exist?]
|
|
95
|
+
|
|
96
|
+
## Alternatives Considered
|
|
97
|
+
1. **Option A**: [Description]
|
|
98
|
+
- Pros: ...
|
|
99
|
+
- Cons: ...
|
|
100
|
+
- Why not chosen: ...
|
|
101
|
+
|
|
102
|
+
2. **Option B**: [Description]
|
|
103
|
+
- Pros: ...
|
|
104
|
+
- Cons: ...
|
|
105
|
+
- Why not chosen: ...
|
|
106
|
+
|
|
107
|
+
## Related Decisions
|
|
108
|
+
- ADR-XXX: [Related decision]
|
|
109
|
+
- ADR-YYY: [Depends on]
|
|
110
|
+
|
|
111
|
+
## References
|
|
112
|
+
- [Link to relevant documentation]
|
|
113
|
+
- [Link to discussion]
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Decision Categories
|
|
117
|
+
|
|
118
|
+
### When to Write an ADR
|
|
119
|
+
```
|
|
120
|
+
✅ Architecture decisions
|
|
121
|
+
- System structure
|
|
122
|
+
- Service boundaries
|
|
123
|
+
- Data flow patterns
|
|
124
|
+
|
|
125
|
+
✅ Technology choices
|
|
126
|
+
- Frameworks
|
|
127
|
+
- Databases
|
|
128
|
+
- Cloud services
|
|
129
|
+
|
|
130
|
+
✅ Security decisions
|
|
131
|
+
- Authentication approach
|
|
132
|
+
- Encryption strategy
|
|
133
|
+
- Access control model
|
|
134
|
+
|
|
135
|
+
✅ Performance decisions
|
|
136
|
+
- Caching strategy
|
|
137
|
+
- Scaling approach
|
|
138
|
+
- Database sharding
|
|
139
|
+
|
|
140
|
+
✅ Process decisions
|
|
141
|
+
- Deployment strategy
|
|
142
|
+
- Testing approach
|
|
143
|
+
- Code organization
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### When NOT to Write an ADR
|
|
147
|
+
```
|
|
148
|
+
❌ Trivial decisions (variable naming)
|
|
149
|
+
❌ Reversible decisions (temporary workaround)
|
|
150
|
+
❌ Team-specific conventions (coding style)
|
|
151
|
+
❌ Decisions already documented elsewhere
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## ADR Lifecycle
|
|
155
|
+
|
|
156
|
+
```
|
|
157
|
+
┌──────────────────────────────────────────────────────┐
|
|
158
|
+
│ ADR Lifecycle │
|
|
159
|
+
├──────────────────────────────────────────────────────┤
|
|
160
|
+
│ │
|
|
161
|
+
│ ┌──────────┐ │
|
|
162
|
+
│ │ Proposed │ ─── Write initial ADR │
|
|
163
|
+
│ └────┬─────┘ │
|
|
164
|
+
│ │ │
|
|
165
|
+
│ │ Team review, discussion │
|
|
166
|
+
│ ▼ │
|
|
167
|
+
│ ┌──────────┐ │
|
|
168
|
+
│ │ Accepted │ ─── Decision is active │
|
|
169
|
+
│ └────┬─────┘ │
|
|
170
|
+
│ │ │
|
|
171
|
+
│ │ Context changes, better option found │
|
|
172
|
+
│ ▼ │
|
|
173
|
+
│ ┌───────────┐ │
|
|
174
|
+
│ │Deprecated │ ─── No longer recommended │
|
|
175
|
+
│ └─────┬─────┘ but still in use │
|
|
176
|
+
│ │ │
|
|
177
|
+
│ │ Replacement decision made │
|
|
178
|
+
│ ▼ │
|
|
179
|
+
│ ┌────────────┐ │
|
|
180
|
+
│ │ Superseded │ ─── Replaced by new ADR │
|
|
181
|
+
│ │ by ADR-YYY │ Reference new ADR │
|
|
182
|
+
│ └────────────┘ │
|
|
183
|
+
│ │
|
|
184
|
+
└──────────────────────────────────────────────────────┘
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
## Best Practices
|
|
188
|
+
|
|
189
|
+
### Writing Style
|
|
190
|
+
```
|
|
191
|
+
DO:
|
|
192
|
+
✅ Be concise (1-2 pages max)
|
|
193
|
+
✅ Use active voice
|
|
194
|
+
✅ Include concrete examples
|
|
195
|
+
✅ Document alternatives considered
|
|
196
|
+
✅ Update status over time
|
|
197
|
+
✅ Link related ADRs
|
|
198
|
+
✅ Include date and author
|
|
199
|
+
|
|
200
|
+
DON'T:
|
|
201
|
+
❌ Write lengthy documents
|
|
202
|
+
❌ Use vague language
|
|
203
|
+
❌ Skip alternatives
|
|
204
|
+
❌ Ignore negative consequences
|
|
205
|
+
❌ Leave status as "Proposed" forever
|
|
206
|
+
❌ Create orphan ADRs
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### Organization
|
|
210
|
+
```
|
|
211
|
+
Recommended structure:
|
|
212
|
+
|
|
213
|
+
docs/
|
|
214
|
+
└── architecture/
|
|
215
|
+
└── adr/
|
|
216
|
+
├── README.md # Index of all ADRs
|
|
217
|
+
├── ADR-001-database.md
|
|
218
|
+
├── ADR-002-auth.md
|
|
219
|
+
├── ADR-003-api-design.md
|
|
220
|
+
├── template.md
|
|
221
|
+
└── images/
|
|
222
|
+
└── ADR-001-diagram.png
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
## Rules
|
|
226
|
+
|
|
227
|
+
### DO
|
|
228
|
+
- ✅ Write ADR before major implementation
|
|
229
|
+
- ✅ Get peer review before accepting
|
|
230
|
+
- ✅ Include both pros and cons
|
|
231
|
+
- ✅ Keep ADRs in version control
|
|
232
|
+
- ✅ Review ADRs periodically
|
|
233
|
+
- ✅ Link to supporting documentation
|
|
234
|
+
|
|
235
|
+
### DON'T
|
|
236
|
+
- ❌ Write ADR after the fact (unless retroactive)
|
|
237
|
+
- ❌ Hide negative consequences
|
|
238
|
+
- ❌ Make ADRs too long
|
|
239
|
+
- ❌ Forget to update status
|
|
240
|
+
- ❌ Delete old ADRs (supersede instead)
|
|
241
|
+
|
|
242
|
+
## Output
|
|
243
|
+
|
|
244
|
+
When writing an ADR:
|
|
245
|
+
1. Create file: `docs/architecture/adr/ADR-XXX-title.md`
|
|
246
|
+
2. Update ADR index
|
|
247
|
+
3. Link from relevant documentation
|
|
248
|
+
4. Share with team for review
|
|
249
|
+
5. Update status after acceptance
|
|
250
|
+
|
|
251
|
+
## Related Skills
|
|
252
|
+
- `tech-selection` - Making technology choices
|
|
253
|
+
- `system-design` - System design decisions
|
|
254
|
+
- `architecture-patterns` - Pattern selection decisions
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
# ADR Best Practices
|
|
2
|
+
|
|
3
|
+
## Writing ADRs
|
|
4
|
+
|
|
5
|
+
### 1. Start with Context
|
|
6
|
+
```
|
|
7
|
+
Good context explains:
|
|
8
|
+
- What is the problem?
|
|
9
|
+
- Why does it matter?
|
|
10
|
+
- What constraints exist?
|
|
11
|
+
- Who is affected?
|
|
12
|
+
|
|
13
|
+
❌ Bad:
|
|
14
|
+
"We decided to use Kubernetes."
|
|
15
|
+
|
|
16
|
+
✅ Good:
|
|
17
|
+
"Our deployment process takes 4 hours and requires 3 people.
|
|
18
|
+
We deploy 5 times per week, spending 60 person-hours on deployments.
|
|
19
|
+
The business needs faster time-to-market for features."
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### 2. Be Specific in Decisions
|
|
23
|
+
```
|
|
24
|
+
❌ Bad:
|
|
25
|
+
"We'll use microservices."
|
|
26
|
+
|
|
27
|
+
✅ Good:
|
|
28
|
+
"We will split the application into 5 services:
|
|
29
|
+
1. User Service (authentication, profiles)
|
|
30
|
+
2. Order Service (order lifecycle)
|
|
31
|
+
3. Catalog Service (products, categories)
|
|
32
|
+
4. Inventory Service (stock management)
|
|
33
|
+
5. Notification Service (emails, SMS)
|
|
34
|
+
|
|
35
|
+
Communication: REST over HTTP
|
|
36
|
+
Data: Each service owns its database"
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### 3. Be Honest About Consequences
|
|
40
|
+
```
|
|
41
|
+
❌ Bad (hiding negatives):
|
|
42
|
+
"Consequences: Faster development, better scalability."
|
|
43
|
+
|
|
44
|
+
✅ Good (honest):
|
|
45
|
+
"Consequences:
|
|
46
|
+
Positive:
|
|
47
|
+
- Independent deployment
|
|
48
|
+
- Team autonomy
|
|
49
|
+
|
|
50
|
+
Negative:
|
|
51
|
+
- Operational complexity increases
|
|
52
|
+
- Debugging becomes harder
|
|
53
|
+
- Need for service mesh
|
|
54
|
+
|
|
55
|
+
Risks:
|
|
56
|
+
- Data consistency across services
|
|
57
|
+
- Network latency"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### 4. Document Alternatives
|
|
61
|
+
```
|
|
62
|
+
Always explain why alternatives were rejected:
|
|
63
|
+
|
|
64
|
+
Option 1: Build in-house
|
|
65
|
+
- Pros: Full control, no licensing
|
|
66
|
+
- Cons: 6 months development, ongoing maintenance
|
|
67
|
+
- Why not: Time to market critical, team bandwidth limited
|
|
68
|
+
|
|
69
|
+
Option 2: Buy existing solution
|
|
70
|
+
- Pros: Immediate availability, support
|
|
71
|
+
- Cons: $50k/year, customization limits
|
|
72
|
+
- Why not: Cost exceeds budget, overkill for needs
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## ADR Numbering
|
|
76
|
+
|
|
77
|
+
### Sequential Numbering
|
|
78
|
+
```
|
|
79
|
+
ADR-001: Database Selection
|
|
80
|
+
ADR-002: API Gateway Choice
|
|
81
|
+
ADR-003: Authentication Strategy
|
|
82
|
+
...
|
|
83
|
+
|
|
84
|
+
Simple and widely used.
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Category Prefixes (Alternative)
|
|
88
|
+
```
|
|
89
|
+
ADR-DB-001: Database Selection
|
|
90
|
+
ADR-API-001: API Gateway
|
|
91
|
+
ADR-SEC-001: Authentication
|
|
92
|
+
...
|
|
93
|
+
|
|
94
|
+
Good for large projects with many ADRs.
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## ADR Review Process
|
|
98
|
+
|
|
99
|
+
### Proposal Stage
|
|
100
|
+
```
|
|
101
|
+
1. Author writes ADR with "Proposed" status
|
|
102
|
+
2. Share with relevant stakeholders
|
|
103
|
+
3. Schedule review meeting (30 min)
|
|
104
|
+
4. Gather feedback
|
|
105
|
+
5. Iterate on ADR
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Acceptance
|
|
109
|
+
```
|
|
110
|
+
1. Decision makers approve
|
|
111
|
+
2. Update status to "Accepted"
|
|
112
|
+
3. Record decision date
|
|
113
|
+
4. Communicate to broader team
|
|
114
|
+
5. Begin implementation
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Rejection
|
|
118
|
+
```
|
|
119
|
+
If ADR is rejected:
|
|
120
|
+
1. Update status to "Rejected"
|
|
121
|
+
2. Document why rejected
|
|
122
|
+
3. Keep ADR for historical record
|
|
123
|
+
4. Don't delete - others may propose same thing
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Common Mistakes
|
|
127
|
+
|
|
128
|
+
### 1. Too Long
|
|
129
|
+
```
|
|
130
|
+
❌ Bad: 10-page ADR with implementation details
|
|
131
|
+
✅ Good: 1-2 pages, implementation in separate docs
|
|
132
|
+
|
|
133
|
+
Keep ADRs focused on the decision.
|
|
134
|
+
Details go in design docs.
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### 2. Missing Context
|
|
138
|
+
```
|
|
139
|
+
❌ Bad: "We chose Kafka."
|
|
140
|
+
(Why? What problem?)
|
|
141
|
+
|
|
142
|
+
✅ Good: "Our event pipeline needs to process 100k events/sec.
|
|
143
|
+
RabbitMQ maxes out at 50k. Kafka handles 1M+."
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### 3. No Alternatives
|
|
147
|
+
```
|
|
148
|
+
❌ Bad: Decision without alternatives
|
|
149
|
+
✅ Good: At least 2-3 alternatives considered
|
|
150
|
+
|
|
151
|
+
If you didn't consider alternatives, you didn't make a decision.
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### 4. Outdated Status
|
|
155
|
+
```
|
|
156
|
+
❌ Bad: ADR-001 shows "Proposed" from 2 years ago
|
|
157
|
+
✅ Good: Status kept current throughout lifecycle
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### 5. Orphaned ADRs
|
|
161
|
+
```
|
|
162
|
+
❌ Bad: ADRs in random locations, no index
|
|
163
|
+
✅ Good: Centralized location with index/README
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## ADR Index Template
|
|
167
|
+
|
|
168
|
+
```markdown
|
|
169
|
+
# Architecture Decision Records
|
|
170
|
+
|
|
171
|
+
## Active Decisions
|
|
172
|
+
|
|
173
|
+
| ADR | Title | Status | Date |
|
|
174
|
+
|-----|-------|--------|------|
|
|
175
|
+
| [ADR-015](ADR-015-jwt-auth.md) | JWT Authentication | Accepted | 2024-06-15 |
|
|
176
|
+
| [ADR-014](ADR-014-graphql.md) | GraphQL API | Accepted | 2024-05-20 |
|
|
177
|
+
| [ADR-016](ADR-016-observability.md) | Observability Stack | Proposed | 2024-06-20 |
|
|
178
|
+
|
|
179
|
+
## Superseded/Deprecated
|
|
180
|
+
|
|
181
|
+
| ADR | Title | Superseded By | Date |
|
|
182
|
+
|-----|-------|---------------|------|
|
|
183
|
+
| [ADR-003](ADR-003-redis-sessions.md) | Redis Sessions | ADR-015 | 2024-06-15 |
|
|
184
|
+
| [ADR-001](ADR-001-mysql.md) | MySQL Database | ADR-010 | 2024-03-01 |
|
|
185
|
+
|
|
186
|
+
## By Category
|
|
187
|
+
|
|
188
|
+
### Data
|
|
189
|
+
- ADR-010: PostgreSQL Migration
|
|
190
|
+
- ADR-011: Data Retention Policy
|
|
191
|
+
|
|
192
|
+
### API
|
|
193
|
+
- ADR-005: GraphQL for Public API
|
|
194
|
+
- ADR-006: API Versioning Strategy
|
|
195
|
+
|
|
196
|
+
### Security
|
|
197
|
+
- ADR-015: JWT Authentication
|
|
198
|
+
- ADR-008: Encryption Standards
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## Retrospective ADRs
|
|
202
|
+
|
|
203
|
+
Sometimes you need to document decisions made earlier:
|
|
204
|
+
|
|
205
|
+
```markdown
|
|
206
|
+
# ADR-001: Use React for Frontend
|
|
207
|
+
|
|
208
|
+
## Status
|
|
209
|
+
Accepted (Retrospective)
|
|
210
|
+
|
|
211
|
+
## Context
|
|
212
|
+
This ADR documents a decision made in January 2023,
|
|
213
|
+
before we started the ADR process.
|
|
214
|
+
|
|
215
|
+
## Decision
|
|
216
|
+
[Document what was decided]
|
|
217
|
+
|
|
218
|
+
## Consequences
|
|
219
|
+
[Document the actual consequences observed]
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
## Tools
|
|
223
|
+
|
|
224
|
+
### ADR Tools
|
|
225
|
+
```
|
|
226
|
+
- adr-tools (CLI): GitHub.com/npryce/adr-tools
|
|
227
|
+
- log4brains (Web): GitHub.com/thomvaill/log4brains
|
|
228
|
+
- ADR Manager (VS Code extension)
|
|
229
|
+
- Notion/Confluence templates
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### Integration with Development
|
|
233
|
+
```
|
|
234
|
+
1. Keep ADRs in git (same repo as code)
|
|
235
|
+
2. Link ADRs from code comments
|
|
236
|
+
3. Reference ADRs in PRs
|
|
237
|
+
4. Include ADR number in commit messages
|
|
238
|
+
|
|
239
|
+
Example:
|
|
240
|
+
git commit -m "feat(orders): implement saga pattern
|
|
241
|
+
|
|
242
|
+
Implements compensating transactions as described
|
|
243
|
+
in ADR-010.
|
|
244
|
+
|
|
245
|
+
Refs: ADR-010"
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
## Metrics
|
|
249
|
+
|
|
250
|
+
### Track ADR Health
|
|
251
|
+
```
|
|
252
|
+
- Total ADRs
|
|
253
|
+
- Proposed but not reviewed (> 2 weeks)
|
|
254
|
+
- Accepted without implementation (> 1 month)
|
|
255
|
+
- Deprecated without migration plan
|
|
256
|
+
- Average time from proposed to accepted
|
|
257
|
+
```
|