Index of every page on this site: llms.txt
All skills
ehnruiz avatar

/skill-collision-audit

@aaa4d45
Run it yourself

Find skills whose descriptions fight over the same request, so Claude picks one at random or the wrong one, and fix the descriptions. Use when the user asks to audit, clean up or deduplicate their skills, when a skill fires that should not have, after installing a plugin, or before adding a new skill to a large library.

Use this Skill: https://skilld.dev/gh/ehnruiz/claude-skills/skill-collision-audit

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈86 tokens for metadata: the name and description. ≈1.4k when used: this file.

Description uses 4.3% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈345 characters, or 4.3%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Skill collision audit

Claude chooses a skill by reading descriptions. Two descriptions that answer the same request, such as "what should I post?" for both a content-strategy skill and a social-calendar skill, make a collision: the choice depends on wording luck, and the wrong skill costs tokens and time. This audit finds collisions and makes each request route to exactly one skill.

Steps

  1. List the libraries. Ask which ones count, or take the defaults: ~/.claude/skills, the project's .claude/skills, and the skills of enabled plugins. A marketplace cache holds plugins that are not installed; leave it out unless the user wants it.

  2. Shortlist candidates with the script, which scores every pair of descriptions by shared distinctive words:

    python3 scripts/find_collisions.py ~/.claude/skills .claude/skills

    The path is relative to this skill's folder. --threshold (default 0.25) widens or narrows the list; --json gives machine-readable output. A one-line description shares few words with anything, so it can score under the threshold and still collide: run a second pass at --threshold 0.12 and look at the pairs where either description is short. The script also lists duplicate names: the same skill installed twice, where only one copy loads. Plugin skills are namespaced (plugin:skill), so a duplicate between two plugins usually is not one. Skills marked disable-model-invocation: true only run when typed by name, so they are never paired. When the library already has a reviewed-pairs.json (step 6), pass it with --reviewed so pairs judged before are listed but not flagged.

  3. Judge each pair. A high score is a reason to look, not a verdict. For each pair, read both descriptions in full and write three realistic requests a user would type for either one, plus one nearby request that neither should take. For each request, decide which skill should fire.

    • Collision: at least one request could reasonably fire either skill, and neither description tells Claude which to prefer.
    • Resolved: the descriptions already draw the line, typically with a "not for …, use the X skill" clause, or by triggering on different nouns.
    • Fine: they share vocabulary but serve different requests.
  4. Fix each collision with the smallest change that works, in this order of preference:

    1. Draw the line in both descriptions. Each names its own trigger and points to the other for the neighboring case: "For a month of scheduled posts, use social-calendar."
    2. Narrow a trigger. Replace a broad phrase ("what to post") with the specific one that skill handles ("a posting plan for this month").
    3. Merge two skills that do the same job, keeping the better body.
    4. Remove a duplicate or an unused skill.
  5. Show the user a table of pairs (verdict, the request that collides, the proposed fix) before changing anything. A skill from a plugin the user does not maintain gets a suggested change to send upstream, not an edit to the installed copy, which an update would overwrite.

  6. Save the requests. Write every pair you judged whose two skills still exist, fine and resolved ones as well as each collision once fixed, to reviewed-pairs.json beside the library (for ~/.claude/skills, ~/.claude/skills/reviewed-pairs.json). Remove existing entries involving skills merged away or removed in step 4 instead of saving those old pairs. Each entry keeps the requests from step 3 and the skill each should reach, at least one for each skill and null for the one neither should take:

    {"pairs": [{"skills": ["content-plan", "social-calendar"], "hash": "",
      "requests": [{"request": "plan May's posts", "expect": "content-plan"},
                   {"request": "what should I post?", "expect": "content-plan"},
                   {"request": "a calendar of posts for June", "expect": "social-calendar"},
                   {"request": "write the caption for this photo", "expect": null}]}]}

    Leave hash empty: step 7 prints the value to set. The hash covers both descriptions, so editing either one reopens the pair.

  7. Check the fix. Both commands must exit 0:

    python3 scripts/find_collisions.py --reviewed ~/.claude/skills/reviewed-pairs.json ~/.claude/skills .claude/skills
    python3 scripts/replay_routing.py --reviewed ~/.claude/skills/reviewed-pairs.json ~/.claude/skills .claude/skills

    The first lists a reviewed pair without flagging it, and flags a missing hash, a changed description, or a pair with fewer than three saved requests or none for neither. The second asks claude -p, with the user's own setup switched off, which skill each saved request needs given only the skills' names and descriptions. It approximates how Claude Code routes, so it shows whether the descriptions alone separate the requests. It fails when one lands on another skill, or when a request for neither lands on either skill of its pair. It makes one model call per request, so run it during the audit and after any description edit, not in CI. A single failure can be chance: replay once more before rewriting a description.

Writing descriptions that route cleanly

  • Lead with what the skill does, then list the distinct situations that should trigger it, one phrase each.
  • When a neighbor exists, name it and say where the boundary is.
  • Keep a description about one job. A skill that routes to other skills says so ("routes each email to the skill that handles it") so it does not compete with them.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts15d3 checks · Risk SAFE
  • Gen Agent Trust Hub15d

    This skill is designed to audit and resolve collisions between different AI agent skills by analyzing their descriptions. It uses Python scripts to calculate similarity scores between skill descriptions and provides a workflow for users to refine those descriptions for better routing. No malicious patterns, exfiltration, or dangerous command execution were detected.

  • Socket15d

    No alerts

  • Snyk15d

    Risk: LOW · No issues

Signed by skilld at aaa4d45. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 6 days ago.

Activeupdated last month

README badge

README badge for ehnruiz/claude-skills/skill-collision-audit