Compose Multiplatform Patterns
A practical KMP/CMP pattern reference for shipping one Compose codebase across Android, iOS, Desktop and Web.
Dev & CodingAdvanced★ 298⑂ 25AI score 9/10Last updated: Jul 31, 2026
What it does
- Teaches correct
expect/actualusage for functions, classes and@Composabledeclarations. - Lays out the
commonMain/androidMain/iosMain/desktopMain/wasmJsMainstructure and the 80–95% shared-code target. - Clarifies cross-platform APIs (
LocalDensity,LocalWindowInfo,BoxWithConstraints) versus Android-only ones (LocalConfiguration). - Covers Compose Resources for fonts/images/strings, bidirectional Compose ↔ SwiftUI/UIKit interop code, plus a candid "what does NOT work" list (iOS drawer swipe conflict,
imePadding(), JVM-only APIs banned in commonMain). - Includes an anti-pattern table against reflection-based platform detection, leaking
Context, and infinite coroutine animation loops.
Who it's for
- Mobile/desktop engineers building with Kotlin Multiplatform + Compose Multiplatform.
- Teams comfortable with Jetpack Compose but new to iOS or Wasm targets.
- Developers embedding Compose screens into SwiftUI apps (or the reverse).
Examples
- "How do I split a share sheet between Android and iOS?" → get a ready
expect fun openShareSheetplus bothactualimplementations. - "Keyboard insets don't work on iOS" → the gotchas section explains
imePadding()limits on iOS and the workaround. - "I need window size in shared code" → use
LocalWindowInfo.current.containerSizeinstead of Android-onlyLocalConfiguration.
· · · Install guide · · ·
Try it now, no install
Paste this into Claude to use the skill without installing anything.
Read the instructions in this file and follow them to help me: https://raw.githubusercontent.com/AThevon/genjutsu/HEAD/skills/_jutsu/compose-multiplatform/SKILL.md What I want: (describe your task here)
If Claude can't open the link, open it yourself and paste the contents instead.
↓ If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on Claude Skill Mart. Copy the skills/_jutsu/compose-multiplatform folder from the GitHub repo AThevon/genjutsu into my ~/.claude/skills/compose-multiplatform/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/AThevon/genjutsu.git /tmp/genjutsu && mkdir -p ~/.claude/skills && cp -r /tmp/genjutsu/skills/_jutsu/compose-multiplatform ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Open a terminal and clone the repo:
git clone https://github.com/AThevon/genjutsu.git - Create the skills folder:
mkdir -p ~/.claude/skills - Copy this skill:
cp -r genjutsu/skills/_jutsu/compose-multiplatform ~/.claude/skills/ - Verify the bundled
references/files (e.g.cmp-interop.md) came along. - To also use linked sibling skills (
compose-motion, etc.), copy them all:cp -r genjutsu/skills/_jutsu/* ~/.claude/skills/ - Restart Claude Code, then ask something like "review my Compose Multiplatform module structure" to trigger the skill.
View source on GitHub ↗License: MIT