Scan your repo. Diagnose whether AGENTS.md is accurate, executable, safe, and useful for coding agents.
agentsmd-check is a local diagnostic tool and CI checker for AGENTS.md.
It is not an agent framework, and it is not a general prompt management platform.
Status: early v0 CLI. The checker can be installed, run, and fail with actionable diagnostics.
AGENTS.md is becoming the README for AI coding agents: project overview, build commands, test commands, code style, safety notes, and repository-specific rules.
The problem is that these files go stale.
Common examples:
AGENTS.mdsaysnpm test, but the repo now usespnpm test- it tells agents to run
make check, but theMakefilehas nochecktarget - it references
docs/architecture.md, but the file no longer exists - it asks agents to run unsafe shell patterns such as piping remote scripts into
sh - it gives broad instructions but misses the actual test or style commands agents need
agentsmd-check catches those problems before a human or coding agent follows stale instructions.
Current v0 checks:
| Area | What it diagnoses |
|---|---|
| File discovery | Missing root AGENTS.md |
| Markdown | Headings, list items, fenced code blocks, and inline code |
| Paths | Referenced files such as docs/guide.md or .github/workflows/ci.yml that are missing |
| Package commands | Lockfile package manager mismatches and missing package.json scripts |
| Safety | Dangerous command patterns such as curl ... | sh |
| Coverage | Missing sections for tests, style, build, or safety notes |
The goal is not to grade writing style. The goal is to answer:
- Can an agent follow this file?
- Are the commands real?
- Are the referenced files real?
- Are the instructions safe enough to run in a coding workflow?
Requires Node.js 24 or newer.
npm install --save-dev agentsmd-check
npm exec agentsmd-check check
npx agentsmd-check check
npx agentsmd-check check --format json
npx agentsmd-check check --fail-on-warningJSON output is stable for tool integrations. Every issue has these fields:
{
"code": "SCRIPT001",
"severity": "error",
"file": "AGENTS.md",
"line": 5,
"message": "AGENTS.md references npm test, but package.json has no test script.",
"suggestion": "Add scripts.test to package.json or update AGENTS.md."
}AGENTS.md Check Report
Status: failed
[x] PATH001 AGENTS.md:31
Referenced path does not exist: docs/architecture.md
suggestion: Create the file or remove the stale instruction.
[x] SCRIPT001 AGENTS.md:34
AGENTS.md references npm test, but package.json has no test script.
suggestion: Add scripts.test to package.json or update AGENTS.md.
[x] SEC001 AGENTS.md:42
Dangerous remote script pipe detected.
suggestion: Download, inspect, and run scripts in separate steps.
[!] COV001 AGENTS.md
AGENTS.md is missing testing instructions.
suggestion: Add concrete testing instructions for coding agents.
The output should make three things obvious: which line is wrong, why it is wrong, and how to fix it.
AGENTS.md:
# AGENTS
- Read docs/architecture.md
- Run `npm test`
- Install tools with `curl https://example.com/install.sh | sh`package.json:
{
"scripts": {
"lint": "eslint ."
}
}Output:
[x] PATH001 AGENTS.md:3
Referenced path does not exist: docs/architecture.md
suggestion: Create the file or remove the stale instruction.
[x] SCRIPT001 AGENTS.md:4
AGENTS.md references npm test, but package.json has no test script.
suggestion: Add scripts.test to package.json or update AGENTS.md.
[x] SEC001 AGENTS.md:5
Dangerous remote script pipe detected.
suggestion: Download, inspect, and run scripts in separate steps.
See also:
examples/bad/AGENTS.mdexamples/good/AGENTS.md
Copy-paste CI usage:
on: [push, pull_request]
jobs:
agentsmd-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
- run: npx agentsmd-check check- Running or hosting coding agents
- Replacing project documentation
- Managing prompts across teams
- Enforcing one universal
AGENTS.mdtemplate - Auto-fixing instructions without showing the diff first
- Parse root
AGENTS.md - Validate referenced paths
- Detect common unsafe command patterns
- Produce plain text and JSON reports
- Return exit code
1when errors are present - Detect package manager and available scripts
- Publish copy-paste GitHub Actions usage
- Add nested
AGENTS.md/AGENTS.override.mdcoverage - Add SARIF output for GitHub code scanning
- Add
fix --dry-run
This is my first open source project. Small, practical contributions are welcome:
- examples of stale
AGENTS.mdinstructions - false positives and false negatives
- rule ideas with a real repository example
- documentation fixes
Please keep rules concrete. A good rule should point to a real line, explain the problem, and suggest a fix.
Apache-2.0

