skill-lint
Linter for AI instruction files — skills, prompts, and agent specs.
skill-lint scans AI instruction files (CLAUDE.md, AGENTS.md, GEMINI.md, SKILL.md, .cursorrules, .github/copilot-instructions.md, .github/instructions/, and agent/skill directories) for issues that cause token waste, hallucination risk, and unpredictable agent behavior. 44 rules across 8 categories with fix suggestions.
Quick Start
pip install ai-skill-lint # or: pipx install ai-skill-lint
skill-lint . # Scan current project
skill-lint /path/to/project # Scan a local directory
skill-lint https://github.com/org/repo # Scan a GitHub repo
skill-lint . --format sarif --fail-on warning # CI gate (severity)
skill-lint . --fail-under 80 # CI gate (score)
skill-lint . -v # Verbose
skill-lint . --exclude "vendor/*.md" # Exclude patterns
skill-lint rule TCOST001 # Explain a rule
skill-lint rule # List all 44 rules
What It Checks
| Category | Rules | Examples |
|---|---|---|
| Token cost | 11 | Oversized files, duplicates, filler phrases, hedging |
| Description | 7 | Too long, spec limit, overlap detection, missing trigger conditions |
| Hallucination risk | 5 | Vague instructions, no output format, prompt injection, destructive ops |
| Framing | 4 | Prohibition overuse, emphasis overuse, bare directives |
| Output quality | 3 | No examples, no verification, no role statement |
| Best practice | 6 | No model, no error handling, model-complexity mismatch, options without default |
| Structure | 7 | Broken refs, encoding, file too large |
| Cross-file | 1 | Contradictions between CLAUDE.md and skill files |
Each file scored 0-100 with actionable fix suggestions.
CI Integration
GitHub Actions (recommended)
# Basic — one line
- uses: rajusem/skill-lint@v0
# With SARIF upload to GitHub Code Scanning
- uses: rajusem/skill-lint@v0
with:
format: sarif
fail-on: warning
- uses: github/codeql-action/upload-sarif@v3
if: always()
with:
sarif_file: results.sarif
# Score gate — fail if average score below 80
- uses: rajusem/skill-lint@v0
with:
fail-under: '80'
Manual (any CI)
pip install ai-skill-lint
skill-lint . --fail-on warning
pre-commit
repos:
- repo: https://github.com/rajusem/skill-lint
rev: v0.3.0
hooks:
- id: skill-lint
Baseline (incremental adoption)
skill-lint . --save-baseline # Save current findings
skill-lint . --diff # Show only NEW issues
Common include/exclude patterns
| Layout | Pattern |
|---|---|
| Prompt directory | --include "prompts/*.md" |
| Nested agent docs | --include "docs/agents/**/*.md" |
| Custom instruction dir | --include "instructions/**/*.md" |
| Exclude vendor | --exclude "vendor/*.md" |
| Exclude generated | --exclude "generated/**/*.md" |
Inline Suppression
<!-- skill-lint: disable TCOST005 -->
<!-- skill-lint: disable TCOST003, HRISK001 -->
Configuration
For VS Code/Cursor autocomplete, add to the top of your .skill-lint.yaml:
# yaml-language-server: $schema=https://raw.githubusercontent.com/rajusem/skill-lint/main/skill-lint-schema.json
Option 1: .skill-lint.yaml
disable:
- HRISK002
- OQUAL001
fail_on: warning
fail_under: 80 # exit 1 if avg score < 80
thresholds:
max_tokens: 8000 # default: 5000
max_lines: 800 # default: 500
include:
- "prompts/*.md"
- "docs/agents/**/*.md"
exclude:
- "vendor/*.md"
Option 2: pyproject.toml
[tool.skill-lint]
disable = ["HRISK002", "OQUAL001"]
fail_on = "warning"
fail_under = 80
thresholds = {max_tokens = 8000, max_lines = 800}
include = ["prompts/*.md", "docs/agents/**/*.md"]
exclude = ["vendor/*.md"]
Precedence: CLI flags > .skill-lint.yaml > pyproject.toml
Custom Rules
Write your own rules by extending the Rule base class:
from skill_lint.scanner import Rule, Issue, register_rule
class MyRule(Rule):
id = "CUSTOM_001"
description = "Check for company-specific patterns"
def check(self, ctx):
issues = []
if "legacy API" in ctx.content:
issues.append(Issue(
category="best-practice",
severity="suggestion",
message="References legacy API",
fix="Use the new v2 API instead",
rule_id=self.id,
))
return issues
register_rule(MyRule())
Custom rule IDs must use the CUSTOM_ prefix. The ctx object provides: content, lines, regions, filepath, root, tokens, and content_text (code-fence-filtered).
Philosophy
- Help, don't restrict — every finding is a suggestion, not a gate
- Show, don't enforce — display impact, let users decide
- Honest numbers — no inflated claims; validated across 88+ repos
Agent Integration
Want Claude to fix your instruction files automatically? Copy our official skill:
cp -r examples/fix-instruction-files/ .claude/skills/fix-instruction-files/
The skill runs skill-lint, interprets findings, and proposes fixes with before/after diffs. See examples/fix-instruction-files/SKILL.md.
Rule Reference
See docs/rules.md for detailed documentation on all 44 rules.
License
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 ai_skill_lint-0.3.0.tar.gz.
File metadata
- Download URL: ai_skill_lint-0.3.0.tar.gz
- Upload date:
- Size: 58.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26ba1acd08ba2428e8fbc5f31020c52f3901e92b41efa16a2b8ed1b3e192249b
|
|
| MD5 |
cb01ae823b06c49757eaec734c665ede
|
|
| BLAKE2b-256 |
8f0f09b100154012910e417be4e70877ab48fef1325f55dad9a8d202f5011186
|
Provenance
The following attestation bundles were made for ai_skill_lint-0.3.0.tar.gz:
Publisher:
publish.yml on rajusem/skill-lint
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai_skill_lint-0.3.0.tar.gz -
Subject digest:
26ba1acd08ba2428e8fbc5f31020c52f3901e92b41efa16a2b8ed1b3e192249b - Sigstore transparency entry: 2166703403
- Sigstore integration time:
-
Permalink:
rajusem/skill-lint@f4c15af1bf62ccb869ff26e04c69c78fd970a781 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/rajusem
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f4c15af1bf62ccb869ff26e04c69c78fd970a781 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ai_skill_lint-0.3.0-py3-none-any.whl.
File metadata
- Download URL: ai_skill_lint-0.3.0-py3-none-any.whl
- Upload date:
- Size: 35.3 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 |
faef34d6a87f0bf64a08a4a676cca4958874d16438c78093d4df31274d2fc287
|
|
| MD5 |
2961816bb92b3aa3b8a15ea70790edbf
|
|
| BLAKE2b-256 |
50c573505618f6cc242852e9ebcc4f50ef2616c0478fc872db951ee463ab6004
|
Provenance
The following attestation bundles were made for ai_skill_lint-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on rajusem/skill-lint
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai_skill_lint-0.3.0-py3-none-any.whl -
Subject digest:
faef34d6a87f0bf64a08a4a676cca4958874d16438c78093d4df31274d2fc287 - Sigstore transparency entry: 2166703410
- Sigstore integration time:
-
Permalink:
rajusem/skill-lint@f4c15af1bf62ccb869ff26e04c69c78fd970a781 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/rajusem
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f4c15af1bf62ccb869ff26e04c69c78fd970a781 -
Trigger Event:
push
-
Statement type: