kotlin-multiplatform

Guide Kotlin Multiplatform architecture decisions for source set placement and expect/actual patterns.

9|2|Updated Feb 14, 2026
One-click install
npx skills add https://github.com/dallay/corvus --skill kotlin-multiplatform-dallay
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kotlin-multiplatform
Source: https://github.com/dallay/corvus/tree/main/.agents/skills/kotlin-multiplatform
Command: npx skills add https://github.com/dallay/corvus --skill kotlin-multiplatform-dallay

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides expert guidance on making critical platform abstraction decisions within Kotlin Multiplatform (KMP) projects, ensuring efficient code sharing and maintainable architecture.

Core Features & Use Cases

  • Abstraction Guidance: Helps decide when to abstract code versus keeping it platform-specific.
  • Source Set Placement: Guides the correct placement of code across commonMain, jvmAndroid, and platform-specific source sets.
  • Expect/Actual Patterns: Explains and demonstrates the use of expect/actual for platform variance.
  • Use Case: When developing a new feature, this Skill helps you determine if a piece of logic should reside in commonMain for universal sharing, jvmAndroid for JVM-based platforms, or require platform-specific implementations using expect/actual.

Quick Start

Use the kotlin-multiplatform skill to decide where to place new code in a KMP project.

Frequently Asked Questions about kotlin-multiplatform

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

FAQPage Schema
How do I decide where to place new code in a Kotlin Multiplatform project?

To place new code in a Kotlin Multiplatform project, you must decide whether the logic is universal for `commonMain`, shared for JVM-based platforms in `jvmAndroid`, or requires platform-specific implementations using `expect`/`actual` declarations.

When should I use expect actual patterns for platform abstraction in KMP?

You should use `expect`/`actual` patterns in KMP when a feature requires platform-specific implementations for Android, JVM, or iOS, allowing you to define a common contract while providing separate underlying logic per platform source set.

What is the best way to share code between Android and JVM in Kotlin Multiplatform?

The best way to share code between Android and JVM is by utilizing the `jvmAndroid` source set, which allows you to write shared logic for JVM-based platforms before needing separate platform-specific source sets or `expect`/`actual` declarations.

Does this KMP architecture guidance support web and wasm targets?

This KMP architecture guidance focuses primarily on Android, JVM, and iOS targets, but it does factor in future considerations for web and wasm when making source set placement and platform abstraction decisions.

How do I configure build.gradle.kts for shared source sets in Kotlin Multiplatform?

Configuring `build.gradle.kts` for Kotlin Multiplatform involves defining source sets like `commonMain` and `jvmAndroid` to structure code sharing, which this Skill provides decision-making guidance for to ensure maintainable architecture.