Capas de dominio y datos compartidas, interfaz nativa en cada plataforma.
Constitution — Kotlin Multiplatform
Version 1.0.0 · Ratified 2026-11-10
These principles hold for every spec, plan and task of the project. A spec may add rules; it never weakens these.
-
Shared domain and data layers. Models, use cases, repositories, networking (Ktor) and local storage (SQLDelight) live in
commonMain. Shared code references no UI types from either platform. -
Native UI on each platform. iOS uses SwiftUI and Android uses Jetpack Compose. Shared code exposes state as
Flowand suspend functions, adapted for Swift with SKIE or KMP-NativeCoroutines. -
expect/actual only for platform features.
expectandactualare used only where a platform capability is needed; otherwise an interface is injected. Eachactualhas a test on its own platform. -
A Swift-friendly API. The public API of the shared module is reviewed from the Swift side before it is merged. Types that come out awkward in Swift are wrapped, and the exported framework stays within its size budget.
-
Tests in commonTest. The domain and data layers are covered in
commonTest, which CI runs on the JVM and on the iOS simulator. A test that passes on only one target is a defect. -
One reproducible build. Kotlin, Gradle and library versions live in the version catalog. The shared module ships to iOS as an XCFramework through Swift Package Manager, built by CI, never from a laptop.