Skip to main content
Every codebase has conventions — how you name branches, which commands run tests, where important files live. Without context, agents guess: they run npm test when your project uses yarn test, or put a component in the wrong directory. AGENTS.md teaches them your conventions, commands, and architecture so they produce code that fits your project. AGENTS.md is an open standard stewarded by the Linux Foundation, supported by Ona and other AI coding tools. Think of it as a README for agents — the tribal knowledge that senior engineers carry in their heads.

Create your AGENTS.md

Create an AGENTS.md file in your repository root:
Ona Agent automatically loads this file at the start of every session.

Keep it concise

Shorter is better. As instruction count increases, instruction-following quality decreases. Aim for:
  • Under 300 lines - the recommended maximum
  • Under 60 lines - ideal for most projects
If you need more detail, link to other files rather than duplicating content:

What to include

Commands - The most important section. Tell agents exactly how to:
  • Run tests
  • Build the project
  • Start the dev server
  • Lint and format code
Project structure - Where things live:
  • Key directories and their purpose
  • Where to add new components or features
Conventions - How your team does things:
  • Branch naming patterns
  • Commit message format
  • Code style rules
Security considerations - What to avoid:
  • Files that should never be committed
  • Sensitive patterns to watch for
  • Security-related commands to run

Make critical rules stand out

Agents pay attention to emphasis. For rules that must not be broken:

Use nested files for large projects

For monorepos or large codebases, you can place AGENTS.md files in subdirectories. Agents read the nearest file in the directory tree, so each package can have tailored instructions:

Example

After adding AGENTS.md, start a session and ask the agent to make a change. If it misses a convention, add emphasis or move that rule higher in the file.

Skills for multi-step workflows

Agent Skills are SKILL.md files that live in your repository. For repeatable, multi-step procedures (deployment workflows, triage runbooks, PR checklists), use repository skills. The agent discovers and loads them automatically when a task matches. For organization-wide workflows that apply across all projects, use organization skills.

Getting notified when an agent finishes

Enable the completion sound in Settings > Preferences to hear when a task completes. For webhook-style notifications, add an instruction to your AGENTS.md that tells the agent to run a curl command after completing all work:
You can also monitor task completion programmatically via the WatchEvents API method.

Next steps