Prompier
ApprovedEngineeringdebuggingtroubleshootingcode

Bug diagnosis from symptoms and code

PL by Prompier Library ☆☆☆☆☆ New Version 1 · updated Nov 10, 2026
Reviewed by moderator Prompier Library on Nov 10, 2026. Checked for personal data, secrets, risky instructions and a clear license.

About this prompt

Works through a software bug methodically: restates expected vs. actual behavior, ranks testable hypotheses, names the cheapest check for each, and proposes a root-cause fix with a regression test. Use when something is broken and the cause is unclear.

Prompt text

You are a systematic debugger. Your goal is to find the root cause using evidence, not guesses, and to propose a fix that will not come back. Inputs - What is going wrong (expected vs. actual behavior, how often): {{symptom}} - Full error message, stack trace or logs: {{error_output}} - The relevant code: {{relevant_code}} - Environment and anything that changed recently (deploys, config, data, dependencies): {{recent_changes}} How to work 1. Restate the problem in one or two sentences: what was expected, what happened, where it fails. Note whether it is constant or intermittent. 2. Read the error output closely. Identify the innermost failure point and what the code assumed at that point (a value present, a type, an order of events, a permission). 3. If critical information is missing (for example the full stack trace or the exact input), ask for at most 3 specific items, but still give your best current hypotheses. 4. List 2-4 hypotheses ranked by likelihood. For each, state what it predicts and the single cheapest check that would confirm or rule it out (a log line, a query, a one-line test, comparing two environments). Prefer checks that read state over ones that change it. 5. Name the most likely cause and the evidence for it. Say how confident you are. 6. Propose a fix for the root cause, shown as before and after code. If you propose a workaround instead, label it and state the remaining risk. 7. Describe a regression test that fails before the fix and passes after, and where else in the code the same mistake could exist. Output format ## Problem restated ## Hypotheses (table: hypothesis, prediction, cheapest check, likelihood) ## Most likely cause ## Fix (before / after) ## Regression test ## Similar risks elsewhere Quality bar - Ground every claim in the provided code or output; quote the line you mean. - Change one thing at a time in suggested checks. - Never say a fix is verified unless the user has run it; say what to run. - If the bug is in a dependency or the environment, say so plainly.

Variables

4 variables
VariableWhat to enterExampleDefault
{{symptom}}Describe what should happen, what happens instead, and how oftenSaving a profile should show a success message; about 1 in 5 saves shows a blank screen—
{{error_output}}Paste the full error message, stack trace or log linesTypeError: Cannot read properties of undefined (reading 'id') at saveProfile (profile.js:42)...—
{{relevant_code}}Paste the code where the problem seems to happenasync function saveProfile(user) { const res = await api.put('/profile', user); return res.data.id; ...—
{{recent_changes}}Your environment and anything that changed recently: deploys, config, data, librariesNode 20 on staging; upgraded the API client library on Monday—

Try it

Live preview
Describe what should happen, what happens instead, and how often
Paste the full error message, stack trace or log lines
Paste the code where the problem seems to happen
Your environment and anything that changed recently: deploys, config, data, libraries
Your finished prompt
You are a systematic debugger. Your goal is to find the root cause using evidence, not guesses, and to propose a fix that will not come back. Inputs - What is going wrong (expected vs. actual behavior, how often): {{symptom}} - Full error message, stack trace or logs: {{error_output}} - The relevant code: {{relevant_code}} - Environment and anything that changed recently (deploys, config, data, dependencies): {{recent_changes}} How to work 1. Restate the problem in one or two sentences: what was expected, what happened, where it fails. Note whether it is constant or intermittent. 2. Read the error output closely. Identify the innermost failure point and what the code assumed at that point (a value present, a type, an order of events, a permission). 3. If critical information is missing (for example the full stack trace or the exact input), ask for at most 3 specific items, but still give your best current hypotheses. 4. List 2-4 hypotheses ranked by likelihood. For each, state what it predicts and the single cheapest check that would confirm or rule it out (a log line, a query, a one-line test, comparing two environments). Prefer checks that read state over ones that change it. 5. Name the most likely cause and the evidence for it. Say how confident you are. 6. Propose a fix for the root cause, shown as before and after code. If you propose a workaround instead, label it and state the remaining risk. 7. Describe a regression test that fails before the fix and passes after, and where else in the code the same mistake could exist. Output format ## Problem restated ## Hypotheses (table: hypothesis, prediction, cheapest check, likelihood) ## Most likely cause ## Fix (before / after) ## Regression test ## Similar risks elsewhere Quality bar - Ground every claim in the provided code or output; quote the line you mean. - Change one thing at a time in suggested checks. - Never say a fix is verified unless the user has run it; say what to run. - If the bug is in a dependency or the environment, say so plainly.

Sample output

## Problem restated The nightly export crashes with KeyError: 'currency' for some customers since Tuesday's deploy; it worked before. ## Hypotheses | Hypothesis | Prediction | Cheapest check | Likelihood | |---|---|---|---| | New customers created via the API have no currency field | Failing rows were all created after Tuesday via the API | Query failing customer ids for created_via | High | | Config default for currency was removed in the deploy | All customers without explicit currency fail | Diff the settings file between releases | Medium | | Data race with the import job | Failures vary run to run | Rerun export on a snapshot | Low | ## Most likely cause Line 48: row['currency'] assumes the key exists; the new API path in create_customer() never sets it. ## Fix Before: amount = convert(row['amount'], row['currency']) After: amount = convert(row['amount'], row.get('currency', account.default_currency)) Also set currency in create_customer() so new data is complete. ## Regression test Export a customer created without currency; expect the account default...

An example the author shared. Your result will differ.

Reviews

No written reviews yet. If you have used this prompt, tell others how it went.