The Commands Section Is the Highest-ROI Part of Your AGENTS.md

The Commands Section Is the Highest-ROI Part of Your AGENTS.md

The Commands Section Is the Highest-ROI Part of Your AGENTS.md

If you only get one section of your AGENTS.md right, make it the commands. It is the single highest-return part of the file, because it is what lets an agent not just write code but verify it — run the build, run the tests, read the output, and fix its own errors before handing the work back to you.

Why Commands Matter More Than Anything Else

Most of what an agent does on a real task ends in a build or a test. When it knows the exact commands, it closes the loop on its own. When it does not, it guesses — and a wrong guess means it either cannot verify its work or, worse, reports success on code that never actually built or passed. The commands section turns an agent from something that writes plausible code into something that writes code it has checked.

Be Exact and Literal

Write the commands as the literal strings to run, not as a description. "Run the tests" cannot be executed; "pnpm test" can. If a command needs a flag, an environment variable, or a particular working directory, include it. Anything vague becomes a failure the agent has to debug — using attention it could have spent on your actual task.

## Commands
Install:    pnpm install --frozen-lockfile
Dev:        pnpm dev
Build:      pnpm build
Test (all): pnpm test
Test (one): pnpm test -- path/to/file.test.ts
Typecheck:  pnpm typecheck
Lint + fix: pnpm lint --fix
The free AGENTS.md Cheat Sheet includes a copy-ready commands template you can adapt in minutes.Download Free — AGENTS.md Cheat Sheet

Always Include the Single-Test Command

One small addition pays off repeatedly: show the agent how to run a single test, not just the whole suite. On a focused change, an agent that can run one test file iterates in seconds; one that can only run everything either wastes time or skips verification altogether.

Name the Checks That Gate a Change

Beyond the raw commands, say which checks must pass before a change is done — types check, linter clean, tests green. The agent will treat those as the bar to clear and work toward passing them on its own. For the tightest results, make these match the checks your CI actually runs, so the work the agent considers done is work that will actually merge.

AGENTS.md: The Complete Guide to the Cross-Tool Agent Standard has a full chapter on the commands section, plus how it scales across a monorepo.Get the Complete Guide