k-skill-cleaner
Interview the user and inspect coding-agent skill trigger counts to recommend unused K-skills for removal.
Security Assessment
About k-skill-cleaner
K-Skill Cleaner helps users slim down a K-skill bundle by identifying skills they never use and building an evidence-backed deletion shortlist, rather than removing directories by guesswork. It operates under a strict safety contract: it never deletes skills automatically, producing a ranked recommendation first and acting only after the user explicitly approves the shortlist. Trigger counts are treated as best-effort signals rather than absolute truth, since different agents store transcripts differently and may rotate or omit logs; any skill the user marks as keep is protected even at zero usage, and whole root-level skill directories are removed only after checking README, docs, and install references in the same change.
The workflow begins with a compact interview covering which agents the user relies on, which skills must never be deleted, which they are certain they never use, the time window of interest (30, 90, or 180 days), and whether they want recommendations only or approved deletions carried out. It then inspects agent-specific trigger-count sources: Claude Code, Codex, and OpenCode transcripts are treated as best-effort, while OpenClaw/ClawHub and Hermes logs are manual-confirm and fall back to user-exported stats where no stable local schema exists. A deterministic helper, k_skill_cleaner.py, scans default logs or an imported usage-JSON with options such as --skills-root, --days or --since, --never-use, and --keep, emitting JSON with the skill count, ranked remove or review candidates with trigger counts and reasons, the agent usage sources and their caveats, the effective time window, whether imported counts were merged, how many logs were scanned, and a safety reminder that nothing was deleted.
Recommendations are grouped into remove (skills the user confirmed as never used, with any low-trigger evidence as context), review (zero or low trigger count only), keep (protected or actively triggered), and a statistics-limits group naming agents whose logs could not be read. If deletion is approved, it removes the skill directory along with its README, docs, and install references, removes package or workspace references the skill owns, and then runs lint, typecheck, and test (or the CI script for packaging changes).
FAQ
Does it delete skills automatically?
No. Its safety contract requires it to produce a ranked recommendation first and delete only after you explicitly approve the shortlist. Skills you mark as keep are protected even if their trigger count is zero.
How does it decide which skills are unused?
It interviews you, then inspects agent transcripts and logs for trigger counts. These are treated as best-effort signals, not absolute truth, because agents store logs differently and may rotate or omit them.
Which agents' usage can it check?
Claude Code, Codex, and OpenCode (best-effort log scanning), plus OpenClaw/ClawHub and Hermes (manual-confirm, preferring exported stats since no stable local schema is assumed).
What do the recommendation categories mean?
remove is for skills you confirmed you never use; review is for skills with only a zero or low trigger count; keep is for protected or actively triggered skills; and a statistics-limits group flags agents whose logs could not be read.
What happens after I approve deletions?
It removes the skill directory plus its README table entries, docs feature links, and install references, removes package or workspace references the skill owns, and then runs lint, typecheck, and test.
Install k-skill-cleaner
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
nomadamas/k-skill