Skip to main content

agent-rules-lint

New: SARIF reports, GitHub Action and pre-commit integration. Usage and examples.

PyPI Python CI License: MIT

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.md
    • CLAUDE.md
    • GEMINI.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:

Contributing

See CONTRIBUTING.md.

License

MIT

Metadata

Release files for agent-rules-lint 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agent-rules-lint 0.2.0
File Size Uploaded Provenance
agent_rules_lint-0.2.0.tar.gz 62.4 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for agent-rules-lint 0.2.0
File Interpreter ABI Platform
agent_rules_lint-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 72.3 kB

Release files / agent_rules_lint-0.2.0.tar.gz

Download URL agent_rules_lint-0.2.0.tar.gz
Size 62.4 kB
Tags Source
SHA-256 checksum
How to use checksums
61432586a4d0be9845b2b6b7c3d06724bedf6ee4c3cd88302cc0f615e1a3a405
BLAKE2b-256 checksum
How to use checksums
0b5537056e61be3272efec2358a4c040fb20a3a3610448d362de02bd354543fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 16, 2026.

Transparency log

Release files / agent_rules_lint-0.2.0-py3-none-any.whl

Download URL agent_rules_lint-0.2.0-py3-none-any.whl
Size 9.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ce6543714ea5557539c1dd192423c1894d903be772c3f752e607fa11a8696548
BLAKE2b-256 checksum
How to use checksums
8742206c8ff7618c9f9a12c4c651bf5ae9efa19129b769e5ea1f01c9eb999cdf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 16, 2026.

Transparency log

Security for agent-rules-lint 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for agent_rules_lint-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 16, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page