@istmx/skills 1.2.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/README.md +38 -20
  2. package/bin/cli.js +50 -24
  3. package/istm-animate/SKILL.md +31 -26
  4. package/istm-animate/core/motion-principles/SKILL.md +284 -0
  5. package/istm-animate/core/motion-principles/references/designers.md +127 -0
  6. package/istm-animate/core/motion-principles/references/easing-guide.md +231 -0
  7. package/istm-animate/core/motion-principles/references/enter-exit-recipes.md +466 -0
  8. package/istm-animate/frameworks/canvas-generative/SKILL.md +325 -0
  9. package/istm-animate/frameworks/canvas-generative/references/algorithms.md +925 -0
  10. package/istm-animate/frameworks/css-native/SKILL.md +319 -0
  11. package/istm-animate/frameworks/css-native/references/modern-css.md +465 -0
  12. package/istm-animate/frameworks/framer-motion/SKILL.md +187 -0
  13. package/istm-animate/frameworks/framer-motion/references/api.md +312 -0
  14. package/istm-animate/frameworks/gsap/SKILL.md +188 -0
  15. package/istm-animate/frameworks/gsap/references/core.md +218 -0
  16. package/istm-animate/frameworks/gsap/references/plugins.md +371 -0
  17. package/istm-animate/frameworks/gsap/references/scrolltrigger.md +325 -0
  18. package/istm-animate/frameworks/gsap/references/timeline.md +218 -0
  19. package/istm-animate/frameworks/threejs-r3f/SKILL.md +243 -0
  20. package/istm-animate/frameworks/threejs-r3f/references/scene-setup.md +392 -0
  21. package/istm-animate/frameworks/threejs-r3f/references/shaders.md +446 -0
  22. package/istm-animate/mobile/android/compose-graphics/SKILL.md +503 -0
  23. package/istm-animate/mobile/android/compose-graphics/references/agsl-recipes.md +356 -0
  24. package/istm-animate/mobile/android/compose-graphics/references/canvas-generative.md +282 -0
  25. package/istm-animate/mobile/android/compose-graphics/references/m3-expressive-deep.md +303 -0
  26. package/istm-animate/mobile/android/compose-motion/SKILL.md +359 -0
  27. package/istm-animate/mobile/android/compose-motion/references/gestures-compose.md +273 -0
  28. package/istm-animate/mobile/android/compose-motion/references/recomposition-and-anim.md +196 -0
  29. package/istm-animate/mobile/android/compose-motion/references/shared-transitions.md +281 -0
  30. package/istm-animate/mobile/android/compose-multiplatform/SKILL.md +311 -0
  31. package/istm-animate/mobile/android/compose-multiplatform/references/cmp-interop.md +288 -0
  32. package/istm-animate/mobile/android/compose-multiplatform/references/cmp-platform-quirks.md +156 -0
  33. package/istm-animate/mobile/apple/swiftui-graphics/SKILL.md +408 -0
  34. package/istm-animate/mobile/apple/swiftui-graphics/references/canvas-swiftui.md +239 -0
  35. package/istm-animate/mobile/apple/swiftui-graphics/references/liquid-glass-deep.md +252 -0
  36. package/istm-animate/mobile/apple/swiftui-graphics/references/metal-recipes.md +382 -0
  37. package/istm-animate/mobile/apple/swiftui-motion/SKILL.md +379 -0
  38. package/istm-animate/mobile/apple/swiftui-motion/references/gestures-swiftui.md +336 -0
  39. package/istm-animate/mobile/apple/swiftui-motion/references/phase-keyframe-deep.md +231 -0
  40. package/istm-animate/mobile/apple/swiftui-motion/references/springs-cheatsheet.md +129 -0
  41. package/istm-animate/references/animate.md +199 -0
  42. package/istm-animate/references/audit.md +115 -0
  43. package/istm-animate/references/design-engineering.md +674 -0
  44. package/istm-animate/references/improve.md +101 -0
  45. package/istm-animate/references/opportunities.md +132 -0
  46. package/istm-animate/references/plan-template.md +73 -0
  47. package/istm-animate/references/recipes.md +324 -0
  48. package/istm-animate/references/review.md +112 -0
  49. package/istm-animate/references/standards.md +187 -0
  50. package/istm-animate/references/vocabulary.md +173 -0
  51. package/istm-awwward-designer/SKILL.md +29 -17
  52. package/istm-design/SKILL.md +31 -59
  53. package/istm-design/core/design-audit/SKILL.md +248 -0
  54. package/istm-design/core/desktop-principles/SKILL.md +363 -0
  55. package/istm-design/core/desktop-principles/references/keyboard-patterns.md +137 -0
  56. package/istm-design/core/desktop-principles/references/multi-window.md +105 -0
  57. package/istm-design/core/mobile-principles/SKILL.md +289 -0
  58. package/istm-design/core/mobile-principles/references/accessibility-mobile.md +175 -0
  59. package/istm-design/core/mobile-principles/references/gestures-deep.md +220 -0
  60. package/istm-design/core/ui-ux-pro-max/SKILL.md +392 -0
  61. package/istm-design/core/ui-ux-pro-max/UPSTREAM.md +23 -0
  62. package/istm-design/core/ui-ux-pro-max/data/app-interface.csv +31 -0
  63. package/istm-design/core/ui-ux-pro-max/data/charts.csv +26 -0
  64. package/istm-design/core/ui-ux-pro-max/data/colors.csv +193 -0
  65. package/istm-design/core/ui-ux-pro-max/data/google-fonts.csv +1924 -0
  66. package/istm-design/core/ui-ux-pro-max/data/icons.csv +106 -0
  67. package/istm-design/core/ui-ux-pro-max/data/landing.csv +35 -0
  68. package/istm-design/core/ui-ux-pro-max/data/motion.csv +17 -0
  69. package/istm-design/core/ui-ux-pro-max/data/products.csv +193 -0
  70. package/istm-design/core/ui-ux-pro-max/data/react-performance.csv +45 -0
  71. package/istm-design/core/ui-ux-pro-max/data/stacks/angular.csv +51 -0
  72. package/istm-design/core/ui-ux-pro-max/data/stacks/astro.csv +54 -0
  73. package/istm-design/core/ui-ux-pro-max/data/stacks/avalonia.csv +57 -0
  74. package/istm-design/core/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  75. package/istm-design/core/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  76. package/istm-design/core/ui-ux-pro-max/data/stacks/javafx.csv +76 -0
  77. package/istm-design/core/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
  78. package/istm-design/core/ui-ux-pro-max/data/stacks/laravel.csv +51 -0
  79. package/istm-design/core/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  80. package/istm-design/core/ui-ux-pro-max/data/stacks/nuxt-ui.csv +71 -0
  81. package/istm-design/core/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  82. package/istm-design/core/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  83. package/istm-design/core/ui-ux-pro-max/data/stacks/react.csv +54 -0
  84. package/istm-design/core/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  85. package/istm-design/core/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  86. package/istm-design/core/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  87. package/istm-design/core/ui-ux-pro-max/data/stacks/threejs.csv +54 -0
  88. package/istm-design/core/ui-ux-pro-max/data/stacks/uno.csv +60 -0
  89. package/istm-design/core/ui-ux-pro-max/data/stacks/uwp.csv +56 -0
  90. package/istm-design/core/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  91. package/istm-design/core/ui-ux-pro-max/data/stacks/winui.csv +60 -0
  92. package/istm-design/core/ui-ux-pro-max/data/stacks/wpf.csv +57 -0
  93. package/istm-design/core/ui-ux-pro-max/data/styles.csv +85 -0
  94. package/istm-design/core/ui-ux-pro-max/data/typography.csv +75 -0
  95. package/istm-design/core/ui-ux-pro-max/data/ui-reasoning.csv +162 -0
  96. package/istm-design/core/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  97. package/istm-design/core/ui-ux-pro-max/references/pro-rules.md +109 -0
  98. package/istm-design/core/ui-ux-pro-max/references/quick-reference.md +240 -0
  99. package/istm-design/core/ui-ux-pro-max/scripts/core.py +464 -0
  100. package/istm-design/core/ui-ux-pro-max/scripts/design_system.py +1371 -0
  101. package/istm-design/core/ui-ux-pro-max/scripts/search.py +162 -0
  102. package/istm-design/core/ui-ux-pro-max/scripts/tests/test_core.py +134 -0
  103. package/istm-design/core/ui-ux-pro-max/scripts/validate_data.py +114 -0
  104. package/istm-design/references/apple-design.md +282 -0
  105. package/istm-design/references/generation-guide.md +209 -0
  106. package/istm-design/references/pick-ui-library.md +77 -0
  107. package/istm-design/references/picker.md +197 -0
  108. package/istm-design/references/prototype.md +90 -0
  109. package/istm-design/references/schema.md +366 -0
  110. package/package.json +1 -1
  111. package/RELEASE_v1.2.0.md +0 -40
