Rules vs. skills for AI coding agents: what the data says
On this page
"Should this be a rule or a skill?" is the most common question we hear from people setting up Cursor, Claude Code or Codex. Both are Markdown files. Both teach the agent about your project. Vendors describe them differently, and the docs mostly explain how, not which.
There's now real data to answer it. Here's what it says, and how we applied it to presets.dev.
The difference in one table
Rule / AGENTS.md | Skill | |
|---|---|---|
| When it's in context | Always, or when matching files are touched | When the agent picks it, or you invoke it |
| Up-front cost | The whole file | About a sentence (name and description) |
| Failure mode | Bloat: too much always-on text | Neglect: the agent never opens it |
Every tool we cover splits them this way: rules (or AGENTS.md, CLAUDE.md, Copilot instructions) are always-on or path-scoped; skills follow the Agent Skills model of progressive disclosure, where only metadata is loaded until activation.
The Vercel evals
In January 2026, Vercel published evals on teaching coding agents Next.js 16 APIs that weren't in model training data, like 'use cache', connection(), forbidden() and proxy.ts (Vercel blog). They compared four setups:
| Configuration | Pass rate |
|---|---|
| No docs (baseline) | 53% |
| Docs skill, default behavior | 53% |
| Docs skill plus an instruction to use it | 79% |
Compressed docs index in AGENTS.md | 100% |
The headline finding: in 56% of cases the skill was never invoked. The agent had the docs available and didn't look. With default behavior, the skill added nothing.
Telling the agent to use the skill pushed invocation above 95% and the pass rate to 79%, but the wording was fragile. "You MUST invoke the skill" made the agent read docs first and miss project context; "explore the project first, then invoke the skill" did better.
The always-on AGENTS.md index won outright. Vercel's explanation: there's no decision point, the information is present on every turn, and there are no ordering problems.
What the data doesn't say
It's tempting to read this as "skills don't work". That's not what Vercel concluded, and it's not what the setup tested.
- It tested general framework knowledge, the kind of thing that matters on almost every task. That's exactly what always-on context is for.
- The winner was an 8 KB compressed index, not a pile of docs. Vercel started at 40 KB and compressed it by 80%. Size still matters.
- Vercel's own conclusion: skills work better for "vertical, action-specific workflows that users explicitly trigger", like upgrades and migrations, and "the two approaches complement each other".
Tool vendors say the same thing in their docs. Claude Code's guidance is to keep CLAUDE.md to facts needed every session and move multi-step procedures to skills (Claude Code docs). Devin's is to prefer a skill for anything needed only sometimes, and use a rule to point the agent at the skills it should use (Devin docs).
What big repos actually do
We looked at three widely used open-source repos in November 2026:
- vercel/next.js: root
AGENTS.md, 20+ skills in.agents/skills/, and.claude/skillssymlinked to the same folder. - supabase/supabase:
AGENTS.md, a one-lineCLAUDE.md(@AGENTS.md), and 20+ skills in.agents/skills/. - openai/openai-agents-python:
AGENTS.mdand skills likecode-change-verificationin.agents/skills/.
None of them chose one or the other. All three pair an always-on file with on-demand skills.
The practical rule
Put guidance where its failure mode hurts least:
- Facts needed on most tasks (commands, versions, boundaries): always-on. If the agent skips them, everything suffers.
- Conventions for part of the code: path-scoped rules. Always present where they apply, absent elsewhere.
- Procedures (reviews, audits, test writing, releases): skills. Too long to keep always on, and only needed when asked.
- A pointer from 1 to 3. One line in
AGENTS.md: "For code reviews, use thenextjs-code-reviewskill." This is the cheapest fix for skill neglect in the data.
How we applied it to presets.dev
Every official stack ships both:
- Standards, scoped to the stack's files where the tool supports globs: Cursor
globs, CopilotapplyTo, Claude Code and Clinepaths. For Codex and Antigravity, whereAGENTS.mdandGEMINI.mdare always on, the section is appended between markers. - A skill with a description written to trigger: what it does, the words people actually use, and what it's not for.
The CLI installs both by default. If you only want one, use --only standards or --only skill:
npx presets-dev add nextjs --only standardsTakeaways
- Skills can be ignored. Don't hide must-know facts in them.
- Always-on context wins for broad knowledge, but only when it's compact.
- Skills win for procedures you ask for, especially with a one-line pointer.
- Use both, and keep them from repeating each other.
Go deeper in the course: Rules, skills and AGENTS.md and Pairing rules and skills.