返回 Skill 列表
extension
分类: AI Agent 能力无需 API Key

skill-inventory-auditor

审核所有在全球范围和项目范围内安装的代理技能,查找并移除重复的技能。当被要求“审核我的技能”、“检查重复技能”、“清理技能”、“去重技能”、“查找重复技能”,或者用户想要找到并移除重复安装的技能时使用。

person作者: jakexiaohubgithub

Skill Inventory Auditor

Find and remove duplicate skills across installed skill directories.

Repo Sync Before Edits (mandatory)

Before removing skills from git-tracked directories, sync the current branch with remote:

branch="$(git rev-parse --abbrev-ref HEAD)"
git fetch origin
git pull --rebase origin "$branch"

If the working tree is not clean, stash first, sync, then restore:

git stash push -u -m "pre-sync"
branch="$(git rev-parse --abbrev-ref HEAD)"
git fetch origin && git pull --rebase origin "$branch"
git stash pop

If origin is missing, pull is unavailable, or rebase/stash conflicts occur, stop and ask the user before continuing.

Workflow

Phase 1: Scan

Run the duplicate scanner with scope both (default) unless the user specifies otherwise:

python3 {SKILL_DIR}/scripts/scan_inventory.py --scope both --project-dir {cwd}

Scopes: global (~/.claude/skills/, ~/.agents/skills/), project (.claude/skills/), or both.

Parse the JSON output. If the script fails, report the error and stop.

Phase 2: Report Duplicates

If no duplicates are found, say so and stop.

For each duplicate group:

  1. Present a table with skill name, location, version, and description excerpt
  2. Show the similarity score between descriptions
  3. Explain why they were flagged (same name or similar description)
  4. Recommend which to keep based on:
    • Higher version number
    • More descriptive name
    • Richer feature set (more scripts/files)
    • Location preference (project-local skills may override global)

Ask the user which skills to keep/remove for each group. Wait for confirmation.

Phase 3: Remove Duplicates

Present a summary of planned removals, then ask for confirmation.

Symlink removal (preserves the source):

rm {symlink_path}

Directory removal:

rm -rf {directory_path}

Safety rules:

  • Always confirm before executing removals
  • Print exactly what will be deleted
  • Never remove skills from the project source repository (e.g., skills/ in a git repo)
  • When removing a symlink, only the link is deleted — the source remains intact

After removals, rerun the scanner to verify no duplicates remain.

Important Notes

  • This skill only removes installed copies (in ~/.claude/skills/, ~/.agents/skills/, or .claude/skills/). It never touches source repositories.
  • Symlinks between ~/.claude/skills/ and ~/.agents/skills/ pointing to the same target are shared installations, NOT duplicates. The scanner excludes these automatically.