Engineering Legacy Code Code Review

Legacy Code Review Prompt

Mentoring-style maintainability review: what makes the next change expensive, explained with corrected examples — teach, don't just judge.

Overview

Legacy code review has a different goal: not gatekeeping a merge, but building a map for gradual cleanup — and teaching the developer doing it. This setup runs the maintainability focus (duplication that drifts, intent-hiding names, cohesion, coupling, dead code, test coverage of what changes) under Mentoring style: every finding explains WHY it matters, CRITICAL and MAJOR findings come with short corrected examples, and the review ends with the three most important things to learn — not a verdict to fear.

Workflow

  1. Review before you change anything

    The maintainability map tells you where changes will be expensive — before you're mid-change and finding out.

  2. Use the corrected examples as patterns

    Mentoring style shows the fix shape for major findings — apply the pattern, not just the instance.

  3. Hand the top-three learnings to the team

    The closing learnings generalize beyond this module — that's the compounding value.

Why This Works

  • Maintainability focus prices the NEXT change — the metric legacy code actually fails on
  • Mentoring style converts findings into transferable knowledge
  • A map-not-gate framing makes the review usable on code that would fail any gate

Best for

  • Modules everyone fears and nobody owns
  • Onboarding developers into old codebases
  • Cleanup work that needs a defensible priority order

Not for

  • Actually performing the refactor — that's the Refactor Prompt Builder, with behavior-preserving constraints
  • Blocking a release — mentoring style deliberately doesn't gate

Use cases

  • Mapping a legacy module before touching it
  • Teaching newer developers what good looks like, in context
  • Prioritizing cleanup by what makes changes expensive

Tip: Save time by exploring related resources and tools that integrate with this workflow.

Explore all resources