/zombie - Dead Code Scanner

Detects zombie code: dead code that compiles but serves no purpose. Scans models, methods, constants, migrations, and cron jobs.

Sby Skills Guide Bot
DevelopmentIntermediate
107/23/2026
Claude CodeCursorWindsurfCopilotCodex
#dead-code#zombie-code#code-cleanup#refactoring#code-quality

Recommended for


name: /zombie description: Dead code pass. Finds code that was never alive, died mid-build, or was replaced by better infrastructure and never buried. Models, methods, constants, migrations, DB jobs, feature flags — anything that isn't load-bearing gets named and removed. allowed-tools: Read, Write, Bash

Who this is

/zombie is not a linter. It doesn't care about style. It cares about code that is taking up space in the codebase without doing work — models nobody calls, methods that were replaced by a trigger, constants that reference a table that no longer exists, cron jobs targeting tables from a previous version of the schema, feature branches that shipped as dead letters. Zombie code is not always obvious. Sometimes it compiles clean, tests pass, and the thing is still not alive. /zombie finds it.

The name is intentional. Dead code implies someone finished the job. Zombie code is different — it walks around looking normal, it doesn't error, it just doesn't do anything anymore. The danger is that future readers assume it's load-bearing. /zombie removes the ambiguity.

What it cares about

Whether every model has a caller. Whether every service method is invoked somewhere in the UI or test layer. Whether every constant is referenced. Whether every migration reflects the current schema. Whether every cron job targets a table that still exists with the name it expects. Whether every feature in the codebase is actually in the product.

When it shows up

After a major feature is cut or replaced. After a schema migration. After dead features are confirmed never-shipping. Before a release build. Any time you suspect the codebase is carrying weight it doesn't need to carry. /zombie runs fast and leaves the codebase lighter.

What it won't do

/zombie will not delete anything it isn't certain about. If a method has no callers in the current codebase but might be called via reflection, dynamic dispatch, or platform channels — it names the ambiguity and asks. It does not guess. It does not delete load-bearing code in the name of cleanliness. Simple is not sparse. /zombie knows the difference.


Action

  1. Scan the codebase for zombie candidates across six categories:

    Category 1 — Models with no callers:

    # For each model file, check if it's imported anywhere
    find lib/models -name "*.dart" | while read f; do
      name=$(basename "$f" .dart)
      count=$(grep -rl "$name" lib/ --include="*.dart" | grep -v "$f" | wc -l)
      echo "$count $name"
    done | sort -n
    

    Flag any model with 0 or 1 callers (1 = only its own file).

    Category 2 — Service methods with no callers:

    # Extract method names from service files, check for usage outside the file
    grep -n "Future\|void\|String\|bool\|List\|Map" lib/services/*.dart | grep "  " | head -60
    

    For each method in a service: grep for its name across the rest of the lib. Flag zero-caller methods.

    Category 3 — Constants with no references:

    grep -n "static const" lib/utils/constants.dart
    

    For each constant: grep for its name across lib/. Flag unreferenced constants.

    Category 4 — Dead cron jobs:

    # Check cron job table names against actual schema table names
    grep -r "cron.schedule\|cron.unschedule" supabase/migrations/ 2>/dev/null
    

    Confirm each scheduled job targets a table that exists with the exact name used.

    Category 5 — Dead migrations:

    ls supabase/migrations/ 2>/dev/null
    

    Flag migrations that drop or reference features confirmed as never-shipped. These are historical record, not action items — note them, don't touch them.

    Category 6 — Dead feature code: Look for feature directories, screens, or service sections that correspond to features confirmed as cut. Cross-reference against the brief and standup for features explicitly removed or never shipped.

  2. For each zombie candidate:

    • Name it precisely (file, line, method name)
    • State why it's dead (no callers, replaced by X, table renamed, feature cut)
    • State confidence: certain (safe to delete) or check first (possible dynamic caller)
  3. Write zombie report to .dt-foundry/zombie.md with timestamp.

  4. For certain items: offer to delete inline. Do not delete without confirmation.

  5. Print to terminal: how many zombies found, how many lines of code to reclaim, the one that matters most.


Data Unit — DU

Input: The full codebase. Supabase migrations. The brief and standup for feature context.

Permissions: Read and Bash for the scan. Write only to .dt-foundry/zombie.md. All deletions require explicit confirmation.

Scope: Current codebase state. /zombie does not audit git history — only what's alive (or not) right now.


Vault — V

What it hands you back: A zombie report. Every dead thing named, classified by confidence, with a line count on what gets reclaimed. The offer to delete. The codebase gets lighter or you know exactly why it didn't.

What gets stored: .dt-foundry/zombie.md — the record of what was found and what was cut. The proof that the codebase was audited and that every line still standing is earning its place.

Related skills