skill-cleaner
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSkill Cleaner
Skill Cleaner 技能清理工具
Use this when trimming skill prompt budget, finding duplicate skills, auditing enabled/disabled skill roots, or deciding which skills/plugins to remove.
当你需要削减技能提示词预算、查找重复技能、审核启用/禁用的技能根目录,或决定移除哪些技能/插件时,可以使用本工具。
Workflow
工作流程
- Run the analyzer from this skill directory or repo root:
bash
node --experimental-strip-types skills/skill-cleaner/scripts/skill-cleaner.ts --months 3Useful variants:
bash
node --experimental-strip-types skills/skill-cleaner/scripts/skill-cleaner.ts --no-logs
node --experimental-strip-types skills/skill-cleaner/scripts/skill-cleaner.ts --months 6 --max-log-mb 800 --deep-logs
node --experimental-strip-types skills/skill-cleaner/scripts/skill-cleaner.ts --context-tokens 272000 --budget-percent 2 --no-logs
node --experimental-strip-types skills/skill-cleaner/scripts/skill-cleaner.ts --root ~/Dropbox/boxd/skills --no-logs- Read the report in this order:
- : GPT-5.5 context size, 2% skills budget, Codex-budgeted usage, and pre-budget full-list pressure.
Skill Budget - : long descriptions where relaxed grammar saves prompt budget.
Description candidates - : same skill name or near-identical description/body across Codex, plugin cache, repo siblings, and personal skill roots.
Duplicates - : no recent
Unused candidatesmention,$skillread, or explicit skill-use trace in recent Codex/OpenClaw logs.SKILL.md - : where skills came from and whether config marks them disabled.
Root summary
- Before deleting or editing:
- Verify the kept copy exists and is loaded.
- Prefer deleting repo-local or duplicates when Codex built-ins cover them.
agent-scripts - Keep repo-local OpenClaw maintainer skills when they encode repo policy or live operations.
- Preserve trigger nouns in descriptions: product, tool, action, object.
- 从本技能目录或仓库根目录运行分析器:
bash
node --experimental-strip-types skills/skill-cleaner/scripts/skill-cleaner.ts --months 3实用命令变体:
bash
node --experimental-strip-types skills/skill-cleaner/scripts/skill-cleaner.ts --no-logs
node --experimental-strip-types skills/skill-cleaner/scripts/skill-cleaner.ts --months 6 --max-log-mb 800 --deep-logs
node --experimental-strip-types skills/skill-cleaner/scripts/skill-cleaner.ts --context-tokens 272000 --budget-percent 2 --no-logs
node --experimental-strip-types skills/skill-cleaner/scripts/skill-cleaner.ts --root ~/Dropbox/boxd/skills --no-logs- 按以下顺序阅读报告:
- :GPT-5.5上下文窗口大小、2%技能预算占比、Codex预算使用情况,以及预算前完整技能列表的压力。
技能预算 - :可通过简化语法节省提示词预算的冗长描述。
待精简描述候选 - :在Codex、插件缓存、仓库同级目录和个人技能根目录中存在同名或描述/内容几乎完全一致的技能。
重复技能 - :近期Codex/OpenClaw日志中无
未使用技能候选提及、$skill读取记录或明确的技能使用痕迹。SKILL.md - :技能的来源以及配置中是否标记为禁用。
根目录汇总
- 删除或编辑前注意事项:
- 确认保留的技能副本已存在且已加载。
- 若Codex内置技能已覆盖功能,优先删除仓库本地或中的重复技能。
agent-scripts - 若仓库本地的OpenClaw维护者技能包含仓库策略或实时操作逻辑,请予以保留。
- 保留描述中的触发名词:产品、工具、动作、对象。
Analyzer Notes
分析器说明
- The script mirrors Codex's model-visible line shape: .
- name: description (file: path) - It applies Codex-like frontmatter rules: YAML frontmatter only, default name from parent dir, single-line sanitized and
name.description - It follows Codex : 2% of raw
core-skills/src/render.rs, token costcontext_window, then full descriptions -> equal description truncation -> omitted minimum lines.ceil(utf8_bytes / 4) - It reads for GPT-5.5
~/.codex/models_cache.json; fallback is 272,000 tokens and 2%.context_window - It scans only normal Codex/plugin/repo skill roots by default. Extra folders such as Dropbox archives are included only with .
--root <path> - It realpath-dedupes roots, so symlinked roots such as do not create false duplicates.
~/.codex/skills/agent-scripts -> ~/Projects/agent-scripts/skills - For duplicate names, it reports description/body similarity and suggests deletion candidates only when bodies are near copies. Keep priority defaults to direct Codex system skills, then direct Codex skills, then plugin skills, then personal/repo copies.
- It scans and recent
~/.codex/history.jsonlby default. Add~/.codex/sessions/**/*.jsonlfor archived sessions and common OpenClaw/Clawd log folders.--deep-logs - Usage evidence is heuristic: ,
$skill, and paths likeUse $skill.skills/<name>/SKILL.md
- 脚本镜像Codex模型可见的行格式:。
- name: description (file: path) - 它应用类Codex的前置规则:仅支持YAML前置内容,默认名称取自父目录,和
name需为单行净化后的内容。description - 它遵循Codex 的逻辑:占用原始
core-skills/src/render.rs的2%,token成本按context_window计算,处理顺序为完整描述→等长描述截断→省略最少行数。ceil(utf8_bytes / 4) - 它从读取GPT-5.5的
~/.codex/models_cache.json值; fallback值为272,000 tokens和2%占比。context_window - 默认仅扫描常规的Codex/插件/仓库技能根目录。仅当使用参数时,才会包含Dropbox归档等额外文件夹。
--root <path> - 它会通过真实路径对根目录去重,因此像这样的符号链接根目录不会产生虚假重复项。
~/.codex/skills/agent-scripts -> ~/Projects/agent-scripts/skills - 对于同名技能,仅当内容几乎完全相同时,才会报告描述/内容相似度并建议删除候选。保留优先级默认顺序为:Codex直接系统技能→Codex直接技能→插件技能→个人/仓库副本。
- 默认扫描和近期的
~/.codex/history.jsonl。添加~/.codex/sessions/**/*.jsonl参数可扫描归档会话及常见的OpenClaw/Clawd日志文件夹。--deep-logs - 使用证据为启发式判断:包括、
$skill以及Use $skill这类路径。skills/<name>/SKILL.md
Output Policy
输出策略
- Suggest first; edit only when the user asks.
- If asked to apply cleanup, make small grouped commits: descriptions, deletes, config disables.
- Do not delete ignored/untracked skill dirs without naming the destination or confirming they are disposable.
- 先给出建议;仅在用户要求时进行编辑。
- 若用户要求执行清理操作,需进行分组小提交:精简描述、删除技能、禁用配置。
- 若未指定目标位置或未确认可丢弃,请勿删除已忽略/未追踪的技能目录。