Install
$ agentstack add skill-yli769227-jpg-agent-discipline-no-dead-code ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
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](./EXAMPLES.md) — read them before you act. 本纪律的真实 before/after 反例见 [EXAMPLES.md](./EXAMPLES.md) —— 动手前先对照。
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: yli769227-jpg
- Source: yli769227-jpg/agent-discipline
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.