kotlin-multiplatform

kotlin-multiplatform

Kotlin Multiplatform - shared code, expect/actual, iOS integration

2звезд
1форков
Обновлено 1/20/2026
SKILL.md
readonlyread-only
name
kotlin-multiplatform
description

Kotlin Multiplatform - shared code, expect/actual, iOS integration

version
"1.0.0"

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")

You Might Also Like

Related Skills

coding-agent

coding-agent

179Kdev-codegen

Run Codex CLI, Claude Code, OpenCode, or Pi Coding Agent via background process for programmatic control.

add-uint-support

add-uint-support

97Kdev-codegen

Add unsigned integer (uint) type support to PyTorch operators by updating AT_DISPATCH macros. Use when adding support for uint16, uint32, uint64 types to operators, kernels, or when user mentions enabling unsigned types, barebones unsigned types, or uint support.

at-dispatch-v2

at-dispatch-v2

97Kdev-codegen

Convert PyTorch AT_DISPATCH macros to AT_DISPATCH_V2 format in ATen C++ code. Use when porting AT_DISPATCH_ALL_TYPES_AND*, AT_DISPATCH_FLOATING_TYPES*, or other dispatch macros to the new v2 API. For ATen kernel files, CUDA kernels, and native operator implementations.

skill-writer

skill-writer

97Kdev-codegen

Guide users through creating Agent Skills for Claude Code. Use when the user wants to create, write, author, or design a new Skill, or needs help with SKILL.md files, frontmatter, or skill structure.

Implements JavaScript classes in C++ using JavaScriptCore. Use when creating new JS classes with C++ bindings, prototypes, or constructors.

Creates JavaScript classes using Bun's Zig bindings generator (.classes.ts). Use when implementing new JS APIs in Zig with JSC integration.