Legacy sweep
Audits a whole repository or subsystem for unused legacy code and bloated or worthless tests, proves each candidate is obsolete before deleting it, fixes real defects instead of removing the failing test, and keeps the coverage that still protects behaviour.
When to use it
- A codebase has accumulated dead paths, unused exports and stale tests.
- A test suite is slow or noisy and you want to prune it without losing the checks that matter.
- A cleanup should fix the failures it uncovers instead of deleting them.
- You want a cleanup that reports what it could not prove.
It is not a lint pass and not a licence to delete code. Every removal needs a filled evidence row, a failing test is treated as a defect before it is treated as bloat, and it never authors unit tests.
A practical example
You ask
“Sweep the repo: remove the dead code and the bloated tests, but fix real bugs instead of hiding them.”
Your agent does
It records a baseline, splits production ownership into read-only and write lanes, removes only candidates with completed proof, fixes the failures that are real defects, and reports what it removed, the contracts it preserved and every blocked candidate.
What gets installed
The whole folder is copied, so scripts, references and any license notices stay together.
- references/campaign-execution.md5,231 bytes
- references/evidence-standard.md6,698 bytes
- references/report-template.md2,631 bytes
- SKILL.md11,354 bytes
Credit and license
The test evidence gate was written independently, inspired by the test-audit concepts in the openclaw project; no source text was copied. Production-code, failure-triage and campaign material is original.