Skip to content
Back to skills

Reuse And Report Dead Code

ASecurity

Use before writing new functions, helpers, or refactors. Prevents duplicate code, bloated files, and forgotten dead code.

  • 4 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 29, 2026
ai-agentsgo

Security analysis

A100/100

Scanned November 29, 2026

npx -y skills add Ganesh-Dark/ai-coding-agent-skills --skill reuse-and-report-dead-code --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Reuse And Report Dead Code?

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

Security grade badge for Reuse And Report Dead Code
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ganesh-dark-reuse-and-report-dead-code/badge)](https://www.skillsdirectory.com/skills/ganesh-dark-reuse-and-report-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: reuse-and-report-dead-code
description: Use before writing new functions, helpers, or refactors. Prevents duplicate code, bloated files, and forgotten dead code.
---

# Reuse and Report Dead Code

Agents are often afraid of breaking existing functions, so they append a brand-new duplicate helper at the bottom of the file. Over a few sessions, the codebase fills up with copies and dead code that nobody cleans up.

## Rules

- Search the repository before writing any new helper, validator, or constant. If one already exists, reuse it or extend it cleanly.
- Do not pile unrelated logic into one giant file. If a file is turning into a dumping ground, keep new logic modular and aligned with the project structure.
- Remove any imports, variables, or helper functions that your own edit made unused.
- Watch for pre-existing dead code while you work. If you spot unused functions, unreachable `if` branches, commented-out code blocks, or orphaned imports already in the file, report their exact file paths and line numbers to the user.
- Never silently delete unrelated dead code on your own. Tell the user what is unused and wait for explicit approval before removing it.

## Example

When editing `parser.py` to fix date formatting:
- You reuse the existing `parse_iso_date` helper in `date_utils.py` instead of writing `convert_date_v2` in `parser.py`.
- You notice an old `legacy_csv_import` function on lines 140 to 178 of `parser.py` that has zero callers in the repo. You leave it untouched and tell the user: "Note: `legacy_csv_import` in `parser.py` (lines 140 to 178) appears unused. Let me know if you want it removed."

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.

View all in ai-agents →

Comments

Loading comments…

Newsletter

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