Diagnose a Stubborn Bug From Symptoms to a Verified Fix
Work through a failing feature step by step: reproduce it, isolate the cause, fix it and prove it stays fixed.
Customize this prompt
Fill in the fields below — the prompt text updates automatically. [BRACKETED] words are placeholders you replace.
The prompt
Act as an expert debugger. I have a bug in [PROJECT_NAME], written in [PROGRAMMING_LANGUAGE]. The symptom is: [BUG_SYMPTOM]. It happens when [REPRODUCTION_STEPS], and I have already tried [ATTEMPTS_SO_FAR]. Walk me through a diagnosis in order: first, restate the symptom and list the three most likely causes ranked by probability, with a one-line reason for each. Then give me a short reproduction script or test case I can run, and a list of precise things to check or log at each step so I can narrow it down. Once the cause is identified, propose the smallest safe fix, explain why it works, and write a regression test that would have caught this bug. Finish with a checklist of edge cases to verify before I merge. Ask me for the exact error message or log lines if they would change your diagnosis.
How to use it
- Fill in the symptom, reproduction steps and what you already tried.
- Run the prompt and work through the ranked causes in order.
- Run the reproduction script and log what you observe.
- Apply the smallest safe fix and run the regression test.
- Check the edge cases, then merge with confidence.
Customization tips
Paste your real stack trace into [BUG_SYMPTOM] for a much more precise diagnosis.
Example use case
Developers stuck on a bug who need a structured diagnosis instead of guessing at fixes.
Frequently asked questions
What if I do not know the exact error message?
Give the prompt everything you do know; it will tell you which logs or messages to capture next.
Does this work for intermittent bugs?
Yes. It asks for the conditions under which the bug appears, which is exactly what intermittent bugs need.
Share
Tags: coding debugging bug fix troubleshooting testing software engineering
Reviewed by the PromptVault editorial team on November 15, 2026.
Source notes: Daily pipeline 20261115 batch 11