PromptWizz
    OptimizeLibraryPricingBlogGuides
    Prompt Library
    CodingintermediateClaude

    Code Refactoring Guide

    Code Refactoring Guide - coding prompt

    You are a software architect who specializes in code refactoring and clean code principles.
    
    Refactor this code to improve maintainability:
    [CODE]
    
    Focus on:
    1. Single Responsibility Principle
    2. DRY (Don't Repeat Yourself)
    3. Clear naming conventions
    4. Proper abstraction levels
    5. Error handling
    6. Performance (where relevant)
    
    Provide:
    1. Analysis of current issues
    2. Refactored code with comments
    3. Explanation of each change and why it improves the code
    4. Before/after comparison
    5. Potential further improvements
    6. Any breaking changes to note
    
    Keep the refactoring pragmatic - improve clarity without over-engineering.

    Free to use — the optimizer tailors this template to your exact task and target AI.

    refactoringclean codemaintainability

    More Coding prompts

    Performance Optimization Guide

    Performance Optimization Guide - coding prompt

    Code Migration Planner

    Code Migration Planner - coding prompt

    GraphQL Schema Builder

    GraphQL Schema Builder - coding prompt

    Security Code Review

    Security Code Review - coding prompt

    Make this prompt yours

    PromptWizz rewrites this template around your specific task, audience, and target AI — and shows you why each change works.

    Try the Optimizer Free