AB

absolute-prune

Cleans up unused code and dependencies across your entire repository with tool-validated safety checks.

Install

mkdir -p .claude/skills/absolute-prune && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/16942" && unzip -o skill.zip -d .claude/skills/absolute-prune && rm skill.zip

Installs to .claude/skills/absolute-prune

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Dead code and dependency cleanup, repo-wide: unused deps, unreferenced exports, unreachable code, orphaned files — removed only with tool evidence, in reversible waves. Runs on green main. For diff-scoped cleanup use absolute-simplify. Triggers on "absolute prune", "remove dead code", "find unused deps/exports", "what can we delete", "clean up orphaned files".
362 charsno explicit “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Advanced

Key capabilities

  • Identify unused dependencies in various ecosystems
  • Detect unreferenced exports and unreachable code
  • Find orphaned files across the repository
  • Remove identified dead code and dependencies in waves
  • Verify removals with tests, builds, and typechecks

How it works

The skill scans the entire committed repository for dead code and dependencies using specific tools for different ecosystems, then removes them in reversible waves with verification after each step.

Inputs & outputs

You give it
codebase of a repository
You get back
repository with unused dependencies, unreferenced exports, unreachable code, and orphaned files removed, with verification

When to use absolute-prune

  • Remove unused dependencies
  • Find orphaned files
  • Clean up unreferenced exports
  • Reduce bundle size

About this skill

Start your first response with the ✂️ emoji.

Absolute Prune

Cut dead growth from the repo: unused dependencies, unreferenced exports, unreachable code, orphaned files. Evidence-based — every removal is backed by a tool that proves nothing references it — applied in safe waves with tests green after each.

Runs the shared engine in references/health-engine.md — read it for the DETECT → SCAN → TRIAGE → FIX → VERIFY → REPORT loop and the safety contract. This file covers only what's specific to pruning.


When to use

  • "Remove dead code", "clean up unused deps", "what can we delete?".
  • Bundle/install bloat from packages nothing imports anymore.
  • Post-refactor orphans: files and exports left behind after a feature was rerouted.

prune vs simplify: simplify polishes your working git diff. prune sweeps the whole committed repo for things that are dead repo-wide. Use simplify mid-change; prune as standing cleanup on green main.


What it scans

Dead dependencies — declared but never imported (and missing deps that are imported but undeclared):

EcosystemTool
JS/TSdepcheck or knip (knip also covers exports/files)
Pythondeptry
Gogo mod tidy (diff), unused module detection

Dead code — unreferenced exports, unreachable branches, orphaned files:

EcosystemTool
JS/TSknip (exports/files), ts-prune, eslint no-unused-vars
Pythonvulture, ruff unused rules
Godeadcode ./..., staticcheck (U1000)

Prefer tools already in the project. Treat results as candidates — verify each isn't reached via dynamic import, reflection, DI, public API, or a config string before removing.


Risk ranking (TRIAGE)

WaveRemovalDefault
1unused devDeps, unreferenced local exports/functionsfix now — lowest risk
2unused runtime deps, orphaned internal filesfix this pass after confirming no dynamic ref
3anything reachable via public API, plugin system, dynamic require, reflection, or configgated / usually defer — high false-positive risk

Static tools miss dynamic references. Anything in wave 3, or anything a tool flags but you can't prove is dead, gets confirmed with the user or deferred — never auto-removed.


Fix & verify

  • Remove in small, reversible waves. One category per wave (e.g. "unused devDeps", then "orphaned files").
  • After each wave: full test + build + typecheck. A green typecheck/build is the proof the removed symbol truly had no references. If anything goes red, the symbol wasn't dead — revert and reclassify.
  • Removing a dep: drop it from the manifest, regenerate the lockfile, rebuild.
  • Don't delete: generated files, vendored code, public-API surface, or anything load-bearing for a config/plugin you can't trace. Report those as "suspected dead, needs human call". Treat preferences.health.protectedPaths from config as never-delete globs — anything matching is out of scope even if a tool flags it.

Gotchas

  1. Trusting the tool blindly. Dynamic imports, DI containers, reflection, and string-keyed lookups defeat static analysis. Confirm before deleting.
  2. Removing public API. A library's unused-internally export may be its whole point. Check the package entry points / exports map.
  3. Deleting generated or vendored files. They look orphaned but are rebuilt/checked-in on purpose.
  4. Big-bang prune. Deleting everything flagged in one commit makes regressions un-bisectable. Wave it.
  5. Scope creep into refactor. prune removes dead things; it does not restructure live code. Restructuring → simplify or work.

Companion commands

  • /absolute simplify — for restructuring/clarity of live code in your diff.
  • /absolute upgrade — pairs well: prune unused deps, then upgrade what remains.
  • /absolute debt — pruning often clears a batch of lint/unused-var warnings too.

When not to use it

  • When cleaning up only a working git diff (use `simplify` instead)
  • When dynamic imports, reflection, or DI are heavily used without static analysis support
  • When the goal is to restructure live code rather than remove dead code

Limitations

  • Static tools may miss dynamic references
  • Requires full test, build, and typecheck after each removal wave
  • Does not restructure live code

How it compares

This skill performs evidence-based, repo-wide dead code and dependency cleanup in safe, reversible waves, ensuring build health, unlike manual or diff-scoped cleanup.

Compared to similar skills

absolute-prune side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
absolute-prune (this skill)01moNo flagsAdvanced
software-architecture3336moNo flagsIntermediate
effective-go32310moNo flagsBeginner
solid-principles579moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

software-architecture

davila7

Guide for quality focused software architecture. This skill should be used when users want to write code, design architecture, analyze code, in any case that relates to software development.

333868

effective-go

openshift

Apply Go best practices, idioms, and conventions from golang.org/doc/effective_go. Use when writing, reviewing, or refactoring Go code to ensure idiomatic, clean, and efficient implementations.

323536

solid-principles

SmidigStorm

Enforce SOLID principles (Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, Dependency Inversion) in object-oriented design. Use when writing or reviewing classes and modules.

57236

typescript-review

metabase

Review TypeScript and JavaScript code changes for compliance with Metabase coding standards, style violations, and code quality issues. Use when reviewing pull requests or diffs containing TypeScript/JavaScript code.

39178

react-modernization

wshobson

Upgrade React applications to latest versions, migrate from class components to hooks, and adopt concurrent features. Use when modernizing React codebases, migrating to React Hooks, or upgrading to latest React versions.

21134

ast-grep

ast-grep

Guide for writing ast-grep rules to perform structural code search and analysis. Use when users need to search codebases using Abstract Syntax Tree (AST) patterns, find specific code structures, or perform complex code queries that go beyond simple text search. This skill should be used when users ask to search for code patterns, find specific language constructs, or locate code with particular structural characteristics.

17135

Search skills

Search the agent skills registry