kotlin-multiplatform-expect-actual

Installation
SKILL.md

Kotlin Multiplatform: expect/actual boundaries

Core principle

Keep common APIs semantic and stable. Put platform mechanics behind small expect/actual declarations or interfaces, and keep Android/iOS/Desktop details out of commonMain.

Boundary procedure

  1. Name the product capability in common terms: share text, read clipboard, request haptic feedback, resolve current region.
  2. Check whether common callers need fakes, injected dependencies, lifecycle ownership, or runtime implementation choice.
  3. Pick the smallest boundary from the table below.
  4. Keep the common signature free of platform types and platform vocabulary.
  5. Put business branching in common code; keep actuals/platform bindings as translation layers.
  6. Validate by compiling every affected source set and testing common code with a fake where possible.

Choose the boundary

Installs
810
GitHub Stars
848
First Seen
May 12, 2026
kotlin-multiplatform-expect-actual — chrisbanes/skills