Lint AI agent configuration markdown files for structural problems.
Project description
ailint
Lint AI agent configuration files for structural problems that agents silently ignore.
What it does
- Scans CLAUDE.md, AGENTS.md, GEMINI.md, .cursorrules, .windsurfrules for bloat, vague language, redundancy, dead references, and contradictions.
- Reports problems with file:line:column, severity, rule ID, and suggested fixes.
- Provides
--deepmode for semantic contradiction analysis via the Claude CLI.
Quick start
pip install airulelint
ailint # auto-detects config file in current directory
ailint CLAUDE.md # specify a file
ailint --deep AGENTS.md # add LLM-powered semantic analysis
Example output
$ ailint CLAUDE.md
CLAUDE.md:3:20 warning [R002] Vague phrase 'try to' is hard to enforce.
suggestion: Replace it with a concrete condition, threshold, or required action.
CLAUDE.md:27:1 warning [R005] Possible contradiction in section 'Task Execution': ...
suggestion: Clarify the condition that decides whether action is automatic or requires confirmation.
CLAUDE.md:145:5 error [R004] Referenced path does not exist: rules/deploy-sop.md
suggestion: Fix the path, create the referenced file, or remove the stale reference.
✖ 3 problems (1 error, 2 warnings)
Clean file:
$ ailint CLAUDE.md
✔ No problems found
Rules
| ID | Name | Default Severity | What it catches |
|---|---|---|---|
| R001 | bloat | warning / error | File >500 lines (warn) or >1000 (error). Sections >100 lines. |
| R002 | vague-language | warning | Unenforceable phrases: "try to", "when possible", "盡量", "適當", etc. Skips definition context (e.g. "forbidden: 大概"). |
| R003 | redundancy | warning | Sections with >70% TF-IDF cosine similarity. Skips parent-child pairs. |
| R004 | dead-reference | error | Local file paths that don't exist. Filters out version numbers, cloud IAM roles, and wildcards. |
| R005 | contradiction | warning | Keyword pairs that conflict: "always" vs "never", "直接做" vs "先確認", etc. |
Deep mode
ailint --deep invokes the claude CLI to perform semantic contradiction detection beyond keyword matching. It finds contradictions that static rules miss — like "use barrel files" conflicting with "never use barrel exports" in the same config.
Requires Claude Code installed and authenticated.
Install
pip install airulelint # standard
pipx install airulelint # recommended on macOS with Homebrew Python
The PyPI package is airulelint — the CLI command it installs is ailint.
CLI reference
usage: ailint [-h] [--deep] [--format {text,json,github}]
[--severity {info,warning,error}] [--no-color] [--version]
[path]
positional arguments:
path Path to config file (auto-detects if omitted)
options:
--deep LLM-powered semantic analysis (requires claude CLI)
--format Output format: text (default), json, github
--severity Minimum severity to report: info, warning, error
--no-color Disable ANSI colors
--version Show version
The story
I spent months adding rules to my CLAUDE.md until it hit 3,550 lines. Then I analyzed which rules Claude actually followed — turns out, text rules have near-zero enforcement. I refactored to ~400 lines and moved everything else to hooks. This tool checks for the structural problems I found in my own file.
Contributing
Issues and pull requests welcome. To run tests:
pip install -e ".[test]"
pytest
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 airulelint-0.1.0.tar.gz.
File metadata
- Download URL: airulelint-0.1.0.tar.gz
- Upload date:
- Size: 14.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee710d1a24cea2596140423bc6957878d3215ef0765046f6dd8d46dc0ca56121
|
|
| MD5 |
4f0617be1411bd49bba535d334315db0
|
|
| BLAKE2b-256 |
2c8d1732ff91eebaa96d867e5315f466ad5dbf2c4d7e3a8c73f7589ccd22e77b
|
File details
Details for the file airulelint-0.1.0-py3-none-any.whl.
File metadata
- Download URL: airulelint-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83a4892fbe5fbeb39c6dd631d922fb4fdc92046adc7bca096fc33025514ab27b
|
|
| MD5 |
b1000d1170cac2fea518228c5a1683b5
|
|
| BLAKE2b-256 |
636b4a17a43d36648960419bc630d11e91d7ccb5c690acc28dacfc9727b17033
|