CLAUDE.md vs AGENTS.md vs SKILL.md vs DESIGN.md

The arguments about these files usually collapse into one question — which one should I use? — when the useful question is which job each one does. They are not four competing standards. They are four scopes, and they stack.

Updated July 27, 2026

The precedence order, in one pass

Read outward from the narrowest scope. A rule in a more specific file wins over a more general one, and a rule the user types in the session wins over every file.

  1. What the user says in the session — always wins, including when it contradicts a file.
  2. `SKILL.md` — active only while that skill is invoked, and scoped to it.
  3. `CLAUDE.md` / tool-specific file — this tool's behaviour in this repo.
  4. `AGENTS.md` — the project's rules for any agent.
  5. `DESIGN.md` — the visual contract, referenced by the above rather than competing with them.

DESIGN.md sits slightly outside the stack on purpose. The other three tell an agent how to *work*; this one tells it what the result should *look like*. They rarely conflict, which is why a project can adopt it without renegotiating anything else.

AGENTS.md: the cross-tool project file

This is the one to write first. It is read by a growing set of agents, it is not owned by any vendor, and it holds the things that are true regardless of who is doing the work: how to build, how to test, what not to touch, which conventions the codebase actually follows.

The discipline that matters is cost. It loads on every request, so every line is paid forever. A rule earns a place inline only if it changes default behaviour, applies broadly, and is expensive to get wrong. Command catalogues, API schemas and setup procedures belong in a doc with a one-line pointer.

# AGENTS.md

## Build and verify
- `pnpm dev` on :4000. Never run `pnpm build` — it corrupts the shared dev cache.
- Verify with `tsc --noEmit`, not a build.

## Conventions
- Server work goes in `src/server/` as server actions, not API routes.
- Never hardcode theme colors; use the semantic tokens in DESIGN.md.

## Before you act
- Changing the payment flow: read `docs/PRICING.md` first.
Short, behavioural, and it points outward rather than inlining detail.

CLAUDE.md: an import plus a tail

The recurring mistake is maintaining CLAUDE.md and AGENTS.md as two full copies. They drift silently, and the drift surfaces as an agent confidently following a rule you deleted two months ago.

# CLAUDE.md

@AGENTS.md

## Claude Code only
- Use the local browser tool for hydration checks; the remote one stalls RSC.
- Slash commands live in `.claude/commands/`.
One canonical file, one tool-specific tail. Nothing is written twice.

The import gotcha

@file expansion is not universal. Claude expands relative in-project paths; several other tools pass the line through as literal text, and absolute paths often silently do nothing. Verify what your agent actually loads before relying on an import.

SKILL.md: a capability, not a rulebook

The distinction that makes skills click: AGENTS.md is *always* in context, and a skill is loaded *when it is relevant*. That difference is a budget decision. A 400-line code-review checklist in AGENTS.md is paid on every request including the ones that change a typo. The same checklist as a skill costs nothing until review actually starts.

So the test is not importance, it is frequency. Rules that apply to almost every request belong in the always-loaded file. Procedures that apply to a specific kind of task — deploying, reviewing, generating a migration — belong in a skill.

AGENTS.mdSKILL.mdDESIGN.md
LoadedEvery requestOn invocationWhen writing UI
ScopeWhole projectOne task typeEverything visual
Good fitBuild commands, constraintsDeploy steps, review checklistTokens, type scale, motifs
Bad fitA 300-line procedureA rule needed on every requestAnything non-visual
Cost of a wrong linePaid foreverPaid when invokedWrong pixels
Where a given instruction belongs.

DESIGN.md: the file nobody writes

Here is the gap. AGENTS.md has no natural home for a colour ramp. CLAUDE.md is about tool behaviour. A skill is invoked, not ambient. So the visual contract ends up nowhere — and an agent with no visual contract falls back to defaults, which is why AI-built sites converge on one look.

