Compose Multiplatform Platform Split Guide
Senior-level rules for Compose Multiplatform: what belongs in commonMain, when to use expect/actual vs interface + DI, and how to validate iOS, desktop and web targets.
Dev & CodingAdvanced★ 300⑂ 25AI score 9/10Last updated: Oct 2, 2026
What it does
- Placement rules: ViewModels, Contracts and repository interfaces must live in
commonMain; platform source sets only hold paths, bindings and translations. - Bridge decision table: stateful services (secure storage, players, auth, analytics) become
commonMaininterfaces bound in platform Koin modules;expect/actualis reserved for tiny stateless hooks. - iOS/Swift interop: SKIE as the default bridge, no hand-written
Flow/suspendwrappers, and a small, concrete exported Swift surface. - Desktop & web pitfalls: missing
kotlinx-coroutines-swingforDispatchers.Main, per-platform DataStore paths, wasm limits. - Verification gates:
check-commonmain-imports.shblocksjava.*,android.*,LocalContextandRfrom shared code and flags missingactuals.
Who it's for
- Teams shipping Compose Multiplatform apps to Android, iOS, desktop and web
- Developers tired of shared code that compiles on Android but breaks the iOS link
- Leads who want Koin + SKIE conventions enforced like an automated code review
Examples
- "Add secure storage" → the skill routes it to a
commonMaininterface with androidMain/iosMain adapters bound via Koin, notexpect/actual. - "Consume this ViewModel Flow from Swift" → it points to SKIE setup and version checks in
libs.versions.tomlinstead of a hand-rolled collector. - "Desktop UI never updates" → it checks the Main dispatcher, multiplatform lifecycle artifacts and
viewModelScopewiring.
· · · 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/Meet-Miyani/compose-skill/HEAD/skills/compose-platform/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/compose-platform folder from the GitHub repo Meet-Miyani/compose-skill into my ~/.claude/skills/compose-platform/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/Meet-Miyani/compose-skill.git /tmp/compose-skill && mkdir -p ~/.claude/skills && cp -r /tmp/compose-skill/skills/* ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Open a terminal.
- Clone the repo:
git clone https://github.com/Meet-Miyani/compose-skill.git - Create the skills folder:
mkdir -p ~/.claude/skills - Copy the skills:
cp -r compose-skill/skills/* ~/.claude/skills/(copy all of them — this skill references sibling skills such ascompose-architectureandcompose-ui). - Restart Claude Code, open your KMP project, and ask something like "review my commonMain placement" to trigger it.
- To use the verification script, make it executable:
chmod +x ~/.claude/skills/compose-platform/scripts/run-checks.sh.
View source on GitHub ↗License: MIT