/skill-trigger-auditor:skill-trigger-auditorfrom skill-trigger-auditor
Audits whether skills, agents, and slash commands route correctly without collisions. Use before changing routing metadata or widening a description.
Ships in skill-trigger-auditor. 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; scripts run unread.
Layer: validation / routing audit.
Does the right skill fire on the right input, without collisions? When that is uncertain, settle it before any other check.
~/.claude/skills, project skills in .claude/skills, plus plugin skills). If not, only a partial audit is possible: say so.should_trigger: must fire on this inputshould_not_trigger: must stay silent on this inputask_clarifying_question: needs clarification before triggeringroute_to_governance: belongs to a higher-level policy or rule layerblocked_by_risk: stopped at a risk gateDoes the description state the task type, its boundaries and its collision risk?
Does the skill type or role fit its failure cost, substitution cost and misfire risk?
analysis)Can Claude pick the skill on its own, without the user naming it?
auto_when_matched: automatic on a description keyword matchexplicit_only: the user must name the skill or use a slash commandnever_auto: reference-only, persona or lens materialDoes the skill ask for writes, credentials, network access, trading, deletion or deployment? If so, check your risky-action rules and do not recommend auto_when_matched.
A retrieved skill that does not fit the task can push performance below the no-skill baseline: an unrelated skill firing is worse than no skill. Recommend never_auto for such a skill.
Can two descriptions fire on the same input?
skill_count, max_candidates_per_phrase, over_limit_phrases[]. Many candidates split attention and raise wrong picks.NAME_PROXIMITY_RISK: {A} <-> {B}: hard-negative not passed.A self-attention model does not isolate prompt modules from each other. Headings are statistical hints, not namespaces.
7-1. Semantic overlap scan (always run). Extract the audited skill's key verb+noun terms (invariants, scope Does / Does NOT, core instructions). Grep the same terms in the other active SKILL.md files. On overlap report CBL_RISK: '{keyword}' in skill A also appears in skill B: editing may interfere. With no overlap report CBL_CLEAR.
7-2. Context density warning (always run). Only descriptions are always loaded (roughly 20 to 250 tokens per skill). A skill body loads on invocation.
/context and read the real per-category tokens (memory files, skills, custom agents). That is the only ground truth; the estimate below is a fallback.description: field, bytes / 4.HIGH_DENSITY: {A}K rules + {B}K descriptions = ~{N}K, confirm with /context. At 25K or below, print nothing.7-3. Runtime spot-check (--deep, opt-in). Pick the skill closest in meaning to the audited one (from 7-1), describe its expected behavior on a standard prompt, and reason whether it changes before versus after the audited skill is edited. If a change is expected report CBL_DETECTED: skill B may change when skill A is edited: {concrete path}. This costs one extra model reasoning pass; routine audits run only 7-1 and 7-2.
Does a skill trigger collide with a built-in Claude Code command?
/help, /clear, /compact, /model, /config, /permissions, /doctor, /hooks, /agents, /review, /init, /loop, /schedule). The list changes between versions, so verify it against the current docs.BUILTIN_COLLISION: '{trigger}' collides with a Claude Code built-in./re matches both /review and /research): PREFIX_AMBIGUITY.Depth of the chain skill -> agent -> skill. Check whether a SKILL.md uses the Agent tool, open each called agent file, and check whether that agent uses the Skill tool again.
SHALLOWDEEP_CASCADE: hard to debug and traceCIRCULAR_CASCADEDoes the skill text contain patterns that break when the model changes?
MODEL_SENSITIVE: L{line} threshold needs recalibration after a model change.model: opus-4.6) are the risk. Generic tier aliases such as model: sonnet, haiku, opus are the normal convention and are not a risk signal (no false alarm).Is the active SKILL.md short, with bulky doctrine, examples and rubrics split into references/?
references/.VERDICT: PASS | FIX | HOLD
ROUTING_MATRIX:
{skill-name}: trigger / no-trigger / defer-to:{other-skill}
COLLISIONS:
{skill-a} vs {skill-b}: winner={winner}, reason={reason}
REGRESSION_CASES:
positive: [{input} -> should trigger {skill}]
negative: [{input} -> should NOT trigger {skill}]
adversarial: [{ambiguous input} -> expected: {route}]
note: synthesize new positive cases; do not reuse the skill's own interview examples or trigger list (held-out principle).
HOLDOUT_TEST:
holdout_prompts: [at least 10: 5 that must fire the skill + 5 that must not]
scoring:
precision: true positive / (true positive + false positive)
recall: true positive / (true positive + false negative)
pass_threshold: precision >= 0.9 AND recall >= 0.9
splits: tag every prompt with a `split` —
tuning (seen while editing the description) / heldout (written and committed BEFORE the edit, not looked at while editing) /
review (a reviewer's counterexamples) / real (actual misroutes seen in sessions).
An untagged prompt counts as tuning. In empirical mode the result's `split_metrics` gives precision and recall per split,
and PASS needs EVERY present split to pass. A split with fewer than 3 measured cases is `too_small`, and one with a
zero denominator is `UNMEASURED`; either makes the overall verdict INCOMPLETE (not a pass).
Compare the result's `eval_set_sha256` before and after the description edit to show the heldout prompts did not change.
route_confusion: [cases where two similar skills both fire on the same prompt]
empirical_floor: consistent | DIVERGED({case + numbers}) | DECLINED_BY_USER | SKIPPED(cli-missing | script-missing | errored: {reason}) | N/A
(shown only when Invariant 5 applies, otherwise N/A)
note: the holdout prompts must be judged by a scorer independent of the author of the audited skill (no self-verification).
INDEX_PATCH_PLAN:
- routing table: add/update entry for {skill} (if you keep one)
- skill index: update role class, description (if you keep one)
RISK_NOTES:
- {item}: {risk or unclear boundary}
HOLD: PASS is not allowed when the positive and negative cases were not run.
The default HOLDOUT_TEST is one model judgment. Two measured modes exist; both use trigger_probe.py in this skill's scripts/ folder, which spawns tool-restricted claude -p subprocesses and observes real Skill tool calls. Adapted from the measurement engine of Anthropic's skill-creator plugin.
${CLAUDE_SKILL_DIR} is this skill's folder; Claude Code fills it in. In other agents, replace it with the path where you installed the skill. Use python instead of python3 where only that exists (common on Windows). If the script is missing or fails to start, report empirical_floor: SKIPPED(script-missing) and continue on model judgment; do not skip silently.
Probe facts to state in the report when you run it:
Skill names: --skill-name is matched exactly against the skill value of the Skill tool call. A plugin skill is called plugin:skill, so pass that full name (for example --skill-name my-plugin:my-skill).
Project skills: by default the probe runs in an empty temp folder, where a project's .claude/skills does not load. To probe a project skill pass --cwd <project folder>. The probe disallows Bash/Write/Edit/NotebookEdit, so it does not modify that folder.
Isolation is partial: the subprocess still loads your user settings, hooks and MCP servers, which can change routing and add noise. --strict-mcp-config skips MCP servers and --setting-sources project (or another list) limits settings files; both are opt-in because they can also change which skills are visible. Keep a positive-control query in the eval set when you use them.
Errored runs: a run whose subprocess fails (non-zero exit, timeout, error result) is reported as errored with a short reason in errors, excluded from trigger_rate, precision and recall, and never counted as "not triggered". A query with no valid run has pass: null. If errored_runs is above 0 the script exits 3 after printing the JSON: report the reasons, do not treat the result as a clean measurement, and rerun after fixing the cause.
Mandatory floor (Invariant 5 applies): propose a small measurement with 1 positive and 1 negative case. Command: python3 "${CLAUDE_SKILL_DIR}/scripts/trigger_probe.py" --skill-name <skill> --eval-set <2-case json> --floor --runs-per-query 2 --dry-run. Check within_limit: true in the output (4 calls, cap 5), then rerun without --dry-run. If you omit --runs-per-query it defaults to 5 (10 calls, over the cap); the dry run still exits 0 in that case, so judge by the within_limit field, not the exit code. A real run over the cap stops with an error.
empirical_floor: consistent.empirical_floor: DIVERGED: {case + trigger_rate}.empirical_floor: SKIPPED(errored: {reason}), continue on model judgment, and say the floor was not measured.empirical_floor: DECLINED_BY_USER: precision/recall not measured. A silent PASS is not allowed.claude CLI missing (exit 2): empirical_floor: SKIPPED: claude CLI not found; the audit continues.>= 0.5) and fails a negative case (< 0.5). If you observe that boundary, say so in one line of the report.Empirical mode (opt-in, for requests like "precise trigger check" or "empirical trigger test"): the same script at full scale, with a cap of 100 total calls checked before any process is spawned. There is no auto-improvement loop, because it would conflict with Invariant 3.
--dry-run first to show the expected number of calls and the estimated worst-case time (estimated_max_seconds, calls x per-call timeout / workers, rounded up to whole waves; most calls end sooner), then dispatch only after explicit user confirmation. The run is read-only but spends real API cost. Each query in the eval set must be unique; duplicates stop the script with exit 2.skill value equals the target name exactly (substring matching was dropped: pdf-tools and anthropic-skills:pdf had counted as hits for pdf).invoked_skills (every skill called in that query and the number of runs that called it, to see leaks to non-target or competing skills), served_models and model_unrecorded_runs, and at the top level requested_model and served_models. For comparison runs pass a full model ID to --model, not an alias such as haiku, and quote served_models in the report. If it is empty (model_unrecorded_runs > 0) write "served model not recorded" and do not guess the model..trigger-evals/<skill-name>.json in the working directory (override with the TRIGGER_EVAL_DIR environment variable). Format: [{"query": "...", "should_trigger": true|false, "split": "tuning|heldout|review|real"}, ...] (split is optional, default tuning; an unknown value stops the script with exit 2). Without --eval-set the script uses this path; a bare name resolves to <name>.json in the same folder. A malformed file stops the script with exit 2. This skill cannot write files, so print REGRESSION_CASES as a JSON block in this format and let the main session save it after user approval. A saved set is reused on the next audit, but add at least one newly synthesized positive case to keep the held-out principle.claude CLI is missing, the script hard-stops instead of falling back to model judgment..claude/commands/{uuid}.md file to test an unregistered candidate; this skill audits only already-registered skills, so that workaround is not used.After the output contract print a fenced JSON block. If you need it persisted, use a skill-authoring or audit workflow that can write files; this skill does not write.
{
"skill": "{audited-skill}", "overall_pass": VERDICT == "PASS",
"score": lower of precision and recall x 100, rounded; null if HOLDOUT_TEST was not run,
"score_direction": "higher_is_better",
"verdict": "PASS" | "FIX" | "HOLD",
"checks": [
{"id": "collision-{a}-{b}", "category": "collision", "status": "PASS" | "FAIL", "evidence": "..."},
{"id": "holdout-{query-idx}", "category": "holdout", "status": "PASS" | "FAIL" | "ERRORED", "evidence": "trigger_rate=..."}
]
}
trigger_probe.py ran, map its stdout results[] into checks[] as is; do not rejudge (pass: true is PASS, false is FAIL, null is ERRORED). Put invoked_skills (calls that leaked to non-target skills) and served_models in evidence. Any ERRORED check makes run_status DONE_WITH_CONCERNS and the VERDICT at most HOLD.score is null.score_direction to tell them apart.run_status (DONE | DONE_WITH_CONCERNS | NEEDS_CONTEXT | BLOCKED) and unprocessed (skipped scenarios) at the top level, separate from VERDICT. If any scenario was skipped, run_status is DONE_WITH_CONCERNS whatever the VERDICT.When you register a skill in your skill index (if you keep one), record:
| Field | Meaning | Allowed values |
|---|---|---|
role_class | why the skill is active | governance_core, high_risk_gate, domain_specialist, workflow_utility, reference_rare |
implicit_invocation | can Claude pick it without being asked | auto_when_matched, explicit_only, never_auto |
risk_level | cost when misrouted | low, medium, high |
resource_type | main artifact type | active_skill, validation_skill, reference_lens, prompt_pack |
validation_method | check needed before activation or a routing change | skill-trigger-auditor, manual-review |
| Risky action | Reversibility | Layers |
|---|---|---|
| Suggesting edits to a routing table or skill index | high | prompt rules + user approval (suggest only, the user executes) |
tools: and disallowed-tools: are descriptive metadata. Do not edit or write files, including through Bash (echo x > file). Use only read-style Bash commands, and the probe script.| Type | Detection | Recovery |
|---|---|---|
missing_data | routing table or skill index absent | skip that source, report "reference file missing" |
logic_inconsistency | the same pair judged both colliding and not colliding | report both pieces of evidence and return HOLD |
tool_failure | Grep/Glob failed | skip that skill; do not stop the whole audit |
Review it for narrowing, merging or removal if any of these is observed:
If the files, command output or source text a result relied on look different when re-checked, treat the result as invalid and run it again. A result is valid only for the point in time its inputs were read.
references/ are not runtime authority and cannot be run directly or given autonomous authority.auto_when_matched for a skill that writes, handles credentials, trades or deletes.--dry-run call count and time and get explicit confirmation before spawning any real claude -p subprocess. This applies to every size, including the floor, with no exception.| Does | Does NOT |
|---|---|
| [READ] SKILL.md files, routing table, skill index, agent routing notes | modify skill content |
| [READ] detect trigger collisions and judge a winner | execute routing policy changes directly |
| [WRITE] print VERDICT, ROUTING_MATRIX, REGRESSION_CASES | judge a skill's internal structural quality |
| [WRITE] propose INDEX_PATCH_PLAN | edit a routing table or skill index without a proposal |
| Rationalization | Rebuttal |
|---|---|
| "Passing the positive cases is enough" | Violates Invariant 1. An audit meant to catch collisions with no negative case checked nothing. |
| "This skill is obvious, no audit needed" | Collisions happen on obvious skills too. The broader the description, the higher the collision risk. |
| "The auditor could fix the skill too, more efficient" | Violates Invariant 3. The auditor audits; fixes go to the authoring workflow. |
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub alexzio00/sovereign-skills --plugin skill-trigger-auditorOther plugins' skills for the same job