Make your repo understandable to AI coding agents.
A fast, local CLI tool that scans your software repository and generates or audits an AGENTS.md file so AI coding agents know exactly how to work in your codebase.
You invite an AI coding agent (like Claude Code, Cursor, OpenHands, or Devin) into your repository. It tries to help, but it runs npm test instead of pytest, it modifies compiled files in dist/, and it hallucinates environment variables because it doesn't know your project's rules.
AGENTS.md is a repository-level instruction file for AI coding agents. Just as README.md is for humans, AGENTS.md tells AI agents:
- How to install dependencies and run tests.
- Which files to avoid (like generated code).
- Where secrets live and how to handle them safely.
- Your project's specific coding conventions.
agents-md-linter automates this. It scans your repo, detects your stack, and generates a comprehensive AGENTS.md draft. It also audits existing files to ensure they meet best practices.
You can run the tool directly using npx without installing it globally:
npx agents-md-linter initOr install it as a dev dependency:
npm install -D agents-md-linter-
Generate a draft:
npx agents-md-linter init
Scans your repo, detects your framework, test commands, and package manager, then creates
AGENTS.md. -
Fill in the blanks: Open
AGENTS.mdand replace theTODOplaceholders with your project-specific context. -
Audit for completeness:
npx agents-md-linter audit
Checks that your
AGENTS.mdincludes required sections like test commands and security warnings.
Scans the repo and generates a draft AGENTS.md.
npx agents-md-linter initChecks whether an existing AGENTS.md has required sections.
npx agents-md-linter audit --strictUpdates missing sections or suggests patches to an existing AGENTS.md.
npx agents-md-linter fixPrints detected repo metadata (language, framework, commands, etc.) without writing any files.
npx agents-md-linter printBefore AGENTS.md:
Agent: "I've updated the code. Running
npm test... Error: command not found."
After AGENTS.md:
Agent: "I read AGENTS.md. I see this is a Python project using Poetry. I ran
poetry run pytestand all tests passed. I also made sure not to touch the__pycache__directory as instructed."
Here is a snippet of what the generator produces:
## Setup Instructions
**Prerequisites:** Node.js ≥ 18.
1. Clone the repository.
2. Install dependencies:
\`\`\`bash
pnpm install
\`\`\`
## Testing Instructions
Test framework: **jest**
Run all tests:
\`\`\`bash
pnpm test
\`\`\`
> Always run tests before opening a pull request.See full examples in the examples/ directory.
graph TD
A[CLI Entry] --> B[Scanner]
B --> C[Detectors]
C -->|Stack, Framework, Commands| B
B --> D{Command}
D -->|init| E[Generator]
D -->|audit| F[Auditor]
D -->|fix| G[Merger]
E --> H[AGENTS.md]
F --> I[Audit Report]
G --> H
The scanner automatically detects and configures instructions for:
- Languages: TypeScript, JavaScript, Python
- Frameworks: Next.js, React, FastAPI, Django, Express, Vue, Svelte, Flask
- Package Managers: npm, pnpm, yarn, poetry, pip, pipenv
- Tooling: Jest, Vitest, Pytest, ESLint, Prettier, Ruff, Black
- Workspaces: Monorepos (Turborepo, npm workspaces, etc.)
- CI/CD: GitHub Actions
- VS Code Extension: Inline linting for
AGENTS.mddirectly in your editor. - GitHub Action: Automatically audit
AGENTS.mdon PRs to ensure instructions stay up-to-date. - Go & Rust Support: Add stack detection for Go modules and Cargo.
- Ruby & Java Support: Add stack detection for Rails, Spring, and Gradle.
- Custom Rules: Allow teams to define custom audit rules in
.agentslinterrc. - Watch Mode: Run
agents-md-linter audit --watchduring development. - JSON/SARIF Output: Export audit results for integration with security dashboards.
- LLM Context Optimizer: A command to minify
AGENTS.mdfor agents with small context windows. - Docker Detection: Automatically document
docker-composecommands. - Database Detection: Auto-detect Prisma, Alembic, or Drizzle migration commands.
We welcome contributions! See our Contributing Guide for details on how to add new detectors, rules, or features.
Summary:
- Fork the repo.
- Create a feature branch.
- Add tests for your changes.
- Open a PR against
main.
agents-md-linter is fully local and deterministic. It never reads the contents of your secret files (like .env) — it only detects their presence to warn AI agents. It makes no network calls and requires no LLM API keys. See SECURITY.md.
MIT License. See LICENSE for details.