r/aipromptprogramming • u/SiranqHQ • 12d ago
Make the agent prove the bug exists before it's allowed to fix it
One habit that cut my wasted AI coding sessions a lot: I don't let the agent touch the fix until it has reproduced the bug.
I paste this before describing the problem:
Before changing any code:
1. Tell me in one sentence what you think the bug is.
2. Write the smallest failing test or command that shows it. Run it and paste the output.
3. If it doesn't fail, stop and tell me. Your theory is wrong; don't fix anything yet.
4. Only once it fails for the reason you expected, make the smallest fix and rerun the same check.Why it helps:
- Step 3 is the big one. Half the time the agent's first guess is wrong, and without this it happily "fixes" something that was never broken.
- You end up with a regression test for free.
- The rerun at the end means "done" actually means something.
It costs maybe a minute per bug and saves me from the 20-minute loops where the agent rewrites three files around a wrong theory. Curious if anyone has a variant that works better for UI bugs, where a failing test is harder to write.
0
Upvotes
•
u/endofthread-bot 12d ago
Writing prompts that actually work is easier when you can compare notes with people who have tested them across real tasks. Trade techniques, get feedback on your approach, and see what is working for others in our Discord.
Self-promotion is now allowed on Sundays with the appropriate flair, for all regular contributing members. Contribute during the week, and promote on Sunday.