@zcy2nn/agent-forge 1.1.3 → 1.1.5

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 (58) hide show
  1. package/README.md +188 -247
  2. package/agent-forge.schema.json +2 -265
  3. package/dist/agents/orchestrator.d.ts +1 -1
  4. package/dist/cli/index.js +90 -259
  5. package/dist/cli/providers.d.ts +0 -44
  6. package/dist/cli/types.d.ts +0 -2
  7. package/dist/config/constants.d.ts +3 -8
  8. package/dist/config/index.d.ts +0 -1
  9. package/dist/config/loader.d.ts +1 -1
  10. package/dist/config/schema.d.ts +1 -184
  11. package/dist/hooks/index.d.ts +0 -6
  12. package/dist/hooks/json-error-recovery/hook.d.ts +1 -1
  13. package/dist/hooks/todo-continuation/index.d.ts +2 -1
  14. package/dist/index.d.ts +1 -1
  15. package/dist/index.js +7875 -31853
  16. package/dist/tools/index.d.ts +0 -3
  17. package/dist/tui.js +5 -61
  18. package/dist/utils/index.d.ts +0 -2
  19. package/package.json +95 -104
  20. package/src/skills/brainstorming/SKILL.md +185 -186
  21. package/src/skills/brainstorming/scripts/frame-template.html +214 -214
  22. package/src/skills/brainstorming/scripts/server.cjs +354 -354
  23. package/src/skills/brainstorming/spec-document-reviewer-prompt.md +1 -1
  24. package/src/skills/requesting-code-review/SKILL.md +1 -1
  25. package/src/skills/subagent-driven-development/SKILL.md +1 -1
  26. package/src/skills/systematic-debugging/SKILL.md +318 -318
  27. package/src/skills/test-driven-development/SKILL.md +392 -392
  28. package/src/skills/verification-before-completion/SKILL.md +153 -153
  29. package/src/skills/writing-plans/SKILL.md +2 -2
  30. package/src/skills/writing-skills/graphviz-conventions.dot +171 -171
  31. package/dist/agents/council.d.ts +0 -27
  32. package/dist/agents/councillor.d.ts +0 -2
  33. package/dist/agents/designer.d.ts +0 -2
  34. package/dist/agents/explorer.d.ts +0 -2
  35. package/dist/agents/fixer.d.ts +0 -2
  36. package/dist/agents/implementer.d.ts +0 -2
  37. package/dist/agents/librarian.d.ts +0 -2
  38. package/dist/agents/observer.d.ts +0 -2
  39. package/dist/agents/oracle.d.ts +0 -2
  40. package/dist/agents/reviewer.d.ts +0 -2
  41. package/dist/cli/migration.d.ts +0 -46
  42. package/dist/config/council-schema.d.ts +0 -127
  43. package/dist/council/council-manager.d.ts +0 -49
  44. package/dist/council/index.d.ts +0 -1
  45. package/dist/hooks/phase-reminder/index.d.ts +0 -26
  46. package/dist/hooks/post-file-tool-nudge/index.d.ts +0 -19
  47. package/dist/skills/systematic-debugging/condition-based-waiting-example.d.ts +0 -51
  48. package/dist/tools/council.d.ts +0 -10
  49. package/src/skills/codemap/README.md +0 -59
  50. package/src/skills/codemap/SKILL.md +0 -163
  51. package/src/skills/codemap/codemap.md +0 -36
  52. package/src/skills/codemap/scripts/codemap.mjs +0 -483
  53. package/src/skills/codemap/scripts/codemap.test.ts +0 -129
  54. package/src/skills/codemap.md +0 -40
  55. package/src/skills/simplify/README.md +0 -19
  56. package/src/skills/simplify/SKILL.md +0 -138
  57. package/src/skills/simplify/codemap.md +0 -36
  58. package/src/skills/using-git-worktrees/SKILL.md +0 -226
@@ -4,7 +4,7 @@ Use this template when dispatching a spec document reviewer subagent.
4
4
 
