用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Undermybelt/hermes-skills --skill memory-skills-cleanup命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
Use when retiring old logic, collapsing duplicate owners, removing fallbacks, or touching schema, persistence, or source-of-truth boundaries while deciding whether to delete old paths, retain compatibility, or stop for confirmation.
Use when defining new features, product behavior, UI/component design, architecture choices, contract changes, or ambiguous medium/high-complexity work before implementation.
Use when the user asks for caveman mode, fewer tokens, brief responses, compressed communication, or otherwise explicitly requests a much shorter answer.
基于 SOC 职业分类
| name | memory-skills-cleanup |
| description | 全面清理 Hermes 记忆层 + skills 目录 + 路由引用。 当用户说"记忆太臃肿"、"清理记忆"、"优化记忆"、"skills太多"、"磁盘满了"时触发。 |
| tags | ["memory","skills","cleanup","optimization","routing"] |
路径:~/.hermes/memories/MEMORY.md
规则:
路径:memory(target='user')
规则:
元→├─链→└─链),非扁平列表架构链模板:
元:[核心行为规则]
├─红线:[不可做]
├─重试:[失败策略]
├─[领域A]链:[约束→执行→验证]
└─[领域B]链:[约束→执行→验证]
路径:~/.hermes/skills/
清理步骤:
# 1. 查大小排序
du -sh ~/.hermes/skills/* | sort -rh | head -20
# 2. 统计每个目录 skill 数
for d in ~/.hermes/skills/*/; do
count=$(find "$d" -name "SKILL.md" | wc -l)
size=$(du -sh "$d" | cut -f1)
echo "$count skills, $size: $(basename $d)"
done | sort -t, -k1 -rn
# 3. 识别可删除项
# - auto-installed 大包(>1M 且 >10 skills,从未手动加载)
# - cloned repos(含 .git 目录)
# - 空目录(0 skills)
# - 用户不会用的领域(gaming、leisure 等)
# 4. 删除
rm -rf ~/.hermes/skills/CATEGORY/UNWANTED_PACK
# 5. 验证
du -sh ~/.hermes/skills/
find ~/.hermes/skills -name "SKILL.md" | wc -l
删除 skills 后必须清理引用,否则路由指向不存在的 skill。
文件:
~/.hermes/hermes-agent/routing/skill-router.md — 删除对应行~/.hermes/hermes-agent/routing/skill-index.md — 删除对应 section + table rows~/.hermes/hermes-agent/routing/skill-index.json — 删除对应 entries方法:
# skill-index.json 清理
import json
data = json.load(open('skill-index.json'))
# 过滤掉已删除的 category 和 skill name
data = [s for s in data if s.get('category') not in deleted_cats
and s.get('name') not in deleted_skills]
json.dump(data, open('skill-index.json', 'w'), indent=2)
验证:
grep -c "DELETED_SKILL_NAME" skill-router.md skill-index.md
# 期望:0
[{skill}, ...],不是 {"skills": [...]}~/.hermes/hermes-agent/routing/,不是 ~/.hermes/routing/