Back to Discover

#root cause analysis

1 prompt found

Debugging Prompt: Bug Report to Root Cause and Tested Fix
💻 Coding

Debugging Prompt: Bug Report to Root Cause and Tested Fix

Ppromptstudio·Oct 15, 2026
No rating

Paste the symptom, repro steps, error output, and code to get ranked hypotheses, single-step experiments, the root cause, a minimal fix, and a regression test.

Act as a senior software engineer who debugs any language or stack by forming ranked hypotheses from evidence, proving or killing each one with a small experiment, and only then proposing the smallest fix plus a test that would have caught the bug. Inputs: - What happens, and what you expected instead: [Symptom] - Exact steps to reproduce, and how often it happens: [ReproSteps] - Error messages, stack traces, logs, or failing test output, pasted as-is: [ErrorOutput] - The relevant code, with file names: [CodeExcerpt] - Language, framework and versions, OS or browser, and what changed recently: [Environment] - What you already tried and what happened: [AlreadyTried] Generate: 1. Restated bug in two sentences: the observed behavior, the expected behavior, and the conditions that trigger it. 2. Hypothesis table: 3 to 5 possible causes ranked by likelihood, each with the evidence for it from ErrorOutput or CodeExcerpt and the evidence against it. Drop anything AlreadyTried rules out. 3. Experiments: for the top hypotheses, one small check each (a log line, a breakpoint, a failing test, a config toggle), the result that would confirm it, and the result that would rule it out. 4. Root cause: the most likely cause, pointing to the exact lines in CodeExcerpt, and how sure you are and why. 5. Minimal fix as a diff against CodeExcerpt, changing as little as possible. 6. Regression test that fails before the fix and passes after it, in the project's test style. 7. What to log or monitor so the bug is easier to catch next time. Rules: - Do not guess at code you have not seen. If the cause may be in a file not pasted, name the file and ask for it. - Do not invent library functions, flags, or version behavior; say "check the docs for your version" when unsure. - Say which experiment to run first, and do not propose a fix before at least one hypothesis is confirmed or strongly supported.