← Back to Electron and React foundation team

Skill · Version 1.0.0

Incremental architecture migration

Replaces architecture in complete, verifiable increments with clear ownership while old and new implementations coexist.

incremental-architecture-migration

Team members using this skill

See how it helps

When is it useful?

Use it when a legacy subsystem needs modernization without a disruptive whole-system rewrite.

What does it help you do?

  • Identifies a boundary for replacing one complete vertical slice.
  • Defines authoritative data ownership during coexistence.
  • Runs shared contract checks and sets adapter-removal conditions.

Try asking this

Replace the legacy pricing service without migrating unrelated order features. Route one agreed pricing case through the replacement and compare outputs with the legacy path. Document which component owns writes during coexistence.

Detailed documentation

Read the skill’s original instructions, examples and checks in their authored language.

Details…Show less

Incremental Architecture Migration

Large structural changes — replacing a legacy persistence layer, extracting a bounded context, migrating a state-management pattern or replacing a core subsystem — fail when attempted as a single long-lived "big-bang" branch. Migrate incrementally on the main line so the system stays shippable after every step.

1. Core Migration Patterns

Choose the migration topology that matches where the seam sits:

  • Branch by Abstraction:
    1. Introduce an abstraction interface in front of the legacy subsystem and route existing callers through it.
    2. Implement the legacy adapter behind the interface and verify zero regressions.
    3. Build the new implementation behind the same interface, tested against the shared contract suite.
    4. Switch callers or configuration from the legacy implementation to the new one incrementally.
    5. Remove the legacy implementation and, if no longer needed, simplify the abstraction.
  • Strangler Fig (Edge / Routing Seam):
    • Intercept requests, commands, routes or events at the perimeter.
    • Route one vertical slice (a single endpoint, command type or feature flow) to the modernized module while all remaining slices continue through the legacy path.
    • Expand migrated slices until the legacy path has zero traffic and can be retired.
  • Anti-Corruption Layer (ACL):
    • Prevent legacy data shapes, naming quirks and mutability assumptions from leaking into the modernized module.
    • Translate between legacy models and clean domain models inside a dedicated boundary adapter so the new code stays clean from day one.

2. Coexistence & Data Synchronization

During an incremental transition, old and new modules often coexist in production:

  • Single source of truth: designate clearly whether the old store or the new store is authoritative at each stage.
  • Dual-read / Shadow verification: where high confidence is required, run the new read/calculation path alongside the legacy path, return the legacy result to callers, and compare discrepancies in structured logs or tests before flipping authority.
  • Safe cutover: make the switch between legacy and new paths controllable at a single enabling point (configuration, dependency injection binding or feature flag) so rollback is immediate if an unexpected production edge case surfaces.

3. Preventing Half-Migrated Limbo

The biggest risk of incremental migration is stopping halfway and leaving two competing architectures permanently in the codebase:

  • Define explicit stage gates: for every migration phase, state what is introduced, which callers move, what temporary adapter exists, and the exact condition that triggers adapter removal.
  • Run contract tests against both implementations: write a shared behavioral test suite against the abstraction interface so both the legacy adapter and the modernized implementation are verified against identical expectations.
  • Finish a vertical slice end-to-end: migrate one complete capability (and delete its legacy branch) before opening migrations across five unrelated areas simultaneously.
  • Coordinate structural boundaries: align any cross-module architectural shift with the architect and relevant technology specialists before widening the migration scope.

Included files 1

  • SKILL.md