KM

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.zip

Installs 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.
769 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Advanced

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

You give it
App requirements
You get back
Cross-platform application

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

  1. Initialize projectsettings.gradle.kts, libs.versions.toml, root build.gradle.kts, build-logic/. See PROJECT_SETUP.md.

  2. Create convention pluginsKmpLibrary, CmpLibrary, CmpFeature, CmpApplication, Room, BuildKonfig, Kover. See CONVENTION_PLUGINS.md.

  3. Set up core modules — domain (Result, DataError), data (HttpClientFactory, auth), designsystem (AppTheme), presentation (UiText). See CORE_MODULES.md.

  4. 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 HttpClientFactory with Bearer auth + automatic token refresh
  • Store API keys via BuildKonfig from local.properties
  • Implement SessionStorage with DataStore
  • Create AuthService interface → KtorAuthService implementation

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 ConnectionRetryHandler for 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

ProblemSolution
HTTP issuesChucker (Android), Ktor Logging (all)
DI resolution failsCore modules must load before features in Koin
Database migration errorCheck Room schema dir, verify migration steps
Flow not emittingCheck SharingStarted.WhileSubscribed(5_000)
Platform crashSeparate 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

  1. ./gradlew build — compiles without errors
  2. ./gradlew allTests — all tests pass
  3. ./gradlew koverVerify — coverage ≥ 60%
  4. ./gradlew :composeApp:assembleRelease — release APK builds
  5. ./gradlew :composeApp:bundleRelease — release AAB for Play Store
  6. 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.properties only — 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-op variant for release builds.
  • TYPESAFE_PROJECT_ACCESSORS must be enabled in settings.gradle.kts.
  • DataStore file path needs expect/actual — each platform stores differently.
  • Desktop target needs kotlinx-coroutines-swing for coroutine dispatching.
  • Navigation Compose routes must be @Serializable data objects/classes.
  • ProGuard must keep @Serializable classes — JSON parsing breaks in release.
  • Always use bundleRelease (AAB) for Play Store, not assembleRelease (APK).
  • Kover koverVerify will fail CI if coverage drops below minimum bound.
  • Use Dispatchers.setMain(testDispatcher) in @BeforeTest and resetMain() in @AfterTest.
  • Never use println() or Log.d() — use Kermit (multiplatform) or Timber (Android-only).

Technology stack

TechnologyPurposeVersion
KotlinLanguage2.1+
Compose MultiplatformUI framework1.7+
KoinDI4.0+
KtorHTTP + WebSockets3.0+
RoomDatabase (offline-first)2.7+
Navigation ComposeNavigationAligned with CMP
DataStoreSession storage1.1+
KoverTest coverage0.9+
TurbineFlow testing1.2+
ChuckerHTTP debugging (Android)4.1+
BuildKonfigBuild constants0.15+
KermitMultiplatform logging2.0+
CoilImage loading3.0+
MOKO PermissionsPermissions0.18+

When not to use it

  • Non-Kotlin projects
  • Projects not targeting Android/iOS/Desktop

Prerequisites

Kotlin 2.1+Compose Multiplatform 1.7+JDK 17+

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.

SkillInstallsUpdatedSafetyDifficulty
kmp-cmp-app-builder (this skill)04moReviewAdvanced
android-kotlin-development2685moReviewAdvanced
kotlin-multiplatform323moReviewAdvanced
android-kotlin74moNo flagsIntermediate

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.

268679

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.

32156

android-kotlin

alinaqi

Android Kotlin development with Coroutines, Jetpack Compose, Hilt, and MockK testing

729

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.

526

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.

12

android-clean-architecture

farhankabir133

Clean Architecture patterns for Android and Kotlin Multiplatform projects — module structure, dependency rules, UseCases, Repositories, and data layer patterns.

00

Search skills

Search the agent skills registry