From aj-geddes-useful-ai-prompts-4
Refactors legacy codebases incrementally to modernize patterns, reduce technical debt, and improve maintainability while preserving functionality. Use for outdated code or deprecated APIs.
npx claudepluginhub joshuarweaver/cascade-code-languages-misc-1 --plugin aj-geddes-useful-ai-prompts-4This skill uses the workspace's default tool permissions.
- [Overview](#overview)
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Checks Next.js compilation errors using a running Turbopack dev server after code edits. Fixes actionable issues before reporting complete. Replaces `next build`.
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 |