What You Need to Know
A good AGENTS.md starts with a mission statement and ordered priorities. For example: "1. Keep all monitored services healthy. 2. Deliver scheduled briefings on time. 3. Respond to direct messages within the current session context. 4. Never take destructive actions without confirmation." Numbered priorities give the assistant a clear decision framework when tasks conflict.
Define execution rules for common scenarios. Specify what the assistant should do automatically (health checks, summarization, routine notifications) versus what requires confirmation (running shell commands, modifying files, sending messages to new contacts). Be explicit about edge cases: "If a cron job fails, retry once after 5 minutes. If it fails again, notify me on Telegram with the error log."
Tool constraints are critical for safety. List which tools the assistant can use freely, which require confirmation, and which are forbidden entirely. For example: "You may use web-search and memory-search freely. You may use file-write only in the workspace directory. Never use ssh or docker exec without explicit approval." These boundaries prevent autonomous actions from causing unintended damage.
Output format expectations reduce friction. Specify how you want information presented: "Use markdown tables for comparisons. Use code blocks for commands. Keep status reports under 200 words. Include timestamps in UTC for server-related updates." Clear formatting rules mean you spend less time re-asking and more time acting on the information.
Treat AGENTS.md as an engineering artifact, not a creative writing exercise. Version it in git, review changes deliberately, and refine it as your workflows mature. The best templates are concise but precise โ under 500 words โ with concrete examples of desired behavior under pressure rather than abstract writing style preferences. If it reads like a job description, it is probably too vague. If it reads like a runbook, you are on the right track.