sdtk-code-kit 0.1.3 → 0.2.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 (39) hide show
  1. package/README.md +17 -0
  2. package/assets/manifest/toolkit-bundle.manifest.json +147 -147
  3. package/assets/manifest/toolkit-bundle.sha256.txt +10 -10
  4. package/assets/toolkit/toolkit/AGENTS.md +219 -219
  5. package/assets/toolkit/toolkit/install.ps1 +156 -156
  6. package/assets/toolkit/toolkit/sdtk-spec.config.json +6 -6
  7. package/assets/toolkit/toolkit/skills/code-debug/SKILL.md +295 -295
  8. package/assets/toolkit/toolkit/skills/code-discover/SKILL.md +54 -54
  9. package/assets/toolkit/toolkit/skills/code-tdd/SKILL.md +377 -377
  10. package/assets/toolkit/toolkit/skills/code-worktree/SKILL.md +215 -215
  11. package/assets/toolkit/toolkit/templates/CODE_WORKFLOW_TEMPLATE.md +28 -0
  12. package/package.json +44 -44
  13. package/src/commands/doctor.js +52 -0
  14. package/src/commands/guardrails.js +215 -0
  15. package/src/commands/help.js +244 -220
  16. package/src/commands/init.js +98 -98
  17. package/src/commands/readiness.js +77 -0
  18. package/src/commands/resume.js +62 -0
  19. package/src/commands/sleep.js +132 -0
  20. package/src/commands/status.js +78 -0
  21. package/src/commands/update.js +11 -11
  22. package/src/commands/verify.js +5 -0
  23. package/src/index.js +108 -73
  24. package/src/lib/project-target-guard.js +53 -53
  25. package/src/lib/ship-readiness.js +281 -0
  26. package/src/lib/sleep-plan.js +175 -0
  27. package/src/lib/sleep-report.js +229 -0
  28. package/src/lib/trust-events.js +166 -0
  29. package/src/lib/trust-file-scope.js +154 -0
  30. package/src/lib/trust-policy.js +212 -0
  31. package/src/lib/trust-redact.js +35 -0
  32. package/src/lib/trust-trace.js +179 -0
  33. package/src/lib/update.js +344 -344
  34. package/src/lib/workflow-artifact.js +9 -2
  35. package/src/lib/workflow-doctor.js +84 -0
  36. package/src/lib/workflow-handoff.js +111 -19
  37. package/src/lib/workflow-review-packet.js +650 -561
  38. package/src/lib/workflow-state.js +439 -0
  39. package/src/lib/workflow-verify.js +393 -356
@@ -1,296 +1,296 @@
1
1
  ---
