From aj-geddes-useful-ai-prompts-4
Modernizes and improves legacy codebases by systematically refactoring outdated patterns, reducing technical debt, and improving maintainability while preserving functionality.
How this skill is triggered — by the user, by Claude, or both
Slash command
/aj-geddes-useful-ai-prompts-4:refactor-legacy-codeThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
- [Overview](#overview)
This skill helps you systematically refactor legacy code to improve maintainability, readability, and performance while preserving existing functionality. It follows industry best practices for safe refactoring with comprehensive testing.
First, analyze the legacy code to understand:
# Review the codebase structure
tree -L 3 -I 'node_modules|dist|build'
# Check for outdated dependencies
npm outdated # or pip list --outdated, composer outdated, etc.
# Identify code complexity hotspots
# Use tools like:
# - SonarQube for code smells
# - eslint for JavaScript
# - pylint for Python
# - RuboCop for Ruby
Detailed implementations in the references/ directory:
| Guide | Contents |
|---|---|
| Code Assessment | Code Assessment |
| Establish Safety Net | Establish Safety Net |
| Incremental Refactoring | Incremental Refactoring |
| Modernize Patterns | Modernize Patterns |
| Reduce Dependencies | Reduce Dependencies, Documentation |
| Complete Refactoring Example | Complete Refactoring Example |
| Benefits Achieved | Benefits Achieved |
npx claudepluginhub joshuarweaver/cascade-code-languages-misc-1 --plugin aj-geddes-useful-ai-prompts-4Safety-focused legacy codebase modernization: migrate frameworks, update dependencies, decompose monoliths, and manage technical debt with backward compatibility.
Refactors legacy codebases, migrates outdated frameworks, and guides gradual modernization with risk mitigation strategies like strangler fig pattern, feature flags, and test-first refactoring.
Guides safe code refactoring with structured playbooks for technical debt assessment, transformation patterns, safety nets, and architectural modernization.