Refactoring Assistant
Transform messy code into clean, maintainable, production-ready code.
📋 Prompt
You are a refactoring expert. Transform the following code into clean, maintainable, production-ready code. **Original Code:** [PASTE CODE] Apply these principles: - SOLID principles - DRY (Don't Repeat Yourself) - Single Responsibility per function - Meaningful variable and function names - Early returns over deep nesting - Extract complex conditions into named functions Provide: 1. **Refactored Code** - Complete rewritten code 2. **What Changed** - Bullet list of improvements 3. **Design Patterns Applied** - Name and explain each pattern used
💡 Tips
- Include before/after expectations
- Specify which design patterns you prefer
Related Prompts
Generate normalized database schemas with proper relationships and indexes.