Skip to content

AntonioBlago/delegate-audit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

delegate-audit

CI PyPI License: MIT

Lint your Claude Code Skills and multi-step LLM pipelines against the four hygiene rules derived from DELEGATE-52 (Microsoft Research, Laban et al. 2026 — arXiv:2604.15597).

DELEGATE-52 shows that even frontier LLMs lose roughly 25 % content fidelity when output is round-tripped through serial pipeline phases. The drift is a pipeline property, not a model bug — it's robust across 19 models and 52 domains. This tool flags the four structural patterns that compound that drift, so you can fix them before they hit production.

The four rules

ID Rule Why
DEL01 Pipeline-Length-Audit — flag skills with > 5 serial LLM hops and no diff-checks Each hop is a drift bruise; past ~5 hops, errors compound past correctability
DEL02 Retrieval, not Round-Trip — multi-phase skills must carry source anchors ([Q1], [mm:ss], #quelle-N ...) through every phase Phases that paraphrase prior LLM output fabricate; phases that reference the original source can verify
DEL03 Mandatory diff-checks at phase boundaries — every LLM-producing phase needs a verify-step against its predecessor Preferably a small script, not another LLM hop (that's just one more drift step)
DEL04 Avoid context rot — SKILL.md body ≤ 200 lines, detail-knowledge in referenced Memory/feedback files Chroma Research (Context Rot 2025) confirms hallucination grows linearly with context length

Install

pip install delegate-audit

Or from source:

git clone https://github.com/AntonioBlago/delegate-audit.git
cd delegate-audit
pip install -e ".[dev]"

Usage

# audit every SKILL.md under ~/.claude/skills
delegate-audit ~/.claude/skills

# single file
delegate-audit ~/.claude/skills/blog-artikel/SKILL.md

# strict: any finding fails, not just high severity
delegate-audit ~/.claude/skills --strict

# machine-readable
delegate-audit ~/.claude/skills --json > report.json

# custom glob (audit any *.md, not just SKILL.md)
delegate-audit ./my-pipelines --pattern "*.md"

Exit codes

Code Meaning
0 No high-severity findings (or no findings at all in --strict)
1 At least one high finding — or any finding under --strict
2 CLI usage error

Wire it into a pre-commit hook or CI step to fail builds on high severity.

Example output

~/.claude/skills/some-skill/SKILL.md
  [DEL02] HIGH   Multi-phase skill has no source-anchor convention ...
  [DEL03] HIGH   6-phase skill has no diff-check / verify-step / gate ...
  [DEL04] MEDIUM Skill body is 287 lines (limit 200). ...

3 finding(s) across 1/12 file(s).

GitHub Action

Drop this into .github/workflows/skill-audit.yml:

name: Skill Audit
on: [pull_request]

jobs:
  audit:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with: { python-version: "3.12" }
      - run: pip install delegate-audit
      - run: delegate-audit . --strict

Programmatic use

from pathlib import Path
from delegate_audit import audit_path

for report in audit_path(Path("~/.claude/skills").expanduser()):
    if report.has_high:
        print(report.path, "needs work")
        for f in report.findings:
            print(" ", f.rule_id, f.severity, f.message)

What it does NOT do

  • Doesn't run LLMs. It's a static lint pass over your skill text — no API calls, no tokens spent.
  • Doesn't auto-fix. It tells you which rule a file breaks; you decide whether to refactor, gate, or accept it.
  • Doesn't lint your prompts. It lints the pipeline structure described in your skill files. Prompt quality is a separate problem.

Reference

Laban, Philippe, et al. DELEGATE-52: Benchmarking Multi-Stage Hallucination in Frontier LLMs Across 52 Domains. Microsoft Research, 2026. arXiv:2604.15597

Hong, Anthropic, et al. Context Rot: How Increasing Input Tokens Impacts LLM Performance. Chroma Research, 2025.

License

MIT — see LICENSE.

About

Lint Claude Code Skills and multi-step LLM pipelines against the four DELEGATE-52 hygiene rules

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages