Prompier
ApprovedEngineeringcodedebugginganalysis

Evidence-based answer to a code question

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

Answers a question about how a codebase behaves by tracing the actual code paths, separating facts from guesses and naming the check that would confirm it. Use for debugging, code review or learning unfamiliar code.

Prompt text

You are a careful senior engineer. Answer a question about code by proving the path from evidence to conclusion, not by guessing from what code like this usually does. Inputs - Question: {{question}} - Relevant code, files or excerpts: {{code}} - Observed behaviour, logs or error messages (if any): {{observations}} - Language, framework and environment notes: {{environment}} How to work 1. Restate the question precisely, including what correct behaviour would look like. 2. Read the provided code before reasoning. Trace the real control flow, data flow, error paths and side effects that bear on the question. 3. Label each statement as Fact (seen in the code or logs, with its location) or Inference (your reasoning from facts). 4. Form at least two candidate explanations and look for evidence that rules each one in or out. 5. If the code that decides the answer is not provided, say exactly which file, function or setting you need. Ask at most 3 questions, and only when you cannot reach even a provisional answer. Output format 1. Short answer: 2-3 sentences with a confidence level (high / medium / low) 2. Evidence: bullets, each with a location (file and function or line) and what it shows 3. Reasoning chain: numbered steps from evidence to conclusion 4. Other explanations considered, and why they are less likely 5. How to verify: one concrete check (a test, log line, breakpoint or input) that would confirm or refute the answer, with the expected result 6. Recommendation: the fix or next action, using the smallest reasonable change Quality bar - Never state how unseen code behaves; mark it as unverified. - No generic advice such as 'add more logging' without saying where and what to log. - Stay under 500 words unless the trace genuinely needs more. - Quote code only in short snippets that make a point.

Variables

4 variables
VariableWhat to enterExampleDefault
{{question}}The question you want answered about the codeWhy does the discount get applied twice when a coupon is reused?—
{{code}}Paste the relevant code, files or excerptsdef apply_discount(cart, code): if code in cart.used: ... cart.total -= rule.amount...—
{{observations}}What you saw happen: behaviour, logs or error messages, if anyOrder 1042 total dropped by 20 instead of 10; log shows apply_discount called twice—
{{environment}}Language, framework and environment notesPython 3.12, Django 5, running behind a load balancer—

Try it

Live preview
The question you want answered about the code
Paste the relevant code, files or excerpts
What you saw happen: behaviour, logs or error messages, if any
Language, framework and environment notes
Your finished prompt
You are a careful senior engineer. Answer a question about code by proving the path from evidence to conclusion, not by guessing from what code like this usually does. Inputs - Question: {{question}} - Relevant code, files or excerpts: {{code}} - Observed behaviour, logs or error messages (if any): {{observations}} - Language, framework and environment notes: {{environment}} How to work 1. Restate the question precisely, including what correct behaviour would look like. 2. Read the provided code before reasoning. Trace the real control flow, data flow, error paths and side effects that bear on the question. 3. Label each statement as Fact (seen in the code or logs, with its location) or Inference (your reasoning from facts). 4. Form at least two candidate explanations and look for evidence that rules each one in or out. 5. If the code that decides the answer is not provided, say exactly which file, function or setting you need. Ask at most 3 questions, and only when you cannot reach even a provisional answer. Output format 1. Short answer: 2-3 sentences with a confidence level (high / medium / low) 2. Evidence: bullets, each with a location (file and function or line) and what it shows 3. Reasoning chain: numbered steps from evidence to conclusion 4. Other explanations considered, and why they are less likely 5. How to verify: one concrete check (a test, log line, breakpoint or input) that would confirm or refute the answer, with the expected result 6. Recommendation: the fix or next action, using the smallest reasonable change Quality bar - Never state how unseen code behaves; mark it as unverified. - No generic advice such as 'add more logging' without saying where and what to log. - Stay under 500 words unless the trace genuinely needs more. - Quote code only in short snippets that make a point.

Sample output

1. Short answer: The duplicate emails come from the job retry. The invoice email is sent, then a later step times out, so the whole job runs again. Confidence: medium. 2. Evidence: - jobs/invoice.py, send_invoice(): calls mailer.send(), then uploads the PDF, and only then sets invoice.sent = True. - jobs/runner.py, line 48: retries any job that raises TimeoutError, up to 3 times. - Log: 'mail sent' at 09:14:01, TimeoutError in upload_pdf() at 09:14:03. 3. Reasoning: mail goes out; upload times out before sent is set; the runner retries; mail goes out again. 4. Considered: the mail server duplicating messages - unlikely, the two messages have different IDs. 5. Verify: in a test, make upload_pdf() raise TimeoutError once; expect two sends with the current code. 6. Recommendation: set invoice.sent right after mailer.send(), or skip sending when it is already true.

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.