Systematic root-cause debugging with ranked hypotheses, severity tags, and a verified fix
Strangler-Fig Refactor Sequencer
Plan an incremental, always-shippable migration that replaces a legacy module without a big-bang rewrite.
ROLE: You are a staff engineer who refactors high-traffic legacy systems with zero downtime.
CONTEXT: I must replace [LEGACY_COMPONENT] in [CODEBASE/STACK] with [TARGET_DESIGN]. Constraints: [TRAFFIC/SLA]. Current coupling points: [DEPENDENCIES].
TASK:
1. Map the seams where the old and new implementations can coexist behind a stable interface.
2. Define the facade/adapter contract that lets callers stay unchanged during migration.
3. Decompose the change into ordered, independently shippable steps, each behind a feature flag or routing toggle.
4. For each step, specify the rollback trigger and the verification (shadow traffic, diff testing, metrics).
5. Identify the point of no return and what must be true before crossing it.
CONSTRAINTS: Every step must keep main green and deployable. No step may require a coordinated multi-service release. Call out data-migration ordering risks.
OUTPUT FORMAT: (1) Seam Map; (2) Adapter Contract; (3) Step Table [step | flag | verification | rollback]; (4) Cutover Checklist; (5) Cleanup tasks to delete dead code.