arisguimera/mobiai-core/mobiai-kmp

Claude Code and agent skill by arisguimera/mobiai-core

Trust tier 2
  • community
LLM review pending
Source check pending

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

Use when working on a Kotlin Multiplatform project — shared code, expect/actual declarations, platform-specific implementations, building and testing.

Install

npx vskill@latest install arisguimera/mobiai-core/mobiai-kmp

SKILL.md

Kotlin Multiplatform (KMP)

Community contribution welcome! Help flesh out this skill with KMP patterns, common pitfalls, and real-world workflows.

Guide for working with Kotlin Multiplatform projects.

When to Use

  • Working on shared Kotlin code that targets multiple platforms
  • Debugging platform-specific issues in KMP projects
  • Writing tests for shared modules

Detecting a KMP Project

bash
# Check for KMP indicators
ls shared/ composeApp/ iosApp/ 2>/dev/null
grep -r "kotlin(\"multiplatform\")\|KotlinMultiplatform" build.gradle* --include="*.gradle*" | head -5
cat shared/build.gradle.kts | head -30

Project Structure

project/
shared/ # Shared KMP module
src/
commonMain/kotlin/ # Shared code (all platforms)
commonTest/kotlin/ # Shared tests
androidMain/kotlin/ # Android-specific implementations
iosMain/kotlin/ # iOS-specific implementations
build.gradle.kts
composeApp/ # Android app (Compose)
src/main/
iosApp/ # iOS app (SwiftUI/UIKit)
iosApp.xcodeproj
build.gradle.kts # Root build file

Key Concepts

expect/actual

Shared interface with platform-specific implementations:

kotlin
// commonMain
expect class PlatformLogger() {
fun log(message: String)
}
// androidMain
actual class PlatformLogger {
actual fun log(message: String) = Log.d("KMP", message)
}
// iosMain
actual class PlatformLogger {
actual fun log(message: String) = NSLog(message)
}
Finding expect/actual declarations
bash
# Find expect declarations
grep -r "expect " shared/src/commonMain --include="*.kt" -l
# Find actual implementations
grep -r "actual " shared/src/androidMain --include="*.kt" -l
grep -r "actual " shared/src/iosMain --include="*.kt" -l

Build Commands

bash
# Build shared module
./gradlew :shared:build
# Run common tests
./gradlew :shared:testDebugUnitTest
# Run iOS tests (on macOS)
./gradlew :shared:iosSimulatorArm64Test
# Build Android app
./gradlew :composeApp:assembleDebug
# Build iOS framework
./gradlew :shared:linkDebugFrameworkIosSimulatorArm64

Testing

Shared Tests (commonTest)
kotlin
// shared/src/commonTest/kotlin/MyTest.kt
class MyTest {
@Test
fun testSharedLogic() {
val result = calculate(2, 3)
assertEquals(5, result)
}
}
Platform-Specific Tests
kotlin
// shared/src/androidTest/kotlin/AndroidSpecificTest.kt
class AndroidSpecificTest {
@Test
fun testAndroidImplementation() { ... }
}

Common Issues

  • iOS build fails: Check that the shared framework is linked correctly in Xcode
  • expect/actual mismatch: Ensure all expect declarations have actual implementations for all targets
  • Dependency conflicts: Use api() vs implementation() carefully in shared module
  • Kotlin/Native memory model: Be aware of the new memory model (default since Kotlin 1.7.20)

Tracing Bugs

  1. Determine if the bug is in shared or platform code — check the stack trace
  2. If shared: fix in commonMain, test in commonTest
  3. If platform-specific: fix in androidMain/iosMain, test in platform-specific test source set
  4. If the bug manifests differently per platform: check expect/actual implementations

Want to improve this skill? Share your KMP expertise, Compose Multiplatform patterns, and platform bridging tips via a PR.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

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

Source

Popularity

Repository stars
391
Repository forks
12
7-day trend score
30

Stars and forks are for the whole GitHub repository, not this skill alone. 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/arisguimera/mobiai-core/mobiai-kmp/badge)](https://verified-skill.com/skills/arisguimera/mobiai-core/mobiai-kmp)

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