cleanup-legacy

Solid

Find and remove deprecated, legacy, and fallback code paths with zero callers. Verifies callers via repo grep + LSP before deletion. Removes unreachable fallback branches. Use when the user asks to remove deprecated code, clean up legacy paths, drop fallbacks, or simplify code branches. Example queries — "remove the deprecated API", "drop the v1 fallback", "this code is marked legacy, kill it", "simplify these branches".

AI & Automation 78 stars 9 forks Updated today MIT

Install

View on GitHub

Quality Score: 87/100

Stars 20%
63
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

Find code marked deprecated/legacy/old/v1 and verify it's truly unused before deletion. Also find unreachable fallback branches (e.g., feature flag defaults that have flipped, version checks for unsupported runtimes). ## Preflight 1. **Language detect** — applies to all. 2. **Git state**: refuse on dirty tree. 3. **Report dir**: ensure exists. 4. **Read deprecation markers** the project uses. Common ones: - `@deprecated` JSDoc/TSDoc - `# deprecated` Python comments, `warnings.warn(DeprecationWarning)` - `// Deprecated:` Go convention - `#[deprecated]` Rust attribute - File/dir naming: `legacy/`, `old/`, `v1/`, `_old.ts` 5. **Read feature flag config** if present — flags that are 100% on with no opposite tests can have their `else` branches deleted. ## Detect ### Marker grep (multi-language) ```bash grep -rn --include="*.ts" --include="*.tsx" --include="*.js" --include="*.py" --include="*.go" --include="*.rs" \ -E "(@deprecated|# ?deprecated|// ?Deprecated|#\[deprecated|warnings\.warn.*Deprecation|TODO.*remove|FIXME.*legacy)" \ --exclude-dir=node_modules --exclude-dir=dist . > /tmp/deprecated.txt # Files/dirs with legacy naming find . -type d \( -name "legacy" -o -name "old" -o -name "v1" -o -name "_archive" \) -not -path "*/node_modules/*" > /tmp/legacy-dirs.txt find . -type f \( -name "*_old.*" -o -name "*-legacy.*" -o -name "*.deprecated.*" \) > /tmp/legacy-files.txt ``` ### Caller verification (TS/JS) For each deprecated symbol, count references us...

Details

Author
raintree-technology
Repository
raintree-technology/agent-starter
Created
7 months ago
Last Updated
today
Language
JavaScript
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category