liteagents 3.0.0 → 3.6.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.
Files changed (159) hide show
  1. package/CHANGELOG.md +158 -1
  2. package/README.md +113 -169
  3. package/installer/cli.js +4 -2
  4. package/installer/package-manager.js +3 -1
  5. package/package.json +4 -3
  6. package/packages/ampcode/AGENT.md +10 -18
  7. package/packages/ampcode/agents/code-developer.md +11 -17
  8. package/packages/ampcode/agents/orchestrator.md +1 -1
  9. package/packages/ampcode/agents/quality-assurance.md +3 -1
  10. package/packages/ampcode/{commands/brainstorming.md → skills/brainstorming/SKILL.md} +2 -3
  11. package/packages/ampcode/{commands/branch-review.md → skills/branch-review/SKILL.md} +27 -13
  12. package/packages/{claude/commands/docs-builder.md → ampcode/skills/docs-builder/SKILL.md} +1 -1
  13. package/packages/ampcode/{commands/live-canvas.md → skills/live-canvas/SKILL.md} +8 -4
  14. package/packages/ampcode/{commands/refactor.md → skills/refactor/SKILL.md} +49 -7
  15. package/packages/ampcode/{commands/release.md → skills/release/SKILL.md} +4 -4
  16. package/packages/{claude/commands → ampcode/skills}/remember/AGENT_RULES.md +44 -84
  17. package/packages/ampcode/{commands/remember.md → skills/remember/SKILL.md} +11 -6
  18. package/packages/ampcode/{commands → skills}/remember/friction.cjs +0 -0
  19. package/packages/ampcode/{commands → skills}/remember/stub-check.cjs +28 -19
  20. package/packages/ampcode/{commands → skills}/remember/sync-rules.cjs +28 -19
  21. package/packages/{claude/commands → ampcode/skills}/remember/version-check.cjs +1 -1
  22. package/packages/ampcode/skills/root-cause/SKILL.md +220 -0
  23. package/packages/ampcode/{commands/trace-back → skills/root-cause}/find-polluter.sh +0 -0
  24. package/packages/{claude/commands/security.md → ampcode/skills/security/SKILL.md} +1 -1
  25. package/packages/{claude/commands/ship.md → ampcode/skills/ship/SKILL.md} +1 -1
  26. package/packages/ampcode/skills/skill-creator/LICENSE.txt +202 -0
  27. package/packages/ampcode/{commands/skill-creator.md → skills/skill-creator/SKILL.md} +1 -2
  28. package/packages/ampcode/{commands → skills}/skill-creator/scripts/init_skill.py +0 -0
  29. package/packages/ampcode/{commands → skills}/skill-creator/scripts/package_skill.py +0 -0
  30. package/packages/ampcode/{commands → skills}/skill-creator/scripts/quick_validate.py +0 -0
  31. package/packages/ampcode/{commands/stash.md → skills/stash/SKILL.md} +2 -1
  32. package/packages/{claude/commands/test-generate.md → ampcode/skills/test-generate/SKILL.md} +2 -2
  33. package/packages/ampcode/variants.json +2 -2
  34. package/packages/claude/CLAUDE.md +10 -17
  35. package/packages/claude/agents/code-developer.md +11 -17
  36. package/packages/claude/agents/orchestrator.md +2 -3
  37. package/packages/claude/agents/quality-assurance.md +3 -1
  38. package/packages/claude/skills/brainstorming/SKILL.md +1 -2
  39. package/packages/claude/{commands/branch-review.md → skills/branch-review/SKILL.md} +15 -1
  40. package/packages/{ampcode/commands/docs-builder.md → claude/skills/docs-builder/SKILL.md} +7 -7
  41. package/packages/claude/skills/live-canvas/SKILL.md +5 -1
  42. package/packages/claude/{commands/refactor.md → skills/refactor/SKILL.md} +45 -3
  43. package/packages/claude/{commands/release.md → skills/release/SKILL.md} +1 -1
  44. package/packages/{ampcode/commands → claude/skills}/remember/AGENT_RULES.md +38 -78
  45. package/packages/claude/{commands/remember.md → skills/remember/SKILL.md} +11 -6
  46. package/packages/claude/{commands → skills}/remember/friction.cjs +0 -0
  47. package/packages/claude/{commands → skills}/remember/stub-check.cjs +28 -19
  48. package/packages/claude/{commands → skills}/remember/sync-rules.cjs +28 -19
  49. package/packages/{ampcode/commands → claude/skills}/remember/version-check.cjs +3 -3
  50. package/packages/claude/skills/root-cause/SKILL.md +220 -0
  51. package/packages/{ampcode/commands/security.md → claude/skills/security/SKILL.md} +2 -2
  52. package/packages/{ampcode/commands/ship.md → claude/skills/ship/SKILL.md} +2 -2
  53. package/packages/claude/skills/skill-creator/SKILL.md +1 -2
  54. package/packages/claude/{commands/stash.md → skills/stash/SKILL.md} +2 -1
  55. package/packages/{ampcode/commands/test-generate.md → claude/skills/test-generate/SKILL.md} +3 -3
  56. package/packages/claude/variants.json +1 -2
  57. package/packages/droid/AGENTS.md +10 -15
  58. package/packages/droid/commands/brainstorming.md +1 -4
  59. package/packages/droid/commands/branch-review.md +25 -14
  60. package/packages/droid/commands/docs-builder.md +0 -3
  61. package/packages/droid/commands/live-canvas.md +7 -5
  62. package/packages/droid/commands/refactor.md +47 -8
  63. package/packages/droid/commands/release.md +2 -5
  64. package/packages/droid/commands/remember/AGENT_RULES.md +38 -78
  65. package/packages/droid/commands/remember/stub-check.cjs +28 -19
  66. package/packages/droid/commands/remember/sync-rules.cjs +28 -19
  67. package/packages/droid/commands/remember/version-check.cjs +1 -1
  68. package/packages/droid/commands/remember.md +6 -4
  69. package/packages/droid/commands/root-cause.md +218 -0
  70. package/packages/droid/commands/security.md +0 -3
  71. package/packages/droid/commands/ship.md +0 -3
  72. package/packages/droid/commands/skill-creator/LICENSE.txt +202 -0
  73. package/packages/droid/commands/skill-creator.md +0 -4
  74. package/packages/droid/commands/stash.md +0 -2
  75. package/packages/droid/commands/test-generate.md +1 -4
  76. package/packages/droid/droids/1-create-prd.md +6 -2
  77. package/packages/droid/droids/2-generate-tasks.md +1 -2
  78. package/packages/droid/droids/3-process-task-list.md +1 -2
  79. package/packages/droid/droids/code-developer.md +12 -19
  80. package/packages/droid/droids/feature-planner.md +1 -2
  81. package/packages/droid/droids/market-researcher.md +1 -2
  82. package/packages/droid/droids/orchestrator.md +1 -2
  83. package/packages/droid/droids/quality-assurance.md +4 -3
  84. package/packages/droid/droids/system-architect.md +1 -2
  85. package/packages/droid/droids/ui-designer.md +1 -2
  86. package/packages/opencode/AGENTS.md +10 -15
  87. package/packages/opencode/agent/code-developer.md +11 -17
  88. package/packages/opencode/agent/quality-assurance.md +3 -1
  89. package/packages/opencode/command/brainstorming.md +1 -4
  90. package/packages/opencode/command/branch-review.md +25 -15
  91. package/packages/opencode/command/docs-builder.md +0 -4
  92. package/packages/opencode/command/live-canvas.md +7 -5
  93. package/packages/opencode/command/refactor.md +47 -9
  94. package/packages/opencode/command/release.md +2 -5
  95. package/packages/opencode/command/remember/AGENT_RULES.md +38 -78
  96. package/packages/opencode/command/remember/stub-check.cjs +28 -19
  97. package/packages/opencode/command/remember/sync-rules.cjs +28 -19
  98. package/packages/opencode/command/remember/version-check.cjs +1 -1
  99. package/packages/opencode/command/remember.md +6 -4
  100. package/packages/opencode/command/root-cause.md +218 -0
  101. package/packages/opencode/command/security.md +0 -4
  102. package/packages/opencode/command/ship.md +0 -3
  103. package/packages/opencode/command/skill-creator/LICENSE.txt +202 -0
  104. package/packages/opencode/command/skill-creator.md +0 -4
  105. package/packages/opencode/command/stash.md +0 -3
  106. package/packages/opencode/command/test-generate.md +1 -5
  107. package/packages/opencode/opencode.jsonc +4 -24
  108. package/packages/subagentic-manual.md +147 -314
  109. package/tools/ampcode/manifest-template.json +0 -1
  110. package/tools/claude/manifest-template.json +0 -1
  111. package/tools/droid/manifest-template.json +0 -1
  112. package/tools/opencode/manifest-template.json +0 -1
  113. package/packages/ampcode/commands/debug-method.md +0 -297
  114. package/packages/ampcode/commands/live-canvas/README.md +0 -264
  115. package/packages/ampcode/commands/optimize.md +0 -61
  116. package/packages/ampcode/commands/tdd-flow.md +0 -390
  117. package/packages/ampcode/commands/test-traps/example.ts +0 -158
  118. package/packages/ampcode/commands/test-traps.md +0 -378
  119. package/packages/ampcode/commands/trace-back.md +0 -176
  120. package/packages/ampcode/commands/verify-done.md +0 -152
  121. package/packages/claude/commands/optimize.md +0 -61
  122. package/packages/claude/plugins/live-canvas-marketplace/plugins/live-canvas-channel/README.md +0 -89
  123. package/packages/claude/skills/debug-method/CREATION-LOG.md +0 -119
  124. package/packages/claude/skills/debug-method/SKILL.md +0 -296
  125. package/packages/claude/skills/debug-method/test-academic.md +0 -14
  126. package/packages/claude/skills/debug-method/test-pressure-1.md +0 -58
  127. package/packages/claude/skills/debug-method/test-pressure-2.md +0 -68
  128. package/packages/claude/skills/debug-method/test-pressure-3.md +0 -69
  129. package/packages/claude/skills/live-canvas/README.md +0 -269
  130. package/packages/claude/skills/tdd-flow/SKILL.md +0 -392
  131. package/packages/claude/skills/test-traps/SKILL.md +0 -378
  132. package/packages/claude/skills/test-traps/example.ts +0 -158
  133. package/packages/claude/skills/trace-back/SKILL.md +0 -176
  134. package/packages/claude/skills/verify-done/SKILL.md +0 -152
  135. package/packages/droid/commands/debug-method.md +0 -297
  136. package/packages/droid/commands/live-canvas/README.md +0 -264
  137. package/packages/droid/commands/optimize.md +0 -61
  138. package/packages/droid/commands/tdd-flow.md +0 -390
  139. package/packages/droid/commands/test-traps/example.ts +0 -158
  140. package/packages/droid/commands/test-traps.md +0 -378
  141. package/packages/droid/commands/trace-back.md +0 -176
  142. package/packages/droid/commands/verify-done.md +0 -152
  143. package/packages/opencode/command/debug-method.md +0 -297
  144. package/packages/opencode/command/live-canvas/README.md +0 -264
  145. package/packages/opencode/command/optimize.md +0 -61
  146. package/packages/opencode/command/tdd-flow.md +0 -390
  147. package/packages/opencode/command/test-traps/example.ts +0 -158
  148. package/packages/opencode/command/test-traps.md +0 -378
  149. package/packages/opencode/command/trace-back.md +0 -176
  150. package/packages/opencode/command/verify-done.md +0 -152
  151. /package/packages/ampcode/{commands → skills}/docs-builder/docs-builder.cjs +0 -0
  152. /package/packages/ampcode/{commands → skills}/live-canvas/DESIGN_PRINCIPLES.md +0 -0
  153. /package/packages/ampcode/{commands → skills}/live-canvas/dev/post-variants.html +0 -0
  154. /package/packages/ampcode/{commands → skills}/live-canvas/templates/lab-banner.html +0 -0
  155. /package/packages/ampcode/{commands → skills}/live-canvas/templates/overlay-vanilla.js +0 -0
  156. /package/packages/claude/{commands → skills}/docs-builder/docs-builder.cjs +0 -0
  157. /package/packages/claude/skills/{trace-back → root-cause}/find-polluter.sh +0 -0
  158. /package/packages/droid/commands/{trace-back → root-cause}/find-polluter.sh +0 -0
  159. /package/packages/opencode/command/{trace-back → root-cause}/find-polluter.sh +0 -0
