Legacy Monolith Refactoring Review Plan
Systematic review plan to de-risk and modernize mission-critical monolithic codebases safely.
Use this template when planning a structural code review for tightly coupled legacy systems before a migration or major refactoring sprint. It establishes clear architectural guardrails and risk mitigation steps for development teams.
Role: Staff Software Architect with 15+ years of experience in enterprise modernization and domain-driven design.
Context
- Target application: {{monolith_name}}
- Primary language and framework: {{tech_stack}}
- Identified architectural debt: {{technical_debt_focus}}
- Target domain boundary: {{target_service_domain}}
- Maximum tolerated downtime: {{availability_sla}}
Task
Generate a prioritized architectural code review and refactoring plan that identifies coupling hotspots, isolates domain models, and delivers a phased remediation roadmap for {{monolith_name}}.
Method
- Analyze the core modules within {{monolith_name}} handling {{target_service_domain}} for tight coupling and hidden side effects.
- Inspect database access patterns and state mutation chains tied to {{tech_stack}} conventions.
- Audit shared utilities and cross-cutting concerns currently exacerbating {{technical_debt_focus}}.
- Map data access dependencies that violate single-responsibility boundaries.
- Define seam extraction points using strangler fig pattern principles.
- Formulate unit and regression test harnesses required to guard against regressions.
- Structure a sequenced execution backlog constrained by {{availability_sla}}.
Constraints
- MUST prioritize non-breaking, incremental refactoring steps over complete rewrites.
- MUST NOT recommend architectural changes that violate {{availability_sla}}.
- Highlight critical risks associated with shared state mutations in bold.
- Keep recommendations tailored strictly to {{tech_stack}} ecosystems.
Output format
Provide the review plan using the following markdown structure:
- Executive Summary (max 150 words)
- Critical Seam Analysis (3-5 bulleted architectural hotspots)
- Phased Refactoring Roadmap (Phase 1: Quarantine, Phase 2: Seam Extraction, Phase 3: Cutover)
- Verification & Safety Checklist (5 precise validation checks)
Self-review
- Ensure all extraction steps account for {{technical_debt_focus}}.
- Verify that zero steps require uncoordinated database downtime.
- Check that every refactoring phase has an associated rollback trigger.
Explicit role, a named task, and discrete steps the model can follow.
Background, inputs and variables the model needs before it starts.
Hard boundaries — what the model must and must not do.
A named, field-level shape for the response.
Ordered work items that force analysis before an answer.
Length and structure that travel across frontier models.
Signal density — instruction weight without padding.
Documented variables so the scaffold adapts to new inputs.
Quality bar, assumptions and behaviour when inputs are thin.
How much real usage the template has behind it.