[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71C4147WT36RF6KZ2BGXJ9E":3,"skill-same:01M71C4147WT36RF6KZ2BGXJ9E":57},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":30,"linkOnly":31,"markdownContent":32,"markdownBody":33,"frontMatter":34,"refName":35,"commitSha":36,"skillDirectory":37,"forksCount":38,"repositoryHtmlUrl":39,"repositoryHomepageUrl":6,"ownerHtmlUrl":40,"ownerBlogUrl":6,"ownerDescription":41,"updatedAt":42,"install":43,"resources":56},"01M71C4147WT36RF6KZ2BGXJ9E","genjutsu-compose-multiplatform",null,"Compose Multiplatform \u002F KMP patterns - expect\u002Factual composables, platform-specific code, density and font handling cross-target, iOS\u002FAndroid\u002FDesktop interop.","nexuslinkproductions\u002Fyuri-os","nexuslinkproductions","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F273246263?v=4","01M718YX9NZRCW50B59B8ZVDKN","Marcel Spatz","01M718YXAQ7530F4B1VKN6SFQV",2,"MIT","https:\u002F\u002Fgithub.com\u002Fnexuslinkproductions\u002Fyuri-os\u002Fblob\u002Fmain\u002Fskills\u002Fgenjutsu-compose-multiplatform\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29],"compose","genjutsu compose multiplatform","target","platform","code","android","desktop","ios","patterns","font","composables","2026-11-10 10:12:30",false,"---\nname: genjutsu-compose-multiplatform\ndescription: \"Compose Multiplatform \u002F KMP patterns - expect\u002Factual composables, platform-specific code, density and font handling cross-target, iOS\u002FAndroid\u002FDesktop interop.\"\n---\n\n# Compose Multiplatform\n\n> Compose Multiplatform (CMP) and Kotlin Multiplatform (KMP) patterns for cross-platform UI.\n> Loaded for projects with `org.jetbrains.compose` plugin.\n> Foundation: `..\u002Fcompose-motion\u002FSKILL.md` for animation API; this file covers what's specific to writing one Compose codebase for Android + iOS + Desktop + Web.\n\n---\n\n## KMP vs CMP - quick clarification\n\n**KMP** (Kotlin Multiplatform) is the language and build infrastructure: shared Kotlin code compiled to JVM, Native (iOS, macOS, Linux, Windows), and Wasm. **CMP** (Compose Multiplatform) is the UI framework on top of KMP, built by JetBrains as a port of Jetpack Compose. You write a single Compose codebase in `commonMain` that runs on Android, iOS, Desktop (JVM), and Web (Wasm). Platform-specific code lives in `androidMain`, `iosMain`, `desktopMain`, `wasmJsMain` and is wired in via `expect`\u002F`actual` declarations.\n\n---\n\n## Project structure\n\n```\ncomposeApp\u002F\n├── src\u002F\n│   ├── commonMain\u002F        ← shared Compose code (most of the app)\n│   │   └── kotlin\u002F\n│   ├── androidMain\u002F       ← Android-specific (uses Activity, Context)\n│   ├── iosMain\u002F           ← iOS-specific (uses UIKit\u002FUIView interop)\n│   ├── desktopMain\u002F       ← JVM desktop (uses java.awt\u002Fswing if needed)\n│   └── wasmJsMain\u002F        ← Wasm web target\n├── build.gradle.kts\niosApp\u002F                    ← Xcode project consuming the generated framework\nandroidApp\u002F                ← Android Application module (often merged into composeApp)\n```\n\nThe `commonMain` folder should hold 80-95% of your code in a well-architected CMP project. If `iosMain` or `androidMain` start growing past a few hundred lines, you're probably leaking platform concerns into UI logic that could stay shared.\n\n---\n\n## `expect`\u002F`actual` pattern\n\nThe KMP escape hatch when you genuinely need different implementations per target. Declare the contract once in `commonMain`, implement it once per target.\n\n```kotlin\n\u002F\u002F commonMain\nexpect fun openShareSheet(text: String)\n\n\u002F\u002F androidMain\nactual fun openShareSheet(text: String) {\n    val intent = Intent(Intent.ACTION_SEND).apply {\n        type = \"text\u002Fplain\"\n        putExtra(Intent.EXTRA_TEXT, text)\n    }\n    context.startActivity(Intent.createChooser(intent, null))\n}\n\n\u002F\u002F iosMain\nactual fun openShareSheet(text: String) {\n    val activityVC = UIActivityViewController(\n        activityItems = listOf(text),\n        applicationActivities = null\n    )\n    UIApplication.sharedApplication.keyWindow\n        ?.rootViewController\n        ?.presentViewController(activityVC, true, null)\n}\n```\n\n`expect`\u002F`actual` works for top-level functions, classes, type aliases, and properties. The signature in `actual` must match exactly, including modifiers and default values.\n\n---\n\n## `expect`\u002F`actual` for composables\n\nComposables follow the same rules. Useful when a feature needs a platform-specific Compose API (Android `RuntimeShader`, iOS `UIKitView`, Desktop `SwingPanel`).\n\n```kotlin\n\u002F\u002F commonMain\n@Composable\nexpect fun PlatformBlur(modifier: Modifier = Modifier, content: @Composable () -> Unit)\n\n\u002F\u002F androidMain (uses RuntimeShader on Android 13+)\n@Composable\nactual fun PlatformBlur(modifier: Modifier, content: @Composable () -> Unit) {\n    Box(modifier.graphicsLayer { renderEffect = blurEffect }) { content() }\n}\n\n\u002F\u002F iosMain (uses UIVisualEffectView via UIKitView)\n@Composable\nactual fun PlatformBlur(modifier: Modifier, content: @Composable () -> Unit) {\n    Box(modifier) {\n        UIKitView(\n            factory = { UIVisualEffectView(effect = UIBlurEffect.systemMaterial()) },\n            modifier = Modifier.matchParentSize()\n        )\n        content()\n    }\n}\n```\n\nRule: `expect` composables should be the exception, not the rule. Most \"platform feel\" differences can be tuned via tokens (colors, corner radii, spring stiffness) in `commonMain`, not via separate code paths.\n\n---\n\n## `LocalDensity` cross-platform\n\nOn Android, `LocalDensity.current.density` reflects the device DPI bucket (1.0, 1.5, 2.0, 3.0...). On iOS, density is computed from `UIScreen.scale` (typically 2.0 or 3.0 on Retina). On Desktop, density depends on the screen scaling factor (1.0 by default; 2.0 on Retina-class displays; user-configurable on Windows). On Wasm, density follows `window.devicePixelRatio`.\n\nDon't hardcode `Dp` to pixel ratios; trust `Dp` and `LocalDensity` to handle conversion. If you need an exact pixel value (e.g., for a `Canvas` draw operation), do the conversion explicitly:\n\n```kotlin\nval density = LocalDensity.current\nval pxValue = with(density) { 16.dp.toPx() }\n```\n\nAvoid reading `density` inside hot loops; cache the conversion.\n\n---\n\n## `LocalConfiguration` and platform-aware UI\n\n`LocalConfiguration.current` is **Android-only** and lives in `androidMain`. For CMP, prefer the cross-platform alternatives:\n\n- `LocalWindowInfo.current.containerSize` - the window\u002Fscreen size as `IntSize`, available in `commonMain`.\n- `LocalDensity.current` - density, available in `commonMain`.\n- `LocalLayoutDirection.current` - LTR \u002F RTL.\n- `BoxWithConstraints { ... }` - read `maxWidth` \u002F `maxHeight` directly inside layout.\n\nIf you need real device characteristics (orientation, idiom, model), wrap the access in `expect`\u002F`actual` and pass a typed object like `PlatformInfo` to the common layer.\n\n---\n\n## Fonts cross-platform via Compose Resources\n\n`org.jetbrains.compose.resources` is the shared resources plugin. Drop fonts in `commonMain\u002FcomposeResources\u002Ffont\u002F`, and the Gradle plugin generates a typed `Res` accessor.\n\n```\ncomposeApp\u002Fsrc\u002FcommonMain\u002FcomposeResources\u002F\n├── font\u002F\n│   ├── Inter-Regular.ttf\n│   └── Inter-Bold.ttf\n├── drawable\u002F\n│   └── logo.svg\n└── values\u002F\n    ├── strings.xml          ← default locale\n    └── strings.fr.xml       ← French overrides\n```\n\nUsage in `commonMain`:\n\n```kotlin\nimport myproject.composeapp.generated.resources.Inter_Regular\nimport myproject.composeapp.generated.resources.Inter_Bold\nimport myproject.composeapp.generated.resources.Res\n\nval InterFamily = FontFamily(\n    Font(Res.font.Inter_Regular, FontWeight.Normal),\n    Font(Res.font.Inter_Bold, FontWeight.Bold),\n)\n\nText(\"Hello\", fontFamily = InterFamily)\n```\n\nSame pattern for `Res.drawable.logo` (image), `Res.string.app_name` (localized string via `stringResource(...)`), `Res.file.config` (raw bytes via `Res.readBytes(...)`).\n\n---\n\n## iOS interop with SwiftUI\n\nCMP produces a `UIViewController` you can drop into a SwiftUI app. KMP generates a top-level Kotlin function (commonly named `MainViewController()` or `ComposeUIViewController { ... }`) that returns a `UIViewController`. Wrap it with `UIViewControllerRepresentable`.\n\n```kotlin\n\u002F\u002F iosMain\u002Fkotlin\u002Fmain.ios.kt\nfun MainViewController(): UIViewController = ComposeUIViewController {\n    AppContent()  \u002F\u002F commonMain composable\n}\n```\n\n```swift\n\u002F\u002F iOS app target\nimport SwiftUI\nimport ComposeApp  \u002F\u002F KMP-generated framework\n\nstruct ComposeContent: UIViewControllerRepresentable {\n    func makeUIViewController(context: Context) -> UIViewController {\n        Main_iosKt.MainViewController()\n    }\n    func updateUIViewController(_ uiViewController: UIViewController, context: Context) {}\n}\n\nstruct ContentView: View {\n    var body: some View { ComposeContent().ignoresSafeArea() }\n}\n```\n\nThe Kotlin function name gets mangled to `Main_iosKt.MainViewController()` because the file is `main.ios.kt`. Check the generated framework headers if the symbol name surprises you.\n\n---\n\n## Android entry point\n\nNo interop ceremony on Android. The Activity hosts the common composable directly via `setContent { ... }`.\n\n```kotlin\n\u002F\u002F androidApp\u002Fsrc\u002Fmain\u002Fkotlin\u002FMainActivity.kt\nclass MainActivity : ComponentActivity() {\n    override fun onCreate(savedInstanceState: Bundle?) {\n        super.onCreate(savedInstanceState)\n        setContent {\n            AppContent()  \u002F\u002F commonMain composable\n        }\n    }\n}\n```\n\nIf you need to pass `Context` or `Activity` into `commonMain`, expose it via a DI graph or an `expect class PlatformContext` in `commonMain` with `actual class PlatformContext(val context: Context)` in `androidMain`.\n\n---\n\n## Embedding SwiftUI\u002FUIKit inside a Compose iOS view (the reverse direction)\n\nUse `UIKitView` for a `UIView` factory or `UIKitViewController` for a `UIViewController` factory.\n\n```kotlin\n\u002F\u002F iosMain\nUIKitView(\n    factory = {\n        UISwitch().apply {\n            addTarget(target, action = NSSelectorFromString(\"onToggle:\"), forControlEvents = UIControlEventValueChanged)\n        }\n    },\n    modifier = Modifier.size(48.dp, 32.dp)\n)\n```\n\nFor SwiftUI views: wrap them in a `UIHostingController` exposed via a Swift `@objc` bridge function, then call from Kotlin via the generated headers (cinterop). See `references\u002Fcmp-interop.md` for the full pattern.\n\n---\n\n## Animation cross-platform\n\nAll animation APIs (`animate*AsState`, `AnimatedVisibility`, `updateTransition`, `SharedTransitionLayout`) work identically across targets in CMP 1.7+. Spring tuning written in `commonMain` produces the same physics on Android and iOS. Gestures (`Modifier.draggable`, `Modifier.pointerInput`) work cross-platform with the same API surface.\n\nThe animation primer lives in `..\u002Fcompose-motion\u002FSKILL.md`. Cross-platform deltas to keep in mind:\n- iOS first-frame is slower (Skia bootstrap); a 200ms enter animation feels tighter on Android, slightly delayed on iOS cold start.\n- Wasm motion can stutter on first frame (JIT warmup); pre-warm critical paths or hide motion until interactive.\n\n---\n\n## What does NOT work (gotchas)\n\n- **Drawer state on iOS**: native `ModalNavigationDrawer` swipe-to-open from the leading edge conflicts with iOS's back-swipe gesture. Use a button trigger or move the swipe area inward 30dp+.\n- **`LayoutDirection.Rtl` quirks**: Android handles RTL natively, iOS Compose had bugs in 1.6 (text alignment, padding inversions). Improved in 1.7+ but verify with real Arabic\u002FHebrew strings.\n- **Soft keyboard handling**: `imePadding()` works on Android out of the box. On iOS Compose 1.6+, it requires `IOSKeyboardEventListener` setup or a `WindowInsets` observer wired through the platform layer.\n- **`Color.parseHex(...)`** does not exist in Compose. Use `Color(0xFFRRGGBB)` or write a tiny extension.\n- **System fonts on iOS via Compose**: do not fallback to `FontFamily.SansSerif` and expect SF Pro. Compose on iOS ships its own font fallback chain. Either bundle SF Pro via Compose Resources (license-permitting) or use `UIKitView` to drop a native `UILabel` for system-font text.\n- **Animations on Web (Wasm)**: heavier startup, occasional first-frame stutter; profile with browser devtools and lazy-load heavy animation graphs.\n- **`java.util.UUID`, `java.io.File`** and other JVM-only APIs are forbidden in `commonMain` if you ship to iOS or Wasm. Use `kotlinx.uuid`, `kotlinx-io`, or the `okio` multiplatform port.\n\n---\n\n## CMP version notes (April 2026 baseline)\n\n- Compose Multiplatform 1.7 stable: `SharedTransitionLayout` cross-platform, improved iOS keyboard handling, lifecycle observability via `LocalLifecycleOwner` on iOS.\n- Kotlin 2.0+ required (K2 compiler).\n- Some Material 3 components have platform-specific look (e.g., `Switch` on iOS auto-renders with iOS-style proportions; `DatePicker` stays Material across all targets).\n- `compose-multiplatform-resources` plugin is the standard for assets; the older `moko-resources` is no longer recommended for new projects.\n\n---\n\n## Performance considerations\n\n- **iOS first-frame** is slower than Android (Skia bootstrapping ~150-300ms cold). Keep your splash visible until the first composition emits, or pre-warm with a transparent root composable.\n- **Wasm bundle size**: aim for \u003C2MB compressed. Tree-shake heavy deps, lazy-load secondary screens via `kotlinx.coroutines` deferred composition, and inspect the `.wasm` output in `wasmJsBrowserDistribution`.\n- **Desktop**: cold start is fast on JVM; AOT compilation via Kotlin\u002FNative is overkill for desktop unless you need a single-file binary.\n- **Android**: same baseline as Jetpack Compose - profile with the Compose compiler stability metrics and `Layout Inspector` recomposition counts.\n\n---\n\n## Anti-Patterns\n\n| BAD | GOOD | Why |\n|---|---|---|\n| Reflection trick or `System.getProperty(\"os.name\")` to detect platform inside `commonMain` | `expect`\u002F`actual` with a typed `Platform` object | Reflection breaks on Wasm\u002FNative; `expect`\u002F`actual` is the contract the compiler enforces |\n| Assuming Android `Context` is reachable in `commonMain` | Inject a typed dependency via `expect class PlatformContext` or a DI scope | `Context` does not exist on iOS\u002FDesktop\u002FWasm; the code will not compile for those targets |\n| Hardcoding Material colors that look great on Android but jarring on iOS | Define a `commonMain` design system, then optionally adjust 2-3 tokens via `actual` | Cross-platform consistency is good, but iOS users notice when a Material blue feels alien on iPhone |\n| `LaunchedEffect(Unit) { while(true) { delay(16); ... } }` in `commonMain` | `rememberInfiniteTransition()` or scope to lifecycle events | Tight coroutine loops drain battery on iOS; infinite transitions pause when offscreen |\n\n---\n\n## Quick Reference: Loading Sub-skills\n\n| Need | Load |\n|---|---|\n| iOS \u002F Android interop deep-dive | `references\u002Fcmp-interop.md` |\n| Per-platform behavior catalog | `references\u002Fcmp-platform-quirks.md` |\n| Animation API | `..\u002Fcompose-motion\u002FSKILL.md` |\n| Advanced graphics (M3 Expressive, AGSL on Android only) | `..\u002Fcompose-graphics\u002FSKILL.md` |\n| iOS-side native interop with SwiftUI | `..\u002Fswiftui-motion\u002FSKILL.md` (when target is iOS and SwiftUI native blend wanted) |\n| Mobile UX context | `..\u002Fmobile-principles\u002FSKILL.md` |\n| Desktop UX context | `..\u002Fdesktop-principles\u002FSKILL.md` |\n| Foundation | `..\u002Fmotion-principles\u002FSKILL.md` |\n\n---\n\n## Sources\n\n- [Meet-Miyani\u002Fcompose-skill](https:\u002F\u002Fgithub.com\u002FMeet-Miyani\u002Fcompose-skill) (KMP\u002FCMP comprehensive)\n- [JetBrains Compose Multiplatform](https:\u002F\u002Fwww.jetbrains.com\u002Flp\u002Fcompose-multiplatform\u002F)\n- [Compose Multiplatform docs](https:\u002F\u002Fwww.jetbrains.com\u002Fhelp\u002Fkotlin-multiplatform-dev\u002Fcompose-multiplatform.html)\n- [skydoves\u002FOrbital](https:\u002F\u002Fgithub.com\u002Fskydoves\u002FOrbital) (KMP-aware shared transitions)\n","# Compose Multiplatform\n\n> Compose Multiplatform (CMP) and Kotlin Multiplatform (KMP) patterns for cross-platform UI.\n> Loaded for projects with `org.jetbrains.compose` plugin.\n> Foundation: `..\u002Fcompose-motion\u002FSKILL.md` for animation API; this file covers what's specific to writing one Compose codebase for Android + iOS + Desktop + Web.\n\n---\n\n## KMP vs CMP - quick clarification\n\n**KMP** (Kotlin Multiplatform) is the language and build infrastructure: shared Kotlin code compiled to JVM, Native (iOS, macOS, Linux, Windows), and Wasm. **CMP** (Compose Multiplatform) is the UI framework on top of KMP, built by JetBrains as a port of Jetpack Compose. You write a single Compose codebase in `commonMain` that runs on Android, iOS, Desktop (JVM), and Web (Wasm). Platform-specific code lives in `androidMain`, `iosMain`, `desktopMain`, `wasmJsMain` and is wired in via `expect`\u002F`actual` declarations.\n\n---\n\n## Project structure\n\n```\ncomposeApp\u002F\n├── src\u002F\n│   ├── commonMain\u002F        ← shared Compose code (most of the app)\n│   │   └── kotlin\u002F\n│   ├── androidMain\u002F       ← Android-specific (uses Activity, Context)\n│   ├── iosMain\u002F           ← iOS-specific (uses UIKit\u002FUIView interop)\n│   ├── desktopMain\u002F       ← JVM desktop (uses java.awt\u002Fswing if needed)\n│   └── wasmJsMain\u002F        ← Wasm web target\n├── build.gradle.kts\niosApp\u002F                    ← Xcode project consuming the generated framework\nandroidApp\u002F                ← Android Application module (often merged into composeApp)\n```\n\nThe `commonMain` folder should hold 80-95% of your code in a well-architected CMP project. If `iosMain` or `androidMain` start growing past a few hundred lines, you're probably leaking platform concerns into UI logic that could stay shared.\n\n---\n\n## `expect`\u002F`actual` pattern\n\nThe KMP escape hatch when you genuinely need different implementations per target. Declare the contract once in `commonMain`, implement it once per target.\n\n```kotlin\n\u002F\u002F commonMain\nexpect fun openShareSheet(text: String)\n\n\u002F\u002F androidMain\nactual fun openShareSheet(text: String) {\n    val intent = Intent(Intent.ACTION_SEND).apply {\n        type = \"text\u002Fplain\"\n        putExtra(Intent.EXTRA_TEXT, text)\n    }\n    context.startActivity(Intent.createChooser(intent, null))\n}\n\n\u002F\u002F iosMain\nactual fun openShareSheet(text: String) {\n    val activityVC = UIActivityViewController(\n        activityItems = listOf(text),\n        applicationActivities = null\n    )\n    UIApplication.sharedApplication.keyWindow\n        ?.rootViewController\n        ?.presentViewController(activityVC, true, null)\n}\n```\n\n`expect`\u002F`actual` works for top-level functions, classes, type aliases, and properties. The signature in `actual` must match exactly, including modifiers and default values.\n\n---\n\n## `expect`\u002F`actual` for composables\n\nComposables follow the same rules. Useful when a feature needs a platform-specific Compose API (Android `RuntimeShader`, iOS `UIKitView`, Desktop `SwingPanel`).\n\n```kotlin\n\u002F\u002F commonMain\n@Composable\nexpect fun PlatformBlur(modifier: Modifier = Modifier, content: @Composable () -> Unit)\n\n\u002F\u002F androidMain (uses RuntimeShader on Android 13+)\n@Composable\nactual fun PlatformBlur(modifier: Modifier, content: @Composable () -> Unit) {\n    Box(modifier.graphicsLayer { renderEffect = blurEffect }) { content() }\n}\n\n\u002F\u002F iosMain (uses UIVisualEffectView via UIKitView)\n@Composable\nactual fun PlatformBlur(modifier: Modifier, content: @Composable () -> Unit) {\n    Box(modifier) {\n        UIKitView(\n            factory = { UIVisualEffectView(effect = UIBlurEffect.systemMaterial()) },\n            modifier = Modifier.matchParentSize()\n        )\n        content()\n    }\n}\n```\n\nRule: `expect` composables should be the exception, not the rule. Most \"platform feel\" differences can be tuned via tokens (colors, corner radii, spring stiffness) in `commonMain`, not via separate code paths.\n\n---\n\n## `LocalDensity` cross-platform\n\nOn Android, `LocalDensity.current.density` reflects the device DPI bucket (1.0, 1.5, 2.0, 3.0...). On iOS, density is computed from `UIScreen.scale` (typically 2.0 or 3.0 on Retina). On Desktop, density depends on the screen scaling factor (1.0 by default; 2.0 on Retina-class displays; user-configurable on Windows). On Wasm, density follows `window.devicePixelRatio`.\n\nDon't hardcode `Dp` to pixel ratios; trust `Dp` and `LocalDensity` to handle conversion. If you need an exact pixel value (e.g., for a `Canvas` draw operation), do the conversion explicitly:\n\n```kotlin\nval density = LocalDensity.current\nval pxValue = with(density) { 16.dp.toPx() }\n```\n\nAvoid reading `density` inside hot loops; cache the conversion.\n\n---\n\n## `LocalConfiguration` and platform-aware UI\n\n`LocalConfiguration.current` is **Android-only** and lives in `androidMain`. For CMP, prefer the cross-platform alternatives:\n\n- `LocalWindowInfo.current.containerSize` - the window\u002Fscreen size as `IntSize`, available in `commonMain`.\n- `LocalDensity.current` - density, available in `commonMain`.\n- `LocalLayoutDirection.current` - LTR \u002F RTL.\n- `BoxWithConstraints { ... }` - read `maxWidth` \u002F `maxHeight` directly inside layout.\n\nIf you need real device characteristics (orientation, idiom, model), wrap the access in `expect`\u002F`actual` and pass a typed object like `PlatformInfo` to the common layer.\n\n---\n\n## Fonts cross-platform via Compose Resources\n\n`org.jetbrains.compose.resources` is the shared resources plugin. Drop fonts in `commonMain\u002FcomposeResources\u002Ffont\u002F`, and the Gradle plugin generates a typed `Res` accessor.\n\n```\ncomposeApp\u002Fsrc\u002FcommonMain\u002FcomposeResources\u002F\n├── font\u002F\n│   ├── Inter-Regular.ttf\n│   └── Inter-Bold.ttf\n├── drawable\u002F\n│   └── logo.svg\n└── values\u002F\n    ├── strings.xml          ← default locale\n    └── strings.fr.xml       ← French overrides\n```\n\nUsage in `commonMain`:\n\n```kotlin\nimport myproject.composeapp.generated.resources.Inter_Regular\nimport myproject.composeapp.generated.resources.Inter_Bold\nimport myproject.composeapp.generated.resources.Res\n\nval InterFamily = FontFamily(\n    Font(Res.font.Inter_Regular, FontWeight.Normal),\n    Font(Res.font.Inter_Bold, FontWeight.Bold),\n)\n\nText(\"Hello\", fontFamily = InterFamily)\n```\n\nSame pattern for `Res.drawable.logo` (image), `Res.string.app_name` (localized string via `stringResource(...)`), `Res.file.config` (raw bytes via `Res.readBytes(...)`).\n\n---\n\n## iOS interop with SwiftUI\n\nCMP produces a `UIViewController` you can drop into a SwiftUI app. KMP generates a top-level Kotlin function (commonly named `MainViewController()` or `ComposeUIViewController { ... }`) that returns a `UIViewController`. Wrap it with `UIViewControllerRepresentable`.\n\n```kotlin\n\u002F\u002F iosMain\u002Fkotlin\u002Fmain.ios.kt\nfun MainViewController(): UIViewController = ComposeUIViewController {\n    AppContent()  \u002F\u002F commonMain composable\n}\n```\n\n```swift\n\u002F\u002F iOS app target\nimport SwiftUI\nimport ComposeApp  \u002F\u002F KMP-generated framework\n\nstruct ComposeContent: UIViewControllerRepresentable {\n    func makeUIViewController(context: Context) -> UIViewController {\n        Main_iosKt.MainViewController()\n    }\n    func updateUIViewController(_ uiViewController: UIViewController, context: Context) {}\n}\n\nstruct ContentView: View {\n    var body: some View { ComposeContent().ignoresSafeArea() }\n}\n```\n\nThe Kotlin function name gets mangled to `Main_iosKt.MainViewController()` because the file is `main.ios.kt`. Check the generated framework headers if the symbol name surprises you.\n\n---\n\n## Android entry point\n\nNo interop ceremony on Android. The Activity hosts the common composable directly via `setContent { ... }`.\n\n```kotlin\n\u002F\u002F androidApp\u002Fsrc\u002Fmain\u002Fkotlin\u002FMainActivity.kt\nclass MainActivity : ComponentActivity() {\n    override fun onCreate(savedInstanceState: Bundle?) {\n        super.onCreate(savedInstanceState)\n        setContent {\n            AppContent()  \u002F\u002F commonMain composable\n        }\n    }\n}\n```\n\nIf you need to pass `Context` or `Activity` into `commonMain`, expose it via a DI graph or an `expect class PlatformContext` in `commonMain` with `actual class PlatformContext(val context: Context)` in `androidMain`.\n\n---\n\n## Embedding SwiftUI\u002FUIKit inside a Compose iOS view (the reverse direction)\n\nUse `UIKitView` for a `UIView` factory or `UIKitViewController` for a `UIViewController` factory.\n\n```kotlin\n\u002F\u002F iosMain\nUIKitView(\n    factory = {\n        UISwitch().apply {\n            addTarget(target, action = NSSelectorFromString(\"onToggle:\"), forControlEvents = UIControlEventValueChanged)\n        }\n    },\n    modifier = Modifier.size(48.dp, 32.dp)\n)\n```\n\nFor SwiftUI views: wrap them in a `UIHostingController` exposed via a Swift `@objc` bridge function, then call from Kotlin via the generated headers (cinterop). See `references\u002Fcmp-interop.md` for the full pattern.\n\n---\n\n## Animation cross-platform\n\nAll animation APIs (`animate*AsState`, `AnimatedVisibility`, `updateTransition`, `SharedTransitionLayout`) work identically across targets in CMP 1.7+. Spring tuning written in `commonMain` produces the same physics on Android and iOS. Gestures (`Modifier.draggable`, `Modifier.pointerInput`) work cross-platform with the same API surface.\n\nThe animation primer lives in `..\u002Fcompose-motion\u002FSKILL.md`. Cross-platform deltas to keep in mind:\n- iOS first-frame is slower (Skia bootstrap); a 200ms enter animation feels tighter on Android, slightly delayed on iOS cold start.\n- Wasm motion can stutter on first frame (JIT warmup); pre-warm critical paths or hide motion until interactive.\n\n---\n\n## What does NOT work (gotchas)\n\n- **Drawer state on iOS**: native `ModalNavigationDrawer` swipe-to-open from the leading edge conflicts with iOS's back-swipe gesture. Use a button trigger or move the swipe area inward 30dp+.\n- **`LayoutDirection.Rtl` quirks**: Android handles RTL natively, iOS Compose had bugs in 1.6 (text alignment, padding inversions). Improved in 1.7+ but verify with real Arabic\u002FHebrew strings.\n- **Soft keyboard handling**: `imePadding()` works on Android out of the box. On iOS Compose 1.6+, it requires `IOSKeyboardEventListener` setup or a `WindowInsets` observer wired through the platform layer.\n- **`Color.parseHex(...)`** does not exist in Compose. Use `Color(0xFFRRGGBB)` or write a tiny extension.\n- **System fonts on iOS via Compose**: do not fallback to `FontFamily.SansSerif` and expect SF Pro. Compose on iOS ships its own font fallback chain. Either bundle SF Pro via Compose Resources (license-permitting) or use `UIKitView` to drop a native `UILabel` for system-font text.\n- **Animations on Web (Wasm)**: heavier startup, occasional first-frame stutter; profile with browser devtools and lazy-load heavy animation graphs.\n- **`java.util.UUID`, `java.io.File`** and other JVM-only APIs are forbidden in `commonMain` if you ship to iOS or Wasm. Use `kotlinx.uuid`, `kotlinx-io`, or the `okio` multiplatform port.\n\n---\n\n## CMP version notes (April 2026 baseline)\n\n- Compose Multiplatform 1.7 stable: `SharedTransitionLayout` cross-platform, improved iOS keyboard handling, lifecycle observability via `LocalLifecycleOwner` on iOS.\n- Kotlin 2.0+ required (K2 compiler).\n- Some Material 3 components have platform-specific look (e.g., `Switch` on iOS auto-renders with iOS-style proportions; `DatePicker` stays Material across all targets).\n- `compose-multiplatform-resources` plugin is the standard for assets; the older `moko-resources` is no longer recommended for new projects.\n\n---\n\n## Performance considerations\n\n- **iOS first-frame** is slower than Android (Skia bootstrapping ~150-300ms cold). Keep your splash visible until the first composition emits, or pre-warm with a transparent root composable.\n- **Wasm bundle size**: aim for \u003C2MB compressed. Tree-shake heavy deps, lazy-load secondary screens via `kotlinx.coroutines` deferred composition, and inspect the `.wasm` output in `wasmJsBrowserDistribution`.\n- **Desktop**: cold start is fast on JVM; AOT compilation via Kotlin\u002FNative is overkill for desktop unless you need a single-file binary.\n- **Android**: same baseline as Jetpack Compose - profile with the Compose compiler stability metrics and `Layout Inspector` recomposition counts.\n\n---\n\n## Anti-Patterns\n\n| BAD | GOOD | Why |\n|---|---|---|\n| Reflection trick or `System.getProperty(\"os.name\")` to detect platform inside `commonMain` | `expect`\u002F`actual` with a typed `Platform` object | Reflection breaks on Wasm\u002FNative; `expect`\u002F`actual` is the contract the compiler enforces |\n| Assuming Android `Context` is reachable in `commonMain` | Inject a typed dependency via `expect class PlatformContext` or a DI scope | `Context` does not exist on iOS\u002FDesktop\u002FWasm; the code will not compile for those targets |\n| Hardcoding Material colors that look great on Android but jarring on iOS | Define a `commonMain` design system, then optionally adjust 2-3 tokens via `actual` | Cross-platform consistency is good, but iOS users notice when a Material blue feels alien on iPhone |\n| `LaunchedEffect(Unit) { while(true) { delay(16); ... } }` in `commonMain` | `rememberInfiniteTransition()` or scope to lifecycle events | Tight coroutine loops drain battery on iOS; infinite transitions pause when offscreen |\n\n---\n\n## Quick Reference: Loading Sub-skills\n\n| Need | Load |\n|---|---|\n| iOS \u002F Android interop deep-dive | `references\u002Fcmp-interop.md` |\n| Per-platform behavior catalog | `references\u002Fcmp-platform-quirks.md` |\n| Animation API | `..\u002Fcompose-motion\u002FSKILL.md` |\n| Advanced graphics (M3 Expressive, AGSL on Android only) | `..\u002Fcompose-graphics\u002FSKILL.md` |\n| iOS-side native interop with SwiftUI | `..\u002Fswiftui-motion\u002FSKILL.md` (when target is iOS and SwiftUI native blend wanted) |\n| Mobile UX context | `..\u002Fmobile-principles\u002FSKILL.md` |\n| Desktop UX context | `..\u002Fdesktop-principles\u002FSKILL.md` |\n| Foundation | `..\u002Fmotion-principles\u002FSKILL.md` |\n\n---\n\n## Sources\n\n- [Meet-Miyani\u002Fcompose-skill](https:\u002F\u002Fgithub.com\u002FMeet-Miyani\u002Fcompose-skill) (KMP\u002FCMP comprehensive)\n- [JetBrains Compose Multiplatform](https:\u002F\u002Fwww.jetbrains.com\u002Flp\u002Fcompose-multiplatform\u002F)\n- [Compose Multiplatform docs](https:\u002F\u002Fwww.jetbrains.com\u002Fhelp\u002Fkotlin-multiplatform-dev\u002Fcompose-multiplatform.html)\n- [skydoves\u002FOrbital](https:\u002F\u002Fgithub.com\u002Fskydoves\u002FOrbital) (KMP-aware shared transitions)\n",{"name":5,"description":7},"main","4c6d8d65f3d6096e2fc25b0845e481dda73c2794","skills\u002Fgenjutsu-compose-multiplatform",0,"https:\u002F\u002Fgithub.com\u002Fnexuslinkproductions\u002Fyuri-os","https:\u002F\u002Fgithub.com\u002Fnexuslinkproductions","Building deterministic AI governance and continuity systems. Workflow architect + visual storyteller","2026-11-14 03:05:17",{"source":8,"skillName":5,"commands":44,"prompt":54,"zipAvailable":55},[45,48,51],{"tool":46,"command":47},"npx","npx skills add nexuslinkproductions\u002Fyuri-os --skill genjutsu-compose-multiplatform",{"tool":49,"command":50},"bunx","bunx skills add nexuslinkproductions\u002Fyuri-os --skill genjutsu-compose-multiplatform",{"tool":52,"command":53},"pnpm","pnpm dlx skills add nexuslinkproductions\u002Fyuri-os --skill genjutsu-compose-multiplatform","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fnexuslinkproductions\u002Fyuri-os\u002Fblob\u002Fmain\u002Fskills\u002Fgenjutsu-compose-multiplatform\u002FSKILL.md",true,[],[58,66,73,80,87,94],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":65},"01M73K12W8K0GSTB4ABKS8BD7H","executing-plans","Use when you have a written implementation plan to execute in a separate session with review checkpoints","https:\u002F\u002Fgithub.com\u002Fnexuslinkproductions\u002Fyuri-os\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fexecuting-plans\u002FSKILL.md",[],[],"2026-11-11 15:11:14",{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":65},"01M73HC2NSXYYN54GBASVG2RDJ","using-git-worktrees","Use when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback","https:\u002F\u002Fgithub.com\u002Fnexuslinkproductions\u002Fyuri-os\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fusing-git-worktrees\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":65},"01M73HC12557CB08VDEF1YTF3H","triage","Triage issues through a state machine driven by triage roles. Use when user wants to create an issue, triage issues, review incoming bugs or feature requests, prepare issues for an AFK agent, or manage issue workflow.","https:\u002F\u002Fgithub.com\u002Fnexuslinkproductions\u002Fyuri-os\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Ftriage\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":65},"01M73HBXB8F8ED4KQXVXEWCV8B","trade-edge-audit","The EDGE LENS for trading peers — recalls EVERY factor\u002Findicator running from the live forecast ledger (no enumeration) and renders the whole pile through the edge arsenal off ONE call: multi-horizon scoring (the ladder) + deflated Sharpe (overfit) + Benjamini-Hochberg FDR (multiple-testing across the fleet) + spread-bounce + maker-fee falsification, then ranks only what survives ALL of it. Use when a peer must answer \"does ANY running factor have real, overfit-corrected, multiple-testing-corrected, fee-surviving edge, and at which horizon\" without hand-assembling 6 tools. The trade-engine analog of quantum-hypothesis-simulation.","https:\u002F\u002Fgithub.com\u002Fnexuslinkproductions\u002Fyuri-os\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Ftrade-edge-audit\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":65},"01M73HBT5ZRCA82SQJ781NWVNQ","trade-decision-sim","The DECISION LENS for trading peers — recalls the CURRENT signal snapshot per market from the live ledger and renders it through the sim arsenal off ONE call: quantum factor-circuit order-optimal sequencing + decision-sim CVaR-robust sizing, sized against the MEASURED per-factor edge (from the edge-audit), correlation-aware. Emits an actionable call per market {side, sizePct, confidence, sequence}. Flat\u002Fzero-size when there is no measured edge after cost — the honest default. Sibling of trade-edge-audit (the EDGE lens); the trade-engine analog of quantum-hypothesis-simulation for a live decision.","https:\u002F\u002Fgithub.com\u002Fnexuslinkproductions\u002Fyuri-os\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Ftrade-decision-sim\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":65},"01M73HBN2WTKGN790WYQD6GBM4","to-issues","Break a plan, spec, or PRD into independently-grabbable issues on the project issue tracker using tracer-bullet vertical slices. Use when user wants to convert a plan into issues, create implementation tickets, or break down work into issues.","https:\u002F\u002Fgithub.com\u002Fnexuslinkproductions\u002Fyuri-os\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fto-issues\u002FSKILL.md",[],[]]