Your ChatGPT, Midjourney, Gemini, Grok Prompt
ChatGPT, Claude, Gemini Prompt for Code Refactoring Strategist

ChatGPT, Claude, Gemini Prompt for Code Refactoring Strategist

Transform legacy or messy code into clean, maintainable implementations

Transform legacy or messy code into clean, maintainable implementations

AI Prompt:

I need a comprehensive refactoring strategy for the following code that's suffering from [DESCRIBE ISSUES: e.g., "tight coupling," "poor error handling," "excessive complexity," etc.]: ```[PASTE YOUR CODE]``` Please provide a systematic refactoring approach through these structured steps: 1) Code Quality Assessment: - Architecture and design pattern evaluation - Identification of specific code smells with examples - Cohesion and coupling analysis - Maintainability metrics and concerns - Technical debt inventory 2) Refactoring Priorities: - Critical issues ranked by impact - Quick wins vs. structural improvements - Risk assessment for each change - Dependencies between refactoring tasks - Testing implications 3) Refactoring Plan: - Step-by-step refactoring sequence - Specific refactoring patterns to apply at each step - Incremental approach that preserves functionality - Decision points and alternative approaches - Risk mitigation strategies 4) Refactored Implementation: - Complete refactored code with improvements applied - Clear documentation of changes made - Design pattern implementations - Error handling improvements - Performance considerations 5) Validation Strategy: - Test coverage recommendations - Regression testing approach - Key scenarios to validate - Performance testing considerations - Code review focus areas Include before/after comparisons highlighting key improvements, with specific attention to maintainability, readability, and adherence to software engineering principles.

I need a comprehensive refactoring strategy for the following code that's suffering from [DESCRIBE ISSUES: e.g., "tight coupling," "poor error handling," "excessive complexity," etc.]: ```[PASTE YOUR CODE]``` Please provide a systematic refactoring approach through these structured steps: 1) Code Quality Assessment: - Architecture and design pattern evaluation - Identification of specific code smells with examples - Cohesion and coupling analysis - Maintainability metrics and concerns - Technical debt inventory 2) Refactoring Priorities: - Critical issues ranked by impact - Quick wins vs. structural improvements - Risk assessment for each change - Dependencies between refactoring tasks - Testing implications 3) Refactoring Plan: - Step-by-step refactoring sequence - Specific refactoring patterns to apply at each step - Incremental approach that preserves functionality - Decision points and alternative approaches - Risk mitigation strategies 4) Refactored Implementation: - Complete refactored code with improvements applied - Clear documentation of changes made - Design pattern implementations - Error handling improvements - Performance considerations 5) Validation Strategy: - Test coverage recommendations - Regression testing approach - Key scenarios to validate - Performance testing considerations - Code review focus areas Include before/after comparisons highlighting key improvements, with specific attention to maintainability, readability, and adherence to software engineering principles.

Best for

Best for

Code modernization, technical debt reduction, maintenance improvement, codebase quality

Code modernization, technical debt reduction, maintenance improvement, codebase quality

Works with

Works with

ChatGPT, Claude, Gemini, Bard, other AI Assistants

ChatGPT, Claude, Gemini, Bard, other AI Assistants

Level

Level

Advanced

Advanced

Icon

Works with all AI Chat Assistant tools
ChatGPT, Claude, Grok, Gemini, and other AI assistant

Icon
Icon
Icon

Free to share prompt
Help others with copy this prompt link