kotlin-multiplatform

Apply the Abstraction Decision Tree to place Kotlin Multiplatform code in commonMain or platform-specific source sets.

1|Updated Apr 2, 2026
One-click install
npx skills add https://github.com/leogallego/ansible-jane --skill kotlin-multiplatform-leogallego
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kotlin-multiplatform
Source: https://github.com/leogallego/ansible-jane/tree/main/skills/kotlin-kmp-abstraction-decision
Command: npx skills add https://github.com/leogallego/ansible-jane --skill kotlin-multiplatform-leogallego

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Platform architecture decisions across Kotlin Multiplatform projects can be opaque, causing teams to misplace code in commonMain or platform-specific source sets and struggle with expect/actual versus the jvmAndroid pattern.

Core Features & Use Cases

  • Guidance on when to share code across platforms and when to keep it platform-specific
  • A decision-tree framework for placing code in commonMain, platform-specific source sets, or the jvmAndroid pattern
  • Practical considerations for future web/wasm targets and migration paths to kotlinx.serialization and ktor

Quick Start

Design Kotlin Multiplatform modules to determine cross‑platform sharing; ask about platform APIs, dependencies, and future targets, then apply the decision tree to place code appropriately.

Frequently Asked Questions about kotlin-multiplatform

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I decide what Kotlin code to share in commonMain versus platform-specific source sets?

To decide what Kotlin code to share, evaluate platform APIs and dependencies using an Abstraction Decision Tree to determine if code belongs in commonMain or platform-specific source sets like androidMain, jvmMain, or iosMain.

When should I use expect/actual versus the jvmAndroid pattern in Kotlin Multiplatform?

Use expect/actual versus the jvmAndroid pattern in Kotlin Multiplatform by applying a decision-tree framework that assesses cross-platform reuse requirements based on your specific platform APIs and dependencies.

How do I migrate Kotlin Multiplatform code to support future web and wasm targets?

To migrate Kotlin Multiplatform code for future web and wasm targets, guide your migrations toward kotlinx.serialization and ktor while validating build configurations and dependencies for compatibility.

What is the best way to structure Kotlin Multiplatform modules for cross-platform reuse?

The best way to structure Kotlin Multiplatform modules is to ask about platform APIs, dependencies, and future targets, then apply a decision tree to place code appropriately across commonMain and platform-specific source sets.

Does placing code in commonMain cause compatibility issues with platform-specific dependencies?

Placing code in commonMain can cause compatibility issues if platform APIs and dependencies are not properly assessed, which is why an Abstraction Decision Tree is needed to validate cross-platform reuse and ensure correct placement.