no-dead-code
Skill1 starsChanged 6 months agoMITView on GitHub
Never assume dead code (cross-agent safety). Before deleting any symbol (function/class/variable/file), grep every caller. After adding a file, update the project manifest. When multiple agents edit in parallel, re-read the latest file before editing — don't trust a cached copy. Triggers when about to delete a symbol, add a source file, or edit a file that may be concurrently modified. 不假设 Dead Code:删任何符号前先 grep 所有调用方;新增文件后更新清单;多 agent 并行时编辑前先读最新文件;看到"像是没用"的符号先 grep 再说。 消歧:多文件接口改造的逐文件 build 节奏归 incremental-build,本 skill 只管"删/改符号前证明安全"。
In this repository9 other files it gives its agents.
- agent-teamSkill
- ask-before-actSkill
- check-versionsSkill
- first-principlesSkill
- incremental-buildSkill
- log-firstSkill
- restraintSkill
- test-is-truthSkill
- test-qualitySkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 20
Before deleting a function/variable, grep all callers across the repo.
- Very specific: line 22
After adding a file to the project, update the manifest (package.json, go.mod, exports index, etc.).
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Never Assume Dead Code / 不假设 Dead Code
"Nobody uses this" is a hypothesis, not a fact. Grep proves it; memory doesn't. "没人用这个"是假设不是事实。grep 能证明,记忆不能。
The discipline / 纪律
- Before deleting a function/variable, grep all callers across the repo. 删除函数/变量前,grep 所有调用方。
- After adding a file to the project, update the manifest (
package.json,go.mod, exports index, etc.). 新增文件后,更新项目清单(package.json、go.mod、导出索引等)。 - With agents working in parallel, re-read the latest file before editing — never rely on a cached view. 多 agent 并行时,编辑前重新读最新文件——绝不依赖缓存视图。
When this triggers / 触发时机
- About to delete a function / class / variable / file.
- About to add a source file / module.
- About to edit a file that another agent may be modifying concurrently.
- You spot a symbol that "looks unused".
Done criterion (verifiable) / 完成判据(可验证)
✅ Before the deletion, you ran a repo-wide grep for the symbol and it returned zero live callers (and you can show the search). New files are registered in the manifest. For a possibly-concurrent edit, there's a fresh Read of the file in this turn right before the edit. ⚠️ Grep found callers — those are not dead; handle them or stop. ❌ You deleted on the assumption it was unused, without searching. Restore and grep first.
Worked examples / 实战反例
Real before/after cases for this discipline live in EXAMPLES.md — read them before you act. 本纪律的真实 before/after 反例见 EXAMPLES.md —— 动手前先对照。
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