@@ -1,392 +0,0 @@
1
- ---
2
- name: tdd-flow
3
- description: Use when implementing any feature or bugfix, before writing implementation code - write the test first, watch it fail, write minimal code to pass; ensures tests actually verify behavior by requiring failure first
4
- usage: /tdd-flow <feature-or-behavior-to-test>
5
- auto_trigger: true
6
- ---
7
-
8
- # TDD Flow
9
-
10
- ## Auto-Trigger
11
-
12
- **APPLIES WHEN:**
13
- - About to write new production code (function, method, class)
14
- - Implementing any feature or bug fix
15
- - Modifying behavior of existing code
16
- - Task metadata includes `tdd: yes`
17
- - User requests feature implementation
18
-
19
- **APPLIES TO:**
20
- - All production code changes
21
- - Feature implementations
22
- - Bug fixes
23
- - Refactoring that changes behavior
24
- - API endpoint creation
25
- - Model/class creation
26
-
27
- **DOES NOT APPLY TO:**
28
- - Documentation files
29
- - Configuration files (unless logic-bearing)
30
- - Throwaway prototypes (with explicit user permission)
31
- - Generated code (with explicit user permission)
32
-
33
- **ENFORCEMENT:**
34
- If you find yourself writing implementation code before tests, STOP immediately. Delete the implementation and start over with TDD.
35
-
36
- ## Overview
37
-
38
- Write the test first. Watch it fail. Write minimal code to pass.
39
-
40
- **Core principle:** If you didn't watch the test fail, you don't know if it tests the right thing.
41
-
42
- **Violating the letter of the rules is violating the spirit of the rules.**
43
-
44
- ## When to Use
45
-
46
- **Always:**
47
- - New features
48
- - Bug fixes
49
- - Refactoring
50
- - Behavior changes
51
-
52
- **Exceptions (ask your human partner):**
53
- - Throwaway prototypes
54
- - Generated code
55
- - Configuration files
56
-
57
- Thinking "skip TDD just this once"? Stop. That's rationalization.
58
-
59
- ## The Iron Law
60
-
61
- ```
62
- NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
63
- ```
64
-
65
- Write code before the test? Delete it. Start over.
66
-
67
- **No exceptions:**
68
- - Don't keep it as "reference"
69
- - Don't "adapt" it while writing tests
70
- - Don't look at it
71
- - Delete means delete
72
-
73
- Implement fresh from tests. Period.
74
-
75
- ## Red-Green-Refactor
76
-
77
- ```dot
78
- digraph tdd_cycle {
79
- rankdir=LR;
80
- red [label="RED\nWrite failing test", shape=box, style=filled, fillcolor="#ffcccc"];
81
- verify_red [label="Verify fails\ncorrectly", shape=diamond];
82
- green [label="GREEN\nMinimal code", shape=box, style=filled, fillcolor="#ccffcc"];
83
- verify_green [label="Verify passes\nAll green", shape=diamond];
84
- refactor [label="REFACTOR\nClean up", shape=box, style=filled, fillcolor="#ccccff"];
85
- next [label="Next", shape=ellipse];
86
-
87
- red -> verify_red;
88
- verify_red -> green [label="yes"];
89
- verify_red -> red [label="wrong\nfailure"];
90
- green -> verify_green;
91
- verify_green -> refactor [label="yes"];
92
- verify_green -> green [label="no"];
93
- refactor -> verify_green [label="stay\ngreen"];
94
- verify_green -> next;
95
- next -> red;
96
- }
97
- ```
98
-
99
- ### RED - Write Failing Test
100
-
101
- Write one minimal test showing what should happen.
102
-
103
- <Good>
104
- ```typescript
105
- test('retries failed operations 3 times', async () => {
106
- let attempts = 0;
107
- const operation = () => {
108
- attempts++;
109
- if (attempts < 3) throw new Error('fail');
110
- return 'success';
111
- };
112
-
113
- const result = await retryOperation(operation);
114
-
115
- expect(result).toBe('success');
116
- expect(attempts).toBe(3);
117
- });
118
- ```
119
- Clear name, tests real behavior, one thing
120
- </Good>
121
-
122
- <Bad>
123
- ```typescript
124
- test('retry works', async () => {
125
- const mock = jest.fn()
126
- .mockRejectedValueOnce(new Error())
127
- .mockRejectedValueOnce(new Error())
128
- .mockResolvedValueOnce('success');
129
- await retryOperation(mock);
130
- expect(mock).toHaveBeenCalledTimes(3);
131
- });
132
- ```
133
- Vague name, tests mock not code
134
- </Bad>
135
-
136
- **Requirements:**
137
- - One behavior
138
- - Clear name
139
- - Real code (no mocks unless unavoidable)
140
-
141
- ### Verify RED - Watch It Fail
142
-
143
- **MANDATORY. Never skip.**
144
-
145
- ```bash
146
- npm test path/to/test.test.ts
147
- ```
148
-
149
- Confirm:
150
- - Test fails (not errors)
151
- - Failure message is expected
152
- - Fails because feature missing (not typos)
153
-
154
- **Test passes?** You're testing existing behavior. Fix test.
155
-
156
- **Test errors?** Fix error, re-run until it fails correctly.
157
-
158
- ### GREEN - Minimal Code
159
-
160
- Write simplest code to pass the test.
161
-
162
- <Good>
163
- ```typescript
164
- async function retryOperation<T>(fn: () => Promise<T>): Promise<T> {
165
- for (let i = 0; i < 3; i++) {
166
- try {
167
- return await fn();
168
- } catch (e) {
169
- if (i === 2) throw e;
170
- }
171
- }
172
- throw new Error('unreachable');
173
- }
174
- ```
175
- Just enough to pass
176
- </Good>
177
-
178
- <Bad>
179
- ```typescript
180
- async function retryOperation<T>(
181
- fn: () => Promise<T>,
182
- options?: {
183
- maxRetries?: number;
184
- backoff?: 'linear' | 'exponential';
185
- onRetry?: (attempt: number) => void;
186
- }
187
- ): Promise<T> {
188
- // YAGNI
189
- }
190
- ```
191
- Over-engineered
192
- </Bad>
193
-
194
- Don't add features, refactor other code, or "improve" beyond the test.
195
-
196
- ### Verify GREEN - Watch It Pass
197
-
198
- **MANDATORY.**
199
-
200
- ```bash
201
- npm test path/to/test.test.ts
202
- ```
203
-
204
- Confirm:
205
- - Test passes
206
- - Other tests still pass
207
- - Output pristine (no errors, warnings)
208
-
209
- **Test fails?** Fix code, not test.
210
-
211
- **Other tests fail?** Fix now.
212
-
213
- ### REFACTOR - Clean Up
214
-
215
- After green only:
216
- - Remove duplication
217
- - Improve names
218
- - Extract helpers
219
-
220
- Keep tests green. Don't add behavior.
221
-
222
- ### Repeat
223
-
224
- Next failing test for next feature.
225
-
226
- ## Good Tests
227
-
228
- | Quality | Good | Bad |
229
- |---------|------|-----|
230
- | **Minimal** | One thing. "and" in name? Split it. | `test('validates email and domain and whitespace')` |
231
- | **Clear** | Name describes behavior | `test('test1')` |
232
- | **Shows intent** | Demonstrates desired API | Obscures what code should do |
233
-
234
- ## Why Order Matters
235
-
236
- **"I'll write tests after to verify it works"**
237
-
238
- Tests written after code pass immediately. Passing immediately proves nothing:
239
- - Might test wrong thing
240
- - Might test implementation, not behavior
241
- - Might miss edge cases you forgot
242
- - You never saw it catch the bug
243
-
244
- Test-first forces you to see the test fail, proving it actually tests something.
245
-
246
- **"I already manually tested all the edge cases"**
247
-
248
- Manual testing is ad-hoc. You think you tested everything but:
249
- - No record of what you tested
250
- - Can't re-run when code changes
251
- - Easy to forget cases under pressure
252
- - "It worked when I tried it" ≠ comprehensive
253
-
254
- Automated tests are systematic. They run the same way every time.
255
-
256
- **"Deleting X hours of work is wasteful"**
257
-
258
- Sunk cost fallacy. The time is already gone. Your choice now:
259
- - Delete and rewrite with TDD (X more hours, high confidence)
260
- - Keep it and add tests after (30 min, low confidence, likely bugs)
261
-
262
- The "waste" is keeping code you can't trust. Working code without real tests is technical debt.
263
-
264
- **"TDD is dogmatic, being pragmatic means adapting"**
265
-
266
- TDD IS pragmatic:
267
- - Finds bugs before commit (faster than debugging after)
268
- - Prevents regressions (tests catch breaks immediately)
269
- - Documents behavior (tests show how to use code)
270
- - Enables refactoring (change freely, tests catch breaks)
271
-
272
- "Pragmatic" shortcuts = debugging in production = slower.
273
-
274
- **"Tests after achieve the same goals - it's spirit not ritual"**
275
-
276
- No. Tests-after answer "What does this do?" Tests-first answer "What should this do?"
277
-
278
- Tests-after are biased by your implementation. You test what you built, not what's required. You verify remembered edge cases, not discovered ones.
279
-
280
- Tests-first force edge case discovery before implementing. Tests-after verify you remembered everything (you didn't).
281
-
282
- 30 minutes of tests after ≠ TDD. You get coverage, lose proof tests work.
283
-
284
- ## Common Rationalizations
285
-
286
- | Excuse | Reality |
287
- |--------|---------|
288
- | "Too simple to test" | Simple code breaks. Test takes 30 seconds. |
289
- | "I'll test after" | Tests passing immediately prove nothing. |
290
- | "Tests after achieve same goals" | Tests-after = "what does this do?" Tests-first = "what should this do?" |
291
- | "Already manually tested" | Ad-hoc ≠ systematic. No record, can't re-run. |
292
- | "Deleting X hours is wasteful" | Sunk cost fallacy. Keeping unverified code is technical debt. |
293
- | "Keep as reference, write tests first" | You'll adapt it. That's testing after. Delete means delete. |
294
- | "Need to explore first" | Fine. Throw away exploration, start with TDD. |
295
- | "Test hard = design unclear" | Listen to test. Hard to test = hard to use. |
296
- | "TDD will slow me down" | TDD faster than debugging. Pragmatic = test-first. |
297
- | "Manual test faster" | Manual doesn't prove edge cases. You'll re-test every change. |
298
- | "Existing code has no tests" | You're improving it. Add tests for existing code. |
299
-
300
- ## Red Flags - STOP and Start Over
301
-
302
- - Code before test
303
- - Test after implementation
304
- - Test passes immediately
305
- - Can't explain why test failed
306
- - Tests added "later"
307
- - Rationalizing "just this once"
308
- - "I already manually tested it"
309
- - "Tests after achieve the same purpose"
310
- - "It's about spirit not ritual"
311
- - "Keep as reference" or "adapt existing code"
312
- - "Already spent X hours, deleting is wasteful"
313
- - "TDD is dogmatic, I'm being pragmatic"
314
- - "This is different because..."
315
-
316
- **All of these mean: Delete code. Start over with TDD.**
317
-
318
- ## Example: Bug Fix
319
-
320
- **Bug:** Empty email accepted
321
-
322
- **RED**
323
- ```typescript
324
- test('rejects empty email', async () => {
325
- const result = await submitForm({ email: '' });
326
- expect(result.error).toBe('Email required');
327
- });
328
- ```
329
-
330
- **Verify RED**
331
- ```bash
332
- $ npm test
333
- FAIL: expected 'Email required', got undefined
334
- ```
335
-
336
- **GREEN**
337
- ```typescript
338
- function submitForm(data: FormData) {
339
- if (!data.email?.trim()) {
340
- return { error: 'Email required' };
341
- }
342
- // ...
343
- }
344
- ```
345
-
346
- **Verify GREEN**
347
- ```bash
348
- $ npm test
349
- PASS
350
- ```
351
-
352
- **REFACTOR**
353
- Extract validation for multiple fields if needed.
354
-
355
- ## Verification Checklist
356
-
357
- Before marking work complete:
358
-
359
- - [ ] Every new function/method has a test
360
- - [ ] Watched each test fail before implementing
361
- - [ ] Each test failed for expected reason (feature missing, not typo)
362
- - [ ] Wrote minimal code to pass each test
363
- - [ ] All tests pass
364
- - [ ] Output pristine (no errors, warnings)
365
- - [ ] Tests use real code (mocks only if unavoidable)
366
- - [ ] Edge cases and errors covered
367
-
368
- Can't check all boxes? You skipped TDD. Start over.
369
-
370
- ## When Stuck
371
-
372
- | Problem | Solution |
373
- |---------|----------|
374
- | Don't know how to test | Write wished-for API. Write assertion first. Ask your human partner. |
375
- | Test too complicated | Design too complicated. Simplify interface. |
376
- | Must mock everything | Code too coupled. Use dependency injection. |
377
- | Test setup huge | Extract helpers. Still complex? Simplify design. |
378
-
379
- ## Debugging Integration
380
-
381
- Bug found? Write failing test reproducing it. Follow TDD cycle. Test proves fix and prevents regression.
382
-
383
- Never fix bugs without a test.
384
-
385
- ## Final Rule
386
-
387
- ```
388
- Production code → test exists and failed first
389
- Otherwise → not TDD
390
- ```
391
-
392
- No exceptions without your human partner's permission.