Overview
Therecursive-debugging subskill inserts a mandatory Phase 1.5 between Phase 1 (AS-IS) and Phase 2 (TO-BE Plan) whenever a requirement involves fixing a bug, investigating a test failure, or understanding unexpected behavior. It enforces systematic root cause analysis before any fix is attempted.
The Iron Law
When to Use
Insert Phase 1.5 whenever:- A requirement is a bug fix
- Tests are failing and you need to understand why
- Behavior is unexpected or intermittent
- A performance problem needs investigation
- Integration issues are reported
How Phase 1.5 Fits
Phase 1.5 sits between AS-IS analysis and planning:01.5-root-cause.md with Status: DRAFT and work through the four steps below. Lock Phase 1.5 when root cause is confirmed. Phase 2 then consumes the findings from Phase 1.5.
The Four Steps
Error Analysis
Read error messages and stack traces completely before doing anything else. They often contain the exact location of the problem.Record in the artifact:Then verify you can reproduce the issue reliably. If you cannot reproduce it, gather more data — do not guess.
Pattern Analysis
Find the difference between working and broken code before proposing any fix.
- Locate similar working code in the same codebase
- Compare the working and broken paths line by line
- Check recent commits, dependency changes, and config changes for what could have introduced the problem
- Trace data flow backward through the call stack to find where the bad value originates
Hypothesis Testing
Form one clear hypothesis. Make the smallest possible change to test it. One variable at a time.If the hypothesis is rejected, form a new one. Do not stack multiple fixes on top of each other to see if something works.
Output Artifact
Write the artifact to:Red Flags
Stop and return to the systematic process if you catch yourself thinking any of the following:Thoughts that mean you're about to skip process
Thoughts that mean you're about to skip process
- “Quick fix for now, investigate later”
- “Just try changing X and see if it works”
- “Add multiple changes, run tests”
- “It’s probably X, let me fix that”
- “I don’t fully understand but this might work”
- You are proposing solutions before tracing data flow
- You are on your third failed fix attempt
If you have made three or more failed fix attempts, stop fixing. The pattern indicates an architectural problem. Document the attempts in Phase 1.5, question whether the approach is sound, and decide whether a deeper refactor is needed before continuing.
Common Shortcuts to Reject
| Excuse | Why It’s Wrong |
|---|---|
| ”Issue is simple, don’t need process” | Simple issues have root causes too. The process is fast for simple bugs. |
| ”Emergency, no time for process” | Systematic debugging is faster than guess-and-check thrashing. |
| ”I see the problem, let me fix it” | Seeing symptoms is not the same as understanding root cause. |
| ”Multiple fixes at once saves time” | You can’t isolate what worked. Multiple simultaneous changes cause new bugs. |
| ”One more fix attempt” (after 2+ failures) | Three or more failures indicate an architectural problem. Question the pattern. |