kotlin-platform-kmp-bridges

Review Kotlin Multiplatform source-set placement and expect/actual bridge design.

11|2|Updated Sep 8, 2015
One-click install
npx skills add https://github.com/jitrapon/astro-mobile --skill kotlin-platform-kmp-bridges-jitrapon
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kotlin-platform-kmp-bridges
Source: https://github.com/jitrapon/astro-mobile/tree/main/.claude/skills/kotlin-platform-kmp-bridges
Command: npx skills add https://github.com/jitrapon/astro-mobile --skill kotlin-platform-kmp-bridges-jitrapon

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you design and review platform-specific integrations in Kotlin Multiplatform projects so shared code stays clean, testable, and correctly separated from native concerns.

Core Features & Use Cases

  • Source-set placement guidance: Decide whether logic belongs in commonMain, an intermediate source set, or a platform source set.
  • Bridge architecture review: Evaluate when to use interfaces, entry-point wiring, or expect/actual for native dependencies.
  • Boundary protection: Prevent Android, iOS, and vendor SDK types from leaking into shared business logic.
  • Use case: Review a KMP feature that needs device APIs, then propose the smallest valid shared-to-native bridge with minimal duplication and strong testability.

Quick Start

Ask me to review a Kotlin Multiplatform bridge and recommend the correct source-set, expect/actual, and entry-point wiring strategy.

Frequently Asked Questions about kotlin-platform-kmp-bridges

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

FAQPage Schema
How do I structure Kotlin Multiplatform platform bridges to keep shared code clean?

To structure Kotlin Multiplatform platform bridges cleanly, enforce a correct common, intermediate, and platform source-set split. Ensure minimal expect/actual usage and prevent vendor SDK types from leaking into shared business logic.

When should I use expect/actual versus interfaces in KMP projects?

Use expect/actual in KMP projects only when minimally justified for platform API access, preferring interfaces or entry-point wiring for native dependencies to maintain stronger testability across targets.

What is the best way to prevent Android and iOS SDK leakage in Kotlin Multiplatform shared code?

Preventing Android and iOS SDK leakage in Kotlin Multiplatform shared code requires strict boundary protection. Ensure platform-specific types remain entirely within platform source sets and never enter commonMain.

How do I decide if logic belongs in commonMain or an intermediate source set in KMP?

Deciding if logic belongs in commonMain or an intermediate source set in KMP depends on hierarchical sharing needs. Place shared logic in intermediate sets when it targets specific platform subsets rather than all targets.

How do I wire platform-specific entry points for native dependencies in Kotlin Multiplatform?

Wire platform-specific entry points for native dependencies in Kotlin Multiplatform by injecting platform implementations via interfaces, ensuring shared code remains testable and correctly separated from native concerns.

Can I review my KMP feature to ensure testable abstractions across iOS and Android targets?

You can review a KMP feature for testable abstractions by validating the shared-to-native bridge. This ensures correct source-set placement, minimal duplication, and strong testability across iOS and Android targets.