diegopacheco/agent-skills/code-digger-agent

Claude Code and agent skill by diegopacheco/agent-skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

⛏️ Code Digger, the dead code cleaner night agent. Scans a repository for unused classes, methods, functions, variables, parameters, imports, files, exports and dependencies, writes tests that prove the code is dead, runs the suite before and after removal, and leaves the cleanup on its own branch with a report. Use when the user runs /code-digger-agent, /night-agents digger, or asks to find or remove dead code, unused code or unused imports.

Install

npx vskill@latest install diegopacheco/agent-skills/code-digger-agent

SKILL.md

The same SKILL.md was published earlier as diegopacheco/agent-skills/code-digger-agent.

⛏️ Code Digger

Find code nothing uses, prove it is dead, remove it, keep the suite green.

Follow ~/.night-agents/CONTRACT.md. Agent name: code-digger-agent.

1. Start

Start the run with night-run.sh start code-digger-agent unless the dispatcher handed you a run, install dependencies and record the baseline (contract steps 1 and 2).

2. Dig

Build the list of candidates. Use the language's own tooling first, then confirm by reading code:

StackTools
TypeScript / JavaScripttsc --noEmit --noUnusedLocals --noUnusedParameters, npx knip, npx ts-prune, eslint no-unused-vars
Java / Kotlincompiler warnings, IDE inspections via javac -Xlint, search for references across modules
Pythonvulture, ruff check --select F401,F841
Gostaticcheck (U1000), go vet, deadcode
Rustcargo build dead_code warnings, cargo udeps

Do not install tools globally. Use npx, a local venv inside $WORKTREE, or skip the tool and grep.

Look for:

  • unused imports
  • unused local variables and parameters (keep parameters that an interface or callback signature needs)
  • private and module level functions and methods with no caller
  • classes, interfaces, types and enums with no reference
  • exported symbols that no module imports and that are not part of the public API
  • files that nothing imports, requires, loads or routes to
  • dependencies in the manifest that no file imports
  • code after return, branches behind constant false conditions, feature flags that are always off
  • commented out code blocks

3. Prove it is dead

A candidate is dead only when every check passes. Record the evidence for each one.

  1. Grep the whole repo, including tests, scripts, configs, templates, SQL, HTML and docs, for the

name, its string form, and its file path.

  1. Rule out dynamic use: reflection, getattr, require(variable), dependency injection by name,

routes and handlers registered by string, serializers, ORM entities, CLI entry points, package.json main/bin/exports, public library API, plugin registries, framework conventions (controllers, migrations, fixtures).

  1. Write a proof test when the language allows it: a test that loads the module or package and

asserts the public surface the rest of the code relies on, so it fails if the removal breaks a real caller. Run it before and after the removal. Keep the proof tests that guard real behavior. Delete the ones that only existed to load the removed symbol.

  1. When the suite and the build both pass after removal, the candidate is dead.

When a candidate fails any check, keep it and record it as action: skipped with the reason. Public library APIs are never removed, only reported.

4. Remove

  • One commit per kind of removal or per module: <project>: code-digger-agent: remove unused imports in src/cart.
  • Remove the now orphaned imports, tests of only the removed code, and fixtures it alone used.
  • Never reformat surrounding code.

5. Verify, document, finish

Contract steps 4 to 7. The report lists every removed symbol with file, line, kind and the proof, and every skipped candidate with the reason.

Metrics

removedImports, removedVariables, removedFunctions, removedClasses, removedFiles, removedDependencies, skippedCandidates. Finding kinds: unused-import, unused-variable, unused-parameter, unused-function, unused-method, unused-class, unused-file, unused-export, unused-dependency, unreachable-code, commented-code.

Security

  • Security scanPassed, 98 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/diegopacheco/agent-skills/code-digger-agent/badge)](https://verified-skill.com/skills/diegopacheco/agent-skills/code-digger-agent)

Something wrong with this skill or its page? Tell us.