agentleFS
exerias21exerias21/brainstorm-toolkit/skills/dead-code-review/SKILL.md

dead-code-review

Skill0 starsChanged 39 days agoMITView on GitHub

Launches a parallel fan-out of review agents to find dead code, dead docs, and dead plans, then removes them and runs the test suite before and after to verify zero regressions. THIS IS THE SKILL FOR "launch a few agents to review everything for dead code / anything no longer needed" — use it instead of hand-composing an ad-hoc agent fan-out. Use when the user says /dead-code-review, "what can be deleted", "what's no longer needed", "clean this up", "look for dead code", or asks to sweep the repo before a release or after a refactor.

2 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 2

    1. mrveiss/AutoBot-AI★ 39same name
    2. pankaj-mahaur/Agent-Daemon★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository14 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 9 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run the configured test suites (from .claude/project.json test.* — unit, frontend, e2e) and record pass/fail counts.

    line 25
  2. Distinctive:

    After all agents report back:

    line 62
  3. Distinctive:

    Execute MEDIUM-confidence removals: if tests pass

    line 68
  4. Distinctive:

    Test comparison (baseline vs after cleanup)

    line 77
  5. Distinctive:

    If a specific run genuinely needs deeper analysis (e.g., the database agent flags ambiguous cross-module references), promote that single …

    line 91
  6. Distinctive:

    Never commit during the review — the user decides when to commit

    line 93
  7. Distinctive:

    Always run tests before AND after to verify zero regressions

    line 94
  8. Distinctive:

    Only remove code at HIGH confidence unless the user explicitly approves MEDIUM items

    line 95
  9. Distinctive:

    If a function appears unused but is referenced by a string-based dispatch (like intent routing), do NOT remove it

    line 97
  10. Distinctive:

    If a type is used as a return type of a live API method, do NOT remove it even if never imported externally

    line 98

≈ “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

Systematically find and remove dead code, stale documentation, unused database objects, and orphaned files across the entire codebase. Uses parallel agents tiered by reasoning load (Haiku / Sonnet) for exhaustive analysis, then applies fixes with test verification.

Process

Phase 1: Establish Test Baseline

Run the configured test suites (from .claude/project.json test.* — unit, frontend, e2e) and record pass/fail counts. Skip any key that is not configured, and say which you skipped. No project.json and no discoverable suite means no baseline: say so plainly and restrict the run to report-only, because "zero regressions" is unverifiable without one.

Phase 2: Launch Parallel Analysis Agents

Launch up to 6 agents in parallel. Each agent does research only — no edits — and reports back findings with confidence levels. Models are tiered by reasoning load: Haiku for grep-heavy hygiene work and Sonnet for code-pattern reasoning — including the data lens, whose cross-module dependency calls have the highest blast radius (raise it with models.dead_code_review: {data: opus}). Models: the tiers below are the defaults of models.dead_code_review in project.json (a string for all lenses, or a map keyed server, client, data, docs, scripts); resolve per skills/sdlc/templates/models.md, print model: dead_code_review <lens>=<tier>, … (cap: <cap|none>) and pass model explicitly on every dispatch.

Read references/lenses.md (next to this SKILL.md) now — it carries the five lenses and their per-surface checklists, plus the shared reporting contract.

First resolve which lenses apply. The surfaces are roles, not paths: read .claude/project.json modules if present, otherwise infer them from the repo layout. A repo with no client code skips the client lens; a repo with no database skips the data lens. Say which lenses you dropped and why — a silent skip reads as "clean".

LensTierApplies when
1 — Server / backend codeSonnetthere is a service or library layer
2 — Client / frontend codeSonnetthere is a UI surface
3 — Data layer and migrationsSonnetthere is a schema or migration directory
4 — Documentation and plansHaikualways
5 — Scripts, config, test infraHaikualways

Dispatch the applicable lenses in one message. There is no separate test-runner agent — Phase 1 already established the baseline.

Phase 3: Consolidate & Execute

After all agents report back:

  1. Triage findings by confidence level (HIGH/MEDIUM/LOW)
  2. Execute HIGH-confidence removals first — deletions, import cleanups, dead function removal
  3. Restart or rebuild the running stack if the repo has one (project.json stack.*)
  4. Re-run test suite to verify zero regressions
  5. Execute MEDIUM-confidence removals if tests pass
  6. Final test run to confirm everything

Phase 4: Report

Provide a summary table:

  • Files deleted (count + line count)
  • Files modified (count + lines removed)
  • Database objects dropped (tables, indexes, columns)
  • Test comparison (baseline vs after cleanup)

Scope Options

ScopeWhat runs
full (default)every lens that applies to this repo
backendlenses 1 + 3
frontendlens 2
databaselens 3
docslenses 4 + 5

Rules

  • If a specific run genuinely needs deeper analysis (e.g., the database agent flags ambiguous cross-module references), promote that single agent — not the whole fleet.
  • Never commit during the review — the user decides when to commit
  • Always run tests before AND after to verify zero regressions
  • Only remove code at HIGH confidence unless the user explicitly approves MEDIUM items
  • Consult GOTCHAS.md at repo root (or project.json gotchas_file) for known patterns
  • If a function appears unused but is referenced by a string-based dispatch (like intent routing), do NOT remove it
  • If a type is used as a return type of a live API method, do NOT remove it even if never imported externally

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.