Rules vs. skills for AI coding agents: what the data says

4 min readpresets.devUpdated
  • rules
  • skills
  • agents-md
  • research
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.mdSkill
When it's in contextAlways, or when matching files are touchedWhen the agent picks it, or you invoke it
Up-front costThe whole fileAbout a sentence (name and description)
Failure modeBloat: too much always-on textNeglect: 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:

ConfigurationPass rate
No docs (baseline)53%
Docs skill, default behavior53%
Docs skill plus an instruction to use it79%
Compressed docs index in AGENTS.md100%

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/skills symlinked to the same folder.
  • supabase/supabase: AGENTS.md, a one-line CLAUDE.md (@AGENTS.md), and 20+ skills in .agents/skills/.
  • openai/openai-agents-python: AGENTS.md and skills like code-change-verification in .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:

  1. Facts needed on most tasks (commands, versions, boundaries): always-on. If the agent skips them, everything suffers.
  2. Conventions for part of the code: path-scoped rules. Always present where they apply, absent elsewhere.
  3. Procedures (reviews, audits, test writing, releases): skills. Too long to keep always on, and only needed when asked.
  4. A pointer from 1 to 3. One line in AGENTS.md: "For code reviews, use the nextjs-code-review skill." 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, Copilot applyTo, Claude Code and Cline paths. For Codex and Antigravity, where AGENTS.md and GEMINI.md are 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 standards

Takeaways

  • 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.