Godly Prompts
Home
AI ModelsLeaderboard🛒 Marketplace
HomeCodingCode Refactoring Expert
Back to Coding Prompts
48

Code Refactoring Expert

promptmaster@promptmaster263 views1mo agoVerified
Claude Sonnet 4.5CodingRefactoringCode Review

Transform messy code into clean, maintainable code with design patterns and SOLID principles.

Prompt
You are a software architect with expertise in clean code principles and design patterns. Refactor the following code to improve its quality:

```
{paste your code here}
```

**Language**: {programming language}
**Main Issues**: {what you want to improve}
**Constraints**: {any limitations to consider}

Provide:

1. **Code Smells Identified**
   - List each issue found
   - Explain why it's problematic

2. **Refactored Code**
   - Complete, working code
   - Inline comments explaining changes

3. **Design Patterns Applied**
   - Which patterns were used
   - Why they're appropriate here

4. **SOLID Principles**
   - How each principle was applied
   - Specific improvements made

5. **Testing Considerations**
   - How refactoring improves testability
   - Suggested test cases

6. **Performance Impact**
   - Any performance implications
   - Before/after complexity analysis

Follow clean code principles and modern best practices.

💡 Tips for Best Results

  • •Works best with Claude Sonnet 4.5 or similar models
  • •Replace placeholders in {curly braces} with your specific content
  • •For better results, be as specific as possible with your inputs

Comments (21)

About the Author

promptmaster - AI Prompt Creator

@promptmaster

890 reputation

Prompts Shared4
Total Votes262
SpecializationCoding

Member since Nov 2025

The Art of the Prompt
FREE

From the Author

The Art of the Prompt

Get on Amazon

Related Prompts

â–² 87

Ultimate Python Debugging Assistant

Claude Sonnet 4.5
â–² 52

React Component Generator with TypeScript

Claude Sonnet 4.5
â–² 37

SQL Query Optimizer and Explainer

Claude Sonnet 4.5
â–² 29

API Documentation Writer

Claude Sonnet 4.5

Explore More

More Coding prompts →All Claude Sonnet 4.5 prompts →
Godly Prompts

The largest community-driven collection of AI prompts. Find, share, and vote on prompts that actually work.

Categories

  • Coding
  • Writing
  • Business
  • Research
  • Creative
  • Productivity

AI Models

  • ChatGPT / GPT-5
  • Claude 4
  • Gemini 3
  • Grok 4
  • Llama 4

Resources

  • Submit a Prompt
  • Leaderboard
  • About the Author
  • 📚 Get the Book
  • RSS Feed

Legal

  • Privacy Policy
  • Terms of Service
  • Contact Us

© 2025 Godly Prompts. All rights reserved.

Made with passion for the AI community