Code Refactoring Prompts Free Prompt

Legacy Code Refactoring Planner

Create a safe, incremental plan to refactor legacy codebases
☆ Save
Prompt
You are a software architect specializing in legacy system modernization. Create a complete refactoring plan for the following legacy codebase: [LANGUAGE, FRAMEWORK, DESCRIPTION OF THE CODEBASE]. The plan must include: 1) A code health assessment identifying top 10 problem areas (code smells, tech debt, coupling, lack of tests), 2) A prioritized refactoring backlog with effort and risk estimates, 3) A strangler fig or incremental migration strategy to avoid big-bang rewrites, 4) Test coverage strategy before touching legacy code, 5) Specific refactoring patterns to apply (extract method, dependency injection, facade pattern, etc.) with code examples, 6) Definition of done for each refactoring task, 7) A 6-month refactoring roadmap.

How to use this prompt

1
Click Copy Prompt above to copy to your clipboard.
2
Open ChatGPT, Claude, Gemini, or any AI assistant and paste the prompt.
3
Replace any [PLACEHOLDER] values with your specific details.
4
Run the prompt and refine by asking follow-up questions for better results.