Skip to content
Back to skills

Dead Code

ASecurity

Find and remove unused code, exports, and files across the project

  • 3 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 3, 2026
ai-agentsgoapi

Works with

  • api

Security analysis

A100/100

Scanned September 3, 2026

npx -y skills add black141312/ada --skill dead-code --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Dead Code?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Dead Code
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/black141312-dead-code/badge)](https://www.skillsdirectory.com/skills/black141312-dead-code)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: dead-code
description: Find and remove unused code, exports, and files across the project
category: review
---

# Dead Code

Use this to clean out code that nothing references anymore — unreachable branches, unused exports, orphaned files, and stale dependencies that quietly accrue.

1. Run the language's dead-code tooling first (e.g. `ts-prune`/`knip`, `unimport`, `vulture`, `cargo +nightly udeps`, compiler `-Wunused`, or IDE "unused" inspections).
2. For each candidate, grep the whole repo for the symbol — including dynamic references, string-based lookups, reflection, and test-only usage — before deleting.
3. Remove unreachable branches, commented-out blocks, unused params, and exports no longer imported anywhere.
4. Delete orphaned files and prune dependencies in the manifest that nothing imports.
5. Run the build, type-checker, and full test suite after each batch of deletions to confirm nothing broke.
6. Commit the removals in a focused, behavior-preserving commit separate from any feature work.

## Rules
- Verify a symbol is truly unreferenced before deleting — dynamic dispatch, DI containers, and string keys evade static analysis.
- Keep public API surface intact unless you've confirmed no external consumer depends on it; deprecate before deleting when unsure.
- Don't delete code guarded by feature flags, platform conditionals, or build targets you're not exercising.
- Make deletions in small, reviewable commits so a regression is easy to bisect and revert.
- Tests and fixtures count as usage — don't delete code only the tests use unless you're removing the tests too.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…