agentleFS
pankaj-mahaurpankaj-mahaur/Agent-Daemon/skills/engineering/dead-code-review/SKILL.md

dead-code-review

Skill0 starsChanged 6 days agoMITView on GitHub

Review and safely remove unused or disconnected code. Use for dead code cleanup, unused files, stale shims, unused CSS, unused dependencies, unconnected routes, orphan views/URLs, stale documentation, or runtime artifacts checked into repos.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this for proof-based cleanup.

    line 13
  2. Distinctive:

    Check dynamic imports, lazy loading, and string-based references

    line 30
  3. Distinctive:

    Check framework conventions (auto-discovery of routes, middleware, plugins)

    line 31
  4. Distinctive:

    Check configuration files that may reference code by string

    line 32

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Dead Code Review

Use this for proof-based cleanup. Deletion requires evidence and verification — never delete on suspicion alone.

Workflow

  1. Read existing docs — check for refactor summaries, migration notes, or past cleanup records.
  2. Inventory candidates by area:
    • Routes and pages (frontend routes with no links, backend URLs with no callers)
    • Components and views (imported nowhere, rendered nowhere)
    • Hooks and utilities (exported but never imported elsewhere)
    • API helpers (fetch functions with zero call sites)
    • CSS classes and stylesheets (selectors matching no markup)
    • Backend views, URLs, serializers (unreachable endpoints)
    • Dependencies (packages in lockfile but not imported in code)
    • Documentation (docs describing removed features)
    • Runtime artifacts (build outputs, logs, temp files in source control)
  3. Prove unused status with reference searches and framework knowledge:
    • grep/rg for imports, function calls, class references
    • Check dynamic imports, lazy loading, and string-based references
    • Check framework conventions (auto-discovery of routes, middleware, plugins)
    • Check configuration files that may reference code by string
  4. Separate safe deletes from risky ones:
    • Safe: zero references, no dynamic access pattern, not a public API
    • Risky: compatibility shims, public API endpoints, framework convention files
  5. Propose deletion batches grouped by root cause (e.g., "removed feature X" = 5 files).
  6. Verify after each batch — type-check, lint, build, test suite.
  7. Record what was removed and why.

Never Delete Casually

These require extra proof before removal:

  • Migrations — database migration files must never be deleted, even if the feature is gone
  • Public API endpoints — external consumers may depend on them
  • Redirect or compatibility routes — may be serving bookmarks or external links
  • Scheduled task names — job schedulers reference tasks by string name
  • CSS selectors for third-party libraries — charting libraries, rich text editors, and generated markup use class names your code doesn't explicitly reference
  • Configuration/convention files — frameworks auto-discover files by name (e.g., middleware.ts, layout.tsx, __init__.py)
  • Documentation with project decisions — may look stale but preserves architectural context

Output

For each candidate:

FieldDescription
File(s)Clickable file:LINE references
EvidenceHow you proved it's unused (grep output, zero imports, etc.)
RiskNone / Low / Medium (explain if medium)
Deletion planWhat to delete and in what order
VerificationCommand to run after deletion (type-check, build, test)
Rollbackgit checkout <commit> -- <files> if needed

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.