kmp migrate
Modernize legacy cross-platform codebases (React Native, Flutter) into production-grade Kotlin Multiplatform applications using an automated Strangler Fig methodology.
The 3-Step Migration Lifecycle
flowchart LR
A["kmp migrate audit\n(Scan & Risk Analysis)"] --> B["kmp migrate plan\n(Phased Roadmap)"]
B --> C["kmp migrate execute\n(Automated Synthesis)"]
1. kmp migrate audit
Scans a legacy project directory, identifies framework versions, architecture bottlenecks (e.g. legacy JS bridge vs TurboModules, Flutter Platform Channels), and computes a multiplatform compatibility score:
Output highlights:
- Detected framework: REACT_NATIVE or FLUTTER.
- Architecture type: OLD_BRIDGE, NEW_ARCHITECTURE_TURBOMODULES, FLUTTER_PLATFORM_CHANNELS.
- Detected platform targets: android, ios, web, windows, macos.
- Dependency replacement matrix (e.g., axios -> Ktor, AsyncStorage -> Multiplatform-Settings).
- Recommended modernization pathway: COMPOSE_MULTIPLATFORM, NATIVE_UI_SHARED_CORE, or DUAL_NATIVE.
2. kmp migrate plan
Generates an incremental Strangler Fig modernization roadmap dividing the migration into risk-controlled phases:
Roadmap Phases: - Phase 1: Living Foundation & Core Domain - Phase 2: Networking & Shared Data Sync - Phase 3: State Management & ViewModels - Phase 4: UI Modernization & Edge-to-Edge Design
3. kmp migrate execute
Synthesizes the new Kotlin Multiplatform target project:
Options
-o,--output: Output directory for the new KMP project.-p,--package: Application package / namespace ID.--strategy:autonomous(default) orguided.--pathway: Override pathway (compose-multiplatform,native-ui-shared-core,dual-native).--json: Output execution summary as JSON.
Execution Deliverables
- Foundation Scaffolding: Gradle multiplatform build scripts, active runners (
:androidApp,iosApp). - Layer 1 (Domain Models): Type-safe Kotlin data classes.
- Layer 2 (Data & Networking): Ktor 3 and Multiplatform-Settings integration.
- Layer 3 (State Management): Shared
StateFlowViewModels with Koin DI. - Layer 4 (UI & Assets): Compose Multiplatform screens with density-routed assets (
drawable/,drawable-xhdpi/). - Living Progress Tracker: Auto-generates
MIGRATION_PROGRESS.mdin the destination project.