by webkubor
🪦 让死代码与墓碑技能真正入土为安,晒出你的减法战绩,终结 AI 时代的上下文污染。
Available after the catalog security scan passes.
⚠️ Third-Party Software Notice
This skill is third-party open-source software developed and hosted independently on GitHub. SkillsLLM is an informational directory and does not control or maintain the underlying repository.
Any security checks, ratings, or warnings displayed by SkillsLLM are automated and limited in scope. They do not constitute a security certification or guarantee that the software is safe, error-free, or free from malicious code, vulnerabilities, compromised dependencies, or prompt-injection risks.
Review the source code, permissions, dependencies, and configuration before installing or running any third-party skill. Use is at your own risk. To the maximum extent permitted by applicable law, SkillsLLM is not liable for losses arising from third-party software.
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
# Add to your Claude Code skills
git clone https://github.com/webkubor/tombstone-reaper-skillGuides for using ai agents skills like tombstone-reaper-skill.
"立了墓碑不叫下线,入土为安才叫下线。"
很多开发者在废弃某项功能时,习惯把文件头部改成【已停用】、deprecated,以为结案了 —— 这是立了墓碑。
墓碑比死代码更危险:它占着检索池,霸占触发词,继续污染 Agent 上下文并消耗 Token。
依据系统思维宪法:"无用本身就是删除的充分理由。删除不需要论证,保留才需要。"
git revert 即可召回)。版本控制就是它的永生之地,代码库工作区不是历史陈列馆。| 类型 | 典型症状 | 危害 | 处置方式 |
|---|---|---|---|
| ⚰️ 墓碑技能 | SKILL.md 前 25 行 frontmatter 含 【已停用】、已废弃、该链路退役 或 status: deprecated |
占着关键词,Agent 依然会被误触发 | git mv 进 archive/skills/(保留 rename 历史) |
| 🤖 AI 幽灵 | *.rej(Patch 失败抛弃块)、*.scratch.*、scratch/temp_*、temp_*.py |
污染 Agent 检索上下文,产生模型幻觉 | 彻底粉碎删除 |
| 🗑️ 幽灵垃圾 | *.bak、*.bak2、*.update.lock、*~、.DS_Store |
污染 git status,容易误提交进仓库 |
彻底粉碎删除 |
| 📄 草稿碎片 | < 100 字节且无 frontmatter 的散落 .md |
误导全局搜索,形成知识噪音 | 归档或删除 |
| 🌳 孤立工作树 | 关联任务已结束、HEAD 干净但未 prune 的 git worktree |
导致本地全局搜索(grep/find)双倍冗余 | --apply 模式下 git worktree remove 安全解绑 |
| ⚡ 构建与系统缓存 | 项目级 __pycache__ / .turbo 及系统级包管理器(npm/pip/go/brew)缓存 |
白白蚕食数 GB 到数十 GB 磁盘空间 | 需加 --cache 或 --system-cache 触发清理 |
bash scripts/reap.sh --check # 或 --dry-run
bash scripts/reap.sh --bury # 或 --apply(两者完全等价)
bash scripts/reap.sh --bury --deep # 或 --all
bash scripts/reap.sh --bury --share
bash scripts/reap.sh --stats
旧版示例路径
skills/devops/tombstone-reaper/scripts/reap.sh是历史命名;当前仓库路径是scripts/reap.sh(仓库根即 SKILL 根)。
命中以下任意一条,直接执行减法,不需要请示:
.bak、.bak2、.update.lock、~ 文件。SELF_DIR,任何落在自身目录(含 archive/skills/)下的命中都会被跳过,避免 reaper 在自己仓库跑时把 SKILL.md 自己归档了。archive/ 排除锚定自身:用户项目里已有的 archive/ 不会被一刀切排除 —— 只排除 reaper 自己的归档根。/ 换 __」命名,plugins/auth/SKILL.md 与 tools/auth/SKILL.md 不会互相覆盖。.md 才算碎片(≈ 30 CJK 或 100 ASCII 字符以内)。任何通过本工具清理的内容都受 Git 严密保护:
git checkout HEAD~1 -- path/to/resurrected-file
# 或
git revert <cleanup-commit-hash>
不用担心误删,勇敢做减法!
See how tombstone-reaper-skill compares with popular alternatives.
在传统开发中,死代码只是"看着难受";而在 AI Agent / LLM 时代,立了墓碑的死代码会直接烧钱(消耗 Token)、产生幻觉、并把废弃逻辑塞满上下文。
| 现状与传统做法 | 典型后果 | 🪦 tombstone-reaper-skill 方案 |
|---|---|---|
立墓碑 (Tombstone):把废弃代码/技能加上注释 // deprecated 或 【已停用】 但留着文件 |
扫描器、RAG、Agent 检索依然把它塞进上下文,产生幻觉并浪费 Token | 入土安葬 (Bury):一键识别自称已废的死物,安全归档或物理移除 |
AI 幽灵残留:Agent 调试留下的 *.rej、scratch/ 脚本、临时 prompt 文件 |
再次被 Agent 检索扫描,引发多轮幻觉并污染上下文 | AI 碎片清道夫:精准定位并物理粉碎所有 AI 遗留脚手架 |
| 偷偷减法,无人知晓:删除了几千行死代码,团队没人感知 | 开发者缺乏做减法的成就感,倾向于一直堆积"加法" | 入土功德战报:自动生成炫酷的「减法战报」,晒出超度技能数与释放 Token |
临时文件堆积:构建调试留下的 *.bak、*.tmp、*.orig、.DS_Store |
污染 git status,极易意外 commit 进版本历史 |
雷达粉碎:自动嗅探并清理所有无用的备份与临时镜像 |
| 依赖缓存膨胀:开发环境残留几十 GB 的 npm/go/pip/brew 构建缓存 | 蚕食硬盘容量,拖慢 IDE 索引速度 | 深度减法 (--cache/--deep):一键安全蒸发系统与项目构建垃圾 |
| 不敢删代码:"万一以后还要用呢?" | 仓库无限熵增,每个未来的维护者都要多花 10 分钟重新判断 | 版本控制即永生:无用即删除的充分理由,Git 历史就是终极安全网 |
每次执行入土清理,终端自动渲染高饱和度的赛博朋克入土战报卡片与一键复制 Markdown:
==================================================
📜 🪦 墓碑收割·入土功德战报 (Burial Certificate)
==================================================
⚰️ 超度墓碑技能: 3 个
🤖 粉碎 AI 碎片: 5 份
📄 清理草稿碎片: 14 份
🗑️ 粉碎幽灵垃圾: 8 个文件
🌳 清理孤立工作树: 2 个
⚡ 清除项目构建缓存: 120 MB
🧹 清理系统依赖纯缓存: 11.3 GB
🧠 释放上下文记忆: ~15,200 Tokens
📦 缩减磁盘空间: ~11.4 GB
--------------------------------------------------
💬 悼词: 版本控制(Git)是它们的永生之地,工作区不是历史陈列馆。
==================================================
无需任何复杂依赖,纯 Bash 驱动,随时随地在任何项目根目录下运行:
# 1. 运行验尸报告(只读,查看有哪些死物与墓碑)
./scripts/reap.sh --check # 或 --dry-run,等价
# 2. 执行常规安全入土(清理墓碑、AI 碎片、临时垃圾并生成功德战报)
./scripts/reap.sh --bury # 或 --apply,等价
# 3. 全量深度减法(含项目构建缓存与系统级包管理器纯缓存)
./scripts/reap.sh --bury --deep # 或 --all,彻底回血数 GB 磁盘
# 4. 只打晒单卡片,跳过逐项清单(适合贴 PR / 社交媒体)
./scripts/reap.sh --bury --share
# 4. 查看累计功德账本
./scripts/reap.sh --stats
本仓库完全符合 CS Skill Spec v1.0 规范,只需挂载 SKILL.md,你的 Agent(Claude Code / Codex / DSH / Cursor)即可获得清道夫本能:
"收割墓碑"、"清理死代码"、"减法优先"、"tombstone"、"看看有什么该删的"。bash tests/run.sh
跑一遍 fixtures 验尸报告 + 入土链路,确认脚本在改动后没退化。
基于 MIT License 开源。欢迎 Star 与提 Issue 贡献你的收割规则!
tombstone-reaper-skill is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by webkubor. 🪦 让死代码与墓碑技能真正入土为安,晒出你的减法战绩,终结 AI 时代的上下文污染。. It has 50 GitHub stars.
tombstone-reaper-skill's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/webkubor/tombstone-reaper-skill" and add it to your Claude Code skills directory (see the Installation section above). tombstone-reaper-skill ships a SKILL.md manifest, so compatible agents can discover and load it automatically.
tombstone-reaper-skill is primarily written in Shell. It is open-source under webkubor on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh tombstone-reaper-skill against similar tools.
No comments yet. Be the first to share your thoughts!