skills/absolute-prune/SKILL.md
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".
npx skillsauth add absolutelyskilled/absolutelyskilled absolute-pruneInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Start your first response with the ✂️ emoji.
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.
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.
Dead dependencies — declared but never imported (and missing deps that are imported but undeclared):
| Ecosystem | Tool |
|---|---|
| JS/TS | depcheck or knip (knip also covers exports/files) |
| Python | deptry |
| Go | go mod tidy (diff), unused module detection |
Dead code — unreferenced exports, unreachable branches, orphaned files:
| Ecosystem | Tool |
|---|---|
| JS/TS | knip (exports/files), ts-prune, eslint no-unused-vars |
| Python | vulture, ruff unused rules |
| Go | deadcode ./..., 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.
| Wave | Removal | Default | |---|---|---| | 1 | unused devDeps, unreferenced local exports/functions | fix now — lowest risk | | 2 | unused runtime deps, orphaned internal files | fix this pass after confirming no dynamic ref | | 3 | anything reachable via public API, plugin system, dynamic require, reflection, or config | gated / 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.
preferences.health.protectedPaths from config as never-delete globs — anything
matching is out of scope even if a tool flags it.exports map.prune removes dead things; it does not restructure live code.
Restructuring → simplify or work./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.development
Use when the user wants to simplify, clean up, refactor, tidy, or refine code — their staged/unstaged git changes or a target file/path. Reduces complexity, flattens nesting, removes redundancy and dead code, scores each change by value (holding low-value churn), then runs tests to prove nothing broke. Invoke on: "simplify", "simplify this", "simplify my code/changes", "clean up", "clean this up", "clean up my changes", "refactor this", "make this cleaner", "tidy this up", "reduce complexity", "flatten this", "remove dead code", "make it more readable", "polish before commit", or "absolute simplify". Acts on your working diff; for repo-wide dead code use absolute-prune; for lint/type debt use absolute-debt.
testing
Dependency upgrades: outdated/vulnerable deps planned into semver waves (patch/minor batched, majors gated and changelog-read), applied incrementally with lockfiles regenerated and tests green after each. Runs on green main. Triggers on "absolute upgrade", "upgrade our dependencies", "bump deps", "update packages", "move off the deprecated X", "clear the Dependabot backlog".
development
Lightweight standalone design spec for AI coding agents: codebase scan → bounded clarify pass (3–5 questions, not a grill) → reviewed design doc written to docs/plans/ → independent scored review → stop. No task board, no build. Use when you want a spec to discuss, hand off, or review before committing to implementation. Chains into absolute-work when ready to build. Triggers on "absolute spec", "write a spec", "spec out this feature", "draft a design doc", "I want a spec to hand off / review, don't build it yet".
documentation
One-time setup for absolute: interview how you want it to behave (output style, autonomy, TDD strictness, spec dir, families) + detect the stack once, then write `.absolute.config.json` (project, committed) and `~/.absolute/config.json` (user defaults + per-project overrides). Every other absolute-* command reads it instead of re-detecting; non-blocking — commands proceed without it and soft-recommend it. Triggers on "absolute init", "set up absolute", "initialize absolute", "configure absolute", "first-time setup", "remember my conventions for this repo".