/vibe:kotlin-multiplatform-expertfrom vibe
Guides Kotlin Multiplatform project setup with expect/actual, Compose Multiplatform, Ktor, SQLDelight, kotlinx coroutines/serialization, and iOS interop. Use when developing Android apps with KMP.
Ships in vibe. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are an expert in Kotlin Multiplatform (KMP) — sharing logic (and increasingly UI) across Android, iOS, desktop, and web from a single Kotlin codebase. You set up the source set hierarchy, write expect/actual declarations, integrate Ktor for networking, SQLDelight for persistence, and Compose Multiplatform for shared UI when it makes sense (and views/SwiftUI bridges when it doesn't).
commonMain, androidMain, iosMain, commonTest)expect/actual declarationsappleMain, mobileMain)shared/
└── src/
├── commonMain/kotlin/... # platform-agnostic
├── androidMain/kotlin/...
├── iosMain/kotlin/... # iosArm64 + iosX64 + iosSimulatorArm64
├── commonTest/kotlin/...
└── ...
androidApp/
iosApp/
shared/build.gradle.kts:
plugins {
kotlin("multiplatform")
kotlin("plugin.serialization")
id("com.android.library")
id("app.cash.sqldelight")
id("org.jetbrains.compose") // Compose Multiplatform (optional)
id("org.jetbrains.kotlin.plugin.compose")
}
kotlin {
androidTarget()
iosArm64(); iosX64(); iosSimulatorArm64()
sourceSets {
commonMain.dependencies {
implementation("io.ktor:ktor-client-core:2.3.x")
implementation("io.ktor:ktor-client-content-negotiation:2.3.x")
implementation("io.ktor:ktor-serialization-kotlinx-json:2.3.x")
implementation("app.cash.sqldelight:runtime:2.x")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.x")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.x")
}
androidMain.dependencies {
implementation("io.ktor:ktor-client-okhttp:2.3.x")
implementation("app.cash.sqldelight:android-driver:2.x")
}
iosMain.dependencies {
implementation("io.ktor:ktor-client-darwin:2.3.x")
implementation("app.cash.sqldelight:native-driver:2.x")
}
}
}
expect / actualDefine a contract in commonMain, supply implementations per target:
// commonMain
expect class Platform {
val name: String
}
// androidMain
actual class Platform {
actual val name: String = "Android ${android.os.Build.VERSION.RELEASE}"
}
// iosMain
import platform.UIKit.UIDevice
actual class Platform {
actual val name: String = UIDevice.currentDevice.systemName() + " " +
UIDevice.currentDevice.systemVersion
}
Use expect/actual sparingly — most code stays in commonMain. Prefer dependency injection of platform implementations over expect class when the contract is non-trivial.
// commonMain
val client = HttpClient {
install(ContentNegotiation) { json(Json { ignoreUnknownKeys = true }) }
install(Logging) { level = LogLevel.INFO }
defaultRequest { url("https://api.example.com/") }
}
@Serializable data class User(val id: String, val name: String)
suspend fun getUser(id: String): User =
client.get("users/$id").body()
Engines: okhttp on Android, darwin on iOS, cio cross-platform fallback, js for browsers.
src/commonMain/sqldelight/com/example/db/User.sq:
CREATE TABLE User(
id TEXT NOT NULL PRIMARY KEY,
name TEXT NOT NULL
);
selectAll: SELECT * FROM User;
insert: INSERT OR REPLACE INTO User(id, name) VALUES (?, ?);
Generates type-safe Kotlin:
val driver: SqlDriver = /* AndroidSqliteDriver(...) on Android, NativeSqliteDriver(...) on iOS */
val db = AppDatabase(driver)
db.userQueries.insert(id = "1", name = "Ada")
val all: List<User> = db.userQueries.selectAll().executeAsList()
val flow: Flow<List<User>> = db.userQueries.selectAll().asFlow().mapToList(Dispatchers.IO)
Dispatchers.Default, Dispatchers.IO, Dispatchers.Main work across targets, with platform-appropriate implementations. Don't assume Dispatchers.Main.immediate exists everywhere — use plain Dispatchers.Main.
Single composable runs on Android, iOS, desktop, and (experimentally) wasm:
// commonMain
@Composable
fun App() {
MaterialTheme {
Text("Hello, ${Platform().name}")
}
}
Resources via compose.components.resources — Res.string.app_name, Res.drawable.logo, painterResource(Res.drawable.logo). Compose Multiplatform 1.7+ is production stable for iOS; views interop with SwiftUI via UIViewControllerRepresentable.
Build an XCFramework that the iOS app consumes:
kotlin {
val xcfName = "shared"
iosArm64 { binaries.framework { baseName = xcfName } }
iosSimulatorArm64 { binaries.framework { baseName = xcfName } }
}
iOS app imports it via SwiftPM (KMM Gradle plugin generates a Swift-friendly umbrella) or via the legacy CocoaPods plugin.
Swift code calls Kotlin:
import shared
let user = try await SharedSdk().getUser(id: "1")
Suspend functions are surfaced as async throws in Swift via Kotlin/Native's coroutines bridge.
commonMain and mark with expect class. Inject implementations instead — easier to test.expect class for the iOS XCFramework — every actual symbol must exist; missing one is a build error.core and engine in lockstep.AfterVersion blocks; missing migrations corrupt user databases on app upgrade.kotlin.native.binary.memoryModel=experimental is removed (it's the default now).Date/Instant — use kotlinx-datetime for cross-platform time.commonMain — won't compile for iOS. Use multiplatform alternatives (Ktor, SQLDelight, Realm KMP).iosArm64 (device), iosSimulatorArm64 (Apple Silicon sim), iosX64 (Intel sim, fading away).Use this when starting a cross-platform mobile app, sharing networking + persistence + business logic between an existing Android and iOS app, evaluating Compose Multiplatform vs SwiftUI for the UI layer, or wiring Kotlin into an existing Swift codebase. Pair with jetpack-compose-expert-mode for Android-specific Compose patterns and compose-performance-expert-mode for shared performance discipline.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
kmp, kotlin-multiplatform, compose-multiplatform, ktor, sqldelight, ios-interop
npx claudepluginhub anubhavg-icpl/vibe --plugin vibe5,304 skills in this plugin
/3d-pipelineChoose a 3D generation or reconstruction pipeline given input type, output format, and use case. Use when you need help with 3d pipeline./8-bit-orbit-video-templateHyperframes Video TemplateShip a premium template-mode Hyperframes composition with a ready default showcase and deterministic timeline behavior./a2a-agent-specProduce the Agent Card and skills schema for an agent that should be callable over A2A. Use when you need help with a2a agent spec.Other plugins' skills for the same job