There is no secret phrase. "Prompt engineering" for coding agents comes down to something much more ordinary: being able to say clearly what you want. That's it. It's the same skill as briefing a colleague, and people who are good at that are immediately good at this.
Four habits carry almost all of the value.
1. Say what "done" looks like
The agent can't read your mind about when to stop. "Make the page faster" has no finish line. "The page takes 4 seconds to load; get it under 1, and show me the before and after" does.
2. Say what must not change
This is the one people skip, and it's the one that prevents the mess. "Don't change the database schema." "Leave the styling alone." A boundary is worth three instructions.
3. Ask for the plan before the work
"Show me what you're going to change before you change it." Ten seconds of reading saves you from an agent confidently doing the wrong thing across eleven files. This is the single highest-value sentence in this whole page.
4. Give it a way to check itself
An agent that can run the tests will keep working until they pass. An agent with no way to check is just guessing loudly. "Run `npm test` and don't stop until it's green."
And when it goes wrong
It will. The fix is almost never a cleverer prompt — it's a smaller one. Break the task in half. Start a fresh conversation (/clear) so old, wrong context stops poisoning the new attempt. If it's confused about your project, that's a sign the project needs a memory file, not a longer sentence.