codebase-prune-review
Skill1 starsChanged 5 months agoMITView on GitHub
Review an existing codebase for redundant, legacy, dead, superseded, or attack-surface-increasing code paths and guide progressive removal with behavior mapping, test coverage, security review, and validation. Use when asked to remove old providers or integrations, clean redundant code paths, reduce tech debt, reduce attack surface, review dead code, retire obsolete routes, remove stale compatibility layers, or clean up after migrations such as Google Drive uploads to Vercel Blob.
In this repository15 other files it gives its agents.
- clarify-before-buildSkill
- client-requirements-to-planSkill
- docker-disk-cleanupSkill
- error-logging-instrumentationSkill
- feature-design-preflightSkill
- frontend-design-qualitySkill
- full-app-reviewSkill
- laptop-currency-maintenanceSkill
- nextjs-vercel-analyticsSkill
- pr-production-gateSkill
- repo-technical-documentationSkill
- repo-testing-setupSkill
- security-threat-modelSkill
- test-readiness-preflightSkill
- user-action-coverage-reviewSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 5 are distinctive, and 10 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Use this skill to safely remove obsolete code from an existing repo without losing live functionality.
- Distinctive: line 16
Start from current repo truth and live entrypoints.
- Very specific: line 19
Do not remove unknown paths until usage is disproven by references, tests, runtime config, logs, or explicit user confirmation.
- Distinctive: line 20
Add or update tests before removing a path when current behavior is not already covered.
- Distinctive: line 21
Remove one coherent layer at a time and run targeted tests after each layer.
- Distinctive: line 22
Keep rollback simple. Do not mix unrelated cleanup, formatting, dependency churn, or feature work into a prune layer.
- Very specific: line 23
Use $security-threat-model when removals touch auth, uploads, parsers, webhooks, admin paths, secrets, provider clients, storage, payments, …
- Very specific: line 24
Use $test-readiness-preflight before expensive validation and after each removal layer to clear predictable blockers.
- Very specific: line 25
Use $feature-design-preflight when the prune follows a provider/platform replacement or migration whose new path still needs requirement …
- Very specific: line 29
Baseline the repo: Read instructions, package scripts, deployment config, routes, jobs, API handlers, provider integrations, env examples, …
- Very specific: line 33
Remove progressively: Follow references/removal-layers.md.
- Very specific: line 34
Validate and report: Run the final local/container gate, dependency audit, containerized repo-scoped gitleaks, and security review when …
- Very specific: line 53
Read references/discovery-checklist.md before proposing removal candidates.
- Very specific: line 54
Read references/removal-layers.md before editing or deleting code.
- Very specific: line 55
Read references/evidence-report.md for the behavior map, removal plan, and completion report format.
≈ “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.
Files
Codebase Prune Review
Purpose
Use this skill to safely remove obsolete code from an existing repo without losing live functionality. It audits current behavior, classifies removal candidates, proves test coverage, removes in small layers, and validates after each layer.
This is not a generic refactor pass. The goal is to reduce tech debt and attack surface by retiring code paths that are proven superseded, dead, or no longer part of the live product.
Operating Rules
- Start from current repo truth and live entrypoints. Prefer code, runtime config, package scripts, deployment config, tests, and workflows over historical docs.
- Build a behavior and ownership map before deleting anything.
- Classify each candidate as
active,compatibility,superseded,dead, orunknown. - Do not remove
unknownpaths until usage is disproven by references, tests, runtime config, logs, or explicit user confirmation. - Add or update tests before removing a path when current behavior is not already covered.
- Remove one coherent layer at a time and run targeted tests after each layer.
- Keep rollback simple. Do not mix unrelated cleanup, formatting, dependency churn, or feature work into a prune layer.
- Use
$security-threat-modelwhen removals touch auth, uploads, parsers, webhooks, admin paths, secrets, provider clients, storage, payments, or deployment surfaces. - Use
$test-readiness-preflightbefore expensive validation and after each removal layer to clear predictable blockers. - Use
$feature-design-preflightwhen the prune follows a provider/platform replacement or migration whose new path still needs requirement tracing.
Workflow
- Baseline the repo. Read instructions, package scripts, deployment config, routes, jobs, API handlers, provider integrations, env examples, and tests. Use
references/discovery-checklist.md. - Map live behavior. List the functionality that must remain unchanged, the entrypoints that serve it, the providers it depends on, and the tests that prove it.
- Classify candidates. Mark each old path as
active,compatibility,superseded,dead, orunknown. Record evidence for every classification. - Build the proof plan first. Map each behavior to unit, integration, browser/E2E, visual, migration, security, and local/container validation as applicable. Add missing tests before deletion.
- Remove progressively. Follow
references/removal-layers.md; remove one coherent layer, then run targeted tests. Update docs, env examples, fixtures, workflows, and dependency manifests as obsolete paths disappear. - Validate and report. Run the final local/container gate, dependency audit, containerized repo-scoped gitleaks, and security review when push/readiness is in scope. Use
references/evidence-report.mdfor the completion report.
Classification Rules
active: Used by current production behavior, runtime config, route handling, jobs, tests, or documented release flow. Do not remove.compatibility: Preserved intentionally for migrations, old clients, rollback, data backfills, redirects, or external integrations. Keep unless a retirement plan exists.superseded: Replaced by a newer live path and no longer needed after compatibility obligations are satisfied. Remove in a planned layer.dead: No reachable runtime use, tests, config, imports, scripts, or deployment references. Remove once the evidence is recorded.unknown: Usage cannot be proven or disproven. Keep by default and ask for confirmation only after reasonable repo evidence is exhausted.
Example Requests
- "Use
$codebase-prune-reviewto remove old Google Drive upload paths now that this repo uses Vercel Blob." - "Review this repo for superseded provider code and reduce attack surface."
- "Find legacy compatibility routes and produce a progressive removal plan with tests."
- "Clean redundant upload, webhook, and storage code after the migration."
References
- Read
references/discovery-checklist.mdbefore proposing removal candidates. - Read
references/removal-layers.mdbefore editing or deleting code. - Read
references/evidence-report.mdfor the behavior map, removal plan, and completion report format.
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
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.

