Skip to content
Back to skills

Dead Code Removal

ASecurity

Use to identify and safely delete unused functions, classes, exports, and files.

  • 6 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added May 29, 2026
ai-agents

Security analysis

A100/100

Scanned May 29, 2026

npx -y skills add yeaight7/agent-powerups --skill dead-code-removal --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Dead Code Removal?

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

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

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-removal
description: "Use to identify and safely delete unused functions, classes, exports, and files."
---

# Dead Code Removal

Dead code increases maintenance overhead and confuses developers.

## The Removal Protocol

1. **Verify Unused**: Before deleting anything, you must search the *entire repository* to ensure the symbol or file is truly unused. Do not assume it is dead just because the current file doesn't use it.
2. **Check for Dynamic Invocation**: Be wary of dynamically invoked code (e.g., reflection, dependency injection by string name, ORM mappers). If there is any doubt, leave it alone or ask the user.
3. **Delete Aggressively**: Once confirmed unused, delete the code. Do not comment it out.
4. **Prune Dependencies**: If you delete the only code that was using an imported module, remove the import statement as well.
5. **Run Tests**: Always run tests and/or type checkers (e.g., `tsc --noEmit`) after removal to ensure you didn't accidentally break a hidden dependency.

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…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.