@@ -0,0 +1,288 @@
1
+ # CMP Interop - cross-platform native bridges
2
+
3
+ Cross-platform interop in Compose Multiplatform spans four directions: Compose hosting native (UIKit, SwiftUI, Android Views, Swing), native hosting Compose (Xcode app embedding `MainViewController`, Android `setContent`), and bidirectional state sharing through KMP types. This file collects the canonical recipes and call-out the build-side wiring that's easy to forget.
4
+
5
+ ---
6
+
7
+ ## iOS interop primitives
8
+
9
+ | API | Purpose |
10
+ |---|---|
11
+ | `UIKitView(factory: () -> UIView, modifier: Modifier)` | Drop a UIView into the Compose tree |
12
+ | `UIKitViewController(factory: () -> UIViewController, modifier: Modifier)` | Drop a UIViewController into the Compose tree |
13
+ | `ComposeUIViewController { content }` | Build a `UIViewController` from a Compose tree, exposed to Swift |
14
+ | `LocalUIViewController.current` | Access the host `UIViewController` from inside Compose (for presenting modals) |
15
+
16
+ To expose a Compose tree to SwiftUI, KMP generates a top-level Kotlin function (commonly `MainViewController()`) which returns a `UIViewController`. Wrap it with `UIViewControllerRepresentable` in Swift.
17
+
18
+ Lifecycle reminder: a `UIKitView` retains its UIView across recompositions only if the `factory` lambda's identity stays stable. Capturing changing variables in the factory triggers a full UIView rebuild. Use `update = { view -> ... }` to mutate properties of an existing UIView.
19
+
20
+ ---
21
+
22
+ ## Recipe: Compose calling SwiftUI
23
+
24
+ Goal: drop a SwiftUI `Map` view (rendered natively by MapKit) inside a Compose screen.
25
+
26
+ ```kotlin
27
+ // commonMain
28
+ @Composable
29
+ expect fun NativeMapView(
30
+ coordinates: Pair<Double, Double>,
31
+ modifier: Modifier = Modifier
32
+ )
33
+
34
+ // iosMain
35
+ @Composable
36
+ actual fun NativeMapView(
37
+ coordinates: Pair<Double, Double>,
38
+ modifier: Modifier
39
+ ) {
40
+ UIKitViewController(
41
+ factory = {
42
+ // SwiftUIBridge is exposed via the Swift framework
43
+ SwiftUIBridge.makeMapController(
44
+ lat = coordinates.first,
45
+ lon = coordinates.second
46
+ )
47
+ },
48
+ modifier = modifier
49
+ )
50
+ }
51
+
52
+ // androidMain - fallback to a Compose Map or a no-op
53
+ @Composable
54
+ actual fun NativeMapView(
55
+ coordinates: Pair<Double, Double>,
56
+ modifier: Modifier
57
+ ) {
58
+ // Use Google Maps Compose or a placeholder
59
+ Box(modifier.background(Color.LightGray)) {
60
+ Text("Map unavailable on this target")
61
+ }
62
+ }
63
+ ```
64
+
65
+ Swift side:
66
+
67
+ ```swift
68
+ // SwiftUIBridge.swift (in iosApp Xcode target)
69
+ import SwiftUI
70
+ import MapKit
71
+
72
+ @objc public class SwiftUIBridge: NSObject {
73
+ @objc public static func makeMapController(lat: Double, lon: Double) -> UIViewController {
74
+ let region = MKCoordinateRegion(
75
+ center: CLLocationCoordinate2D(latitude: lat, longitude: lon),
76
+ span: MKCoordinateSpan(latitudeDelta: 0.05, longitudeDelta: 0.05)
77
+ )
78
+ return UIHostingController(rootView: Map(coordinateRegion: .constant(region)))
79
+ }
80
+ }
81
+ ```
82
+
83
+ Build wiring (`build.gradle.kts` of the `composeApp` module):
84
+
85
+ ```kotlin
86
+ kotlin {
87
+ listOf(iosX64(), iosArm64(), iosSimulatorArm64()).forEach { target ->
88
+ target.compilations.getByName("main") {
89
+ cinterops {
90
+ val swiftBridge by creating {
91
+ defFile(project.file("src/iosMain/swiftBridge.def"))
92
+ }
93
+ }
94
+ }
95
+ }
96
+ }
97
+ ```
98
+
99
+ `swiftBridge.def`:
100
+
101
+ ```
102
+ language = Objective-C
103
+ headers = SwiftUIBridge.h
104
+ package = bridge.swiftui
105
+ ```
106
+
107
+ The Swift class needs `@objc` and a generated header (Xcode auto-generates `ProductName-Swift.h`). The Kotlin import becomes `import bridge.swiftui.SwiftUIBridge`.
108
+
109
+ ---
110
+
111
+ ## Recipe: SwiftUI hosting Compose
112
+
113
+ Goal: a SwiftUI app that uses a Compose screen as one tab among native SwiftUI tabs.
114
+
115
+ ```kotlin
116
+ // iosMain/kotlin/main.ios.kt
117
+ fun MainViewController(): UIViewController = ComposeUIViewController {
118
+ AppContent()
119
+ }
120
+ ```
121
+
122
+ ```swift
123
+ // iOS app target
124
+ import SwiftUI
125
+ import ComposeApp // KMP-generated framework
126
+
127
+ struct ComposeContent: UIViewControllerRepresentable {
128
+ func makeUIViewController(context: Context) -> UIViewController {
129
+ Main_iosKt.MainViewController()
130
+ }
131
+ func updateUIViewController(_ uiViewController: UIViewController, context: Context) {}
132
+ }
133
+
134
+ @main
135
+ struct MyApp: App {
136
+ var body: some Scene {
137
+ WindowGroup {
138
+ TabView {
139
+ NativeHomeView()
140
+ .tabItem { Label("Home", systemImage: "house") }
141
+
142
+ ComposeContent()
143
+ .ignoresSafeArea()
144
+ .tabItem { Label("Studio", systemImage: "wand.and.stars") }
145
+
146
+ SettingsView()
147
+ .tabItem { Label("Settings", systemImage: "gear") }
148
+ }
149
+ }
150
+ }
151
+ }
152
+ ```
153
+
154
+ Tip: `ignoresSafeArea()` is usually right because Compose handles its own safe-area insets via `WindowInsets.safeDrawing`. If you wrap inside SwiftUI containers that add their own padding, you'll get double insets.
155
+
156
+ ---
157
+
158
+ ## Android interop primitives
159
+
160
+ | API | Purpose |
161
+ |---|---|
162
+ | `AndroidView(factory: (Context) -> View, modifier: Modifier)` | Drop a legacy Android View into Compose |
163
+ | `AndroidViewBinding<T>(...)` | Drop a ViewBinding-generated layout into Compose |
164
+ | `setContent { ... }` in Activity | Compose root inside a legacy Activity |
165
+ | `ComposeView` (legacy XML) | Embed a Compose subtree inside an XML layout |
166
+
167
+ Going the other direction (Compose embedded in a Fragment-based legacy app):
168
+
169
+ ```kotlin
170
+ class LegacyFragment : Fragment() {
171
+ override fun onCreateView(
172
+ inflater: LayoutInflater,
173
+ container: ViewGroup?,
174
+ savedInstanceState: Bundle?
175
+ ): View = ComposeView(requireContext()).apply {
176
+ setViewCompositionStrategy(ViewCompositionStrategy.DisposeOnViewTreeLifecycleDestroyed)
177
+ setContent {
178
+ AppContent() // commonMain composable
179
+ }
180
+ }
181
+ }
182
+ ```
183
+
184
+ The `ViewCompositionStrategy` matters: `DisposeOnViewTreeLifecycleDestroyed` is the safe default for Fragments and prevents memory leaks tied to the Activity outliving the View.
185
+
186
+ ---
187
+
188
+ ## Desktop interop
189
+
190
+ Compose Desktop runs on the JVM and has full access to Java/Swing/AWT/JavaFX.
191
+
192
+ ```kotlin
193
+ // desktopMain
194
+ @Composable
195
+ fun MapDesktop() {
196
+ SwingPanel(
197
+ factory = {
198
+ JFXPanel().apply {
199
+ Platform.runLater {
200
+ scene = Scene(WebView().apply { engine.load("https://maps.example") })
201
+ }
202
+ }
203
+ },
204
+ modifier = Modifier.fillMaxSize()
205
+ )
206
+ }
207
+ ```
208
+
209
+ `SwingPanel` is the desktop equivalent of `UIKitView` / `AndroidView`. JavaFX integration via `JFXPanel` is the canonical bridge for things like `WebView` or hardware video playback.
210
+
211
+ ---
212
+
213
+ ## Web (Wasm) interop
214
+
215
+ ```kotlin
216
+ // wasmJsMain
217
+ external fun alert(message: String)
218
+
219
+ @JsName("renderChart")
220
+ external fun renderChart(canvasId: String, data: JsArray<JsNumber>)
221
+
222
+ @Composable
223
+ fun WebOnlyChart(data: List<Double>) {
224
+ DisposableEffect(data) {
225
+ renderChart("chart-canvas", data.toJsArray())
226
+ onDispose { /* tear down JS chart */ }
227
+ }
228
+ }
229
+ ```
230
+
231
+ DOM injection via `kotlinx.browser.document.body?.appendChild(...)` is rare; usually unnecessary because Compose Wasm renders to a single `<canvas>`. If you need HTML next to the canvas (SEO, video element, native form), structure your `index.html` with adjacent containers and use Compose for the canvas portion only.
232
+
233
+ ---
234
+
235
+ ## Communication patterns (state shared between Compose and native)
236
+
237
+ The cleanest pattern is a shared ViewModel layer in `commonMain` exposing `MutableStateFlow` / `SharedFlow` / `Channel`. Both Compose and SwiftUI / native UIKit can observe a `Flow`.
238
+
239
+ ```kotlin
240
+ // commonMain
241
+ class CounterViewModel {
242
+ private val _count = MutableStateFlow(0)
243
+ val count: StateFlow<Int> = _count.asStateFlow()
244
+
245
+ fun increment() { _count.value += 1 }
246
+ }
247
+ ```
248
+
249
+ Compose side:
250
+
251
+ ```kotlin
252
+ @Composable
253
+ fun CounterScreen(vm: CounterViewModel) {
254
+ val count by vm.count.collectAsState()
255
+ Button(onClick = vm::increment) { Text("Count: $count") }
256
+ }
257
+ ```
258
+
259
+ Swift side (using KMP's generated bindings via `Skie` or hand-rolled `Flow` -> `AsyncSequence`):
260
+
261
+ ```swift
262
+ struct CounterView: View {
263
+ @State private var count: Int32 = 0
264
+ let vm = CounterViewModel()
265
+
266
+ var body: some View {
267
+ Button("Count: \(count)") { vm.increment() }
268
+ .task {
269
+ for await value in vm.count {
270
+ count = value as? Int32 ?? 0
271
+ }
272
+ }
273
+ }
274
+ }
275
+ ```
276
+
277
+ The `Skie` Gradle plugin (Touchlab) generates idiomatic Swift wrappers for KMP types - `StateFlow<Int>` becomes `AsyncSequence<Int>`, sealed classes become Swift enums, suspend functions become `async` functions. Without Skie you get raw `KotlinInt` and `Kotlinx_coroutines_coreFlow` types that need manual bridging.
278
+
279
+ For one-shot events (snackbar trigger, navigation event), use `SharedFlow` (replay = 0) or a `Channel` with `Channel.RENDEZVOUS`.
280
+
281
+ ---
282
+
283
+ ## Sources
284
+
285
+ - [JetBrains CMP iOS interop](https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-uikit-integration.html)
286
+ - [Meet-Miyani/compose-skill](https://github.com/Meet-Miyani/compose-skill)
287
+ - [Touchlab Skie](https://skie.touchlab.co/) (Swift bindings for KMP)
288
+ - [Kotlinx coroutines Flow](https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/)
@@ -0,0 +1,156 @@
1
+ # CMP Platform Quirks
2
+
3
+ Catalog of platform-specific behaviors and surprising differences across Android / iOS / Desktop / Web targets in CMP. Updated for CMP 1.7+.
4
+ The point is not to be exhaustive but to flag the cases where "write once, run everywhere" leaks - so you can plan for them rather than discover them in QA.
5
+
6
+ ---
7
+
8
+ ## Layout / sizing
9
+
10
+ ### iOS safe area
11
+ `Modifier.windowInsetsPadding(WindowInsets.safeDrawing)` works on both iOS and Android in CMP 1.7+. Pre-1.7, you needed iOS-specific handling to read `UIScreen.mainScreen.bounds` and subtract notch/home indicator manually.
12
+
13
+ Always verify on a physical iPhone with a notch (iPhone 14 Pro and up have the Dynamic Island, which has the same insets as the notch but different visual treatment). The simulator's notched devices give correct values; older simulators without notches will silently report zero insets.
14
+
15
+ ```kotlin
16
+ Box(
17
+ Modifier
18
+ .fillMaxSize()
19
+ .windowInsetsPadding(WindowInsets.safeDrawing)
20
+ ) {
21
+ AppContent()
22
+ }
23
+ ```
24
+
25
+ ### Desktop window resizing
26
+ Compose composables receive `LocalWindowInfo.current.containerSize` updates as the user drags the window edge. Animations that read window size in `LaunchedEffect` or directly inside layout can stutter during resize because the resize emits ~60 events per second. Throttle reads with `derivedStateOf`:
27
+
28
+ ```kotlin
29
+ val windowInfo = LocalWindowInfo.current
30
+ val widthDp by remember {
31
+ derivedStateOf { windowInfo.containerSize.width.dp }
32
+ }
33
+ ```
34
+
35
+ ### Web (Wasm) viewport
36
+ The Compose canvas fills its host element by default. CSS `width: 100vw; height: 100vh` on the wrapper is the typical setup. Watch out for browser zoom: zooming the page changes `devicePixelRatio` and your `Dp` values stay constant in CSS pixels but render at different physical pixel sizes. Test at 100%, 125%, 150%.
37
+
38
+ ---
39
+
40
+ ## Inputs
41
+
42
+ ### Soft keyboard (iOS)
43
+ `imePadding()` requires `IOSKeyboardEventListener` setup in CMP 1.7. Pre-1.7, you had to handle it manually via `UIKeyboardWillShowNotification`. The listener attaches when the Compose view controller mounts; if you're embedding inside SwiftUI and the SwiftUI parent already adjusts for the keyboard, you'll get double-adjustment. Disable one side.
44
+
45
+ ### Hardware keyboard (Desktop)
46
+ `Modifier.onKeyEvent { event -> ... }` works for global key handling. Use `Modifier.onPreviewKeyEvent` to intercept before child composables. `Key.Tab`, `Key.Enter`, modifier keys (`event.isCtrlPressed`, `event.isMetaPressed`) are platform-aware.
47
+
48
+ ### Native gestures conflict (iOS)
49
+ Edge swipe-back (`UIScreenEdgePanGestureRecognizer`) overrides custom horizontal pan in the leading 30dp on iOS. If your app uses a swipeable carousel or drawer that starts from the edge, users on iOS will trigger system back navigation instead. Mitigations:
50
+ - Move the swipe area inward 30dp+.
51
+ - Disable the system gesture by setting `interactivePopGestureRecognizer.isEnabled = false` on the navigation controller (only if you control the host controller).
52
+
53
+ ### Wasm input
54
+ `Modifier.pointerInput` works for mouse and touch. Right-click via mouse fires as a secondary press; long-press on touch is detected via `detectTapGestures(onLongPress = ...)`. Wheel events come through `Modifier.scrollable`.
55
+
56
+ ---
57
+
58
+ ## Rendering
59
+
60
+ ### Skia on Android vs Skiko on iOS/Desktop/Web
61
+ Both targets use Skia as the rendering engine, but Android uses the Skia bundled with the OS while iOS/Desktop/Web ship Skiko (Kotlin-wrapped Skia). Same engine family, slightly different driver, can produce subtly different anti-aliasing on diagonal lines or sub-pixel text. Visual diff testing across platforms catches it; pixel-exact comparisons will fail.
62
+
63
+ ### Compose 1.7 SharedTransitionLayout
64
+ Works cross-platform but iOS performance is slightly slower than Android - benchmark hero animations on iPhone 12 baseline. If you target lower-end devices (iPhone 8, older Android budget phones), keep shared-element scopes shallow (avoid wrapping a screen with 100+ composables in a single `SharedTransitionLayout`).
65
+
66
+ ### AGSL shaders (advanced)
67
+ Android only. AGSL (Android Graphics Shading Language) requires Android 13+ (`RuntimeShader`). iOS, Desktop, and Web do not have an equivalent. If you need shaders cross-platform:
68
+ - iOS: drop a Metal-backed `MTKView` via `UIKitView`.
69
+ - Desktop: use OpenGL/Vulkan via Skiko's lower-level APIs (advanced).
70
+ - Wasm: WebGL/WebGPU via JS interop.
71
+
72
+ For most projects, restrict shaders to Android-only feature flags rather than attempting cross-platform parity.
73
+
74
+ ---
75
+
76
+ ## Material 3 components
77
+
78
+ | Component | Android | iOS | Desktop | Web |
79
+ |---|---|---|---|---|
80
+ | `Switch` | Material toggle | iOS-style auto-rendering | Material toggle | Material toggle |
81
+ | `Slider` | Material thumb | Material thumb (no native iOS slider) | Material thumb | Material thumb |
82
+ | `DatePicker` | Material grid | Material grid (no native UIDatePicker) | Material grid | Material grid |
83
+ | `BottomAppBar` | Material | Foreign-feeling on iOS | OK on macOS-style apps | OK |
84
+ | `NavigationBar` | Material | Foreign on iOS - consider native `TabView` | Adapts to desktop | Adapts |
85
+ | `TopAppBar` | Material | Acceptable but not a UINavigationBar | Title bar territory | Acceptable |
86
+
87
+ If you need native iOS pickers, tab bars, or nav bars: drop them in via `UIKitView` / `UIKitViewController`. The reverse (native Android Material on iOS) is rarely a goal.
88
+
89
+ ---
90
+
91
+ ## Lifecycle
92
+
93
+ | Platform | Lifecycle source | Compose access |
94
+ |---|---|---|
95
+ | Android | `Activity` lifecycle | `LocalLifecycleOwner.current` |
96
+ | iOS | Scene phase via `UIApplication` notifications | `LocalLifecycleOwner.current` (CMP 1.7+) |
97
+ | Desktop | Window close vs app close differ | `LocalLifecycleOwner.current` (CMP 1.7+) |
98
+ | Web | `visibilitychange` events on the document | `LocalLifecycleOwner.current` (limited) |
99
+
100
+ In CMP 1.7+, `LifecycleEventEffect` works cross-platform:
101
+
102
+ ```kotlin
103
+ LifecycleEventEffect(Lifecycle.Event.ON_RESUME) {
104
+ analytics.track("screen_resumed")
105
+ }
106
+ ```
107
+
108
+ Desktop nuance: closing the last window can either quit the app or keep it running (macOS dock convention). Handle both: `Window(onCloseRequest = ::exitApplication)` to force quit, or hook `onCloseRequest` to hide-only.
109
+
110
+ ---
111
+
112
+ ## Resources
113
+
114
+ Use `org.jetbrains.compose.resources` plugin for fonts, images, strings, files. Generated `Res.font.X`, `Res.drawable.X`, `Res.string.X`, `Res.file.X` accessors live in a generated package keyed off your module name (e.g., `myproject.composeapp.generated.resources.Res`).
115
+
116
+ Localization: `commonMain/composeResources/values/strings.xml` is the default; add `values-fr/strings.xml` for French, `values-ja/strings.xml` for Japanese. Access via `stringResource(Res.string.app_name)`. Plural forms via `pluralStringResource(Res.plurals.items, count)`.
117
+
118
+ Drawable formats: SVG, PNG, JPEG. Vector drawables (Android XML format) are supported but SVG is preferred for cross-platform.
119
+
120
+ ---
121
+
122
+ ## Build / packaging
123
+
124
+ | Target | Command | Output |
125
+ |---|---|---|
126
+ | Android APK | `./gradlew :composeApp:assembleRelease` | `composeApp/build/outputs/apk/release/*.apk` |
127
+ | Android AAB | `./gradlew :composeApp:bundleRelease` | `composeApp/build/outputs/bundle/release/*.aab` |
128
+ | iOS framework | `./gradlew :composeApp:linkReleaseFrameworkIosArm64` | `composeApp/build/bin/iosArm64/releaseFramework/ComposeApp.framework` |
129
+ | iOS via SPM | Generated repo with `Package.swift` consumed by Xcode | Swift Package |
130
+ | Desktop installer | `./gradlew :composeApp:packageDistributionForCurrentOS` | `.dmg` (macOS), `.msi` (Windows), `.deb` (Linux) |
131
+ | Wasm dev | `./gradlew :composeApp:wasmJsBrowserDevelopmentRun` | Local dev server |
132
+ | Wasm prod | `./gradlew :composeApp:wasmJsBrowserDistribution` | `composeApp/build/dist/wasmJs/productionExecutable/` |
133
+
134
+ iOS framework is consumed in Xcode either by directly linking the `.framework` (legacy) or via Swift Package Manager from a generated repo (recommended for CI). The SPM approach lets you version the binary like any other dependency.
135
+
136
+ ---
137
+
138
+ ## Common errors
139
+
140
+ | Symptom | Likely cause | Fix |
141
+ |---|---|---|
142
+ | `ImportError: Symbol not found` on iOS at runtime | A `commonMain` API used a JVM-only thing (e.g., `java.util.UUID`, `java.io.File`) | Use `kotlinx.uuid`, `kotlinx-io`, or `expect`/`actual` |
143
+ | Stack overflow in iOS Compose | Often a `LaunchedEffect` recursion or a state read in a tight loop | Profile with Xcode Instruments; isolate the offending composable |
144
+ | Slow Wasm | Unoptimized initial bundle | Tree-shake heavy deps, lazy-load secondary screens, profile `.wasm` size |
145
+ | Android build OK, iOS link fails with `Undefined symbol` | Cinterop misconfigured or Swift bridge header missing from build phase | Re-run `./gradlew :composeApp:cinteropProcess` and verify `.def` paths |
146
+ | Compose composable looks correct on Android but blank on iOS | Often a missing `Modifier.fillMaxSize()` at the root, or a `Box` with no constraints | Add explicit size; iOS doesn't infer size from parent the same way Android does in some edge cases |
147
+ | Fonts work on Android but not iOS | Font file copied to wrong resources folder, or font name typo | Drop fonts in `commonMain/composeResources/font/`; verify the generated `Res.font.X` accessor matches the file name |
148
+
149
+ ---
150
+
151
+ ## Sources
152
+
153
+ - [JetBrains CMP release notes](https://github.com/JetBrains/compose-multiplatform/blob/master/CHANGELOG.md)
154
+ - [Meet-Miyani/compose-skill](https://github.com/Meet-Miyani/compose-skill) (platform quirks section)
155
+ - [JetBrains CMP iOS interop](https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-uikit-integration.html)
156
+ - [Skiko (Skia for Kotlin)](https://github.com/JetBrains/skiko)