Back to Software Engineering

Refactoring Advisor

Get a structured refactoring plan for messy code with priority, risk, and step-by-step approach.

Updated Feb 20, 2026

ShareLinkedIn

Variables to Customize

0/5 filled

Prompt

You are a software architect specializing in refactoring legacy code. Analyze this code and create a refactoring plan.

Code:
```{{language}}
{{code}}
```

Provide:
1) **Code Smell Inventory** — list every issue, categorized:
   - 🔴 Critical (bugs waiting to happen)
   - 🟡 Major (maintainability problems)
   - 🔵 Minor (style/readability)
2) **Refactoring Priority** — what to fix first and why
3) **Step-by-Step Plan** — ordered refactoring steps:
   - Each step should leave the code in a WORKING state
   - Include what test to write BEFORE refactoring each piece
4) **Design Pattern Suggestions** — which patterns would improve this code?
5) **Before/After** — show the critical section refactored
6) **Risk Assessment** — what could break during refactoring?
7) **Time Estimate** — rough estimate per step

Context: {{what_this_code_does}}
Test coverage: {{none/some/good}}
Can we break backward compatibility: {{yes/no}}

Powered by Hugging Face Inference API

Pro Tips

  • The 'write test first, leave code working after each step' approach is the safe way to refactor.

Prompt Output

See what this prompt produces — real output screenshots from community members, coming soon.

References

More Software Engineering Prompts

💻Software Engineering

Senior Developer Code Review

Get a thorough code review from an experienced senior developer perspective, covering correctness, performance, security, and maintainability.

You are a senior software engineer with 15+ years of experience conducting a tho...

Claude Opus 4
IntermediateView prompt
💻Software Engineering

System Architecture Designer

Design scalable system architectures with detailed component diagrams, trade-off analysis, and implementation roadmaps.

You are a principal systems architect. Design a comprehensive system architectur...

Claude Opus 4
AdvancedView prompt
💻Software Engineering

Debug Detective

Systematically debug complex issues by analyzing error messages, stack traces, and code behavior with a structured approach.

You are an expert debugging specialist. Help me systematically debug this issue....

Claude Sonnet 4
IntermediateView prompt

You Might Also Like

✍️Writing & Content

Blog Post Architect

Create SEO-optimized, engaging blog posts with structured outlines, compelling hooks, and strategic keyword placement.

You are an expert content strategist and SEO specialist. Create a comprehensive ...

Claude Opus 4
IntermediateView prompt
📚Education

Socratic Method Tutor

Learn any concept through guided questioning that builds deep understanding instead of memorization.

You are a Socratic tutor. Your role is to help me deeply understand a concept th...

Claude Opus 4
BeginnerView prompt
🚀Product Management

Product Requirements Document (PRD)

Generate comprehensive PRDs with user stories, acceptance criteria, technical requirements, and success metrics.

You are a senior product manager at a top tech company. Write a comprehensive PR...

Claude Opus 4
IntermediateView prompt