/lab-skills:audit-skillsfrom lab-skills
Audit Claude Code skills for bloat, trigger accuracy, structural quality, redundancy, and pruning opportunities. Use when skills feel bloated, before publishing to lab repo, after building several new skills, when reviewing a single newly-created skill before publishing, or when the user says "audit my skills", "review skills", "check skill quality", "audit this skill", or invokes /audit-skills. Covers both user-level (~/.claude/skills/) and project-level (.claude/skills/) skills, and supports both full-library scans and single-skill reviews. Do NOT load for auditing data analysis scripts (use /audit-script) or project documentation (use /audit-project).
Ships in lab-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Systematically review skills for bloat, trigger accuracy, structural quality, redundancy, and pruning opportunities. Produces a findings table with severity levels that the user works through interactively.
This is the skill-level counterpart to /audit-project (documentation health) and /audit-script
(code correctness). Where those audit what skills produce, this audits the skills themselves.
Audit quality hinges on fresh context. Choose the mechanism by scope and by whether this chat authored the skill being audited:
| Situation | Who reads | Agent calls | Why |
|---|---|---|---|
| Single skill, authored in this chat | Auditor subagent (fresh) → combined-verify subagent | 2 | The orchestrator is contaminated — it rationalizes its own choices. Recuse it from the read. |
| Single skill, clean chat (didn't author it) | orchestrator reads inline → combined-verify subagent | 1 | The clean chat already has fresh eyes; a verifier still catches its anchoring. |
| Full library (~50 skills) | orchestrator reads all inline → verification fans out | many (gated) | Cross-skill overlap/redundancy/naming need one mind holding all skills at once; fanning out the read destroys that signal. |
| Any | never an agent team | — | Fixed rubric over static files — nothing to negotiate. Teams add nondeterminism, coordination, and a second lossy channel for zero gain. |
Three subagent roles ship as prompt templates in templates/, composed differently per scope:
templates/auditor-prompt.md) — cold-reads one skill → findings. Single-skill authoring case only.templates/refuter-prompt.md) — confirms / downgrades / rejects findings. Fans out per finding.templates/completeness-prompt.md) — finds what was missed. Fans out per skill."Combined-verify" = one subagent given the Refuter + Completeness bodies together over a single
skill's findings (the single-skill case, 1 call). In the full-library case the two split apart and
parallelize on their different axes via templates/verify-fanout.workflow.js.
Mechanical pre-pass (always; deterministic; no agent). Before any reading, gather evidence with bash so agents spend judgment on hard calls, not on what a regex settles — then hand the results to the auditor/critic as "mechanical evidence already gathered":
wc -l SKILL.md references/*.md 2>/dev/null # size
grep -rn "/Users/" . 2>/dev/null # absolute-path leaks (portability)
grep -nP '(?<!\\)\$([0-9]|ARGUMENTS)' SKILL.md # $-substitution corruption (SKILL.md only)
diff -rq <this-skill-dir> <lab-repo-twin-dir> 2>/dev/null # lab-repo drift, if the lab repo exists
Capability gating. The Agent/Task tool (single subagents) is standard everywhere, so single-skill delegation works for all users. The Workflow tool (the full-library fan-out) is NOT on every install — gate it on Workflow-present AND an opt-in signal (ultracode / explicit "thorough" / save-report). Fallback when absent: one sequential combined-verify subagent per skill, or solo + self-critique. Never block the audit waiting on a tool the environment may lack, and don't mention the Workflow path to users who can't run it.
Use AskUserQuestion:
~/.claude/skills/) + project-level (.claude/skills/) scan. Common case: periodic library health check.~/.claude/skills/.claude/skills/ in current projectIf the user's invocation already names a skill or scope (e.g., "audit just the busco skill"), skip this question and proceed.
"Is there anything specific you're worried about? (e.g., 'my pipeline skills feel too long', 'I think some skills overlap')" — lets the user steer attention.
Use AskUserQuestion:
This matters because skills are sometimes created in a separate chat session that has deeper context (e.g., the reference implementation). Quick fixes (path corrections, description tweaks) can be done anywhere, but structural changes (adding code templates, reorganizing sections) are better done where the full context lives.
Default by scope:
Skip this phase if scope is a single skill — the inventory table exists to spot patterns across many skills (oversized files, missing accessory dirs, path issues at a glance). With N=1, just go straight to Phase 2 and read the skill thoroughly.
List all skills in scope. For each, report:
| Skill | Lines | Accessory Files | Quick Health |
|---|---|---|---|
expression-report | 969 | none | OVER SIZE |
hpc | 822 | none | OVER SIZE |
conda-env | 45 | none | OK |
Quick Health indicators (computed automatically):
/Users/...)When a skill bundles a scripts/ directory, note in the Accessory Files column which entries
are logic scripts (real executable code) vs boilerplate (templates, sample sheets,
reference data) — the logic scripts are the candidates for a separate /audit-script pass
(see Category 1, Size & Structure).
Present the inventory table and note any patterns before proceeding to detailed review.
Read each skill's SKILL.md (and accessory files if present). Evaluate against the 6 audit
categories below. Load references/quality_checklist.md for detailed per-category criteria.
Who performs this read depends on scope — see Execution Model above. For a single skill authored in this chat, delegate it to a fresh Auditor subagent (
templates/auditor-prompt.md) rather than reading it in the contaminated orchestrator; for a clean chat or the full library, the orchestrator reads inline.
Is the skill appropriately sized and organized?
references/, templates/, scripts/)$-substitution in inline shell — flag an unescaped $N ($ + digit) or
\$ARGUMENTS inside a SKILL.md code block: Claude Code substitutes these on load and
blanks them when the skill loads with no args, silently corrupting the snippet. Probe:
grep -nP '(?<!\\)\$([0-9]|ARGUMENTS)' SKILL.md. Severity FIX. Fix: escape as \$N,
or move the script to templates/ (preferred). $SLURM_*, $HOME, $(…), and ${…}
are safe. See the new-skill skill for the convention.scripts/ file containing genuine logic (parsing,
computation, data handling — e.g. a *.py QC tool), recommend a separate /audit-script
pass and list it in the report's "Scripts flagged for separate review" section (Phase 4).
Do not send deployable boilerplate — templates/ (SLURM scripts), sample sheets, env
YAMLs, reference FASTAs — to audit-script: it calibrates to a script's data and use case and
would misfire on intentional template placeholders (flagging deliberate path/param
placeholders as "hardcoded paths" or "missing validation"). The line: real logic →
/audit-script; boilerplate → the structure/portability checks here.Key question: If someone reads just SKILL.md, do they get the workflow and decision points without drowning in detail?
Will this skill actually load when it should?
Common problems: Too generic ("Use when working with data"), too narrow (misses common phrasings), missing exclusions (fires for wrong task).
Is the content focused, clear, and well-structured?
Key question: Could you remove any section without losing something the skill needs to function correctly?
Does this skill duplicate content found elsewhere?
Key question: If this content disappeared, would something else already cover it?
Are references and assumptions still valid?
Only check references relevant to the current project context. Don't chase every path in every skill — focus on skills that are actively used.
Would this skill work in a different context?
/Users/jm284/) instead of ~/ — the #1 skill issue~/Dropbox/Documents-Db-Work/Research/lab_software/lab-claude-skills/skills/ if that directory exists. Flag files that differ.Skip this phase if scope is a single skill. Cross-skill observations may still surface naturally during Phase 2 (e.g., "this skill defers to hpc correctly" or "the description should add a Do NOT load for X exclusion mirroring skill Y") — note those inline as findings, but don't run a full library-wide pass.
After reviewing individual skills, step back and look at the full library:
Gated — optional enhancement, not a requirement. The audit is complete and valid without this phase. Run it ONLY when both hold:
- the Workflow tool is available in this environment — it is not present in every Claude Code setup (lab-plugin users on a standard install will not have it), and
- at least one opt-in signal: ultracode is on, the user explicitly asked for thorough / adversarial / "double-check" verification, or you are producing a saved handoff report for another session.
If the Workflow tool is absent or no opt-in signal is present, skip this entire phase and proceed with your solo findings. Never block, delay, or weaken the audit waiting on a capability the environment may not have, and don't mention the workflow to users who can't run it.
When the conditions hold, fan out a short verification workflow over the findings you have already formed solo (the read + cross-reference of Phases 1–3 stay solo — see Behavior Notes). The workflow:
Fold the verified / refuted / newly-found findings into the Phase 4 table, and note in the summary that an adversarial pass was run (it raises confidence; its absence is not a defect).
The two roles use the shipped templates — Refuter (templates/refuter-prompt.md, fans out per
finding) and Completeness critic (templates/completeness-prompt.md, fans out per skill).
templates/verify-fanout.workflow.js is a ready-to-adapt skeleton that runs both fan-outs
concurrently and returns structured results for the orchestrator to fold; pass it the findings and
per-skill inputs via args. This is the "adversarial verify + completeness critic" pattern from
the Workflow tool's quality-patterns guidance — see that tool's docs for the fan-out mechanics.
Present all findings in a single table, ordered by severity (FIX first, then PRUNE, RESTRUCTURE, REFINE):
## Skill Audit Findings
| # | Severity | Skill | Category | Finding | Recommendation |
|---|----------|-------|----------|---------|----------------|
| 1 | FIX | hpc | Portability | Absolute path /Users/jm284/ on line 45 | Replace with ~/ |
| 2 | PRUNE | expression-report | Size | 969 lines, no bundled resources | Move palette + layout specs to references/ |
| 3 | RESTRUCTURE | deep-research-genelist | Redundancy | Template format duplicated in deep-research-reports | Consolidate shared format into one reference |
| 4 | REFINE | conda-env | Triggering | Description doesn't mention "pip" or "pip install" | Add pip to trigger list |
| 5 | OK | audit-script | — | Well-structured, good progressive disclosure | — |
Summary line: "Found N findings across M skills: X FIX, Y PRUNE, Z RESTRUCTURE, W REFINE"
If any skill in scope bundles scripts with real executable logic, list them in a short table
so the user can run /audit-script on each. This audit checked their placement and portability,
not their algorithmic correctness — that deeper, data-aware review is audit-script's job.
| Skill | Script | ~Lines | What it does |
|---|---|---|---|
isoseq-pipeline | scripts/isoseq_pipeline_qc.py | 253 | per-step Iso-Seq QC parsing + summary tables |
These are a scope handoff, not a severity finding — they get no FIX/PRUNE/RESTRUCTURE/REFINE tag, because the issue isn't a defect in the skill; it's that the bundled code needs a review this audit doesn't perform. Omit this section entirely if no skill in scope bundles non-trivial logic scripts (boilerplate templates, sample sheets, env YAMLs, and reference data don't count).
Then ask: "Which findings do you want to work through? (all / by severity / specific numbers)"
For each finding the user wants to act on:
For RESTRUCTURE findings that involve moving content to reference files:
references/X.md for details")For PRUNE findings:
Write a self-contained markdown report to ~/.claude/skills/{skill-name}-audit-report.md
that another chat session can use to implement fixes. The report must include:
The report is a handoff artifact — tell the user they can delete it after fixes are applied. It is NOT a skill or memory file.
new-skill skill for best practices on structure, description
writing, and organization. That skill defines the standards this audit checks against.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub musserlab/lab-claude-skills --plugin lab-skills34 skills in this plugin
/audit-projectPeriodic project health check - cross-check docs, prune conventions, find drift. Use when project documentation feels stale, before milestones, or when CLAUDE.md is getting long. Do NOT load for auditing skills (use /audit-skills) or data analysis scripts (use /audit-script).
/audit-scriptSystematic audit of data analysis scripts for bugs, analytical reasoning, data handling, style, and reproducibility. Includes domain verification phase that researches tools, file formats, and methods to catch domain-specific errors (not just code bugs). Use when auditing a script, reviewing code for correctness, checking for bugs, preparing a script for publication, or when the user says "audit this script", "review this code", "check this for bugs", or "is this script correct". Three modes: thorough (collaborative section-by-section), fast (Claude-driven with discussion), and report-only. Do NOT load for quick one-off questions about a single line or function.
/cleanup-scriptsSession-scoped script cleanup for data science projects. Checks scripts/scratch/ for working files that need consolidation into .qmd scripts, flags numbered non-.qmd files in scripts/, and verifies script-output directory correspondence. Use when finishing a coding session, when scripts/scratch/ has accumulated files, or when the user says "clean up scripts", "consolidate scratch", or "check script conventions". Lightweight and fast — reads files, no expensive computation.
/conda-envConda environment activation for Python commands. Use when running Python scripts, pip, or conda-dependent tools./data-handlingData handling best practices for R and Python data science analysis scripts. Use when writing data manipulation code, analysis pipelines, or .qmd scripts that process scientific/analytical data (e.g., filtering, joining, normalizing datasets). Do NOT load for general Python scripting, infrastructure code, or configuration management.
/debugging-before-patchingSystematic debugging and error diagnosis. Use when debugging errors, fixing bugs, diagnosing problems in code or data, or when the user reports something not working.