Agent skill
kotlin-multiplatform
Kotlin Multiplatform - shared code, expect/actual, iOS integration
Install this agent skill to your Project
npx add-skill https://github.com/pluginagentmarketplace/custom-plugin-kotlin/tree/main/skills/kotlin-multiplatform
SKILL.md
Kotlin Multiplatform Skill
Build cross-platform applications with shared Kotlin code.
Topics Covered
Project Setup
kotlin {
androidTarget()
listOf(iosX64(), iosArm64(), iosSimulatorArm64()).forEach {
it.binaries.framework { baseName = "Shared"; isStatic = true }
}
sourceSets {
commonMain.dependencies {
implementation("io.ktor:ktor-client-core:2.3.8")
}
androidMain.dependencies { implementation("io.ktor:ktor-client-okhttp:2.3.8") }
iosMain.dependencies { implementation("io.ktor:ktor-client-darwin:2.3.8") }
}
}
expect/actual
// commonMain
expect class SecureStorage { fun get(key: String): String? }
// androidMain
actual class SecureStorage { actual fun get(key: String) = prefs.getString(key, null) }
// iosMain
actual class SecureStorage { actual fun get(key: String) = KeychainWrapper.get(key) }
Troubleshooting
| Issue | Resolution |
|---|---|
| "No actual for expect" | Add implementation in platform source set |
| iOS framework not found | Run linkDebugFrameworkIos task |
Usage
Skill("kotlin-multiplatform")
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
kotlin-serialization
kotlinx.serialization - JSON, Protobuf, custom serializers
kotlin-testing
Kotlin testing - JUnit 5, MockK, Kotest, coroutine testing
kotlin-spring
Spring Boot with Kotlin - controllers, services, coroutines
kotlin-di
Dependency Injection - Hilt, Koin, scopes, testing
kotlin-fundamentals
Kotlin language fundamentals - syntax, null safety, data classes, extensions
kotlin-android
Modern Android development - Jetpack, Compose, Architecture Components
Didn't find tool you were looking for?