Skip to main content

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. 40 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
skill-lint . -v                                 # Verbose
skill-lint rule TCOST001                        # Explain a rule
skill-lint rule                                 # List all 40 rules

What It Checks

Category Rules Examples
Token cost 11 Oversized files, duplicates, filler phrases, hedging
Description 5 Too long, missing trigger conditions
Hallucination risk 4 Vague instructions, no output format, prompt injection risk
Framing 4 Prohibition overuse, emphasis overuse, bare directives
Output quality 3 No examples, no verification, no role statement
Best practice 5 No model, no error handling, model-complexity mismatch
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
- run: pip install ai-skill-lint
- run: skill-lint . --format sarif --fail-on warning > results.sarif
- uses: github/codeql-action/upload-sarif@v3
  with:
    sarif_file: results.sarif

pre-commit

repos:
  - repo: https://github.com/rajusem/skill-lint
    rev: v0.2.0
    hooks:
      - id: skill-lint

Baseline (incremental adoption)

skill-lint . --save-baseline   # Save current findings
skill-lint . --diff            # Show only NEW issues

Inline Suppression

<!-- skill-lint: disable TCOST005 -->
<!-- skill-lint: disable TCOST003, HRISK001 -->

Configuration

Option 1: .skill-lint.yaml

disable:
  - HRISK002
  - OQUAL001
fail_on: warning
thresholds:
  max_tokens: 8000   # default: 5000
  max_lines: 800     # default: 500
include:
  - "prompts/*.md"
  - "docs/agents/**/*.md"

Option 2: pyproject.toml

[tool.skill-lint]
disable = ["HRISK002", "OQUAL001"]
fail_on = "warning"
thresholds = {max_tokens = 8000, max_lines = 800}
include = ["prompts/*.md", "docs/agents/**/*.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

  1. Help, don't restrict — every finding is a suggestion, not a gate
  2. Show, don't enforce — display impact, let users decide
  3. Honest numbers — no inflated claims; validated across 88+ repos

License

Apache-2.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ai_skill_lint-0.2.0.tar.gz (51.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ai_skill_lint-0.2.0-py3-none-any.whl (32.7 kB view details)

Uploaded Python 3

File details

Details for the file ai_skill_lint-0.2.0.tar.gz.

File metadata

  • Download URL: ai_skill_lint-0.2.0.tar.gz
  • Upload date:
  • Size: 51.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ai_skill_lint-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f280fc050e8a36fba2c7d686ee4664d270237472d32016db9bf22f64f1f026e2
MD5 12a184fc94c3ab804825dce6de807c74
BLAKE2b-256 6be5ea3437318a69530de08e3666a6f14545519f8341abb127a55078880f8819

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_skill_lint-0.2.0.tar.gz:

Publisher: publish.yml on rajusem/skill-lint

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ai_skill_lint-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: ai_skill_lint-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 32.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ai_skill_lint-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ff887f43b6e8c86410a83b6a4066b410bc43b7d9d2e32eb7f056cdd153950a9d
MD5 23cc584d999a85ef3e1690d646afd97a
BLAKE2b-256 9d31ab370a9130d4cf34e8ab209330d0a18a2b7e3dcd8b7c640aa8b28d0d6df1

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_skill_lint-0.2.0-py3-none-any.whl:

Publisher: publish.yml on rajusem/skill-lint

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.6.0

2 files

0.5.0

2 files

0.4.0

2 files

0.3.0

2 files

0.2.1

2 files

This release

0.2.0 This release

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page