prune-codebase
Skill0 starsChanged 3 months agoMITView on GitHub
Prove and safely retire dead or obsolete repository surface, including unused code, exports, routes, and assets or obsolete flags, experiments, compatibility, and migration paths. Use for clear requests to find or remove dead code, retire obsolete behavior, or prune a codebase. Excludes broad code audits, local C# or Python simplification, dependency removal, bug diagnosis, architecture redesign, feature work, and cleanup justified only by style.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- agustinusnathaniel/skillstheir own version, first seen Oct 20, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- agustinusnathaniel/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository20 other files it gives its agents.
- AGENTS.mdAGENTS.md
- audit-data-exposureSkill
- audit-dependenciesSkill
- audit-testsSkill
- build-verification-harnessSkill
- chatgpt-researchSkill
- comment-healthSkill
- deep-code-auditSkill
- deep-planningSkill
- diagnose-bugsSkill
- docs-auditSkill
- maui-blazor-browserSkill
- reduce-code-slopSkill
- retrospectiveSkill
- steering-reviewSkill
- task-handoffSkill
- ui-design-and-polishSkill
- verification-contextSkill
- verify-changeSkill
- write-clearlySkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
16 rules. About 0 are common, 15 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈15
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 13
Read applicable repository instructions and record the initial Git state.
- Distinctive: line 14
Treat a review, inventory, or "find dead code" request as read-only.
- Distinctive: line 18
Do not install analyzers, packages, runtimes, workloads, or tools.
- Very specific: line 19
Do not remove dependencies or edit manifests or lockfiles under this skill.
- Distinctive: line 21
Keep private source and diagnostics local by default.
- Distinctive: line 34
Do not turn ordinary indirection, boilerplate, repeated syntax, or an unfamiliar abstraction into a pruning candidate merely because it …
- Distinctive: line 38
Read references/liveness-entrypoints-and-tooling.md before classifying code, files, exports, routes, handlers, assets, or generated surface.
- Distinctive: line 39
Read references/operational-retirement.md for flags, experiments, shims, compatibility paths, API versions, migrations, rollout code, or …
- Distinctive: line 40
Read references/knowledge-drift-and-policy.md when apparently duplicated constants, rules, mappings, schemas, or policy knowledge are in …
- Distinctive: line 41
Read references/approval-verification-and-reporting.md before presenting a broad candidate set or applying any approved removal.
- Distinctive: line 79
After approval or a precise removal request:
- Distinctive: line 82
Run the smallest trustworthy existing baseline checks when feasible.
- Distinctive: line 83
Remove one reachability chain or retirement concept per coherent batch, including only tests, documentation, registrations, configuration, …
- Distinctive: line 84
Never weaken or delete a test merely to make the removal pass.
- Distinctive: line 86
Run the same checks and relevant neighboring checks, inspect packaging or build outputs where applicable, review the final diff, and …
- Distinctive: line 88
Stop and return to the user if re-verification changes an approved candidate, deletion would cross into an unapproved dependency, external …
≈ “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
Evidence-Driven Codebase Pruning
Reduce maintenance surface only after proving what is live, what is obsolete, and which consumers or lifecycle obligations still matter. An analyzer result is a candidate, not permission to delete.
Preserve scope and authority
- Read applicable repository instructions and record the initial Git state. Preserve unrelated staged, unstaged, and untracked work.
- Treat a review, inventory, or "find dead code" request as read-only.
- For a broad cleanup request, report stable candidate IDs and wait for the user to approve specific IDs or batches before editing.
- A precise removal or edit request that names symbols, files, paths, flags, or retirement work authorizes only those targets. A review remains read-only even when it names exact targets. Re-verify every authorized target immediately before changing it.
- Previously approved candidate IDs remain usable only against the same repository state and evidence boundary. Reclassify a candidate when relevant code, configuration, consumers, or lifecycle state changed.
- Do not install analyzers, packages, runtimes, workloads, or tools. Use repository-native tools only when they are already configured and can run without deployments or external mutations.
- Do not remove dependencies or edit manifests or lockfiles under this skill. Route dependency removal through
$audit-dependencieswhen available. - Do not query or mutate external feature-flag systems or other remote control planes automatically. Read-only access requires explicit authorization for the exact service, destination, and data; mutation remains a separate authorized operation. Do not mutate production data, databases, deployments, remote APIs, or compatibility commitments. Executing a migration or operational retirement requires separate explicit authorization.
- Keep private source and diagnostics local by default. Redact secrets, customer data, internal endpoints, and sensitive runtime evidence from reports.
Keep the capability boundary clear
This skill owns evidence and retirement for repository surface whose absence is intended: unused symbols or files, unreachable handlers, obsolete routes, retired flags or experiments, expired shims, unsupported compatibility paths, completed migration paths, and equivalent maintenance surface.
- Route a comprehensive repository audit to
$deep-code-audit. - Route behavior-preserving simplification of surviving C# or Python code to
$reduce-code-slop. - Route dependency or package removal to
$audit-dependencies. - Route uncertain architecture or compatibility-retirement design to
$deep-planning. - Route a concrete failing behavior to
$diagnose-bugs. - Route personal-data or disposable data-conversion review to
$audit-data-exposure.
Do not turn ordinary indirection, boilerplate, repeated syntax, or an unfamiliar abstraction into a pruning candidate merely because it looks removable. Do not infer authorship or use "slop" as a finding.
Load only the relevant guidance
- Read references/liveness-entrypoints-and-tooling.md before classifying code, files, exports, routes, handlers, assets, or generated surface.
- Read references/operational-retirement.md for flags, experiments, shims, compatibility paths, API versions, migrations, rollout code, or stateful retirement.
- Read references/knowledge-drift-and-policy.md when apparently duplicated constants, rules, mappings, schemas, or policy knowledge are in scope.
- Read references/approval-verification-and-reporting.md before presenting a broad candidate set or applying any approved removal.
Establish the evidence boundary
- Identify the requested scope, revision or comparison base, supported products, entrypoints, workspaces, public surfaces, environments, and build or deployment variants.
- Inspect manifests, project files, build scripts, CI matrices, packaging and deployment configuration, tests, runtime registration, generated-code inputs, and useful history.
- Map consumers beyond direct static references: reflection, serialization, dependency injection, plugins, dynamic imports, route or command discovery, convention-loaded files, templates, native bindings, side-effect initialization, and externally consumed APIs.
- Identify lifecycle evidence for flags, experiments, shims, compatibility paths, migrations, and old versions. Code can be statically reachable yet obsolete, or statically unreachable yet contractually required.
- Record coverage gaps such as unavailable build variants, missing generated inputs, shallow history, inaccessible downstream repositories, absent telemetry, offline services, or uninitialized submodules.
Observed execution proves a path is live for the observed scenario. Lack of observed execution does not prove it is dead. Search results prove only what the searched representation and revision contain.
Build and verify candidates
Assign stable IDs such as PC-001 and retain them through review and authorized follow-up. For each candidate, record:
- repository location and owning subsystem;
- surface type and proposed coherent removal batch;
- static and dynamic liveness evidence;
- lifecycle or obsolescence evidence when applicable;
- entrypoints, variants, public or external consumers, and generated behavior checked;
- missing consumers or configurations;
- concrete maintenance consequence;
- risk, confidence, verification plan, and residual uncertainty.
Classify each candidate as one of:
ready: evidence supports removal within the established boundary, no material consumer or lifecycle obligation remains, and a proportionate verification path exists.needs-decision: removal depends on product, compatibility, retention, rollout, ownership, or operational policy that repository evidence cannot decide.keep: evidence shows the surface is live, contractually required, intentionally reserved, generated, or justified.research-gated: a material coverage gap prevents a trustworthy liveness or lifecycle conclusion.
Do not promote a candidate solely because a tool reports it, a text search finds no references, tests do not cover it, telemetry does not observe it, a flag has one apparent branch, or code is old. When evidence conflicts, narrow the claim or use needs-decision or research-gated.
Duplicated knowledge is in scope only when repository evidence shows that the copies express one authoritative rule that must evolve together. Coincidental equal values, protocol-required constants, independent bounded contexts, test expectations, and intentionally duplicated deployment artifacts are not automatically pruning candidates.
Apply only an authorized coherent batch
After approval or a precise removal request:
- Recheck the revision, Git state, candidate evidence, consumers, lifecycle state, and relevant configuration.
- Run the smallest trustworthy existing baseline checks when feasible. Separate pre-existing failures from task-created regressions.
- Remove one reachability chain or retirement concept per coherent batch, including only tests, documentation, registrations, configuration, and assets whose sole contract is the approved retired behavior.
- Never weaken or delete a test merely to make the removal pass. A failing test may be evidence that the behavior is still required or that the approved batch is incomplete.
- Recompute affected reachability and candidate classifications after each batch. A deletion can expose new dead surface or reveal a previously hidden consumer.
- Run the same checks and relevant neighboring checks, inspect packaging or build outputs where applicable, review the final diff, and compare the final Git state with the initial state.
Stop and return to the user if re-verification changes an approved candidate, deletion would cross into an unapproved dependency, external system, data migration, or compatibility commitment, or the remaining verification cannot distinguish safe retirement from breakage.
Return one outcome
NO_CHANGE: an authorized prune request completed without removal because no approved target survived re-verification or the target was live or required.REVIEWED: a read-only review completed with classified candidates or a verified no-candidate result.PRUNED: an approved coherent batch was removed and relevant checks passed.BLOCKED: essential scope, consumer, lifecycle, permission, or safe verification evidence was unavailable.
Lead with the outcome. Include scope and revision, classified candidate IDs or applied batches, decisive evidence, coverage gaps, checks, observed mutations, final repository state, unrun checks, and residual uncertainty. Describe the concrete maintenance or failure consequence; never claim that a repository is free of dead code or that removal is safe beyond the evidence boundary.
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.

