agentleFS
mrveissmrveiss/AutoBot-AI/.claude/skills/dead-code-review/SKILL.md

dead-code-review

Skill39 starsChanged 18 days agoApache-2.0View on GitHub

Use when removing, flagging, or evaluating any code that appears unused, unreferenced, or commented out — before deletion

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. exerias21/brainstorm-toolkit★ 0same 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

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    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:

    Before touching any dead-looking code, classify it:

    line 12
  2. Distinctive:

    If the commit message says "add X endpoint" or "implement Y for phase 3" — this is unwired or future-phase, not dead.

    line 35
  3. Distinctive:

    Look for these patterns that indicate the code is unwired, not dead:

    line 55
  4. Distinctive:

    Must satisfy ALL of these before deleting:

    line 78
  5. Distinctive:

    Leave the code. Add a comment if context is unclear:

    line 127
  6. Distinctive:

    All of these look dead. None of them should be deleted — they need issues to wire them up.

    line 156

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

Core principle: Unused code is not the same as unwanted code. Code exists for a reason — find the reason before removing it.

The Three Categories

Before touching any dead-looking code, classify it:

CategoryDefinitionAction
Truly deadProven never called, no open issue, no git context suggesting intentRemove — with documented justification
UnwiredImplemented but not yet connected (no caller, no route, no event hook)Create implementation gap issue. Do NOT delete.
Future phaseExists for a planned feature or phase not yet startedNote the issue/comment, leave it. Do NOT delete.

When in doubt → Unwired. Create an issue.

Step 1 — Check git history first

# Who wrote it and when — read the commit message for intent
git log --all --follow -p <file> | head -60

# Search commits mentioning this function/class
git log --all --oneline --grep="<function_name>"

# When was it last touched?
git blame <file> | grep -n "<function_name>"

If the commit message says "add X endpoint" or "implement Y for phase 3" — this is unwired or future-phase, not dead.

Step 2 — Search for references

# Is anything calling or importing it?
grep -r "<function_name>" --include="*.py" --include="*.ts" --include="*.vue" .

# Is it referenced in tests, even if test is skipped?
grep -r "<function_name>" --include="test_*.py" --include="*.spec.ts" .

# Is it referenced in any issue or TODO?
grep -r "<function_name>" --include="*.md" docs/
gh issue list --search "<function_name>" --state all

Zero references ≠ safe to delete. A function waiting to be wired up will have zero callers.

Step 3 — Check for wiring signals

Look for these patterns that indicate the code is unwired, not dead:

# Signal: Function exists but no route registered
async def get_analytics_summary(...):  # no @router.get("/analytics/summary")

# Signal: Service method exists but never called from handlers
class ConfigRevisionService:
    async def record_revision(self, ...):  # no caller in api/ layer

# Signal: Event handler registered nowhere
async def on_agent_complete(event):  # never passed to event_bus.subscribe()

# Signal: Feature flag gates it
if feature_flags.get("new_search_ui"):
    # This whole block appears dead until flag is enabled

Any of these → Unwired. Create an issue.

Step 4 — Classify and act

If Truly Dead

Must satisfy ALL of these before deleting:

  • No callers found anywhere in codebase
  • Git history shows no feature intent (e.g., "cleanup", "remove old code")
  • No open GitHub issue referencing the functionality
  • No TODO/FIXME comment nearby suggesting wiring intent
  • Removing it does not break any tests

Then document the removal:

git commit -m "chore: remove dead <name> — no callers, confirmed via grep + git log (#NNNN)"

If Unwired → Implementation Gap Issue

Unwired code is a feature that was built but never connected. This is an implementation gap — not a cleanup task, not an enhancement, not tech debt. It needs to be wired up to deliver the intended functionality.

# file it, then attach it to its umbrella as a native sub-issue (`issue` skill, Step 4)
gh issue create \
  --title "impl gap: wire up <name> — <what it does>" \
  --body "## Implementation Gap
<function/class/module> in <file:line> is fully implemented but has no callers/routes/subscribers.

## What it does
<brief description from reading the code and git history>

## What is missing to complete it
- [ ] <route registration / event subscription / frontend call / lifecycle hook / etc.>
- [ ] <any other wiring needed>

## Location
\`<file>\` line <N> — \`<function_or_class_name>\`

## Discovered During
Working on #<original-issue>

## Evidence it was intentional
<git commit message / comment / related issue that shows this was planned>" \
  --label "enhancement,backend,priority: medium"

Then report:

Created #<number>: implementation gap for <name>.
This code is complete but unwired — leaving it in place.
Should I: a) Wire it now  b) Finish current issue first  c) Leave for later

If Future Phase

Leave the code. Add a comment if context is unclear:

# TODO(#NNNN): Wire this up in phase X — see issue for details

Red Flags — STOP before deleting

  • "This function has no callers" → Check git history first
  • "This import is unused" → Check if it's a re-export
  • "This class is never instantiated" → Check for dynamic instantiation or factory patterns
  • "This file is never imported" → Check for dynamic loading or string-based references
  • "autoflake/linter flagged it" → Linters don't understand intent. Investigate manually.

Common Patterns in AutoBot

# Pattern: Service implemented, not yet registered in app lifecycle
class ProcessAdapterService:  # exists but start()/stop() not called in lifespan

# Pattern: API endpoint implemented, not registered on router
async def get_config_revision(...):  # missing @router.get(...)

# Pattern: Agent tool defined, not added to tools list
async def search_knowledge(...):  # defined but not in agent.tools = [...]

# Pattern: WebSocket event emitted but no subscriber
await publish_live_event("agent.complete", ...)  # no subscriber registered

All of these look dead. None of them should be deleted — they need issues to wire them up.

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.