Lint AI agent instruction files such as AGENTS.md, CLAUDE.md, Cursor rules, and Copilot instructions.
Project description
agent-rules-lint
Lint AI agent instruction files before they confuse your coding agent.
agent-rules-lint is a small, dependency-free Python CLI that scans files such as AGENTS.md, CLAUDE.md, Cursor rules, and GitHub Copilot instructions for common quality and safety problems.
Why
Recent high-growth developer repos show a clear pattern: teams are adding more agent skills, rule files, memory files, and coding-agent playbooks. The missing piece is a quick quality gate for those instructions.
Bad agent instructions are expensive. They can be too long, vague, contradictory, unsafe, or accidentally include secrets. This tool gives you a fast local and CI check before those rules affect real work.
What It Checks
- Common instruction files:
AGENTS.mdCLAUDE.mdGEMINI.md.cursorrules.cursor/rules/*.md.github/copilot-instructions.md.github/instructions/*.md
- Secret-like values
- Risky shell and Git commands
- Prompt-injection-like language
- Missing title
- Missing purpose, scope, command, or safety guidance
- Vague language
- Files that are too long for practical agent use
- A small set of obvious contradictory rules
Install
Run it without installing:
uvx agent-rules-lint .
Or install it as an isolated CLI:
pipx install agent-rules-lint
agent-rules-lint .
Standard pip installation also works:
python -m pip install agent-rules-lint
For local development:
python -m pip install -e .
Usage
Scan the current repository:
agent-rules-lint .
Return JSON for CI or custom reports:
agent-rules-lint . --format json
Fail CI on warnings:
agent-rules-lint . --warnings-as-errors
Change the long-file threshold:
agent-rules-lint . --max-chars 8000
Example Output
agent-rules-lint checked 1 file(s)
errors=0 warnings=1 info=2
Files:
- AGENTS.md
Findings:
[warning] AGENTS.md:42 risky-command: Risky command should include explicit safeguards or approval rules.
[info] AGENTS.md missing-safety: Consider adding a clear safety section.
CI
Add this to GitHub Actions:
name: Lint agent rules
on:
pull_request:
push:
branches:
- main
jobs:
lint-agent-rules:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7.0.0
- uses: actions/setup-python@v6.3.0
with:
python-version: "3.12"
- run: pipx run agent-rules-lint . --warnings-as-errors
Design Principles
- No model calls
- No network calls
- No dependencies
- Safe to run in CI
- Findings should be specific enough to act on
- Warnings should improve instruction quality, not enforce one writing style
Current Limitations
- Conflict detection is intentionally conservative and only catches obvious pairs.
- It does not estimate real tokenizer counts; it uses character length as a practical proxy.
- It does not validate whether an instruction is correct for a specific tool.
Development
python -m pip install -e .
python -m unittest discover -s tests -v
python -m agent_rules_lint .
Agent OSS Toolkit
This project is part of a small toolkit for building and launching agent-ready open-source repositories:
- agent-repo-kit: scaffold launch-ready, AI-agent-friendly repositories
- oss-launch-check: audit whether a repository is ready to launch as open source
- repo-context-card: generate compact repository context cards for coding agents
- agent-rules-lint: lint AGENTS.md, CLAUDE.md, Cursor rules, and Copilot instructions
- awesome-ai-agents-zh: Chinese AI Agents / MCP / AI DevTools directory
Contributing
See CONTRIBUTING.md.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agent_rules_lint-0.1.1.tar.gz.
File metadata
- Download URL: agent_rules_lint-0.1.1.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2ae25f1daaa0fb445265fbe240f9d4bb93f6bc4da36abd12ddf95f913ec6c0b
|
|
| MD5 |
c22ffeb828b2ea552ad3573253df017b
|
|
| BLAKE2b-256 |
fe756375edd8fdb74b5b42520deede396ddc932fed36cfec0b67e1b2b68dca64
|
Provenance
The following attestation bundles were made for agent_rules_lint-0.1.1.tar.gz:
Publisher:
release.yml on Uky0Yang/agent-rules-lint
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_rules_lint-0.1.1.tar.gz -
Subject digest:
d2ae25f1daaa0fb445265fbe240f9d4bb93f6bc4da36abd12ddf95f913ec6c0b - Sigstore transparency entry: 2170860894
- Sigstore integration time:
-
Permalink:
Uky0Yang/agent-rules-lint@12b71fa2a8f5c4c7b431f94bcfcc7d9741616c3b -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Uky0Yang
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@12b71fa2a8f5c4c7b431f94bcfcc7d9741616c3b -
Trigger Event:
push
-
Statement type:
File details
Details for the file agent_rules_lint-0.1.1-py3-none-any.whl.
File metadata
- Download URL: agent_rules_lint-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8537100a6d2d5b99b387b0b80ca4b2aca73d49941f2f607bdcf2a411bbeaee2
|
|
| MD5 |
760f111f7cd54d702b5f85634cbf59ac
|
|
| BLAKE2b-256 |
0eca3e118bae65a7b4c6c91ad5c5a7176e8ca3b2d130c40c9e5d7db4f9e0c523
|
Provenance
The following attestation bundles were made for agent_rules_lint-0.1.1-py3-none-any.whl:
Publisher:
release.yml on Uky0Yang/agent-rules-lint
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_rules_lint-0.1.1-py3-none-any.whl -
Subject digest:
c8537100a6d2d5b99b387b0b80ca4b2aca73d49941f2f607bdcf2a411bbeaee2 - Sigstore transparency entry: 2170860912
- Sigstore integration time:
-
Permalink:
Uky0Yang/agent-rules-lint@12b71fa2a8f5c4c7b431f94bcfcc7d9741616c3b -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Uky0Yang
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@12b71fa2a8f5c4c7b431f94bcfcc7d9741616c3b -
Trigger Event:
push
-
Statement type: