Debugging with AI: the structured bug report
Understand the idea
"It's broken, fix it" gets inventive help. A report with symptoms, expected versus actual behavior, and repro steps gets usable help.
The cost of a vague report
Vague reports produce vague fixes. The model fills gaps with common failure stories for that feature area. Sometimes it invents a plausible that fits the topic and misses the race you actually have. Structure is how you stop that invention.
AI Lab · bug report
Turn "broken sometimes" into something an AI can use
Vague report
checkout is broken sometimes. can you fix it?You know a bit more than that prompt says: this is a React cart on /checkout. Paying with a saved card sometimes shows "Payment failed" even though Stripe's dashboard shows the charge succeeded. It seems worse on slow hotel Wi-Fi. The cart stores line items in localStorage under wb_cart. The failing function is confirmCheckout in lib/checkout.ts, which calls /api/checkout then clears the cart.
A skeleton that travels well
Use the same spine every time: symptom, expected versus actual, repro steps, relevant context, and frequency when the bug is intermittent. That skeleton is not bureaucracy. It is the minimum packet that lets another engineer - human or model - aim.
| Field | Vague | Structured |
|---|---|---|
| Symptom | checkout broken | Payment failed toast on /checkout |
| Expected | works | Redirect to /orders after success |
| Actual | doesn't | Toast fires; Stripe shows succeeded |
| Repro | sometimes | Fast 3G; pay saved card; 1 in 5 |
Repro steps are the leverage
Ordered steps beat theories. Include environment notes that matter: throttled network, a specific browser, a particular cart size. If you cannot reproduce on demand yet, say the closest pattern you have and how often it appears. "Sometimes" without numbers is fog.
Context without a repo dump
Name the failing function, route, storage key, or dashboard evidence. Paste the smallest snippet that shows the suspicious sequence. Your should point, not flood.
Feed results back into the report
When a suggested experiment fails, update the report with what you learned. Debugging with AI is iterative. Each loop should shrink the hypothesis space, not restart from "it's broken."
Mental model
FOLLOW THE VALUE
Name what the user saw.
01 / 03Trace the transformation
Live example
The logs name the spine of a bug report an assistant can actually use.
Your console output appears here.
Guided challenge
Ask for repro, not guesses
The fourth log says guesses. Change it to repro-steps.
Your console output appears here.
EXPECTED CONSOLE OUTPUT
Payment failed toast on /checkout redirect to /orders after succeeded charge toast + cart kept; Stripe shows succeeded repro-steps structured
Hints 0/2
Use all hints or make 3 failed runs (0/3).
Free sandbox
Make a variation, test an assumption, or break the example on purpose. This draft is saved separately.
Your console output appears here.
Quiz
A quick check for understanding. Retry as often as you like; your learning path stays open.
Ready to call this one understood?
Mark this lesson complete to earn 150 XP. You can always revisit it.