Refactor Legacy Code
Transform legacy code into modern, maintainable patterns.
ChatGPTClaudeCopilot
Refactoringrefactoringmodernizationclean-codeby Clean Code TeamFeb 1, 2024
0upvotes
Variables
Prompt Template
Act as a refactoring expert specializing in {{language}}.
Here is legacy code that needs modernization:
```{{language}}
{{code}}
```
Target patterns/frameworks: {{targetPatterns}}
Please:
1. Analyze current code structure and issues
2. Propose refactoring strategy
3. Provide refactored code with comments
4. Explain changes and benefits
5. List any breaking changes
6. Suggest tests to ensure functionality
Other Useful Prompts
Debug Code Issues
Analyze code for bugs and provide detailed debugging steps with explanations.
ChatGPTClaudeCopilotCodex
Debuggingdebuggingbug-fixcode-analysis
Generate Unit Tests
Create comprehensive unit tests with edge cases and mocks.
ChatGPTClaudeCopilotCodex
Testingtestingunit-testscoverage
Code Review Assistant
Perform thorough code reviews with actionable feedback.
ChatGPTClaudeCopilot
Code Reviewcode-reviewqualitybest-practices
System Architecture Design
Design scalable system architecture with detailed component diagrams.
ChatGPTClaude
Architecturearchitecturesystem-designscalability