2
- name: code-debug
3
- description: Systematic debugging. Use when encountering any bug, test failure, or unexpected behavior -- binary search to root cause, evidence-first, no guessing fixes.
4
- ---
5
-
6
- # Code Debug
7
-
8
- ## Critical Constraints
9
- - I do not propose or apply fixes before tracing the problem to a root cause.
10
- - I do not stack speculative fixes on top of each other to see what sticks.
11
-
12
-
13
- ## Overview
14
- Random fixes waste time and create new bugs. Quick patches mask underlying issues.
15
-
16
- **Core principle:** ALWAYS find root cause before attempting fixes. Symptom fixes are failure.
17
-
18
- **Violating the letter of this process is violating the spirit of debugging.**
19
-
20
- ## Procedure
21
- Follow the four phases in order: investigate root cause, compare against working patterns, form one hypothesis, then implement the smallest fix with proof. If evidence is incomplete, return to investigation instead of proposing another fix.
22
-
23
- ## The Iron Law
24
-
25
- ```
26
- NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
27
- ```
28
-
29
- If you haven't completed Phase 1, you cannot propose fixes.
30
-
31
- ## When to Use
32
-
33
- Use for ANY technical issue:
34
- - Test failures
35
- - Bugs in production
36
- - Unexpected behavior
37
- - Performance problems
38
- - Build failures
39
- - Integration issues
40
-
41
- **Use this ESPECIALLY when:**
42
- - Under time pressure (emergencies make guessing tempting)
43
- - "Just one quick fix" seems obvious
44
- - You've already tried multiple fixes
45
- - Previous fix didn't work
46
- - You don't fully understand the issue
47
-
48
- **Don't skip when:**
49
- - Issue seems simple (simple bugs have root causes too)
50
- - You're in a hurry (rushing guarantees rework)
51
- - Manager wants it fixed NOW (systematic is faster than thrashing)
52
-
53
- ## The Four Phases
54
-
55
- You MUST complete each phase before proceeding to the next.
56
-
57
- ### Phase 1: Root Cause Investigation
58
-
59
- **BEFORE attempting ANY fix:**
60
-
61
- 1. **Read Error Messages Carefully**
62
- - Don't skip past errors or warnings
63
- - They often contain the exact solution
64
- - Read stack traces completely
65
- - Note line numbers, file paths, error codes
66
-
67
- 2. **Reproduce Consistently**
68
- - Can you trigger it reliably?
69
- - What are the exact steps?
70
- - Does it happen every time?
71
- - If not reproducible -> gather more data, don't guess
72
-
73
- 3. **Check Recent Changes**
74
- - What changed that could cause this?
75
- - Git diff, recent commits
76
- - New dependencies, config changes
77
- - Environmental differences
78
-
79
- 4. **Gather Evidence in Multi-Component Systems**
80
-
81
- **WHEN system has multiple components (CI -> build -> signing, API -> service -> database):**
82
-
83
- **BEFORE proposing fixes, add diagnostic instrumentation:**
84
- ```
85
- For EACH component boundary:
86
- - Log what data enters component
87
- - Log what data exits component
88
- - Verify environment/config propagation
89
- - Check state at each layer
90
-
91
- Run once to gather evidence showing WHERE it breaks
92
- THEN analyze evidence to identify failing component
93
- THEN investigate that specific component
94
- ```
95
-
96
- **Example (multi-layer system):**
97
- ```bash
98
- # Layer 1: Workflow
99
- echo "=== Secrets available in workflow: ==="
100
- echo "IDENTITY: ${IDENTITY:+SET}${IDENTITY:-UNSET}"
101
-
102
- # Layer 2: Build script
103
- echo "=== Env vars in build script: ==="
104
- env | grep IDENTITY || echo "IDENTITY not in environment"
105
-
106
- # Layer 3: Signing script
107
- echo "=== Keychain state: ==="
108
- security list-keychains
109
- security find-identity -v
110
-
111
- # Layer 4: Actual signing
112
- codesign --sign "$IDENTITY" --verbose=4 "$APP"
113
- ```
114
-
115
- **This reveals:** Which layer fails (secrets -> workflow , workflow -> build )
116
-
117
- 5. **Trace Data Flow**
118
-
119
- **WHEN error is deep in call stack:**
120
-
121
- See `./references/root-cause-tracing.md` in this directory for the complete backward tracing technique.
122
-
123
- **Quick version:**
124
- - Where does bad value originate?
125
- - What called this with bad value?
126
- - Keep tracing up until you find the source
127
- - Fix at source, not at symptom
128
-
129
- ### Phase 2: Pattern Analysis
130
-
131
- **Find the pattern before fixing:**
132
-
133
- 1. **Find Working Examples**
134
- - Locate similar working code in same codebase
135
- - What works that's similar to what's broken?
136
-
137
- 2. **Compare Against References**
138
- - If implementing pattern, read reference implementation COMPLETELY
139
- - Don't skim - read every line
140
- - Understand the pattern fully before applying
141
-
142
- 3. **Identify Differences**
143
- - What's different between working and broken?
144
- - List every difference, however small
145
- - Don't assume "that can't matter"
146
-
147
- 4. **Understand Dependencies**
148
- - What other components does this need?
149
- - What settings, config, environment?
150
- - What assumptions does it make?
151
-
152
- ### Phase 3: Hypothesis and Testing
153
-
154
- **Scientific method:**
155
-
156
- 1. **Form Single Hypothesis**
157
- - State clearly: "I think X is the root cause because Y"
158
- - Write it down
159
- - Be specific, not vague
160
-
161
- 2. **Test Minimally**
162
- - Make the SMALLEST possible change to test hypothesis
163
- - One variable at a time
164
- - Don't fix multiple things at once
165
-
166
- 3. **Verify Before Continuing**
167
- - Did it work? Yes -> Phase 4
168
- - Didn't work? Form NEW hypothesis
169
- - DON'T add more fixes on top
170
-
171
- 4. **When You Don't Know**
172
- - Say "I don't understand X"
173
- - Don't pretend to know
174
- - Ask for help
175
- - Research more
176
-
177
- ### Phase 4: Implementation
178
-
179
- **Fix the root cause, not the symptom:**
180
-
181
- 1. **Create Failing Test Case**
182
- - Simplest possible reproduction
183
- - Automated test if possible
184
- - One-off test script if no framework
185
- - MUST have before fixing
186
- - Use the `code-tdd` skill for writing proper failing tests
187
-
188
- 2. **Implement Single Fix**
189
- - Address the root cause identified
190
- - ONE change at a time
191
- - No "while I'm here" improvements
192
- - No bundled refactoring
193
-
194
- 3. **Verify Fix**
195
- - Test passes now?
196
- - No other tests broken?
197
- - Issue actually resolved?
198
-
199
- 4. **If Fix Doesn't Work**
200
- - STOP
201
- - Count: How many fixes have you tried?
202
- - If < 3: Return to Phase 1, re-analyze with new information
203
- - **If >= 3: STOP and question the architecture (step 5 below)**
204
- - DON'T attempt Fix #4 without architectural discussion
205
-
206
- 5. **If 3+ Fixes Failed: Question Architecture**
207
-
208
- **Pattern indicating architectural problem:**
209
- - Each fix reveals new shared state/coupling/problem in different place
210
- - Fixes require "massive refactoring" to implement
211
- - Each fix creates new symptoms elsewhere
212
-
213
- **STOP and question fundamentals:**
214
- - Is this pattern fundamentally sound?
215
- - Are we "sticking with it through sheer inertia"?
216
- - Should we refactor architecture vs. continue fixing symptoms?
217
-
218
- **Discuss with the user before attempting more fixes**
219
-
220
- This is NOT a failed hypothesis - this is a wrong architecture.
221
-
222
- ## Red Flags - STOP and Follow Process
223
-
224
- If you catch yourself thinking:
225
- - "Quick fix for now, investigate later"
226
- - "Just try changing X and see if it works"
227
- - "Add multiple changes, run tests"
228
- - "Skip the test, I'll manually verify"
229
- - "It's probably X, let me fix that"
230
- - "I don't fully understand but this might work"
231
- - "Pattern says X but I'll adapt it differently"
232
- - "Here are the main problems: [lists fixes without investigation]"
233
- - Proposing solutions before tracing data flow
234
- - **"One more fix attempt" (when already tried 2+)**
235
- - **Each fix reveals new problem in different place**
236
-
237
- **ALL of these mean: STOP. Return to Phase 1.**
238
-
239
- **If 3+ fixes failed:** Question the architecture (see Phase 4.5)
240
-
241
- ## Signals You Are Doing It Wrong
242
-
243
- **Watch for these redirections:**
244
- - "Is that not happening?" - You assumed without verifying
245
- - "Will it show us...?" - You should have added evidence gathering
246
- - "Stop guessing" - You're proposing fixes without understanding
247
- - "Ultrathink this" - Question fundamentals, not just symptoms
248
- - "We're stuck?" (frustrated) - Your approach isn't working
249
-
250
- **When you see these:** STOP. Return to Phase 1.
251
-
252
- ## Common Rationalizations
253
-
254
- | Excuse | Reality |
255
- |--------|---------|
256
- | "Issue is simple, don't need process" | Simple issues have root causes too. Process is fast for simple bugs. |
257
- | "Emergency, no time for process" | Systematic debugging is FASTER than guess-and-check thrashing. |
258
- | "Just try this first, then investigate" | First fix sets the pattern. Do it right from the start. |
259
- | "I'll write test after confirming fix works" | Untested fixes don't stick. Test first proves it. |
260
- | "Multiple fixes at once saves time" | Can't isolate what worked. Causes new bugs. |
261
- | "Reference too long, I'll adapt the pattern" | Partial understanding guarantees bugs. Read it completely. |
262
- | "I see the problem, let me fix it" | Seeing symptoms is not the same as understanding root cause. |
263
- | "One more fix attempt" (after 2+ failures) | 3+ failures = architectural problem. Question pattern, don't fix again. |
264
-
265
- ## Quick Reference
266
-
267
- | Phase | Key Activities | Success Criteria |
268
- |-------|---------------|------------------|
269
- | **1. Root Cause** | Read errors, reproduce, check changes, gather evidence | Understand WHAT and WHY |
270
- | **2. Pattern** | Find working examples, compare | Identify differences |
271
- | **3. Hypothesis** | Form theory, test minimally | Confirmed or new hypothesis |
272
- | **4. Implementation** | Create test, fix, verify | Bug resolved, tests pass |
273
-
274
- ## When Process Reveals "No Root Cause"
275
-
276
- If systematic investigation reveals issue is truly environmental, timing-dependent, or external:
277
-
278
- 1. You've completed the process
279
- 2. Document what you investigated
280
- 3. Implement appropriate handling (retry, timeout, error message)
281
- 4. Add monitoring/logging for future investigation
282
-
283
- **But:** 95% of "no root cause" cases are incomplete investigation.
284
-
285
- ## Supporting Techniques
286
-
287
- Use `./references/root-cause-tracing.md` to trace bugs backward through the call chain until the original trigger is found.
288
-
289
- **Related skills:**
290
- - **code-tdd** - For creating failing test case (Phase 4, Step 1)
291
- - **code-verify** - Verify fix worked before claiming success
292
-
293
- ## Real-World Impact
294
-
295
- From debugging sessions:
296
- - Systematic debugging minimizes thrash, increases first-time fix rate, and reduces new bugs introduced by speculative patches.
2
+ name: code-debug
3
+ description: Systematic debugging. Use when encountering any bug, test failure, or unexpected behavior -- binary search to root cause, evidence-first, no guessing fixes.
4
+ ---
5
+
6
+ # Code Debug
7
+
8
+ ## Critical Constraints
9
+ - I do not propose or apply fixes before tracing the problem to a root cause.
10
+ - I do not stack speculative fixes on top of each other to see what sticks.
11
+
12
+
13
+ ## Overview
14
+ Random fixes waste time and create new bugs. Quick patches mask underlying issues.
15
+
16
+ **Core principle:** ALWAYS find root cause before attempting fixes. Symptom fixes are failure.
17
+
18
+ **Violating the letter of this process is violating the spirit of debugging.**
19
+
20
+ ## Procedure
21
+ Follow the four phases in order: investigate root cause, compare against working patterns, form one hypothesis, then implement the smallest fix with proof. If evidence is incomplete, return to investigation instead of proposing another fix.
22
+
23
+ ## The Iron Law
24
+
25
+ ```
26
+ NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
27
+ ```
28
+
29
+ If you haven't completed Phase 1, you cannot propose fixes.
30
+
31
+ ## When to Use
32
+
33
+ Use for ANY technical issue:
34
+ - Test failures
35
+ - Bugs in production
36
+ - Unexpected behavior
37
+ - Performance problems
38
+ - Build failures
39
+ - Integration issues
40
+
41
+ **Use this ESPECIALLY when:**
42
+ - Under time pressure (emergencies make guessing tempting)
43
+ - "Just one quick fix" seems obvious
44
+ - You've already tried multiple fixes
45
+ - Previous fix didn't work
46
+ - You don't fully understand the issue
47
+
48
+ **Don't skip when:**
49
+ - Issue seems simple (simple bugs have root causes too)
50
+ - You're in a hurry (rushing guarantees rework)
51
+ - Manager wants it fixed NOW (systematic is faster than thrashing)
52
+
53
+ ## The Four Phases
54
+
55
+ You MUST complete each phase before proceeding to the next.
56
+
57
+ ### Phase 1: Root Cause Investigation
58
+
59
+ **BEFORE attempting ANY fix:**
60
+
61
+ 1. **Read Error Messages Carefully**
62
+ - Don't skip past errors or warnings
63
+ - They often contain the exact solution
64
+ - Read stack traces completely
65
+ - Note line numbers, file paths, error codes
66
+
67
+ 2. **Reproduce Consistently**
68
+ - Can you trigger it reliably?
69
+ - What are the exact steps?
70
+ - Does it happen every time?
71
+ - If not reproducible -> gather more data, don't guess
72
+
73
+ 3. **Check Recent Changes**
74
+ - What changed that could cause this?
75
+ - Git diff, recent commits
76
+ - New dependencies, config changes
77
+ - Environmental differences
78
+
79
+ 4. **Gather Evidence in Multi-Component Systems**
80
+
81
+ **WHEN system has multiple components (CI -> build -> signing, API -> service -> database):**
82
+
83
+ **BEFORE proposing fixes, add diagnostic instrumentation:**
84
+ ```
85
+ For EACH component boundary:
86
+ - Log what data enters component
87
+ - Log what data exits component
88
+ - Verify environment/config propagation
89
+ - Check state at each layer
90
+
91
+ Run once to gather evidence showing WHERE it breaks
92
+ THEN analyze evidence to identify failing component
93
+ THEN investigate that specific component
94
+ ```
95
+
96
+ **Example (multi-layer system):**
97
+ ```bash
98
+ # Layer 1: Workflow
99
+ echo "=== Secrets available in workflow: ==="
100
+ echo "IDENTITY: ${IDENTITY:+SET}${IDENTITY:-UNSET}"
101
+
102
+ # Layer 2: Build script
103
+ echo "=== Env vars in build script: ==="
104
+ env | grep IDENTITY || echo "IDENTITY not in environment"
105
+
106
+ # Layer 3: Signing script
107
+ echo "=== Keychain state: ==="
108
+ security list-keychains
109
+ security find-identity -v
110
+
111
+ # Layer 4: Actual signing
112
+ codesign --sign "$IDENTITY" --verbose=4 "$APP"
113
+ ```
114
+
115
+ **This reveals:** Which layer fails (secrets -> workflow , workflow -> build )
116
+
117
+ 5. **Trace Data Flow**
118
+
119
+ **WHEN error is deep in call stack:**
120
+
121
+ See `./references/root-cause-tracing.md` in this directory for the complete backward tracing technique.
122
+
123
+ **Quick version:**
124
+ - Where does bad value originate?
125
+ - What called this with bad value?
126
+ - Keep tracing up until you find the source
127
+ - Fix at source, not at symptom
128
+
129
+ ### Phase 2: Pattern Analysis
130
+
131
+ **Find the pattern before fixing:**
132
+
133
+ 1. **Find Working Examples**
134
+ - Locate similar working code in same codebase
135
+ - What works that's similar to what's broken?
136
+
137
+ 2. **Compare Against References**
138
+ - If implementing pattern, read reference implementation COMPLETELY
139
+ - Don't skim - read every line
140
+ - Understand the pattern fully before applying
141
+
142
+ 3. **Identify Differences**
143
+ - What's different between working and broken?
144
+ - List every difference, however small
145
+ - Don't assume "that can't matter"
146
+
147
+ 4. **Understand Dependencies**
148
+ - What other components does this need?
149
+ - What settings, config, environment?
150
+ - What assumptions does it make?
151
+
152
+ ### Phase 3: Hypothesis and Testing
153
+
154
+ **Scientific method:**
155
+
156
+ 1. **Form Single Hypothesis**
157
+ - State clearly: "I think X is the root cause because Y"
158
+ - Write it down
159
+ - Be specific, not vague
160
+
161
+ 2. **Test Minimally**
162
+ - Make the SMALLEST possible change to test hypothesis
163
+ - One variable at a time
164
+ - Don't fix multiple things at once
165
+
166
+ 3. **Verify Before Continuing**
167
+ - Did it work? Yes -> Phase 4
168
+ - Didn't work? Form NEW hypothesis
169
+ - DON'T add more fixes on top
170
+
171
+ 4. **When You Don't Know**
172
+ - Say "I don't understand X"
173
+ - Don't pretend to know
174
+ - Ask for help
175
+ - Research more
176
+
177
+ ### Phase 4: Implementation
178
+
179
+ **Fix the root cause, not the symptom:**
180
+
181
+ 1. **Create Failing Test Case**
182
+ - Simplest possible reproduction
183
+ - Automated test if possible
184
+ - One-off test script if no framework
185
+ - MUST have before fixing
186
+ - Use the `code-tdd` skill for writing proper failing tests
187
+
188
+ 2. **Implement Single Fix**
189
+ - Address the root cause identified
190
+ - ONE change at a time
191
+ - No "while I'm here" improvements
192
+ - No bundled refactoring
193
+
194
+ 3. **Verify Fix**
195
+ - Test passes now?
196
+ - No other tests broken?
197
+ - Issue actually resolved?
198
+
199
+ 4. **If Fix Doesn't Work**
200
+ - STOP
201
+ - Count: How many fixes have you tried?
202
+ - If < 3: Return to Phase 1, re-analyze with new information
203
+ - **If >= 3: STOP and question the architecture (step 5 below)**
204
+ - DON'T attempt Fix #4 without architectural discussion
205
+
206
+ 5. **If 3+ Fixes Failed: Question Architecture**
207
+
208
+ **Pattern indicating architectural problem:**
209
+ - Each fix reveals new shared state/coupling/problem in different place
210
+ - Fixes require "massive refactoring" to implement
211
+ - Each fix creates new symptoms elsewhere
212
+
213
+ **STOP and question fundamentals:**
214
+ - Is this pattern fundamentally sound?
215
+ - Are we "sticking with it through sheer inertia"?
216
+ - Should we refactor architecture vs. continue fixing symptoms?
217
+
218
+ **Discuss with the user before attempting more fixes**
219
+
220
+ This is NOT a failed hypothesis - this is a wrong architecture.
221
+
222
+ ## Red Flags - STOP and Follow Process
223
+
224
+ If you catch yourself thinking:
225
+ - "Quick fix for now, investigate later"
226
+ - "Just try changing X and see if it works"
227
+ - "Add multiple changes, run tests"
228
+ - "Skip the test, I'll manually verify"
229
+ - "It's probably X, let me fix that"
230
+ - "I don't fully understand but this might work"
231
+ - "Pattern says X but I'll adapt it differently"
232
+ - "Here are the main problems: [lists fixes without investigation]"
233
+ - Proposing solutions before tracing data flow
234
+ - **"One more fix attempt" (when already tried 2+)**
235
+ - **Each fix reveals new problem in different place**
236
+
237
+ **ALL of these mean: STOP. Return to Phase 1.**
238
+
239
+ **If 3+ fixes failed:** Question the architecture (see Phase 4.5)
240
+
241
+ ## Signals You Are Doing It Wrong
242
+
243
+ **Watch for these redirections:**
244
+ - "Is that not happening?" - You assumed without verifying
245
+ - "Will it show us...?" - You should have added evidence gathering
246
+ - "Stop guessing" - You're proposing fixes without understanding
247
+ - "Ultrathink this" - Question fundamentals, not just symptoms
248
+ - "We're stuck?" (frustrated) - Your approach isn't working
249
+
250
+ **When you see these:** STOP. Return to Phase 1.
251
+
252
+ ## Common Rationalizations
253
+
254
+ | Excuse | Reality |
255
+ |--------|---------|
256
+ | "Issue is simple, don't need process" | Simple issues have root causes too. Process is fast for simple bugs. |
257
+ | "Emergency, no time for process" | Systematic debugging is FASTER than guess-and-check thrashing. |
258
+ | "Just try this first, then investigate" | First fix sets the pattern. Do it right from the start. |
259
+ | "I'll write test after confirming fix works" | Untested fixes don't stick. Test first proves it. |
260
+ | "Multiple fixes at once saves time" | Can't isolate what worked. Causes new bugs. |
261
+ | "Reference too long, I'll adapt the pattern" | Partial understanding guarantees bugs. Read it completely. |
262
+ | "I see the problem, let me fix it" | Seeing symptoms is not the same as understanding root cause. |
263
+ | "One more fix attempt" (after 2+ failures) | 3+ failures = architectural problem. Question pattern, don't fix again. |
264
+
265
+ ## Quick Reference
266
+
267
+ | Phase | Key Activities | Success Criteria |
268
+ |-------|---------------|------------------|
269
+ | **1. Root Cause** | Read errors, reproduce, check changes, gather evidence | Understand WHAT and WHY |
270
+ | **2. Pattern** | Find working examples, compare | Identify differences |
271
+ | **3. Hypothesis** | Form theory, test minimally | Confirmed or new hypothesis |
272
+ | **4. Implementation** | Create test, fix, verify | Bug resolved, tests pass |
273
+
274
+ ## When Process Reveals "No Root Cause"
275
+
276
+ If systematic investigation reveals issue is truly environmental, timing-dependent, or external:
277
+
278
+ 1. You've completed the process
279
+ 2. Document what you investigated
280
+ 3. Implement appropriate handling (retry, timeout, error message)
281
+ 4. Add monitoring/logging for future investigation
282
+
283
+ **But:** 95% of "no root cause" cases are incomplete investigation.
284
+
285
+ ## Supporting Techniques
286
+
287
+ Use `./references/root-cause-tracing.md` to trace bugs backward through the call chain until the original trigger is found.
288
+
289
+ **Related skills:**
290
+ - **code-tdd** - For creating failing test case (Phase 4, Step 1)
291
+ - **code-verify** - Verify fix worked before claiming success
292
+
293
+ ## Real-World Impact
294
+
295
+ From debugging sessions:
296
+ - Systematic debugging minimizes thrash, increases first-time fix rate, and reduces new bugs introduced by speculative patches.