I stopped treating every mistake as a prompt problem. If the same thing fails twice, I add one short rule to AGENTS.md. That gives the agent a durable lesson instead of asking it to remember the whole conversation. For repeated work, I turn it into a script or an automated test. Tests are the useful part: “make the button save” stays vague; a test that fails when the button does not save gives the agent a concrete target. Not every instruction can become code. For repeatable, verifiable work, freeze the outcome into a test and rerun it after each change.