What problem does it solve?
This Skill provides expert guidance on making platform abstraction decisions in Kotlin Multiplatform (KMP) projects, ensuring efficient code sharing, correct source set placement, and effective use of expect/actual patterns.
Core Features & Use Cases
- Abstraction Decision Tree: Guides you on when to abstract code versus keeping it platform-specific.
- Source Set Guidance: Explains the mental model of source sets and the purpose of
commonMain, jvmAndroid, androidMain, jvmMain, and iosMain.
- expect/actual Mechanics: Details how to implement platform-dependent code using
expect and actual declarations.
- Target-Specific Advice: Covers current targets (Android, JVM, iOS) and future considerations (Web/Wasm).
- Integration with Other Skills: Guides when to invoke
gradle-expert for dependency issues.
- Use Case: You're unsure if a piece of business logic should go into
commonMain or if a UI component needs platform-specific implementation. This Skill provides a clear decision-making process and examples.
Quick Start
Use the kotlin-multiplatform skill to decide where to place a new feature module in your KMP project.