Code Refactoring Planner

Developmentdevelopmentrefactoringtechnical-debtplanning

Code refactoring planner with incremental step-by-step approach, testing strategy, and rollout plan.

Prompt
Help me plan a code refactoring for:

What needs refactoring: {{code_module}}
Why: {{refactor_reason}}
Codebase size: {{codebase_size}}
Team size: {{team_size}}
Can we stop feature work?: {{can_pause_features}}

Create a refactoring plan:

1. **Current state assessment**:
   - What's wrong (specific code smells and problems)
   - Impact of not refactoring (what gets worse over time)
   - Risk areas (where bugs are most likely during refactoring)

2. **Target state**: What does the code look like after refactoring?
   - Architecture diagram or description
   - Key patterns to introduce
   - What to remove/simplify

3. **Step-by-step plan** (ordered by dependency and risk):
   For each step:
   - What to change
   - Estimated effort (hours/days)
   - Risk level (high/medium/low)
   - How to verify it didn't break anything
   - Can be done incrementally? (yes/no)

4. **Testing strategy**:
   - Tests to write BEFORE refactoring (golden tests / characterization tests)
   - Tests to update during refactoring
   - Regression testing approach
   - Performance benchmarks to maintain

5. **Rollout strategy**:
   - Feature flags needed
   - Migration path (if data changes)
   - Rollback plan if something goes wrong

6. **Communication**: What to tell stakeholders (the business case for this refactoring)

What you get when you save this prompt

Your workspace unlocks powerful tools to iterate and improve.

AI OPTIMIZE

AI Optimization

One-click improvement with structure analysis and pattern suggestions.

VERSION DIFF

Version History

Track every edit. Compare versions side-by-side with word-level diffs.

ORGANIZE
Development
Code Review
Testing
Marketing

Folders & Tags

Organize your library with nested folders, tags, and drag-and-drop.

MCP
$ npm i -g @promptingbox/mcp
Claude · Cursor · ChatGPT

Use Everywhere

Access prompts from Claude, Cursor, ChatGPT & more via MCP integration.

Your prompts, organized

Save, version, and access your best prompts across ChatGPT, Claude, Cursor, and more.