kotlin-platform-kmp-bridges

Design Kotlin Multiplatform source-set hierarchies and expect/actual boundaries.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Kotlin Multiplatform projects often struggle with placing platform-specific code in the right modules, maintaining clean boundaries between shared and native layers, and avoiding brittle expect/actual usage. This skill provides strict guidelines to maximize sharing at common source sets, ensure clear shared contracts, and keep platform specifics at the edges.

Core Features & Use Cases

  • Guidelines for source-set placement and hierarchical sharing to maximize code reuse across targets.
  • Strategies to minimize unnecessary expect/actual usage while preserving clean API boundaries.
  • Best practices for entry-point wiring and avoiding vendor leakage by keeping platform APIs within platform-specific modules.

Quick Start

Apply these guidelines to refactor a Kotlin Multiplatform project to ensure platform-specific code lives at the edges and shared code remains platform-agnostic.

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 source sets to maximize shared code?▼

Structure Kotlin Multiplatform source sets by utilizing intermediate source sets to maximize code reuse across targets. This hierarchical sharing approach keeps shared contracts platform-agnostic while pushing native specifics to the edges.

What is the best way to minimize expect/actual usage in a KMP project?▼

Minimize expect/actual usage in a KMP project by enforcing strict boundaries and preferring shared contracts in common source sets. Reserve expect/actual declarations only for preserving clean API boundaries, keeping platform specifics contained.

How do I prevent platform leakage in Kotlin Multiplatform modules?▼

Prevent platform leakage in Kotlin Multiplatform modules by applying strict guidelines for entry-point wiring and keeping platform APIs within platform-specific modules. This explicit wiring ensures native specifics remain contained at the edges.

Can I use intermediate source sets for sharing code across Android, iOS, and Desktop targets?▼

Yes, you can use intermediate source sets for sharing code across Android, iOS, and Desktop targets. This hierarchical sharing strategy maximizes platform-agnostic code reuse while maintaining clear API contracts for each specific target.

Why does my Kotlin Multiplatform project have brittle platform boundaries?▼

Kotlin Multiplatform projects become brittle when platform-specific code is misplaced or expect/actual usage is overused. Refactor by enforcing strict boundaries, placing native specifics at the edges, and maximizing shared code in common source sets.