Give AI the error message, reproduction steps, and the 'don't touch this' boundaries — and use it as an assistant, not a teacher.
Let's think about it this way for a sec
A good debug prompt makes AI's search fast. A bad one gets you edits to files that have nothing to do with the bug. You need to own the story: which button you clicked, what you saw, what showed up in the console. Before you tell AI to 'fix it,' ask it to 'tell me which function you suspect first.' That way you actually learn something too.
Connecting it to everyday life
Copy the full stack trace. If you're seeing 'Cannot read properties of undefined (reading map),' first ask which array is likely undefined. Have AI explain the root cause before asking for a fix. Once it's fixed, try to reproduce the bug again — only close it out once it stays gone.
Let's try it together
Bug report for AI
1. Open /mm/notes
2. Click Add with empty input
3. Actual: page crashes
4. Expected: inline “title required”
5. Console: TypeError notes.map is not a function
6. Do not change create UI. Inspect loadNotes() first.You'll be able to use AI as a debugging assistant while understanding the root cause yourself.5-Minute Try-It
Write a bug report for a current bug, following the format above. Ask AI for the root cause before asking for a fix.
A Quick Word of Caution
Never treat AI output as automatically correct. Have a human read through the code and test it — and double-check secrets and user data — before you rely on it.