Skip to content
Agentmart
Submit a tool

android-kmp-shared

Use when building Kotlin Multiplatform (KMP) shared modules, integrating with iOS, or sharing business logic across platforms.

Skill by prasad-vennam

IndexedMIT★ 11
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/prasad-vennam-android-kmp-shared

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Use when building Kotlin Multiplatform (KMP) shared modules, integrating with iOS, or sharing business logic across platforms.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/android-kmp-shared

What's inside

Skill name
android-kmp-shared
Description
Use when building Kotlin Multiplatform (KMP) shared modules, integrating with iOS, or sharing business logic across platforms.
License
MIT
Instructions
75 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Android Kotlin Multiplatform (KMP) 🌍🤝

Professional patterns for sharing code between Android and iOS using the next-generation Kotlin Multiplatform technology.

## ⚡ When to Use
- **Shared Business Logic**: Centralizing ViewModels, Use Cases, and Domain Models.
- **Data Layer Sharing**: Using Ktor (Network) and SQLDelight (Database) across platforms.
- **Modularization**: Creating a cross-platform library module.
- **Migration**: Moving from 100% native to shared logic.
- **Validation**: Building one logic for both apps (e.g., Auth, Calculations).

## 🏗️ The Multiplatform Architecture

- **`commonMain`**: The heart of the app. Pure Kotlin code shared by all platforms.
- **`androidMain`**: Platform-specific implementation for Android.
- **`iosMain`**: Platform-specific implementation for iOS (via Kotlin/Native).

## 🛠️ Essential Shared Tools

### 1. Ktor (Networking)
- **Benefit**: Async, multiplatform HTTP client.
- Use `ContentNegotiation` and `Serialization` for shared DTOs.

### 2. SQLDelight (Local Persistence)
- **Benefit**: Type-safe SQL queries that generate Kotlin code.
- Shared schema, platform-specific drivers (SQLite for Android, Native for iOS).

### 3. Koin (Dependency Injection)
- **Benefit**: Simple and lightweight DI that works across `commonMain`.

### 4. kotlinx-datetime
- Use for consistent date/time logic without platform-specific issues (java.time vs NSDate).

## 🚀 The `expect` / `actual` Pattern

- Use for platform-specific APIs when no shared library exists.
- **Rule**: Avoid `expect`/`actual` if a shared library is available.
- **Bad**: `expect fun getPlatformName(): String`
- **Good**: Use **interfaces** and **DI** to provide platform-specific implementations.

## 🏁 Shared Logic Workflow

- [ ] **ViewModel Sharing**: Use `multiplatform-viewmodel` library for consistent lifecycle mapping.
- [ ] **State Management**: Use `StateFlow` in `commonMain` to expose UI state.
- [ ] **iOS Interoperability**: Be aware of Swift/Kotlin memory management and `@ObjCName` for clean iOS APIs.

## 📦 Gradle Configuration

```kotlin
kotlin {
    androidTarget()
    iosX64()
    iosArm64()
    iosSimulatorArm64()

    sourceSets {
        commonMain.dependencies {
            implementation("io.ktor:ktor-client-core:2.3.0")
        }
    }
}
```

## 🧪 Testing with KMP

- Tests in `commonTest` run on both Android and iOS targets.
- Use `kotlin.test` for standard assertions (`assertTrue`, `assertEquals`).
- Mocking: Use libraries like **Mockative** or **KMock** for multiplatform mocking.

## 🔗 Related Resources
- [KMP Official Guide](https://kotlinlang.org/docs/multiplatform.html)
- [KMP Samples (By JetBrains)](https://github.com/Kotlin/kmp-samples)
- [Clean Architecture Skill](../android-clean-architecture/SKILL.md)

From prasad-vennam/Awesome-Android-AI-Agent-Skills, MIT.

More from prasad-vennam/Awesome-Android-AI-Agent-Skills

Signals

Stars
11
Forks
0
Open issues
0
Last commit (this folder)
Mar 31, 2026 (7 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from prasad-vennam

Cite this page

android-kmp-shared skill. Agent Mart. https://agentmart.dev/skills/prasad-vennam-android-kmp-shared (last updated 2026-10-24)