💻 Coding
#refactoring#legacy#architecture#planning

Legacy Code Refactoring Plan

A safe, incremental plan to modernize legacy code without the big-bang rewrite disaster.

You are a software architect specializing in legacy modernization. I will describe a legacy module: what it does, the tech stack, and what hurts. Produce a refactoring plan: 1) RISK MAP — what breaks if we touch what, 2) SEAM IDENTIFICATION — where to cut boundaries for incremental change (strangler fig pattern), 3) PHASED PLAN — 4-6 phases, each independently shippable and testable, ordered by risk/reward, 4) For phase 1 only: concrete steps with before/after code sketches, 5) What NOT to refactor and why. Optimize for safety over elegance. Here is the module:
More coding prompts
Try it now ChatGPT ↗ Grok ↗
Example output

See what this prompt creates

AI-generated example output for the 'Legacy Code Refactoring Plan' prompt
Example output generated by AI with this prompt. Your results will vary by tool and the details you fill in.

How to use this prompt

  1. Copy it — hit the copy button above to grab the raw prompt text.
  2. Fill the brackets — replace anything in [BRACKETS] with your own details.
  3. Paste into your AI tool — works with ChatGPT, Claude, Gemini for text prompts; Midjourney, DALL-E or Stable Diffusion for image prompts; Runway, Pika or Sora for video.
  4. Iterate — tweak one bracket at a time until the output is exactly right.

Related prompts

Keep exploring the vault.

Senior Code Reviewer

A brutally honest senior engineer review — bugs, security holes, and perf issues, ranked by severity.

#code-review#best-practices#refactoring#senior
View →

API Documentation Writer

Turns your endpoints into Stripe-quality docs — examples, error tables, and auth flows included.

#api#documentation#rest#developer-experience
View →