Systematic Debugging — Root Cause Protocol
Establishes a rigorous methodology for identifying, isolating, and resolving technical issues before any fix is proposed.
The Debugging Protocol
PHASE 2: PATTERN ANALYSIS
- Working examples of similar logic in the codebase are located and examined.
- The broken implementation is compared against reference standards or successful instances.
- All differences are identified, however minor; no detail is assumed to be irrelevant.
PHASE 3: HYPOTHESIS & MINIMAL TESTING
- A single, specific hypothesis is formed: "X is the root cause because Y."
- The smallest possible change is made to test the hypothesis. Example: a one-line guard clause rather than a multi-function refactor.
- The result is verified before adding more logic. If it fails, the change is reverted and a new hypothesis is formed.
PHASE 4: IMPLEMENTATION & VERIFICATION
- A minimal failing test case is created (using the
test-driven-developmentskill). - A single fix addressing the root cause is implemented.
- The fix is verified against the test case and checked for regressions.
Red Flags — STOP
- "Quick fix for now, investigate later." → STOP. Symptom fixes are failure.
- "Just try changing X and see if it works." → STOP. This is guessing, not debugging.
- "I'll skip the test; I manually verified it." → STOP. Untested fixes are guaranteed regressions.
- "Each fix reveals a new problem in a different place." → STOP. This is a signal of an architectural failure (The 3-Fix Limit).
Rationalization Table
Reference Files
test-driven-development/SKILL.md— Creating failing tests.verification-before-completion/SKILL.md— Final verification protocol.sk-pipeline-state/SKILL.md— Debugging state corruption.root-cause-tracing.md— Backward tracing techniques.