skillfed

kotlin-multiplatform

This skill equips you to develop applications that run seamlessly across multiple platforms—Android, iOS, desktop, and web—by leveraging shared Kotlin codebases. Learn to structure projects for maximum code reuse while handling platform-specific implementations efficiently. Master the patterns and tools that make Kotlin Multiplatform a practical choice for teams building truly portable applications.

kotlin-multiplatform (KMP) equips you to develop applications running seamlessly across Android, iOS, desktop, and web by leveraging shared Kotlin codebases. It lets you write business logic once and reuse it across platforms while handling platform-specific implementations efficiently, reducing duplication and maintenance overhead.

AI-generated summary based on this skill's SKILL.md

85 20 MIT updated by travisjneuman

Install

travisjneuman/.claude/kotlin-multiplatform · repository language: JavaScript

CLI (skillfed)coming soon
git clone https://github.com/travisjneuman/.claude
cp -r .claude/skills/kotlin-multiplatform ~/.claude/skills/kotlin-multiplatform

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

What is kotlin-multiplatform and how does it enable cross-platform development?

kotlin-multiplatform (KMP) equips you to develop applications running seamlessly across Android, iOS, desktop, and web by leveraging shared Kotlin codebases. It lets you write business logic once and reuse it across platforms while handling platform-specific implementations efficiently, reducing duplication and maintenance overhead.

How do you set up a kotlin-multiplatform project with shared business logic?

kotlin-multiplatform project setup involves organizing code into shared modules containing business logic and platform-specific modules for UI and native integrations. You define common interfaces in the shared layer, then implement platform-specific variants. This structure maximizes code reuse while keeping platform-specific concerns isolated and maintainable.

What is the expect/actual pattern in kotlin-multiplatform?

The expect/actual pattern in kotlin-multiplatform lets you declare platform-agnostic interfaces (expect) in shared code, then provide platform-specific implementations (actual) for each target. This enables kotlin-multiplatform to handle differences between Android, iOS, desktop, and web without duplicating business logic or cluttering shared modules.

Can you use Compose Multiplatform for shared UI across multiple platforms?

Yes. Compose Multiplatform (CMP) lets kotlin-multiplatform projects share UI code across Android, iOS, desktop, and web using Kotlin and Jetpack Compose. This reduces UI duplication significantly, though platform-specific customizations remain possible when needed for optimal user experience on each target.

How do kotlin-multiplatform, Ktor, SQLDelight, and coroutines work together?

kotlin-multiplatform integrates Ktor for cross-platform HTTP networking, SQLDelight for local storage, and coroutines for async operations—all sharing code across platforms. This combination lets you build complete multiplatform applications with consistent networking, persistence, and concurrency patterns without rewriting for each platform.

What are kotlin-multiplatform best practices for building portable applications?

kotlin-multiplatform best practices include: structure projects with clear shared/platform layers, use expect/actual judiciously for minimal platform code, leverage established libraries like Ktor and SQLDelight, write testable business logic in shared modules, and keep UI platform-specific unless using Compose Multiplatform. This approach maximizes code reuse and maintainability.

SKILL.md

rendered from the published skill — quoted content, verbatim

Kotlin Multiplatform Skill

Shared business logic and optional shared UI across Android, iOS, desktop, and web.


Project Structure

``` project/ ├── composeApp/ # Shared Compose UI (if using CMP) │ └── src/ │ ├── commonMain/ # Shared UI code │ ├── androidMain/ # Android-specific UI │ ├── iosMain/ # iOS-specific UI │ └── desktopMain/ # Desktop-specific UI ├── shared/ # Shared business logic (KMP) │ └── src/ │ ├── commonMain/ # Shared code │ │ └── kotlin/ │ │ ├── data/ # Repositories, data sources │ │ ├── domain/ # Use cases, models │ │ └── platform/ # expect declarations │ ├── androidMain/ # actual implementations │ ├── iosMain/ # actual implementations │ └── commonTest/

(truncated - see the full file via the links below)

Read as markdown · JSON record · Browse the source repository

File tree — 1 file
skills/kotlin-multiplatform/SKILL.md

Related skills

Tags

cross-platform-dev code-sharing kotlin-native mobile-desktop-web platform-abstraction expect-actual-pattern shared-ui-framework swift-kotlin-bridge multiplatform-testing kotlin-ecosystem