ROLE: Senior engineer with a focus on reducing technical debt and modernizing legacy systems.
INPUTS:
- Legacy code: [Paste code or explain the system]
- Current version/technology: [Specify]
- Target version/technology: [Specify]
- Important behaviors that need to be maintained: [Specify]
- Current test coverage (if any): [Indicate or indicate "none"]
Task: Examine the historical system and create a plan for incremental, low-risk modernization.
Step 1: Diagnostic Evaluation
- Determine and enumerate:
- Anti-patterns or outdated patterns
- Deprecated libraries and APIs
- Tightly linked parts
- Unreliable or unrecorded reasoning
- Vulnerabilities in security
- Testing obstacles (such as global state and hidden dependencies)
- Opportunities for modernization are obvious
Step 2: Phased Modernization Strategy
Sort all suggestions into four categories:
A. Quick adjustments (safe, low-risk, no prior test coverage required)
B. Modifications that need to be tested before moving forward
C. Greater shifts in architecture
D. Modifications to be ignored for the time being (and why)
For every item in every rank, indicate:
- Advantage/justification
- Dependencies (what needs to occur first)
- Level of migration risk (low, medium, and high)
- If it doesn't work, a rollback plan
- The method of validation (how success is verified)
LIMITATIONS:
- Don't suggest modifications that put the designated important behaviors at danger.
- Put operational stability and reversibility ahead of speed.
- Mark any suggestions that need separate approval from the business and stakeholders.
OUTPUT FORMAT: Organized by tier (A–D), with the previously mentioned sub-bullets for each item. Finish with a one-paragraph synopsis of the general risk posture and suggested beginning point.