Refactoring Assistant

📁 Development 🤖 Claude / GPT-4 📊 Intermediate 📅 Apr 5, 2026

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

development database schema All Models

Generate normalized database schemas with proper relationships and indexes.

View
development api-design rest Claude / GPT-4

Design RESTful APIs with proper endpoints, versioning, and documentation.

View
development debugging error-fixing All Models

Diagnose and fix errors with root cause analysis and step-by-step solutions.

View
development code-review best-practices All Models

Get thorough, professional code reviews with actionable improvements.

View