(WIP -experiment) feat: add flutter-convert-to-flutter skill for native Android and iOS migrations - #237
(WIP -experiment) feat: add flutter-convert-to-flutter skill for native Android and iOS migrations#237jwren wants to merge 1 commit into
Conversation
… migrations
Add a unified Agent Skill `flutter-convert-to-flutter` to guide migrating native
mobile applications from Android (Java, Kotlin) and iOS (Objective-C, Swift) to
Dart and Flutter.
- Structure skill using progressive disclosure:
- Root `SKILL.md` contains core Flutter paradigms, declarative UI mental model,
Dart 3 type system, universal subsystem mapping, and interop decision trees.
- `reference/android.md`: Android Java migration guide (Activities, XML, Room,
Retrofit, Threads/RxJava, Pigeon/JNI).
- `reference/kotlin.md`: Android Kotlin migration guide (Compose, Coroutines,
Flow, data/sealed classes, Drift, Dio).
- `reference/swift.md`: iOS Swift & SwiftUI migration guide (SwiftUI, async/await,
Combine, structs, Codable, Pigeon).
- `reference/objective-c.md`: iOS Objective-C & UIKit migration guide (UIKit,
Foundation types, GCD, ffigen FFI interop).
There was a problem hiding this comment.
Code Review
This pull request introduces a comprehensive new skill, flutter-convert-to-flutter, which provides detailed documentation and guides for migrating native Android (Java/Kotlin) and iOS (Objective-C/Swift) applications to Flutter. The feedback highlights a few copy-paste errors in the Swift migration guide where 'Jetpack Compose' was incorrectly referenced instead of 'SwiftUI', and suggests replacing LaTeX math arrows with standard Unicode arrows in the main skill file to avoid potential Markdown rendering issues.
| | `.map { ... }` | `stream.map((event) => ...)` | | ||
| | `.filter { ... }` | `stream.where((event) => ...)` | | ||
| | `.debounce(for: .seconds(0.5))` | `stream.debounceTime(Duration(milliseconds: 500))` (`rxdart`) | | ||
| | `.sink { value in ... }` | `stream.listen((value) { ... })` | |
There was a problem hiding this comment.
In the Swift & SwiftUI migration guide, the table header incorrectly references 'Jetpack Compose' instead of 'SwiftUI'. This appears to be a copy-paste error from the Android/Kotlin guide.
| | `.sink { value in ... }` | `stream.listen((value) { ... })` | | |
| | SwiftUI | Flutter Equivalent | Notes | |
| | `Spacer()` | `Spacer()` | Expands to fill flex space | | ||
| | `Divider()` | `Divider()` | Rule separator | | ||
| | `Text("...")` | `Text('...')` | Text rendering | | ||
| | `Button("Title") { ... }` | `CupertinoButton(...)` or `ElevatedButton(...)` | Action button | |
There was a problem hiding this comment.
In the Swift & SwiftUI migration guide, the component equivalents table header incorrectly references 'Jetpack Compose' instead of 'SwiftUI'. This appears to be a copy-paste error from the Android/Kotlin guide.
| | `Button("Title") { ... }` | `CupertinoButton(...)` or `ElevatedButton(...)` | Action button | | |
| | SwiftUI | Flutter (Material 3) Equivalent | |
| | **Android (Java)** | [reference/android.md](reference/android.md) | Activities/Fragments $\rightarrow$ Widgets, XML layouts $\rightarrow$ `Column`/`Row`/`Stack`, `RecyclerView` $\rightarrow$ `ListView.builder`, `AsyncTask`/`Handler` $\rightarrow$ `Future`/`Stream`, Room $\rightarrow$ Drift/Sqflite, Retrofit $\rightarrow$ Dio/Http, Pigeon/JNI. | | ||
| | **Android (Kotlin)** | [reference/kotlin.md](reference/kotlin.md) | `data class` $\rightarrow$ immutable models, `sealed class`/`interface` $\rightarrow$ Dart 3 sealed classes, Coroutines/`Flow` $\rightarrow$ `async`/`await`/`Stream`, Jetpack Compose $\rightarrow$ Widgets, Compose Modifiers $\rightarrow$ composition, Hilt/Koin $\rightarrow$ Riverpod/GetIt. | | ||
| | **iOS (Swift / SwiftUI)** | [reference/swift.md](reference/swift.md) | Swift `struct` $\rightarrow$ Dart models, `Codable` $\rightarrow$ `json_serializable`, Swift Concurrency (`Task`/`actor`) $\rightarrow$ `Future`/`Isolate.run()`, Combine $\rightarrow$ `Stream`, SwiftUI `View` $\rightarrow$ `StatelessWidget`, `@State`/`@Binding`/`@Observable` $\rightarrow$ `StatefulWidget`/`ChangeNotifier`. | | ||
| | **iOS (Objective-C)** | [reference/objective-c.md](reference/objective-c.md) | `@interface`/`@implementation` $\rightarrow$ Dart classes, Foundation types $\rightarrow$ Dart core types, GCD / Blocks $\rightarrow$ `Future`/Closures, `UIViewController` $\rightarrow$ `StatefulWidget`, `UITableView` $\rightarrow$ `ListView.builder`, direct C/ObjC FFI via `ffigen`. | |
There was a problem hiding this comment.
Using LaTeX math notation $\rightarrow$ in Markdown tables can lead to rendering issues depending on the Markdown parser used. It is cleaner and more universally supported to use the standard Unicode arrow →.
| | **Android (Java)** | [reference/android.md](reference/android.md) | Activities/Fragments $\rightarrow$ Widgets, XML layouts $\rightarrow$ `Column`/`Row`/`Stack`, `RecyclerView` $\rightarrow$ `ListView.builder`, `AsyncTask`/`Handler` $\rightarrow$ `Future`/`Stream`, Room $\rightarrow$ Drift/Sqflite, Retrofit $\rightarrow$ Dio/Http, Pigeon/JNI. | | |
| | **Android (Kotlin)** | [reference/kotlin.md](reference/kotlin.md) | `data class` $\rightarrow$ immutable models, `sealed class`/`interface` $\rightarrow$ Dart 3 sealed classes, Coroutines/`Flow` $\rightarrow$ `async`/`await`/`Stream`, Jetpack Compose $\rightarrow$ Widgets, Compose Modifiers $\rightarrow$ composition, Hilt/Koin $\rightarrow$ Riverpod/GetIt. | | |
| | **iOS (Swift / SwiftUI)** | [reference/swift.md](reference/swift.md) | Swift `struct` $\rightarrow$ Dart models, `Codable` $\rightarrow$ `json_serializable`, Swift Concurrency (`Task`/`actor`) $\rightarrow$ `Future`/`Isolate.run()`, Combine $\rightarrow$ `Stream`, SwiftUI `View` $\rightarrow$ `StatelessWidget`, `@State`/`@Binding`/`@Observable` $\rightarrow$ `StatefulWidget`/`ChangeNotifier`. | | |
| | **iOS (Objective-C)** | [reference/objective-c.md](reference/objective-c.md) | `@interface`/`@implementation` $\rightarrow$ Dart classes, Foundation types $\rightarrow$ Dart core types, GCD / Blocks $\rightarrow$ `Future`/Closures, `UIViewController` $\rightarrow$ `StatefulWidget`, `UITableView` $\rightarrow$ `ListView.builder`, direct C/ObjC FFI via `ffigen`. | | |
| | **Android (Java)** | [reference/android.md](reference/android.md) | Activities/Fragments → Widgets, XML layouts → Column/Row/Stack, RecyclerView → ListView.builder, AsyncTask/Handler → Future/Stream, Room → Drift/Sqflite, Retrofit → Dio/Http, Pigeon/JNI. | | |
| | **Android (Kotlin)** | [reference/kotlin.md](reference/kotlin.md) | data class → immutable models, sealed class/interface → Dart 3 sealed classes, Coroutines/Flow → async/await/Stream, Jetpack Compose → Widgets, Compose Modifiers → composition, Hilt/Koin → Riverpod/GetIt. | | |
| | **iOS (Swift / SwiftUI)** | [reference/swift.md](reference/swift.md) | Swift struct → Dart models, Codable → json_serializable, Swift Concurrency (Task/actor) → Future/Isolate.run(), Combine → Stream, SwiftUI View → StatelessWidget, @State/@Binding/@Observable → StatefulWidget/ChangeNotifier. | | |
| | **iOS (Objective-C)** | [reference/objective-c.md](reference/objective-c.md) | @interface/@implementation → Dart classes, Foundation types → Dart core types, GCD / Blocks → Future/Closures, UIViewController → StatefulWidget, UITableView → ListView.builder, direct C/ObjC FFI via ffigen. | |
Add a unified Agent Skill
flutter-convert-to-flutterto guide migrating native mobile applications from Android (Java, Kotlin) and iOS (Objective-C, Swift) to Dart and Flutter.SKILL.mdcontains core Flutter paradigms, declarative UI mental model, Dart 3 type system, universal subsystem mapping, and interop decision trees.reference/android.md: Android Java migration guide (Activities, XML, Room, Retrofit, Threads/RxJava, Pigeon/JNI).reference/kotlin.md: Android Kotlin migration guide (Compose, Coroutines, Flow, data/sealed classes, Drift, Dio).reference/swift.md: iOS Swift & SwiftUI migration guide (SwiftUI, async/await, Combine, structs, Codable, Pigeon).reference/objective-c.md: iOS Objective-C & UIKit migration guide (UIKit, Foundation types, GCD, ffigen FFI interop).