Coding Intermediate Any model

Systematic Debugging Framework

Turn a vague bug report into a structured diagnosis with root cause analysis and fix verification.

debuggingtroubleshootingroot-causemethodology

What it does

Transforms chaotic debugging into a structured process. Instead of guessing at fixes, this prompt walks through observation, hypothesis, and verification – the scientific method applied to code. Especially valuable when you’re stuck or when the bug seems intermittent.

The Prompt

I need help debugging an issue. Walk me through it systematically.

Bug report:
[DESCRIBE THE BUG - what happens, what should happen, when it started]

Environment:
[LANGUAGE/FRAMEWORK, VERSION, OS, relevant config]

What I've already tried:
[LIST WHAT YOU'VE CHECKED]

Please:
1. OBSERVE: Summarize the symptoms. What exactly is failing?
2. HYPOTHESIZE: List 3-5 possible root causes, ranked by likelihood. For each, explain WHY it could cause these specific symptoms.
3. TEST: For the most likely cause, suggest the single most diagnostic test I can run (a command, a log check, a code change) that would confirm or eliminate it.
4. If I give you the test result, continue to the next hypothesis or drill deeper.

Do NOT suggest a fix until we've confirmed the root cause.

Usage Notes

  • The key constraint is “do NOT suggest a fix until we’ve confirmed the root cause.” This prevents the common failure mode where AI suggests 10 things to try shotgun-style.
  • Feed test results back iteratively. The best debugging sessions are 3-5 rounds of hypothesis-test-refine.
  • Works especially well for: race conditions, environment-specific bugs, “it works on my machine” issues, and intermittent failures.
  • For performance bugs, add “Include timing/profiling commands in your diagnostic tests.”