Micro-Frontend Migration Strategy for Legacy Single-Page Applications
Create a phased micro-frontend decomposition roadmap for monolithic web clients using Module Federation.
Use this template when re-architecting a monolithic frontend codebase into independent domain-driven applications. It provides a structured decomposition sequence with shared state contracts, routing safeguards, and team-aligned delivery milestones.
Role: Principal Frontend Architect specializing in distributed web client architectures.
Context
- Legacy web application: {{legacy_app_name}}
- Target framework stack: {{target_framework}}
- Orchestration and federation tooling: {{module_federation_tool}}
- Team distribution model: {{team_topologies}}
- Shared runtime state strategy: {{shared_state_strategy}}
- Target execution window: {{migration_timeframe}}
Task
Develop a comprehensive micro-frontend migration plan for {{legacy_app_name}} to transition domain modules into independently deployable units using {{target_framework}} and {{module_federation_tool}} without interrupting ongoing product delivery.
Method
- Map monolithic route boundaries in {{legacy_app_name}} against domain ownership structures defined in {{team_topologies}}.
- Establish the host shell container using {{module_federation_tool}} with fallback rendering shells and asset preloading rules.
- Define cross-boundary communication contracts aligning with {{shared_state_strategy}} to prevent direct coupling.
- Design the shared design system and vendor dependency resolution matrix to prevent duplicate bundle payload overhead.
- Sequence the vertical slice migration order based on dependency isolation and business criticality within {{migration_timeframe}}.
- Construct a routing and telemetry bridge to handle side-by-side execution between legacy modules and new remote containers.
- Specify canary deployment and automated rollback gates at the individual federated remote level.
Constraints
- MUST establish zero-downtime routing coexistence between the legacy monolith and isolated remotes.
- MUST NOT allow bidirectional state coupling between federated micro-apps.
- All telemetry bridges must measure Core Web Vitals impacts during transition phases.
- State contracts must enforce explicit semantic versioning between host and remotes.
Output format
Structure the deliverable into four sequential sections:
- Architecture Blueprint (host-remote taxonomy and shared dependency tree)
- Phased Migration Sequencing (milestones across {{migration_timeframe}})
- State and Routing Integration Protocol (technical implementation rules)
- Risk Matrix and Rollback Playbook (3-5 failure modes with remediation triggers) Keep total length between 750 and 1200 words.
Self-review
- Verify that all remote modules map cleanly to {{team_topologies}}.
- Confirm that {{shared_state_strategy}} prevents global window namespace pollution.
- Ensure migration milestones fit within {{migration_timeframe}} without requiring big-bang releases.
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.