kmp-core-feature

Guides creation of domain models, DTOs, and Ktor Client requests in a Kotlin Multiplatform shared module.

Updated Apr 1, 2026
One-click install
npx skills add https://github.com/DCueto/zen-track --skill kmp-core-feature-dcueto
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: kmp-core-feature
Source: https://github.com/DCueto/zen-track/tree/main/ZenTrackApp/.agents/skills/kmp-core-feature
Command: npx skills add https://github.com/DCueto/zen-track --skill kmp-core-feature-dcueto

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Adding or modifying shared code in a Kotlin Multiplatform project is error-prone: a single wrong import in commonMain can break compilation for both the JVM server and the Android app. This Skill provides strict procedural rules and code patterns for safely evolving the shared/ module of ZenTrack without violating platform purity or architectural conventions. ## Core Features & Use Cases - Domain Model & DTO Authoring: Enforces @Serializable data classes with portable types (String for UUIDs and ISO-8601 dates) and correct Request/Response naming conventions. - Ktor Client Networking: Standardizes suspend API functions, HttpClient configuration with CIO (JVM) and OkHttp (Android) engines, and Koin dependency registration. - expect/actual Discipline: Restricts expect/actual to simple platform adapters and routes complex logic through injected interfaces. - Use Case: When asked to add a new Task endpoint, the Skill walks through reading the database schema, writing the model and DTOs, implementing the Ktor call, registering it in Koin, and running cross-target compilation tests. ## Quick Start Add a new @Serializable Project model with its CreateProjectRequest DTO and a Ktor Client createProject endpoint in the shared module following the kmp-core-feature procedures.

Frequently Asked Questions about kmp-core-feature

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

FAQPage Schema
How do I add a shared domain model in Kotlin Multiplatform?▼

Create a @Serializable data class in shared/src/commonMain/kotlin/model/ using portable types: String for UUIDs and ISO-8601 dates instead of java.util.UUID or java.time. Optional fields use nullable types with null defaults, never lateinit var.

How to configure Ktor Client for both Android and JVM targets?▼

Declare an expect fun provideHttpClient() in commonMain, then provide actual implementations using the CIO engine in jvmMain and OkHttp engine in androidMain. Install ContentNegotiation with kotlinx.serialization in both, and inject the client via Koin.

Can I use java.util.UUID in Kotlin Multiplatform commonMain?▼

No, java.* and android.* imports are prohibited in commonMain because they break cross-target compilation. Use String for UUIDs, or declare an expect fun generateUuid() with actual implementations delegating to java.util.UUID in each platform source set.

When should I use expect/actual versus a Koin-injected interface?▼

Use expect/actual only for simple platform adapters with zero business logic, such as UUID generation. When the platform implementation is complex, define an interface in commonMain and inject platform-specific implementations with Koin from jvmMain or androidMain.

Why does my KMP shared module fail to compile on Android?▼

Compilation usually fails because commonMain contains java.* or androidx.* imports, or hardcoded dependency versions. Verify platform purity, move versions to gradle/libs.versions.toml, and run ./gradlew :shared:jvmTest and :shared:testDebugUnitTest to validate both targets.