Loading...
Loading...
Owns platform splits for Compose Multiplatform apps: places declarations in commonMain, chooses expect/actual vs interface plus DI, wires host adapters and ports, and validates iOS/Swift interop, desktop and web targets, and platform lifecycle. Use when touching commonMain, expect, actual, iosMain, Swift, SKIE, Flow to Swift, desktop, wasm, web target, or platform-specific code. Do NOT use for routing or architecture (compose-architecture), feature slices (compose-feature), composables or resources (compose-ui), repositories or persistence (compose-data), or Gradle target setup (compose-project).
npx skill4agent add meet-miyani/compose-skill compose-platformcompose-architectureexpectactualtemplates/corecompose-architecturegradle/libs.versions.tomlcommonMain| Task | Use instead |
|---|---|
| Route first: decide the task path and files to read | the |
| Gradle target setup, convention plugins, version catalog, CI | the |
| ViewModels, Contracts, repositories, Ktor, Room, DataStore, Paging | the |
| Composables, stability, resources, images | the |
## Project decisionscompose-architectureexisting-projects.mdcommonMaincommonMainjava.*javax.*android.*LocalContextRkotlin.time.InstantRescompose-uicheck-commonmain-imports.shexpectactualcommonMainexpectactualwithTransactioncommonMainuseWriterConnectionimmediateTransactioncompose-datacompose-dataOkioSerializerOkioStorageviewModelScopecollectAsStateWithLifecycleandroidx.lifecyclekotlinx-coroutines-swingDispatchers.Main.immediateFlowsuspendcommonMainasyncAsyncSequencesuspendasyncFlowAsyncSequencelibs.versions.tomlUnitKotlinUnitsharing-and-bridges.mdcommonMainexpectactualgradle/libs.versions.toml| Need | Level |
|---|---|
| Same screens on every target | Fully shared UI plus ViewModel in |
| Native UI with shared logic | Shared ViewModel in |
| Fully native screens | Shared repository only; ViewModels stay per platform |
| Need | Bridge |
|---|---|
| Service with state, lifecycle, async, fakes, or runtime choice | Interface in |
| Stateless one-liner with no domain meaning (UUID, platform name) | |
| One differing leaf in an otherwise shared composable | Shared composable calling an |
| Fully differing screens | Separate screens behind a common navigation contract |
// commonMain: semantic port, no platform types
interface NoteLockStorage {
suspend fun lock(noteId: Long, secret: String)
}
// androidMain/iosMain: adapter named after the implementation,
// bound as the port interface in a platform Koin modulescripts/composekit/run-checks.shscripts/run-checks.sh <project-root>check-commonmain-imports.sh^import (java|javax|android)\.LocalContextRsrc/commonMain/check-commonmain-imports.shexpectactualexpectactualwithTransactioncommonMainlibs.versions.tomlcommonMainexpectactualFlowsuspend