Fokozatos architektúramigráció
Teljes, ellenőrizhető lépésekben cserél architektúrát világos felelősséggel a régi és új megoldás együttélése alatt.
incremental-architecture-migration
Nézd meg, miben segítMikor hasznos?
Akkor használd, ha régi alrendszert kell korszerűsíteni a teljes rendszer felforgató újraírása nélkül.
Miben segít neked?
- Kijelöli egy teljes funkcionális szelet cseréjének határát.
- Meghatározza a hiteles adatgazdát az együttélés során.
- Közös szerződésellenőrzést futtat és feltételt szab az adapter eltávolításának.
Például ezt kérheted
Cseréld a régi árazási szolgáltatást a többi rendelési funkció átállítása nélkül. Egy kijelölt árazási esetet az új megoldáson vezess át, és vesd össze a régivel. Dokumentáld, az együttélés alatt melyik komponens írhat adatot.
Részletes dokumentáció
Itt a skill eredeti útmutatóját, példáit és ellenőrzési szempontjait olvashatod az eredeti nyelven.
Összecsukás
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:
- Introduce an abstraction interface in front of the legacy subsystem and route existing callers through it.
- Implement the legacy adapter behind the interface and verify zero regressions.
- Build the new implementation behind the same interface, tested against the shared contract suite.
- Switch callers or configuration from the legacy implementation to the new one incrementally.
- 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.
Csomagban lévő fájlok 1
SKILL.md
