k-skill-cleaner
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesek-skill-cleaner
k-skill-cleaner
Use this skill when the user wants to slim down a K-skill bundle, find skills they never use, or make an evidence-backed deletion shortlist instead of deleting directories by guesswork.
当用户想要精简K-skill包、找出从未使用的技能,或者制定有数据支撑的删除候选列表而非凭猜测删除目录时,可使用本技能。
Safety contract
安全协议
- Do not delete skills automatically. Produce a ranked recommendation first, then make deletions only after the user explicitly approves the shortlist.
- Treat trigger counts as best-effort signals, not absolute truth. Different agents store transcripts differently and may rotate or omit logs.
- Protect any skill the user marks as "keep", even if its trigger count is zero.
- Prefer removing whole root-level skill directories only after checking README/docs/install references in the same change.
- 请勿自动删除技能。先生成排序后的推荐列表,仅在用户明确批准候选列表后再执行删除操作。
- 将触发次数视为尽力而为的信号,而非绝对事实。不同Agent存储对话记录的方式不同,可能会轮换或省略日志。
- 保护任何用户标记为“保留”的技能,即使其触发次数为零。
- 仅在检查同一变更中的README/文档/安装引用后,再优先删除完整的根级技能目录。
Interview first
先进行沟通
Ask a compact interview before scanning or recommending deletion:
- 어떤 에이전트를 주로 쓰나요? (Claude Code, Codex, OpenCode, OpenClaw/ClawHub, Hermes Agent, 기타)
- 절대 지우면 안 되는 스킬은 무엇인가요?
- 본인이 절대로 쓰지 않는다고 확신하는 스킬은 무엇인가요?
- 최근 30/90/180일 중 어떤 기간의 사용 흔적을 우선 볼까요? helper 실행 시 또는
--days로 반영합니다.--since - 추천만 원하나요, 아니면 승인 후 실제 삭제까지 원하나요?
在扫描或推荐删除前,先进行简短沟通:
- 您主要使用哪个Agent?(Claude Code、Codex、OpenCode、OpenClaw/ClawHub、Hermes Agent、其他)
- 哪些技能是绝对不能删除的?
- 您确定绝对不会使用的技能有哪些?
- 优先查看最近30/90/180天中哪个时间段的使用记录?运行helper时可通过或
--days参数设置。--since - 您只需要推荐,还是希望在获得批准后执行实际删除操作?
Trigger count sources by agent
各Agent的触发次数来源
| Agent | Where to check | Reliability | Notes |
|---|---|---|---|
| Claude Code | | best-effort | Look for skill-trigger events, |
| Codex | | best-effort | Look for routed skill names, explicit |
| OpenCode | | best-effort | If local schema differs, ask the user for an exported transcript or usage JSON. |
| OpenClaw/ClawHub | | manual-confirm | No stable public local trigger-count schema is assumed; prefer exported stats when available. |
| Hermes Agent | | manual-confirm | No stable public local trigger-count schema is assumed; prefer exported stats when available. |
| Agent | 检查位置 | 可靠性 | 说明 |
|---|---|---|---|
| Claude Code | | 尽力而为 | 查找技能触发事件、 |
| Codex | | 尽力而为 | 查找路由技能名称、显式 |
| OpenCode | | 尽力而为 | 如果本地 schema 不同,请用户提供导出的对话记录或使用情况JSON文件。 |
| OpenClaw/ClawHub | | 手动确认 | 不假设存在稳定的公开本地触发次数 schema;优先使用导出的统计数据(如有)。 |
| Hermes Agent | | 手动确认 | 不假设存在稳定的公开本地触发次数 schema;优先使用导出的统计数据(如有)。 |
Local helper
本地辅助工具
From an installed standalone skill, run the deterministic helper from the skill directory. In a full repository checkout, the compatibility wrapper at accepts the same options.
k-skill-cleanerscripts/k_skill_cleaner.pybash
python3 scripts/k_skill_cleaner.py \
--skills-root . \
--scan-default-logs \
--days 90 \
--never-use blue-ribbon-nearby,lotto-results \
--keep k-skill-setup,k-skill-cleanerFor agent exports or hand-curated counts, pass a JSON object mapping skill name to trigger count:
bash
python3 scripts/k_skill_cleaner.py --skills-root . --usage-json usage-counts.json --days 90--days--since--usage-jsonThe helper prints JSON with:
- : number of root-level skills discovered.
skill_count - : ranked
candidatesorremovecandidates withreviewandtrigger_count.reasons - : the agent-specific paths and caveats above.
agent_usage_sources - : the effective
time_window/--sincecutoff and mtime fallback caveat.--days - : whether imported counts were merged and the pre-windowing caveat.
usage_json - : how many readable log files were scanned and which paths contributed best-effort evidence.
scanned_logs - : reminder that no files were deleted.
safety
从已安装的独立技能中,在技能目录下运行确定性辅助工具。在完整仓库检出时,的兼容性包装器接受相同参数。
k-skill-cleanerscripts/k_skill_cleaner.pybash
python3 scripts/k_skill_cleaner.py \
--skills-root . \
--scan-default-logs \
--days 90 \
--never-use blue-ribbon-nearby,lotto-results \
--keep k-skill-setup,k-skill-cleaner对于Agent导出的数据或手动整理的次数,传入一个将技能名称映射到触发次数的JSON对象:
bash
python3 scripts/k_skill_cleaner.py --skills-root . --usage-json usage-counts.json --days 90--days--since--usage-json辅助工具会输出包含以下内容的JSON:
- : 发现的根级技能数量。
skill_count - : 排序后的“移除”或“审核”候选技能,包含
candidates和trigger_count。reasons - : 上述Agent特定的路径和注意事项。
agent_usage_sources - : 实际的
time_window/--since截止时间以及修改时间回退的注意事项。--days - : 是否合并了导入的次数以及预时间窗口的注意事项。
usage_json - : 扫描了多少可读日志文件,以及哪些路径提供了尽力而为的证据。
scanned_logs - : 提醒未删除任何文件。
safety
Recommendation policy
推荐规则
- : user explicitly marked the skill as never used. Mention any zero/low trigger evidence as supporting context.
remove - : trigger count is zero or below the selected low-usage threshold, but the user did not explicitly ask to remove it.
review - : user-protected skills and actively triggered skills.
keep
When reporting, group recommendations like this:
- 삭제 후보 — interview says never used, with trigger evidence.
- 검토 후보 — zero/low trigger count only.
- 보존 후보 — protected or recently used.
- 통계 한계 — which agents had no readable logs and require manual export.
- : 用户明确标记为从未使用的技能。提及零/低触发次数的证据作为支持依据。
remove - : 触发次数为零或低于所选低使用阈值,但用户未明确要求移除的技能。
review - : 用户保护的技能和频繁触发的技能。
keep
报告时,按以下方式分组推荐:
- 删除候选 — 用户表示从未使用,且有触发记录佐证。
- 审核候选 — 仅触发次数为零或极低。
- 保留候选 — 受保护或近期使用过。
- 统计局限性 — 哪些Agent没有可读日志,需要手动导出数据。
If deletion is approved
若删除获得批准
- Remove the skill directory.
- Remove README table/list entries and links.
docs/features/<skill>.md - Remove entries.
docs/install.md --skill <skill> - Remove package/workspace/test references only if the skill owns those files.
- Run ,
npm run lint, andnpm run typecheck(ornpm run testfor packaging/release changes).npm run ci
- 删除技能目录。
- 删除README表格/列表条目以及中的链接。
docs/features/<skill>.md - 删除中
docs/install.md的条目。--skill <skill> - 仅当技能拥有相关文件时,删除包/工作区/测试引用。
- 运行、
npm run lint和npm run typecheck(若涉及打包/发布变更,可运行npm run test)。npm run ci