Course contents

Rules vs. skills vs. AGENTS.md: which one to use

beginner4 min readUpdated
  • Cursor
  • GitHub Copilot
  • Claude Code
  • Windsurf / Devin
  • Cline
  • Codex
  • Antigravity CLI
On this page

Three file types, one job

All seven tools covered here (Cursor, GitHub Copilot, Claude Code, Windsurf, which is now Devin Desktop, Cline, Codex and Antigravity CLI) give the agent project knowledge through some mix of these:

  • AGENTS.md: one plain Markdown file of always-on project instructions. It's an open format stewarded by the Agentic AI Foundation under the Linux Foundation, and the agents.md site says it's used by over 60,000 open-source projects.
  • Rules (also called instructions): Markdown files with a little frontmatter that controls when they load. Always, for matching files, when the agent judges them relevant, or only when you mention them.
  • Skills: a folder with a SKILL.md file that packages a procedure. Only the skill's name and description sit in context until the agent decides to use it, or you call it by name. Skills follow the open Agent Skills specification.

The key difference: who decides when it loads

AGENTS.mdRuleSkill
LoadsEvery sessionAlways, by file pattern, by relevance, or manuallyWhen matched by description or invoked by name
Who decidesNobody, it's always thereThe tool (globs) or the agent (description)The agent, or you with /name or $name
Up-front costFull fileFull file when active, nothing otherwiseAbout a sentence (the description)
Best forCommands, versions, boundariesConventions for a language, folder or layerMulti-step jobs: reviews, audits, releases, migrations
FormatPlain MarkdownMarkdown plus tool-specific frontmatterSKILL.md with name and description frontmatter, plus optional scripts and references

The trade-off is reliability against cost. Always-on content is guaranteed to be seen, but you pay for it on every request. A skill costs almost nothing until it's used, but the agent has to choose to use it.

That choice is not guaranteed. In Vercel's evals on Next.js 16 tasks, a docs skill was never invoked in 56% of cases, and an always-on AGENTS.md index beat it (Vercel, Jan 2026). We dig into those numbers in Rules vs. skills: what the data says.

A two-question test

When you have a new piece of guidance, ask:

1. Would a mistake here hurt almost any task? Yes: put it in the always-on layer (AGENTS.md, CLAUDE.md, or an always-apply rule). Examples: "use pnpm", "run pnpm test before finishing", "never edit src/generated/".

2. Is it a convention or a procedure?

  • A convention ("how we write X") is a rule. Scope it to the files it covers. Example: "React components use named exports" scoped to **/*.tsx.
  • A procedure ("how to do job Y, step by step") is a skill. Example: "review a pull request for auth and caching bugs, then report findings by severity."

What it looks like in a real repo

Big open-source projects already split things this way. As of November 2026:

  • vercel/next.js has a root AGENTS.md, 20+ skills in .agents/skills/ (for example create-pr, update-docs, write-guide), and a .claude/skills symlink that points at ../.agents/skills so Claude Code sees the same folder.
  • supabase/supabase has AGENTS.md, a CLAUDE.md that contains only @AGENTS.md (an import), and skills such as code-review and safe-sql-execution in .agents/skills/.
  • openai/openai-agents-python has AGENTS.md plus skills like code-change-verification and docs-sync in .agents/skills/.

The pattern: one always-on file for facts, plus a folder of skills for jobs.

A typical layout
my-app/
├── AGENTS.md                    # always-on facts: commands, stack, boundaries
├── CLAUDE.md                    # one line: @AGENTS.md
├── .cursor/rules/
│   └── react.mdc                # scoped convention, globs: **/*.tsx
└── .agents/skills/
    └── release/
        └── SKILL.md             # on-demand procedure

Why presets ship both a rule and a skill

Each official presets.dev stack has two parts:

  • Standards: the stack's conventions, versions and "never generate" list, written as each tool's native rule or instructions file and scoped to the stack's files where the tool supports it.
  • A skill: one focused job for that stack, like nextjs-code-review, supabase-security-review or python-test-writer.

The rule makes sure the agent writes code the right way while it works. The skill gives it a thorough checklist when you ask for a review or tests. Installing both is the default; you can install just one with --only standards or --only skill. See Pairing rules and skills for how the two work together.

Common mistakes

  • Writing a procedure as a rule. A 300-line "how to review a PR" rule loads on every matching edit. Make it a skill.
  • Hiding critical facts in a skill. If the agent needs the package manager for every task, a skill it might not open is the wrong place.
  • Duplicating the same text everywhere. Keep facts in one always-on file and point to it. Duplicates drift apart and contradict each other.
  • Assuming a skill will be used. Give important skills a one-line pointer in your always-on file, for example "For code reviews, use the nextjs-code-review skill."

Recap

  • AGENTS.md is always-on project knowledge in plain Markdown.
  • Rules add frontmatter that controls when they load: always, by glob, by relevance, or manually.
  • Skills load on demand; only the description costs context until they're used.
  • Conventions go in rules, procedures go in skills, universal facts go in always-on files.

Next step

See exactly when each of the seven tools loads these files: How agents load context.