Prompt Engineering
Intermediate

Debugging and Error Analysis

Turn logs, stack traces, and reproduction steps into focused root-cause analysis.

30 min
3 sections
debugging
logs
root-cause
1
2
3

01. Provide evidence, not just symptoms

Section 1 of 3

Good debugging prompts include the error, environment, recent changes, expected behavior, actual behavior, reproduction steps, and relevant code. Ask for ranked hypotheses and a minimal next test.

text
You are diagnosing a production-only Next.js error.

Expected:
Users can submit checkout.

Actual:
POST /api/checkout returns 500 in production only.

Evidence:
<log>
TypeError: Cannot read properties of undefined (reading 'priceId')
</log>

Recent change:
Moved product catalog from static JSON to CMS fetch.

Output:
Return top 3 hypotheses, evidence for each, and the fastest verification step.
Back to Course