kmp-cmp-app-builder
A comprehensive builder for KMP/CMP applications that covers setup, modular development, testing, and CI/CD releases.
Install
mkdir -p .claude/skills/kmp-cmp-app-builder && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/9856" && unzip -o skill.zip -d .claude/skills/kmp-cmp-app-builder && rm skill.zipInstalls to .claude/skills/kmp-cmp-app-builder
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Use when building, developing, or shipping Kotlin Multiplatform (KMP) and Compose Multiplatform (CMP) applications targeting Android, iOS, and Desktop. Covers the full project lifecycle: initial setup with multi-module Clean Architecture, active development (adding features, networking, database, authentication, offline-first sync, testing), and production release (ProGuard, signing, CI/CD). Use this skill when the user asks to create a KMP or CMP app, add feature modules, implement networking or database layers, set up authentication, write tests, prepare release builds, or follow multiplatform code conventions — even if they don't explicitly mention "multiplatform" or "KMP", such as asking to share code between Android and iOS or build a cross-platform app.Key capabilities
- →Multi-module clean architecture
- →Feature module implementation
- →Offline-first sync
- →Production release preparation
How it works
It guides the development lifecycle using multi-module clean architecture and platform-specific release preparation.
Inputs & outputs
When to use kmp-cmp-app-builder
- →Building a cross-platform app
- →Setting up multi-module architecture
- →Adding shared networking code
- →Preparing release builds for iOS/Android
About this skill
KMP/CMP Application Builder
Covers the complete lifecycle of a KMP/CMP application: setup → development → production.
When to use
Phase 1 — Setup: Creating a new project, configuring Gradle, convention plugins, core modules. Phase 2 — Development: Adding features, implementing networking/database/auth, offline-first, testing. Phase 3 — Production: ProGuard/R8, signing, CI/CD, performance, release builds.
Architecture
Use multi-module Clean Architecture:
root/
├── build-logic/convention/ # Gradle convention plugins
├── composeApp/ # Composition root (all platforms)
├── core/
│ ├── domain/ # Pure Kotlin: models, Result, interfaces
│ ├── data/ # Ktor, DataStore, session, HttpClientFactory
│ ├── presentation/ # UiText, shared composables
│ └── designsystem/ # Theme, colors, typography, components
├── feature/<name>/
│ ├── domain/ # Feature models + repository interfaces
│ ├── data/ # Repository implementation
│ ├── database/ # Room entities + DAOs (optional)
│ └── presentation/ # ViewModel (MVI) + screens
├── gradle/libs.versions.toml
└── settings.gradle.kts
Dependency rules (CRITICAL)
composeApp → core/* + feature/*/
feature/*/presentation → feature/*/domain + core/presentation + core/designsystem
feature/*/data → feature/*/domain + core/domain + core/data
feature/*/database → feature/*/domain
core/data → core/domain
core/presentation → core/domain + core/designsystem
- domain = pure Kotlin, ZERO framework imports
- data implements domain interfaces
- presentation depends on domain only, never on data
- Feature modules NEVER depend on other feature modules
- composeApp wires all DI and navigation
Phase 1: Setup
-
Initialize project —
settings.gradle.kts,libs.versions.toml, rootbuild.gradle.kts,build-logic/. See PROJECT_SETUP.md. -
Create convention plugins —
KmpLibrary,CmpLibrary,CmpFeature,CmpApplication,Room,BuildKonfig,Kover. See CONVENTION_PLUGINS.md. -
Set up core modules — domain (Result, DataError), data (HttpClientFactory, auth), designsystem (AppTheme), presentation (UiText). See CORE_MODULES.md.
-
Wire composeApp — Koin DI graph, NavHost, platform entry points. See APP_WIRING.md.
Phase 2: Development
Adding a feature module
- Add module entries to
settings.gradle.kts - Create
feature/<name>/domain/— models + repository interface - Create
feature/<name>/data/— repository implementation - Create
feature/<name>/database/— Room (if needed) - Create
feature/<name>/presentation/— ViewModel (MVI), State, Action, Event, Screen - Create Koin DI module, register in
composeApp - Add navigation route to NavHost
- Write unit tests (ViewModel + repository) with fakes
- Validate:
scripts/validate-module.sh feature/<name>
See FEATURE_MODULES.md for complete patterns.
Security & authentication
- Configure
HttpClientFactorywith Bearer auth + automatic token refresh - Store API keys via BuildKonfig from
local.properties - Implement
SessionStoragewith DataStore - Create
AuthServiceinterface →KtorAuthServiceimplementation
See SECURITY.md.
Offline-first features
- Implement
OfflineFirst*Repository— Room DB as source of truth + network sync - UI observes Room
Flow, NOT network responses - Add
ConnectivityObserver(expect/actual per platform) - Add
ConnectionRetryHandlerfor exponential backoff
See OFFLINE_FIRST.md.
Testing & coverage
- Create
Fake*stubs for all interfaces - Write ViewModel tests with
runTest+Turbine - Apply Kover to testable modules
- Run:
./gradlew allTests koverHtmlReport - Integrate Chucker for Android debug HTTP inspection
See TESTING.md.
Code conventions
Follow naming rules and patterns throughout development. See CODE_CONVENTIONS.md.
Debugging quick reference
| Problem | Solution |
|---|---|
| HTTP issues | Chucker (Android), Ktor Logging (all) |
| DI resolution fails | Core modules must load before features in Koin |
| Database migration error | Check Room schema dir, verify migration steps |
| Flow not emitting | Check SharingStarted.WhileSubscribed(5_000) |
| Platform crash | Separate expect/actual, use Kermit for logging |
Phase 3: Production
Configure ProGuard, signing, CI/CD, optimize performance, and run the pre-release checklist. See PRODUCTION.md.
Validation before release
./gradlew build— compiles without errors./gradlew allTests— all tests pass./gradlew koverVerify— coverage ≥ 60%./gradlew :composeApp:assembleRelease— release APK builds./gradlew :composeApp:bundleRelease— release AAB for Play Store- Test release build on physical device
Gotchas
- Token refresh must skip auth endpoints — otherwise infinite loop when refresh token expires.
- Always call
BearerAuthProvider.clearToken()on logout — cached tokens persist. - API keys go in
local.propertiesonly — never commit secrets. - Offline-first UI must observe Room
Flow, not network responses. - Never catch
CancellationException— always re-throw. - Chucker is Android-only — use
no-opvariant for release builds. TYPESAFE_PROJECT_ACCESSORSmust be enabled insettings.gradle.kts.- DataStore file path needs
expect/actual— each platform stores differently. - Desktop target needs
kotlinx-coroutines-swingfor coroutine dispatching. - Navigation Compose routes must be
@Serializabledata objects/classes. - ProGuard must keep
@Serializableclasses — JSON parsing breaks in release. - Always use
bundleRelease(AAB) for Play Store, notassembleRelease(APK). - Kover
koverVerifywill fail CI if coverage drops below minimum bound. - Use
Dispatchers.setMain(testDispatcher)in@BeforeTestandresetMain()in@AfterTest. - Never use
println()orLog.d()— use Kermit (multiplatform) or Timber (Android-only).
Technology stack
| Technology | Purpose | Version |
|---|---|---|
| Kotlin | Language | 2.1+ |
| Compose Multiplatform | UI framework | 1.7+ |
| Koin | DI | 4.0+ |
| Ktor | HTTP + WebSockets | 3.0+ |
| Room | Database (offline-first) | 2.7+ |
| Navigation Compose | Navigation | Aligned with CMP |
| DataStore | Session storage | 1.1+ |
| Kover | Test coverage | 0.9+ |
| Turbine | Flow testing | 1.2+ |
| Chucker | HTTP debugging (Android) | 4.1+ |
| BuildKonfig | Build constants | 0.15+ |
| Kermit | Multiplatform logging | 2.0+ |
| Coil | Image loading | 3.0+ |
| MOKO Permissions | Permissions | 0.18+ |
When not to use it
- →Non-Kotlin projects
- →Projects not targeting Android/iOS/Desktop
Prerequisites
Limitations
- →Requires specific toolchain versions
- →Complex multi-module setup
How it compares
It provides a complete lifecycle approach for KMP/CMP applications rather than just framework usage.
Compared to similar skills
kmp-cmp-app-builder side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| kmp-cmp-app-builder (this skill) | 0 | 4mo | Review | Advanced |
| android-kotlin-development | 268 | 5mo | Review | Advanced |
| kotlin-multiplatform | 32 | 3mo | Review | Advanced |
| android-kotlin | 7 | 4mo | No flags | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
android-kotlin-development
aj-geddes
Develop native Android apps with Kotlin. Covers MVVM with Jetpack, Compose for modern UI, Retrofit for API calls, Room for local storage, and navigation architecture.
kotlin-multiplatform
vitorpamplona
Platform abstraction decision-making for Amethyst KMP project. Guides when to abstract vs keep platform-specific, source set placement (commonMain, jvmAndroid, platform-specific), expect/actual patterns. Covers primary targets (Android, JVM/Desktop, iOS) with web/wasm future considerations. Integrates with gradle-expert for dependency issues. Triggers on: abstraction decisions ("should I share this?"), source set placement questions, expect/actual creation, build.gradle.kts work, incorrect placement detection, KMP dependency suggestions.
android-kotlin
alinaqi
Android Kotlin development with Coroutines, Jetpack Compose, Hilt, and MockK testing
kotlin-expert
vitorpamplona
Advanced Kotlin patterns for AmethystMultiplatform. Flow state management (StateFlow/SharedFlow), sealed hierarchies (classes vs interfaces), immutability (@Immutable, data classes), DSL builders (type-safe fluent APIs), inline functions (reified generics, performance). Use when working with: (1) State management patterns (StateFlow/SharedFlow/MutableStateFlow), (2) Sealed classes or sealed interfaces, (3) @Immutable annotations for Compose, (4) DSL builders with lambda receivers, (5) inline/reified functions, (6) Kotlin performance optimization. Complements kotlin-coroutines agent (async patterns) - this skill focuses on Amethyst-specific Kotlin idioms.
reviewing-changes
bitwarden
Guides Android code reviews with type-specific checklists and MVVM/Compose pattern validation. Use when reviewing Android PRs, pull requests, diffs, or local changes involving Kotlin, ViewModel, Composable, Repository, or Gradle files. Triggered by "review PR", "review changes", "check this code", "Android review", or code review requests mentioning bitwarden/android. Loads specialized checklists for feature additions, bug fixes, UI refinements, refactoring, dependency updates, and infrastructure changes.
android-clean-architecture
farhankabir133
Clean Architecture patterns for Android and Kotlin Multiplatform projects — module structure, dependency rules, UseCases, Repositories, and data layer patterns.