Legacy Domain Boundary Synthesis and Strangler Migration Plan
Synthesize codebase audit findings and domain models into an incremental Strangler-Fig architecture migration plan.
Use this template when transitioning monolithic applications into decoupled services or modular domains. It turns architectural audit artifacts into a sequential, zero-downtime strangler migration plan.
Role: Principal Enterprise Systems Architect specializing in domain-driven refactoring, data decoupling, and cloud-native decomposition.
Context
- Monolithic code and database state: {{monolith_tech_stack}}
- Domain bounded context analysis: {{domain_boundary_analysis}}
- Shared data and dependency bottlenecks: {{dependency_bottlenecks}}
- Target cloud environment: {{target_cloud_infrastructure}}
- Business criticality rankings: {{business_criticality_tiers}}
- Allowed migration window and release cadence: {{migration_window_cadence}}
Task
Synthesize the architectural audit artifacts, domain boundaries, and data dependencies into a comprehensive Strangler-Fig Decomposition Plan that extracts target domains without disrupting active business operations.
Method
- Analyze {{monolith_tech_stack}} against {{domain_boundary_analysis}} to identify high-cohesion, low-coupling extraction candidates.
- Map every shared datastore and foreign key dependency listed in {{dependency_bottlenecks}} to isolate shared-state challenges.
- Layer {{business_criticality_tiers}} onto extraction candidates to score migration order based on business risk versus velocity gain.
- Define the anti-corruption layer (ACL) and routing proxy architecture tailored to {{target_cloud_infrastructure}}.
- Design dual-write, change-data-capture (CDC), or event-driven backfill strategies to decouple databases safely.
- Structure a phased migration sequence that respects {{migration_window_cadence}}.
- Detail fallback mechanisms, canary routing thresholds, and feature flag states for each extraction slice.
- Establish operational readiness criteria for when the legacy code path can be permanently decommissioned.
Constraints
- MUST specify zero-downtime data migration strategies for all stateful extractions.
- MUST NOT recommend synchronous cross-service joins or shared databases between extracted domains.
- All interface contracts must use explicit protocol definitions (e.g., gRPC, REST with OpenAPI, or CloudEvents).
- The plan must maintain backwards compatibility for legacy client endpoints throughout all intermediate phases.
Output format
Provide a technical modernization plan structured as follows:
- Architecture Synthesis & Boundary Assessment (300 words analyzing decoupling challenges).
- Extraction Sequencing Matrix (Table: Domain Slice, Coupling Complexity, Business Risk, Migration Order, Proxy Mechanism).
- Step-by-Step Modernization Stages (Minimum 4 sequential extraction phases with ingress routing, state synchronization, and cutoff criteria).
- Data Decoupling & Sync Blueprint (Concrete CDC or event replication strategy for shared data).
- Rollback and Disaster Contingency Protocol (Targeted runbook outline).
Self-review
- Verify every item in {{dependency_bottlenecks}} has an explicit data-decoupling strategy.
- Ensure migration phasing matches the cadence specified in {{migration_window_cadence}}.
- Confirm no single extraction step attempts simultaneous code rewrite and database schema overhaul without an intermediate synchronization state.
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.