bobs-workshop 0.3.3 → 3.1.1

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.
Files changed (200) hide show
  1. package/LICENSE +2 -2
  2. package/README.md +199 -210
  3. package/bin/bobs-workshop.js +109 -0
  4. package/config/agents.json +27 -0
  5. package/dist/plugins/bobs-workshop.js +34 -0
  6. package/dist/tools/background-agent/cancel.d.ts +3 -0
  7. package/dist/tools/background-agent/cancel.d.ts.map +1 -0
  8. package/dist/tools/background-agent/cancel.js +52 -0
  9. package/dist/tools/background-agent/concurrency.d.ts +15 -0
  10. package/dist/tools/background-agent/concurrency.d.ts.map +1 -0
  11. package/dist/tools/background-agent/concurrency.js +61 -0
  12. package/dist/tools/background-agent/index.d.ts +8 -0
  13. package/dist/tools/background-agent/index.d.ts.map +1 -0
  14. package/dist/tools/background-agent/index.js +7 -0
  15. package/dist/tools/background-agent/launch.d.ts +6 -0
  16. package/dist/tools/background-agent/launch.d.ts.map +1 -0
  17. package/dist/tools/background-agent/launch.js +33 -0
  18. package/dist/tools/background-agent/list.d.ts +7 -0
  19. package/dist/tools/background-agent/list.d.ts.map +1 -0
  20. package/dist/tools/background-agent/list.js +40 -0
  21. package/dist/tools/background-agent/manager.d.ts +29 -0
  22. package/dist/tools/background-agent/manager.d.ts.map +1 -0
  23. package/dist/tools/background-agent/manager.js +388 -0
  24. package/dist/tools/background-agent/output.d.ts +3 -0
  25. package/dist/tools/background-agent/output.d.ts.map +1 -0
  26. package/dist/tools/background-agent/output.js +41 -0
  27. package/dist/tools/background-agent/types.d.ts +46 -0
  28. package/dist/tools/background-agent/types.d.ts.map +1 -0
  29. package/dist/tools/background-agent/types.js +1 -0
  30. package/dist/tools/index.d.ts +9 -0
  31. package/dist/tools/index.d.ts.map +1 -0
  32. package/dist/tools/index.js +8 -0
  33. package/dist/tools/manual/index.d.ts +3 -0
  34. package/dist/tools/manual/index.d.ts.map +1 -0
  35. package/dist/tools/manual/index.js +2 -0
  36. package/dist/tools/manual/manual-update.d.ts +4 -0
  37. package/dist/tools/manual/manual-update.d.ts.map +1 -0
  38. package/dist/tools/manual/manual-update.js +190 -0
  39. package/dist/tools/manual/verify-manual.d.ts +4 -0
  40. package/dist/tools/manual/verify-manual.d.ts.map +1 -0
  41. package/dist/tools/manual/verify-manual.js +51 -0
  42. package/package.json +34 -66
  43. package/postinstall.js +193 -0
  44. package/src/agents/alice.md +466 -0
  45. package/src/agents/bob-rev.md +493 -0
  46. package/src/agents/bob-send.md +277 -0
  47. package/src/agents/bob.md +442 -0
  48. package/src/agents/trace.md +451 -0
  49. package/src/plugins/bobs-workshop.ts +45 -0
  50. package/src/skills/api-patterns/SKILL.md +376 -0
  51. package/src/skills/architecture/SKILL.md +271 -0
  52. package/src/skills/bobs-workshop/performance/icon.svg +3 -0
  53. package/src/skills/brainstorming/SKILL.md +210 -0
  54. package/src/skills/clean-code/SKILL.md +151 -0
  55. package/src/skills/code-review-checklist/SKILL.md +220 -0
  56. package/src/skills/database-design/SKILL.md +271 -0
  57. package/src/skills/exploration/SKILL.md +257 -0
  58. package/src/skills/frontend-ui-ux/SKILL.md +78 -0
  59. package/src/skills/git-master/SKILL.md +1105 -0
  60. package/src/skills/performance/SKILL.md +144 -0
  61. package/src/skills/performance/icon.svg +3 -0
  62. package/src/skills/plan-writing/SKILL.md +225 -0
  63. package/src/skills/security/SKILL.md +410 -0
  64. package/src/skills/simplification/SKILL.md +238 -0
  65. package/src/skills/systematic-debugging/SKILL.md +175 -0
  66. package/src/skills/testing-patterns/SKILL.md +305 -0
  67. package/src/skills/verification/SKILL.md +286 -0
  68. package/src/tools/background-agent/cancel.ts +67 -0
  69. package/src/tools/background-agent/concurrency.ts +71 -0
  70. package/src/tools/background-agent/index.ts +7 -0
  71. package/src/tools/background-agent/launch.ts +39 -0
  72. package/src/tools/background-agent/list.ts +50 -0
  73. package/src/tools/background-agent/manager.ts +466 -0
  74. package/src/tools/background-agent/output.ts +57 -0
  75. package/src/tools/background-agent/types.ts +55 -0
  76. package/src/tools/index.ts +8 -0
  77. package/src/tools/manual/index.ts +2 -0
  78. package/src/tools/manual/manual-update.ts +197 -0
  79. package/src/tools/manual/verify-manual.ts +60 -0
  80. package/uninstall.js +64 -0
  81. package/Claude.md +0 -162
  82. package/bin/bobs-mcp-server.js +0 -11
  83. package/bin/bobs-mcp.js +0 -130
  84. package/dist/api/taskLogger.js +0 -106
  85. package/dist/api/taskLogger.js.map +0 -1
  86. package/dist/cli/checker.js +0 -401
  87. package/dist/cli/checker.js.map +0 -1
  88. package/dist/cli/cleanup.js +0 -131
  89. package/dist/cli/cleanup.js.map +0 -1
  90. package/dist/cli/debug.js +0 -157
  91. package/dist/cli/debug.js.map +0 -1
  92. package/dist/cli/health.js +0 -97
  93. package/dist/cli/health.js.map +0 -1
  94. package/dist/cli/setup.js +0 -81
  95. package/dist/cli/setup.js.map +0 -1
  96. package/dist/cli/workshop.js +0 -42
  97. package/dist/cli/workshop.js.map +0 -1
  98. package/dist/dashboard/server.js +0 -1203
  99. package/dist/dashboard/server.js.map +0 -1
  100. package/dist/index.js +0 -960
  101. package/dist/index.js.map +0 -1
  102. package/dist/prompts/architect.js +0 -221
  103. package/dist/prompts/architect.js.map +0 -1
  104. package/dist/prompts/debugger.js +0 -257
  105. package/dist/prompts/debugger.js.map +0 -1
  106. package/dist/prompts/engineer.js +0 -249
  107. package/dist/prompts/engineer.js.map +0 -1
  108. package/dist/prompts/orchestrator.js +0 -304
  109. package/dist/prompts/orchestrator.js.map +0 -1
  110. package/dist/prompts/reviewer.js +0 -289
  111. package/dist/prompts/reviewer.js.map +0 -1
  112. package/dist/services/activitySummarizer.js +0 -388
  113. package/dist/services/activitySummarizer.js.map +0 -1
  114. package/dist/services/changeValidator.js +0 -396
  115. package/dist/services/changeValidator.js.map +0 -1
  116. package/dist/services/claudeOrchestrator.js +0 -343
  117. package/dist/services/claudeOrchestrator.js.map +0 -1
  118. package/dist/services/fileMonitor.js +0 -250
  119. package/dist/services/fileMonitor.js.map +0 -1
  120. package/dist/services/implementationSummarizer.js +0 -306
  121. package/dist/services/implementationSummarizer.js.map +0 -1
  122. package/dist/services/liveMonitor.js +0 -315
  123. package/dist/services/liveMonitor.js.map +0 -1
  124. package/dist/services/mcpAuditLogger.js +0 -104
  125. package/dist/services/mcpAuditLogger.js.map +0 -1
  126. package/dist/services/mcpLogger.js +0 -223
  127. package/dist/services/mcpLogger.js.map +0 -1
  128. package/dist/services/tmuxManager.js +0 -541
  129. package/dist/services/tmuxManager.js.map +0 -1
  130. package/dist/tools/approvalTools.js +0 -244
  131. package/dist/tools/approvalTools.js.map +0 -1
  132. package/dist/tools/autoDebugger.js +0 -147
  133. package/dist/tools/autoDebugger.js.map +0 -1
  134. package/dist/tools/cleanupService.js +0 -221
  135. package/dist/tools/cleanupService.js.map +0 -1
  136. package/dist/tools/dashboardTools.js +0 -342
  137. package/dist/tools/dashboardTools.js.map +0 -1
  138. package/dist/tools/developmentNudges.js +0 -336
  139. package/dist/tools/developmentNudges.js.map +0 -1
  140. package/dist/tools/gitTools.js +0 -741
  141. package/dist/tools/gitTools.js.map +0 -1
  142. package/dist/tools/orchestratorTools.js +0 -832
  143. package/dist/tools/orchestratorTools.js.map +0 -1
  144. package/dist/tools/searchCache.js +0 -64
  145. package/dist/tools/searchCache.js.map +0 -1
  146. package/dist/tools/searchTools.js +0 -1107
  147. package/dist/tools/searchTools.js.map +0 -1
  148. package/dist/tools/semgrep-patterns.js +0 -296
  149. package/dist/tools/semgrep-patterns.js.map +0 -1
  150. package/dist/tools/specTools.js +0 -332
  151. package/dist/tools/specTools.js.map +0 -1
  152. package/dist/tools/structural/__tests__/orchestrator.test.js +0 -61
  153. package/dist/tools/structural/__tests__/orchestrator.test.js.map +0 -1
  154. package/dist/tools/structural/cache.js +0 -226
  155. package/dist/tools/structural/cache.js.map +0 -1
  156. package/dist/tools/structural/engines/python/index.js +0 -118
  157. package/dist/tools/structural/engines/python/index.js.map +0 -1
  158. package/dist/tools/structural/engines/typescript/__tests__/typescript-engine.test.js +0 -97
  159. package/dist/tools/structural/engines/typescript/__tests__/typescript-engine.test.js.map +0 -1
  160. package/dist/tools/structural/engines/typescript/analyzer.js +0 -433
  161. package/dist/tools/structural/engines/typescript/analyzer.js.map +0 -1
  162. package/dist/tools/structural/engines/typescript/index.js +0 -381
  163. package/dist/tools/structural/engines/typescript/index.js.map +0 -1
  164. package/dist/tools/structural/engines/typescript/utils.js +0 -279
  165. package/dist/tools/structural/engines/typescript/utils.js.map +0 -1
  166. package/dist/tools/structural/index.js +0 -248
  167. package/dist/tools/structural/index.js.map +0 -1
  168. package/dist/tools/structural/types.js +0 -18
  169. package/dist/tools/structural/types.js.map +0 -1
  170. package/dist/tools/tmuxTools.js +0 -100
  171. package/dist/tools/tmuxTools.js.map +0 -1
  172. package/dist/tools/workRecorder.js +0 -215
  173. package/dist/tools/workRecorder.js.map +0 -1
  174. package/dist/tools/worktreeTools.js +0 -705
  175. package/dist/tools/worktreeTools.js.map +0 -1
  176. package/dist/utils/__tests__/integration.test.js +0 -57
  177. package/dist/utils/__tests__/integration.test.js.map +0 -1
  178. package/dist/utils/__tests__/serverDetection.test.js +0 -151
  179. package/dist/utils/__tests__/serverDetection.test.js.map +0 -1
  180. package/dist/utils/errorHandling.js +0 -336
  181. package/dist/utils/errorHandling.js.map +0 -1
  182. package/dist/utils/processManager.js +0 -172
  183. package/dist/utils/processManager.js.map +0 -1
  184. package/dist/utils/reliability.js +0 -263
  185. package/dist/utils/reliability.js.map +0 -1
  186. package/dist/utils/responseFormatter.js +0 -250
  187. package/dist/utils/responseFormatter.js.map +0 -1
  188. package/dist/utils/serverDetection.js +0 -133
  189. package/dist/utils/serverDetection.js.map +0 -1
  190. package/dist/utils/specMigration.js +0 -105
  191. package/dist/utils/specMigration.js.map +0 -1
  192. package/dist/validation/schemas.js +0 -299
  193. package/dist/validation/schemas.js.map +0 -1
  194. package/public/.well-known/mcp/manifest.json +0 -473
  195. package/public/index.html +0 -3157
  196. package/public/index.html.backup +0 -2805
  197. package/public/index.html.backup2 +0 -1292
  198. package/scripts/cleanup-system-logs.ts +0 -121
  199. package/scripts/init-workspace.js +0 -63
  200. package/scripts/install-search-tools.js +0 -116
