shekhar23/claude-zero-to-hero-android-kmp/android-kmp-shared-module

Claude Code and agent skill by shekhar23/claude-zero-to-hero-android-kmp

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

KMP shared module setup — expect/actual, commonMain/androidMain/iosMain source sets, what belongs in shared vs platform. Use when adding KMP support, creating a shared module, splitting Android code for multiplatform, or working with expect/actual declarations. Trigger on: "KMP", "multiplatform", "shared module", "commonMain", "expect/actual", "iOS shared", "kotlin multiplatform".

Install

npx vskill@latest install shekhar23/claude-zero-to-hero-android-kmp/android-kmp-shared-module

SKILL.md

KMP Shared Module

Gradle setup (build.gradle.kts)

kotlin
plugins {
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.androidLibrary)
}
kotlin {
androidTarget {
compilations.all { kotlinOptions { jvmTarget = "11" } }
}
iosX64(); iosArm64(); iosSimulatorArm64()
sourceSets {
commonMain.dependencies {
implementation(libs.kotlinx.coroutines.core)
implementation(libs.kotlinx.serialization.json)
implementation(libs.ktor.client.core)
}
androidMain.dependencies {
implementation(libs.ktor.client.okhttp)
}
iosMain.dependencies {
implementation(libs.ktor.client.darwin)
}
}
}
android {
namespace = "com.example.shared"
compileSdk = libs.versions.compileSdk.get().toInt()
}

What belongs in commonMain

Put in sharedKeep platform-specific
Domain modelsAndroid Context usage
Repository interfacesRoom / SQLDelight Android config
Use casesCompose UI
Ktor HTTP client callsAndroid permissions
kotlinx.serialization DTOsPlatform file paths
kotlinx.coroutines flowsFirebase (Android only)
Feature flag interfacesPlay Billing

expect / actual pattern

kotlin
// commonMain
expect class PlatformInfo() {
val name: String
}
// androidMain
actual class PlatformInfo actual constructor() {
actual val name: String = "Android ${android.os.Build.VERSION.SDK_INT}"
}
// iosMain
actual class PlatformInfo actual constructor() {
actual val name: String = UIDevice.currentDevice.systemName()
}

Repository interface in shared, impl per platform

kotlin
// commonMain — core:domain
interface TaskRepository {
fun getTasks(): Flow<List<Task>>
suspend fun syncTasks(): EmptyResult<DataError>
}
// androidMain — core:data (Android module)
class TaskRepositoryImpl(
private val dao: TaskDao, // Room — Android only
private val api: TaskApi,
) : TaskRepository { ... }

Checklist

  • [ ] No android.* imports in commonMain
  • [ ] expect/actual only for truly platform-divergent behaviour
  • [ ] Coroutines and serialization come from KMP-compatible artifacts
  • [ ] Ktor engine injected per platform (OkHttp / Darwin)
  • [ ] Domain models are plain Kotlin data classes — no Android annotations

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/shekhar23/claude-zero-to-hero-android-kmp/android-kmp-shared-module/badge)](https://verified-skill.com/skills/shekhar23/claude-zero-to-hero-android-kmp/android-kmp-shared-module)

Something wrong with this skill or its page? Tell us.