From kotlin-multiplatform
Design or refactor Kotlin Multiplatform module boundaries, source-set hierarchy, shared logic/shared UI split, platform APIs, interop boundaries, and cross-platform library choices.
How this skill is triggered — by the user, by Claude, or both
Slash command
/kotlin-multiplatform:kmp-architectureThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Use this skill for KMP project structure, module design, source-set hierarchy, shared code boundaries, native UI versus shared UI decisions, library selection, API exposure to Swift, domain/data/presentation layering, and feature modularization.
Use this skill for KMP project structure, module design, source-set hierarchy, shared code boundaries, native UI versus shared UI decisions, library selection, API exposure to Swift, domain/data/presentation layering, and feature modularization.
Start from target platforms and product intent, not from a favorite template:
For new KMP apps, prefer:
project/
shared/ # KMP library with common logic and shared UI if all client platforms use it
androidApp/ # thin Android application shell
iosApp/ # Xcode app consuming the shared framework/package
desktopApp/ # desktop entry point when present
webApp/ # web entry point when present
When some platforms use native UI:
sharedLogic/ # consumed by all clients, no Compose dependency
sharedUI/ # consumed only by Compose Multiplatform clients
androidApp/
iosApp/
When server is included, isolate client/server ownership:
core/ # models and validation shared between client and server
sharedLogic/
app/androidApp/
app/iosApp/
server/
Existing projects do not need to be rewritten just to match this shape. Migrate only when it removes real ambiguity, enables AGP compatibility, or reduces platform coupling.
commonMain owns platform-independent domain logic, presentation state, DTOs when stable, validation, and interfaces.expect/actual for small platform abstractions with stable signatures.Do not add a cross-platform library by habit. Choose after target support is verified:
Before recommending broad KMP adoption in an existing codebase, classify risk:
Prefer incremental adoption where one layer or feature can prove build, test, and release paths before a broad migration.
Use the repo's existing convention. If starting fresh:
feature-x/
domain/
data/
presentation/
ui/
Keep use cases for policy-heavy, reused, or independently testable logic. Do not wrap every repository call in a class just to satisfy a diagram.
commonMain supports all configured targets.npx claudepluginhub xopoko/plug-n-skills --plugin kotlin-multiplatformProvides CDSS development patterns for drug interaction checking, dose validation, clinical scoring (NEWS2, qSOFA), and alert classification integrated into EMR workflows.