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
- pankaj-mahaur/Agent-Daemontheir own version, first seen Nov 6, 2026
- mrveiss/AutoBot-AItheir own version, first seen Oct 15, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- mrveiss/AutoBot-AI★ 39same name
- 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.
- AGENTS.mdAGENTS.md
- brainstormSkill
- brainstorm-teamSkill
- code-tourSkill
- docstring-syncSkill
- flowsimSkill
- gotchaSkill
- plan-htmlSkill
- repo-healthSkill
- repo-onboardingSkill
- sdlcSkill
- sdlc-statusSkill
- taskSkill
- test-checkSkill
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
- Very specific: line 25
Run the configured test suites (from .claude/project.json test.* — unit, frontend, e2e) and record pass/fail counts.
- Distinctive: line 62
After all agents report back:
- Distinctive: line 68
Execute MEDIUM-confidence removals: if tests pass
- Distinctive: line 77
Test comparison (baseline vs after cleanup)
- Distinctive: line 91
If a specific run genuinely needs deeper analysis (e.g., the database agent flags ambiguous cross-module references), promote that single …
- Distinctive: line 93
Never commit during the review — the user decides when to commit
- Distinctive: line 94
Always run tests before AND after to verify zero regressions
- Distinctive: line 95
Only remove code at HIGH confidence unless the user explicitly approves MEDIUM items
- Distinctive: line 97
If a function appears unused but is referenced by a string-based dispatch (like intent routing), do NOT remove it
- Distinctive: line 98
If a type is used as a return type of a live API method, do NOT remove it even if never imported externally
≈ “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.
Files
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".
| Lens | Tier | Applies when |
| 1 — Server / backend code | Sonnet | there is a service or library layer |
| 2 — Client / frontend code | Sonnet | there is a UI surface |
| 3 — Data layer and migrations | Sonnet | there is a schema or migration directory |
| 4 — Documentation and plans | Haiku | always |
| 5 — Scripts, config, test infra | Haiku | always |
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:
- Triage findings by confidence level (HIGH/MEDIUM/LOW)
- Execute HIGH-confidence removals first — deletions, import cleanups, dead function removal
- Restart or rebuild the running stack if the repo has one (
project.jsonstack.*) - Re-run test suite to verify zero regressions
- Execute MEDIUM-confidence removals if tests pass
- 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
| Scope | What runs |
full (default) | every lens that applies to this repo |
backend | lenses 1 + 3 |
frontend | lens 2 |
database | lens 3 |
docs | lenses 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.mdat repo root (orproject.jsongotchas_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
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
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.

