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

AMC001 command-not-found

Severity: error

A package script, Makefile target or workspace the file tells agents to run does not exist.

What it checks

AMC001 command-not-found (error)

The file tells agents to run a command that cannot work in this repo:
  - `npm run x`, `npm test`, `pnpm run x`, `yarn x`, `bun run x` where package.json has no such script
  - `make x` where the Makefile has no such target
  - a workspace (`npm -w x`, `pnpm --filter x`, `yarn workspace x`) that does not exist
  - `poe x` (or `uv run poe x`) where [tool.poe.tasks] has no task x
  - `uv run x` / `poetry run x` where x is one typo away from a console script in pyproject.toml
  - `pytest` in a Python repo that never mentions pytest (no dependency, config or conftest.py)

Agents follow these lines, so a dead command wastes a turn and often derails the task.
The finding suggests the closest existing script or target, or lists what is available.

What it checks: scripts in the nearest package.json at or above the file (and its parents),
honoring `cd dir` earlier in the same code block. `yarn x`, `pnpm x` and `bun run x` can also
run installed binaries, so those are only reported for conventional or colon-style names
(build, test, lint:fix) or when a similarly named script exists.

What it stays silent on: `npx`, `node x.js`, installs, `--workspaces`, `--if-present`, `--prefix`,
unknown flags, Makefiles that `include` others, commands after "never", "avoid", "e.g.", and
repos with no package.json or Makefile in range.

Fix: correct the command, add the script or target, or remove the line.
Suppress a deliberate case with `<!-- amc-ignore-next-line -->`.

Example

AGENTS.md:

# Dev

- Deploy: `npm run deploy`

In the repo: package.json: {"scripts":{"test":"node --test","build":"tsc"}}.

Finding:

AGENTS.md:3:12  error  AMC001  `npm run deploy`: no such script "deploy" in package.json
fix: Add a "deploy" script to package.json or remove this command. Available scripts: build, test.

How to fix

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

How to suppress

All rules