A DESIGN.md closes it. At minimum it carries semantic colour tokens for light and dark, the type pairing and scale, the spacing and radius system, and the do's and don'ts that stop an agent inventing a new pattern when it hits an unfamiliar case.

# DESIGN.md

## Color (semantic, light + dark)
--background / --foreground / --card / --primary / --muted-foreground …

## Type
Headings: Fraunces 600, -0.02em. Body: Inter 400, 1.6.
Scale: 0.875 / 1 / 1.25 / 1.5 / 2 / 3rem.

## Motifs
Hairline rules between sections. Radius scales with element size.

## Don't
No gradient text. No shadow on flat surfaces. Never hardcode a hex.
Abbreviated. The point is that every value is stated, not described.

The reason this file works where a prompt does not is unglamorous: it is re-read at the start of every session. Instructions held in conversation degrade as context grows. A file does not.

The other three files tell an agent how to work. Only one tells it what the result should look like — and it is usually the one that does not exist.
Preview unavailable here. Browse complete kits in the kit gallery.

Do you need all four?

No, and starting with all four is the wrong move. In rough order of return:

  1. `AGENTS.md` first. Highest value per line, works across tools, cheap to write.
  2. `DESIGN.md` next, if you ship UI. It is the largest quality gap for the least effort, because nothing else covers it.
  3. `CLAUDE.md` as a one-line import, plus a tail only when you genuinely have tool-specific rules.
  4. Skills last, once you notice the same long procedure being explained repeatedly.

Get a DESIGN.md without writing one

Every Identity Forge kit serialises into a complete DESIGN.md — semantic tokens in light and dark, a real font pairing, motifs and do's & don'ts — that any coding agent can read. Free kits need no account.

How many projects actually use each of these?

The files are usually compared on what they are *for*. It is worth knowing how they are used in practice, because the gap between the convention and the practice is where most confusion starts.

We sampled 299 public repository-root DESIGN.md files from GitHub and measured them. The first finding reframes the whole comparison: only 24% of them describe visual design at all. The other 76% are software architecture documents — how a system is built, not how a product looks.

DESIGN.md is a filename collision

The name predates the design-system convention by years. If you add one to an existing repository, expect some readers — and some tooling — to arrive expecting an architecture doc. It is worth a one-line header stating which kind yours is.

Within the 72 that genuinely describe a visual system, the split of responsibilities argued above is not being honoured. 86% use no semantic colour role names, so the file cannot be applied to any component it did not explicitly describe — which is precisely the job it exists to do. 76% state no prohibitions, and prohibitions are the form of instruction agents follow most reliably. 69% omit dark mode, leaving an entire theme to be invented.

The practical reading: most projects that add a DESIGN.md are writing a document rather than a contract. The difference is whether an agent can resolve a value from it without guessing.

If I only write one file, which should it be?

AGENTS.md. It is read by the widest set of tools, it is not vendor-owned, and it holds the rules that stop an agent breaking your build. If you ship a user interface, DESIGN.md is a close second because nothing else covers that ground.

Does AGENTS.md replace CLAUDE.md?

Largely. Keep CLAUDE.md as @AGENTS.md plus genuinely Claude-specific rules. Delete the tail entirely if you do not have any — an empty tail is cheaper than a duplicate.

Are these files actually read, or is it cargo cult?

They are read, but they are not magic. The observable failure mode is length: a 600-line instruction file competes with itself, and specific rules get buried under general ones. Short files are followed more reliably than thorough ones.

Can DESIGN.md just live inside AGENTS.md?

It can, and for a small project that is fine. It separates well once the visual system has real depth, because token tables are long and change on a different schedule from build commands — and because a separate file can be consumed by tools that do not read agent instructions at all.

What happens when two files conflict?

The narrower scope should win, but do not rely on the model arbitrating cleanly. Conflicts are worth removing rather than ranking: if two files disagree, one of them is out of date.