cleanup-legacy

Detect and remove deprecated code paths with no callers via grep and LSP.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/raintree-technology/agent-starter --skill cleanup-legacy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cleanup-legacy
Source: https://github.com/raintree-technology/agent-starter/tree/main/templates/.claude/skills/cleanup-legacy
Command: npx skills add https://github.com/raintree-technology/agent-starter --skill cleanup-legacy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill helps developers find and remove deprecated, legacy, and fallback code paths with zero callers, simplifying and cleaning up the codebase.

Core Features & Use Cases

  • Code Path Identification: Detects deprecated symbols, legacy directories, and unreachable fallback branches.
  • Caller Verification: Confirms code is truly unused before deletion, with fallback to grep if necessary.
  • Automatic Deletion: Safely removes high-confidence code paths with no callers.
  • Reporting: Generates detailed reports for further analysis and migration planning.

Quick Start

Run the cleanup-legacy skill to remove deprecated code from the 'src/' directory.

Frequently Asked Questions about cleanup-legacy

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate the removal of deprecated and legacy code paths?

Automate deprecated code removal by using a skill that detects legacy paths, verifies zero callers via grep and LSP, and safely deletes them. It targets deprecated symbols, legacy directories, and unreachable fallback branches.

What is the safest way to verify deprecated code has no callers before deletion?

The safest way to verify deprecated code has no callers is by using Language Server Protocol (LSP) tools to trace symbol usage. If LSP support is unavailable, the verification falls back to grep searches to confirm zero callers.

How do I clean up unreachable fallback branches in my source code?

Clean up unreachable fallback branches by running an automated detection process that identifies these paths and validates their usage. High-confidence code paths with absolutely no callers are then safely removed from the source repository.

Does legacy code removal require LSP support to function?

Legacy code removal does not strictly require LSP support, but it is highly recommended for accurate caller verification. The process can fall back to using grep if LSP tools are not available in the repository environment.

What is the best way to plan migrations for deprecated symbols?

The best way to plan migrations for deprecated symbols is to generate detailed reports after detecting and verifying unused code paths. These reports provide analysis insights needed for safe refactoring and migration planning.