Your coding agent keeps breaking rules you never wrote down.
You end up correcting the wrong folder, another auth method or a type you've already banned.
I think AGENTS.md, your agent's instruction file, should answer four questions.
โ What the product is. Explain who you're building for and what they're trying to do.
โ Where features live. Name the folders the agent should work in.
โ Which patterns to reuse and what never to touch. Point to existing code and spell out the boundaries.
Those last two deserve more space than a folder list.
Without them, you're leaving the agent to make decisions you've already made, then correcting it during review.
Include the reasons.
For generated files, explain where the source lives so the agent knows what to edit instead.