agent-md-caregiver

A linter for your agent instructions. Checks AGENTS.md, CLAUDE.md and codex.md against the actual repo.

View the Project on GitHub fsystemweb/agent-md-caregiver

AMC003 contradiction

Severity: error

Two instructions conflict: package managers, tabs vs spaces, test runners, “never X” vs “run X”.

What it checks

AMC003 contradiction (error)

The file tells agents two incompatible things, so whichever they follow, they break the other:
  - package manager: "Always use pnpm" and later `npm install` (Python too: "use uv" and later `pip install requests`)
  - indentation: "Use tabs" and later "indent with 2 spaces" (or 2 spaces vs 4 spaces)
  - test runner: "Use vitest" and later "Use jest"
  - "Never run `x`" in one place and a command `x` to run in another

The same checks run between files: CLAUDE.md against AGENTS.md next to it, and a nested file
against the files above it. Each conflict is reported once, in the lower-ranked file.
Nested files may differ on package manager when their directory declares its own (a
lockfile or packageManager field) and on test runner when their package.json uses that runner.

Deliberately quiet: lines scoped to a language, file type or layer ("tabs in Makefiles",
"vitest for e2e"), lines naming both options ("use pnpm, not npm"), headings that name the
manager ("## Using yarn"), and prohibitions with a condition ("never ... unless", "in CI").

Fix: keep one rule. Check the lockfile, .editorconfig or formatter config for the real one.
Suppress a deliberate case with `<!-- amc-ignore-next-line -->`.

Example

AGENTS.md:

# Rules

Always use pnpm.

```sh
npm install
```

Finding:

AGENTS.md:6:1  error  AMC003  Contradicts line 3: that says package manager pnpm, this says npm
fix: Pick one package manager and use it everywhere; the lockfile shows which the repo really uses.

How to fix

Follow the fix: line of the finding, or see the end of the text above.

How to suppress

All rules