{"enrichment":{"faq":[{"a":"Kotlin Multiplatform helps you decide by weighing code reuse against platform-specific optimization needs. Share business logic, serialization, and domain models in commonMain when the logic is truly platform-agnostic. Keep platform-specific code (UI, native APIs, performance-critical paths) in androidMain, iosMain, or jvmMain. The kotlin-multiplatform skill guides you through this trade-off analysis to avoid leaky abstractions while maximizing shared code.","q":"Should I share this code across Android, iOS and desktop?"},{"a":"Kotlin Multiplatform uses a source set hierarchy to organize code by platform scope. Place truly cross-platform logic in commonMain. Use androidMain and iosMain for platform-specific implementations. For JVM-only libraries shared between Android and desktop, use the jvmAndroid source set to avoid duplication. The kotlin-multiplatform skill teaches you to evaluate each module's dependencies and constraints to choose the right placement.","q":"Where do I put my code: commonMain, androidMain, or iosMain?"},{"a":"Kotlin Multiplatform's expect/actual mechanism lets you define an interface in commonMain and provide platform-specific implementations in androidMain, iosMain, or other targets. Use expect/actual for crypto, file I/O, or native APIs that vary by platform. Best practices include keeping expect declarations minimal, avoiding leaky abstractions, and testing each actual implementation. The kotlin-multiplatform skill covers real-world examples like serialization and platform abstraction.","q":"What are expect/actual patterns and best practices?"},{"a":"The jvmAndroid source set eliminates duplication when a library (like Jackson for serialization) runs on both JVM and Android but not on iOS or web. Kotlin Multiplatform's jvmAndroid pattern lets you write the code once instead of repeating it in androidMain and jvmMain. This skill explains when jvmAndroid is appropriate and how it fits into your overall architecture without creating brittle dependencies.","q":"When should I use the jvmAndroid source set?"},{"a":"Kotlin Multiplatform projects organize code into a hierarchy: commonMain for shared logic, intermediate source sets (jvmAndroid) for platform pairs, and leaf source sets (androidMain, iosMain, jvmMain) for platform-specific code. The kotlin-multiplatform skill teaches you to design this hierarchy to maximize reuse, minimize maintenance burden, and future-proof your architecture for web and wasm targets as your project grows.","q":"How do I structure a Kotlin Multiplatform project?"},{"a":"Kotlin Multiplatform reduces duplication by sharing business logic, but poor abstraction design creates leaky abstractions that force platform-specific workarounds. The kotlin-multiplatform skill helps you identify which code genuinely belongs in commonMain versus what should stay platform-specific. Use expect/actual for true platform variations, not as a workaround for incomplete abstractions. This approach keeps your codebase maintainable as you add web and wasm targets.","q":"How do I avoid code duplication and leaky abstractions in KMP?"}],"shadow_tags":["architecture-patterns","code-sharing-strategy","platform-abstraction","source-set-organization","cross-platform-design","expect-actual-mechanics","jvm-layer-pattern","multiplatform-libraries","future-target-readiness","abstraction-boundaries"],"summary_rewrite":"Kotlin Multiplatform lets you write business logic once and deploy it across Android, iOS, web, and desktop targets. This skill helps you evaluate the trade-offs between code sharing and platform-specific optimization, ensuring your architecture decisions align with your project's performance and maintenance goals."},"files":[{"bytes":14542,"path":".claude/skills/kotlin-multiplatform/SKILL.md","sha256":"355a91b8d9f50396aaae3876853cf1368f564ff9d54a456848b41565a9516b2f","url":"https://skillfed.io/files/vitorpamplona/amethyst/kotlin-multiplatform/91904f0a/SKILL.md"}],"id":"vitorpamplona/amethyst/kotlin-multiplatform","links":{"html":"https://skillfed.io/vitorpamplona/amethyst/kotlin-multiplatform","md":"https://skillfed.io/vitorpamplona/amethyst/kotlin-multiplatform.md","repo":"https://github.com/vitorpamplona/amethyst"},"meta":{"agents_supported":["claude-code"],"first_seen":"2026-07-28","forks":212,"language":"Kotlin","last_updated":"2026-07-28","license":"MIT","name":"kotlin-multiplatform","publisher":"vitorpamplona","stars":1565},"relations":{"similar":[{"id":"vitorpamplona/amethyst/gradle-expert"},{"id":"travisjneuman/.claude/kotlin-multiplatform"},{"id":"vitorpamplona/amethyst/quartz-integration"},{"id":"vitorpamplona/amethyst/desktop-expert"},{"id":"vitorpamplona/amethyst/android-expert"},{"id":"Tencent-TDS/KuiklyUI-AI/kuikly-multi-module-config"},{"id":"travisjneuman/.claude/android-development"},{"id":"vitorpamplona/amethyst/feed-patterns"},{"id":"aldefy/compose-skill/compose-expert"},{"id":"affaan-m/ECC/compose-multiplatform-patterns"}]},"slug":{"owner":"vitorpamplona","repo":"amethyst","skill":"kotlin-multiplatform"},"version":"91904f0a"}
