Lesson 5.3 · 3:45
Diagnose before you fix
Goal: Get the agent to explain the *cause* of a bug, with evidence, before it changes anything.
Try it
Use your bug version of the practice app and your BUG-REPORT.md from last lesson.
- Open the folder in OpenCode. Make sure your save point is there.
- Switch to plan mode (lesson 3.2) so it can't edit. Then send:
Read BUG-REPORT.md. Expected: a saved request remains after refresh.
Observed: it disappears after refresh.
Reproduction: submit "Repair the light", verify it appears, then reload.
Inspect where the app saves and loads requests. Explain the likely cause
with file and line evidence before changing anything.
Do not edit files. Do not replace the app or clear storage.
- Read the answer. Does it name a file? A line? Does the explanation match what you saw?
- If the answer is vague, reply: "Show me the exact lines that prove this."
- Add the cause to your
BUG-REPORT.mdunder a new heading, Cause. Write it in your own words, in one sentence.
You're done when your bug report has a one-sentence cause that points at a specific file, and no file in the app has been changed yet.
Recap
- A symptom is what you notice. A cause is why it happens.
- Diagnose first, fix second, in two separate turns.
- Evidence means a file, a line or a result you can point at.
Next lesson (5.4): you let it fix the bug, and learn to read exactly what it changed.