5
5
  **Purpose:** Verify the spec is complete, consistent, and ready for implementation planning.
6
6
 
7
- **Dispatch after:** Spec document is written to docs/superpowers/specs/
7
+ **Dispatch after:** Spec document is written to docs/agent-forge/specs/
8
8
 
9
9
  ```
10
10
  Task tool (general-purpose):
@@ -58,7 +58,7 @@ HEAD_SHA=$(git rev-parse HEAD)
58
58
 
59
59
  [Dispatch superpowers:code-reviewer subagent]
60
60
  WHAT_WAS_IMPLEMENTED: Verification and repair functions for conversation index
61
- PLAN_OR_REQUIREMENTS: Task 2 from docs/superpowers/plans/deployment-plan.md
61
+ PLAN_OR_REQUIREMENTS: Task 2 from docs/agent-forge/plans/deployment-plan.md
62
62
  BASE_SHA: a7981ec
63
63
  HEAD_SHA: 3df7661
64
64
  DESCRIPTION: Added verifyIndex() and repairIndex() with 4 issue types
@@ -128,7 +128,7 @@ Implementer subagents report one of four statuses. Handle each appropriately:
128
128
  ```
129
129
  You: I'm using Subagent-Driven Development to execute this plan.
130
130
 
131
- [Read plan file once: docs/superpowers/plans/feature-plan.md]
131
+ [Read plan file once: docs/agent-forge/plans/feature-plan.md]
132
132
  [Extract all 5 tasks with full text and context]
133
133
  [Create TodoWrite with all tasks]
134
134
 
