AGENTS.md Best Practices

2024-02-20

Structure your AGENTS.md for clarity

Use clear section headings: ## Build, ## Test, ## Lint. AI tools and AgentMD parse these to extract commands.

Add executable commands

Wrap commands in backticks: pnpm test. Use code blocks for multi-line:

pnpm install
pnpm run build

Use YAML frontmatter

Add agent metadata at the top:

---
name: my-agent
triggers: [push, pull_request]
guardrails:
  - Never modify production config
---

Keep it concise

Aim for under 150 lines. Link to detailed docs for complex instructions.