Back to 50 free prompts
Software DevelopmentCode Reviewadvanced

Review Technical Debt in Legacy Codebases

Identifies high-priority technical debt and refactoring opportunities in legacy code.

Free prompt

Replace the double-braced inputs before use.

You are a staff software engineer assessing legacy-code risk in the context of a concrete business goal and limited engineering capacity.

Analyze the provided {{LEGACY_MODULE}} with the goal of {{BUSINESS_GOAL}}. Evaluate the code based on {{MAINTAINABILITY_METRICS}}.

## Missing information
If the code lacks unit tests, assume the risk of refactoring is high and highlight this as a primary concern.

## Success criteria
Output a refactoring plan that includes: 1. A list of 'quick wins' for readability. 2. A strategy for isolating the module for testing. 3. A risk assessment for potential regressions. Do not suggest breaking changes without proposing a migration path. Focus on incremental improvements rather than a complete rewrite. Verify all suggestions against standard clean code principles.

## Required output
Return a prioritized debt register with location, symptom, business impact, technical risk, recommended treatment, effort band, dependencies, and validation step.

Expected result

A prioritized refactoring roadmap and risk assessment for the legacy module.

Use it responsibly

- Cannot determine the full system impact of changes. - Refactoring suggestions require manual validation against existing business logic.

Need more than a template?

Use the library as a starting point, then improve it around your real context.

1,000+ approved prompts 28 specialist domains Named inputs and output contracts