@@ -1,318 +1,318 @@
1
- ---
2
- name: systematic-debugging
3
- description: Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
4
- ---
5
-
6
- # Systematic Debugging
7
-
8
- ## Overview
9
-
10
- Random fixes waste time and create new bugs. Quick patches mask underlying issues.
11
-
12
- **Core principle:** ALWAYS find root cause before attempting fixes. Symptom fixes are failure.
13
-
14
- **Violating the letter of this process is violating the spirit of debugging.**
15
-
16
- ## The Iron Law
17
-
18
- ```
19
- For Medium/Complex bugs: NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
20
- For Simple bugs: Quick fix is acceptable if the cause is obvious, but verify the fix works
21
- ```
22
-
23
- If you haven't completed Phase 1 for a Medium/Complex bug, you cannot propose fixes.
24
-
25
- For Simple bugs (single error, obvious symptom, config typo, known pattern): you may fix directly, but must verify the fix resolves the issue. If the quick fix doesn't work, escalate to full investigation immediately.
26
-
27
- ## When to Use
28
-
29
- Use for ANY technical issue:
30
- - Test failures
31
- - Bugs in production
32
- - Unexpected behavior
33
- - Performance problems
34
- - Build failures
35
- - Integration issues
36
-
37
- **Use this ESPECIALLY when:**
38
- - Under time pressure (emergencies make guessing tempting)
39
- - "Just one quick fix" seems obvious
40
- - You've already tried multiple fixes
41
- - Previous fix didn't work
42
- - You don't fully understand the issue
43
-
44
- **Don't skip when:**
45
- - You're in a hurry (rushing guarantees rework)
46
- - Manager wants it fixed NOW (systematic is faster than thrashing)
47
- - Previous fix didn't work (symptom fixing masks root cause)
48
-
49
- **When abbreviated investigation is acceptable:**
50
- - session-bootstrap classifies the task as Simple
51
- - The cause is obvious from the error message (e.g., config typo, missing import)
52
- - If the quick fix doesn't work, immediately escalate to full investigation
53
-
54
- ## The Four Phases
55
-
56
- You MUST complete each phase before proceeding to the next.
57
-
58
- ### Phase 1: Root Cause Investigation
59
-
60
- **BEFORE attempting ANY fix:**
61
-
62
- 1. **Read Error Messages Carefully**
63
- - Don't skip past errors or warnings
64
- - They often contain the exact solution
65
- - Read stack traces completely
66
- - Note line numbers, file paths, error codes
67
-
68
- 2. **Reproduce Consistently**
69
- - Can you trigger it reliably?
70
- - What are the exact steps?
71
- - Does it happen every time?
72
- - If not reproducible → gather more data, don't guess
73
-
74
- 3. **Check Recent Changes**
75
- - What changed that could cause this?
76
- - Git diff, recent commits
77
- - New dependencies, config changes
78
- - Environmental differences
79
-
80
- 4. **Gather Evidence in Multi-Component Systems**
81
-
82
- **WHEN system has multiple components (CI → build → signing, API → service → database):**
83
-
84
- **BEFORE proposing fixes, add diagnostic instrumentation:**
85
- ```
86
- For EACH component boundary:
87
- - Log what data enters component
88
- - Log what data exits component
89
- - Verify environment/config propagation
90
- - Check state at each layer
91
-
92
- Run once to gather evidence showing WHERE it breaks
93
- THEN analyze evidence to identify failing component
94
- THEN investigate that specific component
95
- ```
96
-
97
- **Example (multi-layer system):**
98
- ```bash
99
- # Layer 1: Workflow
100
- echo "=== Secrets available in workflow: ==="
101
- echo "IDENTITY: ${IDENTITY:+SET}${IDENTITY:-UNSET}"
102
-
103
- # Layer 2: Build script
104
- echo "=== Env vars in build script: ==="
105
- env | grep IDENTITY || echo "IDENTITY not in environment"
106
-
107
- # Layer 3: Signing script
108
- echo "=== Keychain state: ==="
109
- security list-keychains
110
- security find-identity -v
111
-
112
- # Layer 4: Actual signing
113
- codesign --sign "$IDENTITY" --verbose=4 "$APP"
114
- ```
115
-
116
- **This reveals:** Which layer fails (secrets → workflow ✓, workflow → build ✗)
117
-
118
- 5. **Trace Data Flow**
119
-
120
- **WHEN error is deep in call stack:**
121
-
122
- See `root-cause-tracing.md` in this directory for the complete backward tracing technique.
123
-
124
- **Quick version:**
125
- - Where does bad value originate?
126
- - What called this with bad value?
127
- - Keep tracing up until you find the source
128
- - Fix at source, not at symptom
129
-
130
- ### Phase 2: Pattern Analysis
131
-
132
- **Find the pattern before fixing:**
133
-
134
- 1. **Find Working Examples**
135
- - Locate similar working code in same codebase
136
- - What works that's similar to what's broken?
137
-
138
- 2. **Compare Against References**
139
- - If implementing pattern, read reference implementation COMPLETELY
140
- - Don't skim - read every line
141
- - Understand the pattern fully before applying
142
-
143
- 3. **Identify Differences**
144
- - What's different between working and broken?
145
- - List every difference, however small
146
- - Don't assume "that can't matter"
147
-
148
- 4. **Understand Dependencies**
149
- - What other components does this need?
150
- - What settings, config, environment?
151
- - What assumptions does it make?
152
-
153
- ### Phase 3: Hypothesis and Testing
154
-
155
- **Scientific method:**
156
-
157
- 1. **Form Single Hypothesis**
158
- - State clearly: "I think X is the root cause because Y"
159
- - Write it down
160
- - Be specific, not vague
161
-
162
- 2. **Test Minimally**
163
- - Make the SMALLEST possible change to test hypothesis
164
- - One variable at a time
165
- - Don't fix multiple things at once
166
-
167
- 3. **Verify Before Continuing**
168
- - Did it work? Yes → Phase 4
169
- - Didn't work? Form NEW hypothesis
170
- - DON'T add more fixes on top
171
-
172
- 4. **When You Don't Know**
173
- - Say "I don't understand X"
174
- - Don't pretend to know
175
- - Ask for help
176
- - Research more
177
-
178
- ### Phase 4: Implementation
179
-
180
- **Fix the root cause, not the symptom:**
181
-
182
- 1. **Create Failing Test Case**
183
- - Simplest possible reproduction
184
- - Automated test if possible
185
- - One-off test script if no framework
186
- - MUST have before fixing
187
- - Use the `superpowers:test-driven-development` skill for writing proper failing tests
188
-
189
- 2. **Implement Single Fix**
190
- - Address the root cause identified
191
- - ONE change at a time
192
- - No "while I'm here" improvements
193
- - No bundled refactoring
194
-
195
- 3. **Verify Fix**
196
- - Test passes now?
197
- - No other tests broken?
198
- - Issue actually resolved?
199
-
200
- 4. **If Fix Doesn't Work**
201
- - STOP
202
- - Count: How many fixes have you tried?
203
- - If < 3: Return to Phase 1, re-analyze with new information
204
- - **If ≥ 3: STOP and question the architecture (step 5 below)**
205
- - DON'T attempt Fix #4 without architectural discussion
206
-
207
- 5. **If 3+ Fixes Failed: Question Architecture**
208
-
209
- **Pattern indicating architectural problem:**
210
- - Each fix reveals new shared state/coupling/problem in different place
211
- - Fixes require "massive refactoring" to implement
212
- - Each fix creates new symptoms elsewhere
213
-
214
- **STOP and question fundamentals:**
215
- - Is this pattern fundamentally sound?
216
- - Are we "sticking with it through sheer inertia"?
217
- - Should we refactor architecture vs. continue fixing symptoms?
218
-
219
- **Discuss with your human partner before attempting more fixes**
220
-
221
- This is NOT a failed hypothesis - this is a wrong architecture.
222
-
223
- ## Red Flags - STOP and Follow Process
224
-
225
- If you catch yourself thinking:
226
- - "Quick fix for now, investigate later"
227
- - "Just try changing X and see if it works"
228
- - "Add multiple changes, run tests"
229
- - "Skip the test, I'll manually verify"
230
- - "It's probably X, let me fix that"
231
- - "I don't fully understand but this might work"
232
- - "Pattern says X but I'll adapt it differently"
233
- - "Here are the main problems: [lists fixes without investigation]"
234
- - Proposing solutions before tracing data flow
235
- - **"One more fix attempt" (when already tried 2+)**
236
- - **Each fix reveals new problem in different place**
237
-
238
- **ALL of these mean: STOP. Return to Phase 1.**
239
-
240
- **If 3+ fixes failed:** Question the architecture (see Phase 4.5)
241
-
242
- ## your human partner's Signals You're Doing It Wrong
243
-
244
- **Watch for these redirections:**
245
- - "Is that not happening?" - You assumed without verifying
246
- - "Will it show us...?" - You should have added evidence gathering
247
- - "Stop guessing" - You're proposing fixes without understanding
248
- - "Ultrathink this" - Question fundamentals, not just symptoms
249
- - "We're stuck?" (frustrated) - Your approach isn't working
250
-
251
- **When you see these:** STOP. Return to Phase 1.
252
-
253
- ## Common Rationalizations
254
-
255
- | Excuse | Reality |
256
- |--------|---------|
257
- | "Issue is simple, don't need process" | Simple issues have root causes too. Process is fast for simple bugs. |
258
- | "Emergency, no time for process" | Systematic debugging is FASTER than guess-and-check thrashing. |
259
- | "Just try this first, then investigate" | First fix sets the pattern. Do it right from the start. |
260
- | "I'll write test after confirming fix works" | Untested fixes don't stick. Test first proves it. |
261
- | "Multiple fixes at once saves time" | Can't isolate what worked. Causes new bugs. |
262
- | "Reference too long, I'll adapt the pattern" | Partial understanding guarantees bugs. Read it completely. |
263
- | "I see the problem, let me fix it" | Seeing symptoms ≠ understanding root cause. |
264
- | "One more fix attempt" (after 2+ failures) | 3+ failures = architectural problem. Question pattern, don't fix again. |
265
-
266
- ## Quick Reference
267
-
268
- | Phase | Key Activities | Success Criteria |
269
- |-------|---------------|------------------|
270
- | **1. Root Cause** | Read errors, reproduce, check changes, gather evidence | Understand WHAT and WHY |
271
- | **2. Pattern** | Find working examples, compare | Identify differences |
272
- | **3. Hypothesis** | Form theory, test minimally | Confirmed or new hypothesis |
273
- | **4. Implementation** | Create test, fix, verify | Bug resolved, tests pass |
274
-
275
- ## When Process Reveals "No Root Cause"
276
-
277
- If systematic investigation reveals issue is truly environmental, timing-dependent, or external:
278
-
279
- 1. You've completed the process
280
- 2. Document what you investigated
281
- 3. Implement appropriate handling (retry, timeout, error message)
282
- 4. Add monitoring/logging for future investigation
283
-
284
- **But:** 95% of "no root cause" cases are incomplete investigation.
285
-
286
- ## Supporting Techniques
287
-
288
- These techniques are part of systematic debugging and available in this directory:
289
-
290
- - **`root-cause-tracing.md`** - Trace bugs backward through call stack to find original trigger
291
- - **`defense-in-depth.md`** - Add validation at multiple layers after finding root cause
292
- - **`condition-based-waiting.md`** - Replace arbitrary timeouts with condition polling
293
-
294
- **Related skills:**
295
- - **superpowers:test-driven-development** - For creating failing test case (Phase 4, Step 1)
296
- - **superpowers:verification-before-completion** - Verify fix worked before claiming success
297
-
298
- ## Complexity Assessment
299
-
300
- **Lightweight usage:**
301
- - Reproduce → read error → fix directly (only when cause is obvious)
302
- - Skip hypothesis verification and root cause analysis
303
- - Applies when session-bootstrap classifies the task as Simple
304
- - If quick fix doesn't work, escalate to Standard immediately
305
-
306
- **Standard usage:**
307
- - Full flow: reproduce → gather evidence → hypothesize → verify → fix → regression test
308
-
309
- **Deep usage:**
310
- - Standard + root cause analysis + fix similar issues + update docs
311
-
312
- ## Real-World Impact
313
-
314
- From debugging sessions:
315
- - Systematic approach: 15-30 minutes to fix
316
- - Random fixes approach: 2-3 hours of thrashing
317
- - First-time fix rate: 95% vs 40%
318
- - New bugs introduced: Near zero vs common
1
+ ---
2
+ name: systematic-debugging
3
+ description: Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
4
+ ---
5
+
6
+ # Systematic Debugging
7
+
8
+ ## Overview
9
+
10
+ Random fixes waste time and create new bugs. Quick patches mask underlying issues.
11
+
12
+ **Core principle:** ALWAYS find root cause before attempting fixes. Symptom fixes are failure.
13
+
14
+ **Violating the letter of this process is violating the spirit of debugging.**
15
+
16
+ ## The Iron Law
17
+
18
+ ```
19
+ For Medium/Complex bugs: NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
20
+ For Simple bugs: Quick fix is acceptable if the cause is obvious, but verify the fix works
21
+ ```
22
+
23
+ If you haven't completed Phase 1 for a Medium/Complex bug, you cannot propose fixes.
24
+
25
+ For Simple bugs (single error, obvious symptom, config typo, known pattern): you may fix directly, but must verify the fix resolves the issue. If the quick fix doesn't work, escalate to full investigation immediately.
26
+
27
+ ## When to Use
28
+
29
+ Use for ANY technical issue:
30
+ - Test failures
31
+ - Bugs in production
32
+ - Unexpected behavior
33
+ - Performance problems
34
+ - Build failures
35
+ - Integration issues
36
+
37
+ **Use this ESPECIALLY when:**
38
+ - Under time pressure (emergencies make guessing tempting)
39
+ - "Just one quick fix" seems obvious
40
+ - You've already tried multiple fixes
41
+ - Previous fix didn't work
42
+ - You don't fully understand the issue
43
+
44
+ **Don't skip when:**
45
+ - You're in a hurry (rushing guarantees rework)
46
+ - Manager wants it fixed NOW (systematic is faster than thrashing)
47
+ - Previous fix didn't work (symptom fixing masks root cause)
48
+
49
+ **When abbreviated investigation is acceptable:**
50
+ - session-bootstrap classifies the task as Simple
51
+ - The cause is obvious from the error message (e.g., config typo, missing import)
52
+ - If the quick fix doesn't work, immediately escalate to full investigation
53
+
54
+ ## The Four Phases
55
+
56
+ You MUST complete each phase before proceeding to the next.
57
+
58
+ ### Phase 1: Root Cause Investigation
59
+
60
+ **BEFORE attempting ANY fix:**
61
+
62
+ 1. **Read Error Messages Carefully**
63
+ - Don't skip past errors or warnings
64
+ - They often contain the exact solution
65
+ - Read stack traces completely
66
+ - Note line numbers, file paths, error codes
67
+
68
+ 2. **Reproduce Consistently**
69
+ - Can you trigger it reliably?
70
+ - What are the exact steps?
71
+ - Does it happen every time?
72
+ - If not reproducible → gather more data, don't guess
73
+
74
+ 3. **Check Recent Changes**
75
+ - What changed that could cause this?
76
+ - Git diff, recent commits
77
+ - New dependencies, config changes
78
+ - Environmental differences
79
+
80
+ 4. **Gather Evidence in Multi-Component Systems**
81
+
82
+ **WHEN system has multiple components (CI → build → signing, API → service → database):**
83
+
84
+ **BEFORE proposing fixes, add diagnostic instrumentation:**
85
+ ```
86
+ For EACH component boundary:
87
+ - Log what data enters component
88
+ - Log what data exits component
89
+ - Verify environment/config propagation
90
+ - Check state at each layer
91
+
92
+ Run once to gather evidence showing WHERE it breaks
93
+ THEN analyze evidence to identify failing component
94
+ THEN investigate that specific component
95
+ ```
96
+
97
+ **Example (multi-layer system):**
98
+ ```bash
99
+ # Layer 1: Workflow
100
+ echo "=== Secrets available in workflow: ==="
101
+ echo "IDENTITY: ${IDENTITY:+SET}${IDENTITY:-UNSET}"
102
+
103
+ # Layer 2: Build script
104
+ echo "=== Env vars in build script: ==="
105
+ env | grep IDENTITY || echo "IDENTITY not in environment"
106
+
107
+ # Layer 3: Signing script
108
+ echo "=== Keychain state: ==="
109
+ security list-keychains
110
+ security find-identity -v
111
+
112
+ # Layer 4: Actual signing
113
+ codesign --sign "$IDENTITY" --verbose=4 "$APP"
114
+ ```
115
+
116
+ **This reveals:** Which layer fails (secrets → workflow ✓, workflow → build ✗)
117
+
118
+ 5. **Trace Data Flow**
119
+
120
+ **WHEN error is deep in call stack:**
121
+
122
+ See `root-cause-tracing.md` in this directory for the complete backward tracing technique.
123
+
124
+ **Quick version:**
125
+ - Where does bad value originate?
126
+ - What called this with bad value?
127
+ - Keep tracing up until you find the source
128
+ - Fix at source, not at symptom
129
+
130
+ ### Phase 2: Pattern Analysis
131
+
132
+ **Find the pattern before fixing:**
133
+
134
+ 1. **Find Working Examples**
135
+ - Locate similar working code in same codebase
136
+ - What works that's similar to what's broken?
137
+
138
+ 2. **Compare Against References**
139
+ - If implementing pattern, read reference implementation COMPLETELY
140
+ - Don't skim - read every line
141
+ - Understand the pattern fully before applying
142
+
143
+ 3. **Identify Differences**
144
+ - What's different between working and broken?
145
+ - List every difference, however small
146
+ - Don't assume "that can't matter"
147
+
148
+ 4. **Understand Dependencies**
149
+ - What other components does this need?
150
+ - What settings, config, environment?
151
+ - What assumptions does it make?
152
+
153
+ ### Phase 3: Hypothesis and Testing
154
+
155
+ **Scientific method:**
156
+
157
+ 1. **Form Single Hypothesis**
158
+ - State clearly: "I think X is the root cause because Y"
159
+ - Write it down
160
+ - Be specific, not vague
161
+
162
+ 2. **Test Minimally**
163
+ - Make the SMALLEST possible change to test hypothesis
164
+ - One variable at a time
165
+ - Don't fix multiple things at once
166
+
167
+ 3. **Verify Before Continuing**
168
+ - Did it work? Yes → Phase 4
169
+ - Didn't work? Form NEW hypothesis
170
+ - DON'T add more fixes on top
171
+
172
+ 4. **When You Don't Know**
173
+ - Say "I don't understand X"
174
+ - Don't pretend to know
175
+ - Ask for help
176
+ - Research more
177
+
178
+ ### Phase 4: Implementation
179
+
180
+ **Fix the root cause, not the symptom:**
181
+
182
+ 1. **Create Failing Test Case**
183
+ - Simplest possible reproduction
184
+ - Automated test if possible
185
+ - One-off test script if no framework
186
+ - MUST have before fixing
187
+ - Use the `superpowers:test-driven-development` skill for writing proper failing tests
188
+
189
+ 2. **Implement Single Fix**
190
+ - Address the root cause identified
191
+ - ONE change at a time
192
+ - No "while I'm here" improvements
193
+ - No bundled refactoring
194
+
195
+ 3. **Verify Fix**
196
+ - Test passes now?
197
+ - No other tests broken?
198
+ - Issue actually resolved?
199
+
200
+ 4. **If Fix Doesn't Work**
201
+ - STOP
202
+ - Count: How many fixes have you tried?
203
+ - If < 3: Return to Phase 1, re-analyze with new information
204
+ - **If ≥ 3: STOP and question the architecture (step 5 below)**
205
+ - DON'T attempt Fix #4 without architectural discussion
206
+
207
+ 5. **If 3+ Fixes Failed: Question Architecture**
208
+
209
+ **Pattern indicating architectural problem:**
210
+ - Each fix reveals new shared state/coupling/problem in different place
211
+ - Fixes require "massive refactoring" to implement
212
+ - Each fix creates new symptoms elsewhere
213
+
214
+ **STOP and question fundamentals:**
215
+ - Is this pattern fundamentally sound?
216
+ - Are we "sticking with it through sheer inertia"?
217
+ - Should we refactor architecture vs. continue fixing symptoms?
218
+
219
+ **Discuss with your human partner before attempting more fixes**
220
+
221
+ This is NOT a failed hypothesis - this is a wrong architecture.
222
+
223
+ ## Red Flags - STOP and Follow Process
224
+
225
+ If you catch yourself thinking:
226
+ - "Quick fix for now, investigate later"
227
+ - "Just try changing X and see if it works"
228
+ - "Add multiple changes, run tests"
229
+ - "Skip the test, I'll manually verify"
230
+ - "It's probably X, let me fix that"
231
+ - "I don't fully understand but this might work"
232
+ - "Pattern says X but I'll adapt it differently"
233
+ - "Here are the main problems: [lists fixes without investigation]"
234
+ - Proposing solutions before tracing data flow
235
+ - **"One more fix attempt" (when already tried 2+)**
236
+ - **Each fix reveals new problem in different place**
237
+
238
+ **ALL of these mean: STOP. Return to Phase 1.**
239
+
240
+ **If 3+ fixes failed:** Question the architecture (see Phase 4.5)
241
+
242
+ ## your human partner's Signals You're Doing It Wrong
243
+
244
+ **Watch for these redirections:**
245
+ - "Is that not happening?" - You assumed without verifying
246
+ - "Will it show us...?" - You should have added evidence gathering
247
+ - "Stop guessing" - You're proposing fixes without understanding
248
+ - "Ultrathink this" - Question fundamentals, not just symptoms
249
+ - "We're stuck?" (frustrated) - Your approach isn't working
250
+
251
+ **When you see these:** STOP. Return to Phase 1.
252
+
253
+ ## Common Rationalizations
254
+
255
+ | Excuse | Reality |
256
+ |--------|---------|
257
+ | "Issue is simple, don't need process" | Simple issues have root causes too. Process is fast for simple bugs. |
258
+ | "Emergency, no time for process" | Systematic debugging is FASTER than guess-and-check thrashing. |
259
+ | "Just try this first, then investigate" | First fix sets the pattern. Do it right from the start. |
260
+ | "I'll write test after confirming fix works" | Untested fixes don't stick. Test first proves it. |
261
+ | "Multiple fixes at once saves time" | Can't isolate what worked. Causes new bugs. |
262
+ | "Reference too long, I'll adapt the pattern" | Partial understanding guarantees bugs. Read it completely. |
263
+ | "I see the problem, let me fix it" | Seeing symptoms ≠ understanding root cause. |
264
+ | "One more fix attempt" (after 2+ failures) | 3+ failures = architectural problem. Question pattern, don't fix again. |
265
+
266
+ ## Quick Reference
267
+
268
+ | Phase | Key Activities | Success Criteria |
269
+ |-------|---------------|------------------|
270
+ | **1. Root Cause** | Read errors, reproduce, check changes, gather evidence | Understand WHAT and WHY |
271
+ | **2. Pattern** | Find working examples, compare | Identify differences |
272
+ | **3. Hypothesis** | Form theory, test minimally | Confirmed or new hypothesis |
273
+ | **4. Implementation** | Create test, fix, verify | Bug resolved, tests pass |
274
+
275
+ ## When Process Reveals "No Root Cause"
276
+
277
+ If systematic investigation reveals issue is truly environmental, timing-dependent, or external:
278
+
279
+ 1. You've completed the process
280
+ 2. Document what you investigated
281
+ 3. Implement appropriate handling (retry, timeout, error message)
282
+ 4. Add monitoring/logging for future investigation
283
+
284
+ **But:** 95% of "no root cause" cases are incomplete investigation.
285
+
286
+ ## Supporting Techniques
287
+
288
+ These techniques are part of systematic debugging and available in this directory:
289
+
290
+ - **`root-cause-tracing.md`** - Trace bugs backward through call stack to find original trigger
291
+ - **`defense-in-depth.md`** - Add validation at multiple layers after finding root cause
292
+ - **`condition-based-waiting.md`** - Replace arbitrary timeouts with condition polling
293
+
294
+ **Related skills:**
295
+ - **superpowers:test-driven-development** - For creating failing test case (Phase 4, Step 1)
296
+ - **superpowers:verification-before-completion** - Verify fix worked before claiming success
297
+
298
+ ## Complexity Assessment
299
+
300
+ **Lightweight usage:**
301
+ - Reproduce → read error → fix directly (only when cause is obvious)
302
+ - Skip hypothesis verification and root cause analysis
303
+ - Applies when session-bootstrap classifies the task as Simple
304
+ - If quick fix doesn't work, escalate to Standard immediately
305
+
306
+ **Standard usage:**
307
+ - Full flow: reproduce → gather evidence → hypothesize → verify → fix → regression test
308
+
309
+ **Deep usage:**
310
+ - Standard + root cause analysis + fix similar issues + update docs
311
+
312
+ ## Real-World Impact
313
+
314
+ From debugging sessions:
315
+ - Systematic approach: 15-30 minutes to fix
316
+ - Random fixes approach: 2-3 hours of thrashing
317
+ - First-time fix rate: 95% vs 40%
318
+ - New bugs introduced: Near zero vs common