dead-code-removal
Prove and remove unreachable or unused code while checking indirect, generated, reflective, configuration-driven, plugin, and external usage. Use for a bounded deletion candidate; do not use when usage cannot be established.
- License 许可
- MPL-2.0
- 最近更新
- 2026-11-13
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- dead-code-removal
- updated
- 1785024000000
- metadata
- { "version": "1.0.0", "akm-type": "skill", "akm-updated": "2026-07-26" }
- description
- Prove and remove unreachable or unused code while checking indirect, generated, reflective, configuration-driven, plugin, and external usage. Use for a bounded deletion candidate; do not use when usage cannot be established.
- compatibility
- Requires repository search, build, test, and compatibility tools appropriate to the target language.
02 资源文件 1
- 参考文档references/indirect-usage-checklist.md1.0 KB
03 SKILL.md 正文
Dead Code Removal
When To Use It
Use when specific symbols, files, flags, routes, or compatibility branches are suspected to be unused and deletion would simplify the current system.
When Not To Use It
Do not use from a linter warning alone, for public APIs with unknown consumers, or where framework discovery and runtime registration cannot be inspected.
Required Inputs
- Candidate paths and symbols
- Repository assessment and public-contract inventory
- Build, test, package, and compatibility commands
skills/coding/dead-code-removal/references/indirect-usage-checklist.md
Procedure
- Search direct references, imports, exports, call sites, tests, docs, and history.
- Check generated code, configuration, reflection, serialization, routing, dependency injection, plugins, templates, scripts, and external contracts.
- Exercise the relevant runtime or build path when static proof is insufficient.
- Classify the candidate as removable, externally constrained, conditional, or unresolved and record evidence.
- For an approved removable candidate, add a guard test if absence could regress, delete the smallest complete unit, and remove only newly orphaned code.
- Run targeted and full verification plus compatibility checks.
Constraints
- Absence from text search is not proof of non-use.
- Do not delete tests merely because their implementation was removed; retain behavior-level coverage where the contract remains.
- Do not remove deprecation or compatibility paths without confirming support windows and external consumers.
- Keep deletion separate from replacement feature work.
Expected Output
An evidence matrix for each candidate, a deletion diff for approved candidates, tests protecting retained behavior, command results, and unresolved external-use questions.
Verification
Run repository search after deletion, build/package checks, affected tests, full verification, and API/schema compatibility checks. Compare packaged or generated exports when relevant.
Stop Or Escalation Conditions
Stop deletion when any indirect-use channel remains unverified, the symbol is public or serialized, support policy is unknown, runtime evidence conflicts with static analysis, or verification cannot exercise the registration path.
04 同仓库更多 Skills
tax-filing-checklist
Walk through the steps and documents needed to file an individual federal income tax return
patient-vitals-charting
Record patient vital signs consistently and flag values outside the normal reference range
pasta-from-scratch
Make fresh egg pasta dough from scratch, roll it, and cut it into shapes
knife-sharpening
Sharpen and hone kitchen knives to keep an edge safe and effective
first-aid-response
Respond to a first aid emergency using a scene-safety-first, ABC-based (airway, breathing, circulation) approach
contract-review-basics
Review a contract draft for missing terms, ambiguous language, and risky clauses before signing