agent-context-doctor
AGENTS.md1 starsChanged 2 months agoMITView on GitHub
This is a TypeScript Node.js CLI project. You are an implementation agent. agent-context-doctor (acd) is a deterministic CLI that audits agent instruction files for quality, safety, contradictions, and stale commands. It is not an AI product. Do not do any of the following without explicit approval: All five must pass with zero errors before you consider work complete. The only file the tool writes is the optional Markdown report via --output. Paths are resolved relative to the audited repo root.…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,638 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository3 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .cursor/rules/project.mdcCursor rule
- adding-an-audit-checkSkill
The file
We split this AGENTS.md into the rules it gives an agent
10 rules. About 1 is common, 7 are distinctive, and 2 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Do not: do any of the following without explicit approval:
- Distinctive: line 14
Add LLM or AI API calls of any kind
- Distinctive: line 15
Add telemetry, analytics, or any outbound network calls
- Common: line 16
Add authentication or credential handling
- Very specific: line 21
Write to any file outside the audited repo path (only --output writes are allowed)
- Distinctive: line 22
Add dependencies that make external network requests
- Distinctive: line 41
All five must pass with zero errors before you consider work complete.
- Very specific: line 45
All source files live under src/.
- Distinctive: line 49
Do not add comments that narrate what the code does — only explain non-obvious intent
- Distinctive: line 59
After completing work, provide:
≈ “Common” is an estimate: at least 1 in 5 of the 16,597 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS — agent-context-doctor
This is a TypeScript Node.js CLI project. You are an implementation agent.
What this project is
agent-context-doctor (acd) is a deterministic CLI that audits agent instruction files
for quality, safety, contradictions, and stale commands. It is not an AI product.
Absolute constraints
Do not do any of the following without explicit approval:
- Add LLM or AI API calls of any kind
- Add telemetry, analytics, or any outbound network calls
- Add authentication or credential handling
- Build a web server, web app, or browser UI
- Change the binary name (
acd) or existing command names (audit,list) - Modify
.acdrcschema in a breaking way - Change the
AuditResultJSON shape in a backward-incompatible way - Write to any file outside the audited repo path (only
--outputwrites are allowed) - Add dependencies that make external network requests
Tech stack
- TypeScript, ESM, Node.js ≥ 18
- pnpm
commander,fast-glob,zod,picocolorsvitestfor tests,tsxfor dev,prettierfor formatting
Commands to run before finishing
pnpm format:check # formatting
pnpm typecheck # TypeScript
pnpm lint # also TypeScript (same as typecheck)
pnpm test # vitest — all tests must pass
pnpm build # tsc compilation to dist/All five must pass with zero errors before you consider work complete.
Code conventions
- All source files live under
src/; tests undertests/ - Each audit check is a pure function in
src/audit/checks/ - Cross-file logic goes in
auditRepo.ts, not in individual checks - No
anytypes; nots-ignorecomments - Do not add comments that narrate what the code does — only explain non-obvious intent
Safe-write behavior
The only file the tool writes is the optional Markdown report via --output. Paths are
resolved relative to the audited repo root. Do not add any other file-write operations
without approval.
Final report
After completing work, provide:
- Files changed — list every file modified or created
- Commands run — show the output of
pnpm test,pnpm typecheck,pnpm build - Tests added — list new test cases and their purpose
- Known limitations — anything intentionally deferred
- Recommended next steps — what to improve next
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