@@ -0,0 +1,175 @@
1
+ ---
2
+ name: systematic-debugging
3
+ description: 4-phase systematic debugging methodology with root cause analysis and evidence-based verification.
4
+ metadata:
5
+ recommended_for: trace
6
+ category: debugging
7
+ ---
8
+
9
+ # Systematic Debugging
10
+
11
+ > Source: obra/superpowers
12
+
13
+ ## Overview
14
+ This skill provides a structured approach to debugging that prevents random guessing and ensures problems are properly understood before solving.
15
+
16
+ ## 4-Phase Debugging Process
17
+
18
+ ### Phase 1: Reproduce
19
+ Before fixing, reliably reproduce the issue.
20
+
21
+ ```markdown
22
+ ## Reproduction Steps
23
+ 1. [Exact step to reproduce]
24
+ 2. [Next step]
25
+ 3. [Expected vs actual result]
26
+
27
+ ## Reproduction Rate
28
+ - [ ] Always (100%)
29
+ - [ ] Often (50-90%)
30
+ - [ ] Sometimes (10-50%)
31
+ - [ ] Rare (<10%)
32
+ ```
33
+
34
+ ### Phase 2: Isolate
35
+ Narrow down the source.
36
+
37
+ ```markdown
38
+ ## Isolation Questions
39
+ - When did this start happening?
40
+ - What changed recently?
41
+ - Does it happen in all environments?
42
+ - Can we reproduce with minimal code?
43
+ - What's the smallest change that triggers it?
44
+ ```
45
+
46
+ ### Phase 3: Understand
47
+ Find the root cause, not just symptoms.
48
+
49
+ ```markdown
50
+ ## Root Cause Analysis
51
+ ### The 5 Whys
52
+ 1. Why: [First observation]
53
+ 2. Why: [Deeper reason]
54
+ 3. Why: [Still deeper]
55
+ 4. Why: [Getting closer]
56
+ 5. Why: [Root cause]
57
+ ```
58
+
59
+ ### Phase 4: Fix & Verify
60
+ Fix and verify it's truly fixed.
61
+
62
+ ```markdown
63
+ ## Fix Verification
64
+ - [ ] Bug no longer reproduces
65
+ - [ ] Related functionality still works
66
+ - [ ] No new issues introduced
67
+ - [ ] Test added to prevent regression
68
+ ```
69
+
70
+ ## Debugging Checklist
71
+
72
+ ```markdown
73
+ ## Before Starting
74
+ - [ ] Can reproduce consistently
75
+ - [ ] Have minimal reproduction case
76
+ - [ ] Understand expected behavior
77
+
78
+ ## During Investigation
79
+ - [ ] Check recent changes (git log)
80
+ - [ ] Check logs for errors
81
+ - [ ] Add logging if needed
82
+ - [ ] Use debugger/breakpoints
83
+
84
+ ## After Fix
85
+ - [ ] Root cause documented
86
+ - [ ] Fix verified
87
+ - [ ] Regression test added
88
+ - [ ] Similar code checked
89
+ ```
90
+
91
+ ## Common Debugging Commands
92
+
93
+ ```bash
94
+ # Recent changes
95
+ git log --oneline -20
96
+ git diff HEAD~5
97
+
98
+ # Search for pattern
99
+ grep -r "errorPattern" --include="*.ts"
100
+
101
+ # Check logs
102
+ pm2 logs app-name --err --lines 100
103
+ ```
104
+
105
+ ## Anti-Patterns
106
+
107
+ ❌ **Random changes** - "Maybe if I change this..."
108
+ ❌ **Ignoring evidence** - "That can't be the cause"
109
+ ❌ **Assuming** - "It must be X" without proof
110
+ ❌ **Not reproducing first** - Fixing blindly
111
+ ❌ **Stopping at symptoms** - Not finding root cause
112
+
113
+ ---
114
+
115
+ ## Bob's Workshop Integration
116
+
117
+ This skill is used by **trace (debugger)** agent during the FIX phase.
118
+
119
+ ### MANUAL Integration
120
+
121
+ Add debugging section to MANUAL:
122
+ ```markdown
123
+ ## 🔍 Debug Logs
124
+
125
+ ### Issue Summary
126
+ - **Bug ID:** [BUG-001]
127
+ - **Reported by:** [User/Agent]
128
+ - **Severity:** [Critical/High/Medium/Low]
129
+
130
+ ### Phase 1: Reproduce
131
+ - [ ] Reproduction steps documented
132
+ - [ ] Reproduction rate identified
133
+ - [ ] Expected vs actual behavior clear
134
+
135
+ ### Phase 2: Isolate
136
+ - [ ] Timeline: When did this start?
137
+ - [ ] Changes: What changed recently?
138
+ - [ ] Environment: Does it happen everywhere?
139
+ - [ ] Scope: Can we isolate to specific code?
140
+
141
+ ### Phase 3: Understand
142
+ - [ ] Root cause analysis complete (5 Whys)
143
+ - [ ] Root cause identified: [Description]
144
+ - [ ] Related areas affected: [List]
145
+
146
+ ### Phase 4: Fix & Verify
147
+ - [ ] Fix implemented
148
+ - [ ] Bug no longer reproduces
149
+ - [ ] Related functionality verified
150
+ - [ ] No new issues introduced
151
+ - [ ] Regression test added: [Test name]
152
+
153
+ ### Related Code
154
+ - Files changed: [List]
155
+ - Lines affected: [List]
156
+ - Similar patterns to check: [List]
157
+ ```
158
+
159
+ ### Handoff Format
160
+
161
+ After fixing, document the solution:
162
+ ```markdown
163
+ ## 🤝 Agent Handoffs
164
+
165
+ 🤝 trace: Root cause identified - [Brief description]
166
+ 🤝 trace → bob-rev: Fix verified, ready for re-review
167
+ ```
168
+
169
+ ### Evidence Requirements
170
+
171
+ **Before marking fix complete, gather:**
172
+ 1. **Reproduction steps** - Can we reliably reproduce?
173
+ 2. **Isolation evidence** - What narrows down the cause?
174
+ 3. **Root cause proof** - Why is this the root cause?
175
+ 4. **Fix verification** - Bug gone, tests pass, nothing broken
@@ -0,0 +1,305 @@
1
+ ---
2
+ name: testing-patterns
3
+ description: Testing patterns and principles. Unit, integration, mocking strategies.
4
+ metadata:
5
+ recommended_for: bob-eng
6
+ category: testing
7
+ ---
8
+
9
+ # Testing Patterns
10
+
11
+ > Principles for reliable test suites.
12
+
13
+ ---
14
+
15
+ ## 1. Testing Pyramid
16
+
17
+ ```
18
+ /\ E2E (Few)
19
+ / \ Critical flows
20
+ /----\
21
+ / \ Integration (Some)
22
+ /--------\ API, DB queries
23
+ / \
24
+ /------------\ Unit (Many)
25
+ Functions, classes
26
+ ```
27
+
28
+ ---
29
+
30
+ ## 2. AAA Pattern
31
+
32
+ | Step | Purpose |
33
+ |------|---------|
34
+ | **Arrange** | Set up test data |
35
+ | **Act** | Execute code under test |
36
+ | **Assert** | Verify outcome |
37
+
38
+ ---
39
+
40
+ ## 3. Test Type Selection
41
+
42
+ ### When to Use Each
43
+
44
+ | Type | Best For | Speed |
45
+ |------|----------|-------|
46
+ | **Unit** | Pure functions, logic | Fast (<50ms) |
47
+ | **Integration** | API, DB, services | Medium |
48
+ | **E2E** | Critical user flows | Slow |
49
+
50
+ ---
51
+
52
+ ## 4. Unit Test Principles
53
+
54
+ ### Good Unit Tests
55
+
56
+ | Principle | Meaning |
57
+ |-----------|---------|
58
+ | Fast | < 100ms each |
59
+ | Isolated | No external deps |
60
+ | Repeatable | Same result always |
61
+ | Self-checking | No manual verification |
62
+ | Timely | Written with code |
63
+
64
+ ### What to Unit Test
65
+
66
+ | Test | Don't Test |
67
+ |------|------------|
68
+ | Business logic | Framework code |
69
+ | Edge cases | Third-party libs |
70
+ | Error handling | Simple getters |
71
+
72
+ ---
73
+
74
+ ## 5. Integration Test Principles
75
+
76
+ ### What to Test
77
+
78
+ | Area | Focus |
79
+ |------|-------|
80
+ | API endpoints | Request/response |
81
+ | Database | Queries, transactions |
82
+ | External services | Contracts |
83
+
84
+ ### Setup/Teardown
85
+
86
+ | Phase | Action |
87
+ |-------|------|
88
+ | Before All | Connect resources |
89
+ | Before Each | Reset state |
90
+ | After Each | Clean up |
91
+ | After All | Disconnect |
92
+
93
+ ---
94
+
95
+ ## 6. Mocking Principles
96
+
97
+ ### When to Mock
98
+
99
+ | Mock | Don't Mock |
100
+ |------|------------|
101
+ | External APIs | The code under test |
102
+ | Database (unit) | Simple dependencies |
103
+ | Time/random | Pure functions |
104
+ | Network | In-memory stores |
105
+
106
+ ### Mock Types
107
+
108
+ | Type | Use |
109
+ |------|-----|
110
+ | Stub | Return fixed values |
111
+ | Spy | Track calls |
112
+ | Mock | Set expectations |
113
+ | Fake | Simplified implementation |
114
+
115
+ ---
116
+
117
+ ## 7. Test Organization
118
+
119
+ ### Naming
120
+
121
+ | Pattern | Example |
122
+ |---------|---------|
123
+ | Should behavior | "should return error when..." |
124
+ | When condition | "when user not found..." |
125
+ | Given-when-then | "given X, when Y, then Z" |
126
+
127
+ ### Grouping
128
+
129
+ | Level | Use |
130
+ |-------|-----|
131
+ | describe | Group related tests |
132
+ | it/test | Individual case |
133
+ | beforeEach | Common setup |
134
+
135
+ ---
136
+
137
+ ## 8. Test Data
138
+
139
+ ### Strategies
140
+
141
+ | Approach | Use |
142
+ |----------|-----|
143
+ | Factories | Generate test data |
144
+ | Fixtures | Predefined datasets |
145
+ | Builders | Fluent object creation |
146
+
147
+ ### Principles
148
+
149
+ - Use realistic data
150
+ - Randomize non-essential values (faker)
151
+ - Share common fixtures
152
+ - Keep data minimal
153
+
154
+ ---
155
+
156
+ ## 9. Best Practices
157
+
158
+ | Practice | Why |
159
+ |----------|------|
160
+ | One assert per test | Clear failure reason |
161
+ | Independent tests | No order dependency |
162
+ | Fast tests | Run frequently |
163
+ | Descriptive names | Self-documenting |
164
+ | Clean up | Avoid side effects |
165
+
166
+ ---
167
+
168
+ ## 10. Anti-Patterns
169
+
170
+ | ❌ Don't | ✅ Do |
171
+ |----------|-------|
172
+ | Test implementation | Test behavior |
173
+ | Duplicate test code | Use factories |
174
+ | Complex test setup | Simplify or split |
175
+ | Ignore flaky tests | Fix root cause |
176
+ | Skip cleanup | Reset state |
177
+
178
+ ---
179
+
180
+ > **Remember:** Tests are documentation. If someone can't understand what code does from the tests, rewrite them.
181
+
182
+ ---
183
+
184
+ ## Bob's Workshop Integration
185
+
186
+ This skill is used by **bob-eng (engineer)** agent during BUILD phase.
187
+
188
+ ### MANUAL Integration
189
+
190
+ Add testing section to MANUAL:
191
+ ```markdown
192
+ ## 🧪 Testing Strategy
193
+
194
+ ### Test Pyramid
195
+
196
+ ```
197
+ /\ E2E (2-3 tests)
198
+ / \ Critical user flows
199
+ /----\
200
+ / \ Integration (10-20 tests)
201
+ /--------\ API endpoints, DB queries
202
+ / \
203
+ /------------\ Unit (50-100 tests)
204
+ Functions, classes, utilities
205
+ ```
206
+
207
+ ### Test Coverage
208
+
209
+ | Layer | Test Type | Count | Coverage Target |
210
+ |-------|-----------|--------|----------------|
211
+ | Unit | Pure functions, logic | 50-100 | 80%+ |
212
+ | Integration | API, DB queries | 10-20 | Critical paths |
213
+ | E2E | User flows | 2-3 | Happy path + key edge cases |
214
+
215
+ ### Test Requirements
216
+
217
+ #### Unit Tests
218
+ - [ ] All business logic functions tested
219
+ - [ ] Edge cases covered (empty, null, invalid)
220
+ - [ ] Error handling tested
221
+ - [ ] Pure functions isolated (no mocks if possible)
222
+ - [ ] Tests < 100ms each
223
+
224
+ #### Integration Tests
225
+ - [ ] API endpoints tested
226
+ - [ ] Database queries verified
227
+ - [ ] External services mocked
228
+ - [ ] Transaction rollback tested
229
+ - [ ] Error paths tested
230
+
231
+ #### E2E Tests
232
+ - [ ] Critical user flows covered
233
+ - [ ] Happy path works
234
+ - [ ] Key edge cases tested
235
+ - [ ] Cross-browser verified (if applicable)
236
+
237
+ ### Mocking Strategy
238
+
239
+ | Component | Mock/Fake | Rationale |
240
+ |-----------|-----------|-----------|
241
+ | External API | Mock | Unreliable, slow |
242
+ | Database | Fake (in-memory) | Fast, isolated |
243
+ | Time | Mock | Deterministic |
244
+ | Network | Mock | No network dependency |
245
+
246
+ ### Test Framework
247
+
248
+ - **Unit:** [Jest / Vitest / Pytest / etc.]
249
+ - **Integration:** [Supertest / etc.]
250
+ - **E2E:** [Playwright / Cypress / etc.]
251
+ ```
252
+
253
+ ### Test Tasks
254
+
255
+ Add to implementation plan:
256
+ ```markdown
257
+ #### TEST-001: Unit Tests
258
+ - [ ] Test business logic functions → Verify: All tests pass
259
+ - [ ] Test error handling → Verify: Edge cases covered
260
+ - [ ] Test edge cases → Verify: Empty, null, invalid inputs
261
+
262
+ #### TEST-002: Integration Tests
263
+ - [ ] Test API endpoints → Verify: Returns correct data
264
+ - [ ] Test database queries → Verify: Queries match schema
265
+ - [ ] Test error paths → Verify: Errors handled correctly
266
+
267
+ #### TEST-003: E2E Tests
268
+ - [ ] Test happy path flow → Verify: User completes main task
269
+ - [ ] Test error recovery → Verify: User can recover from errors
270
+ ```
271
+
272
+ ### Verification Criteria
273
+
274
+ Before handing off to bob-rev:
275
+ - [ ] All tests pass (unit, integration, E2E)
276
+ - [ ] Test coverage meets target (80%+)
277
+ - [ ] No tests are skipped or ignored
278
+ - [ ] Flaky tests identified and fixed
279
+ - [ ] Tests run quickly (<5 minutes total)
280
+
281
+ ### Handoff Format
282
+
283
+ ```markdown
284
+ ## 🤝 Agent Handoffs
285
+
286
+ 🤝 bob-eng: Tests written - 75 unit, 15 integration, 3 E2E
287
+ 🤝 bob-eng → bob-rev: All tests pass, ready for review
288
+ ```
289
+
290
+ ### Best Practices Reminder
291
+
292
+ **When writing tests:**
293
+ - Write tests with code (TDD if applicable)
294
+ - Keep tests simple and focused
295
+ - Use descriptive names (should/when/given-when-then)
296
+ - One assert per test (when possible)
297
+ - Keep tests fast (<100ms each)
298
+ - Clean up after each test
299
+
300
+ **What to avoid:**
301
+ - Testing implementation details
302
+ - Testing framework code
303
+ - Duplicate test code (use factories)
304
+ - Complex setup (simplify or split)
305
+ - Skipping tests (fix them)