kmp-architecture_skill

This skill helps you design and apply Kotlin Multiplatform architecture patterns, share modules, and implement expect/actual, Koin, SQLDelight, and Compose
  • Shell

0

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill shotaiuchi/dotclaude --skill kmp-architecture

  • SKILL.md1.4 KB

Overview

This skill helps implement robust Kotlin Multiplatform (KMP) architectures for shared modules, feature boundaries, and platform-specific integration. It focuses on practical patterns for expect/actual separation, dependency wiring, and multi-platform UI with Compose. Use it to align implementations with clean architecture, testing strategy, and KMP conventions.

How this skill works

The skill analyzes your module layout, boundary definitions, and DI/DB/network wiring and recommends concrete patterns: where to place expect/actual types, how to structure shared domain/data/presentation layers, and how to adapt libraries like Koin, SQLDelight, and Ktor. It also produces test strategies and Compose Multiplatform integration steps tailored to your targets and build configuration.

When to use it

  • Creating a new shared module intended for Android, iOS, and desktop
  • Deciding how to model expect/actual APIs for platform-specific behavior
  • Setting up dependency injection and lifecycle integration across targets
  • Configuring SQLDelight schemas and drivers for multiple platforms
  • Integrating Ktor clients and platform-specific engines
  • Implementing Compose Multiplatform UI with shared state and navigation

Best practices

  • Design a minimal, platform-agnostic domain layer; keep expect/actual only for unavoidable platform APIs
  • Use feature modules with clear public contracts and internal implementations per platform
  • Prefer constructor injection and interfaces; provide platform bindings in a single DI entry point
  • Keep SQLDelight schema and migrations in shared code, inject drivers via expect/actual
  • Write unit tests for shared logic and small integration tests per platform using the recommended testing strategy
  • Start Compose Multiplatform with small, stateless components and lift state to shared view models

Example use cases

  • Shared authentication feature: domain logic and token storage in shared module, secure store via expect/actual
  • Offline caching: SQLDelight in shared data layer with platform drivers injected at startup
  • Networking: Ktor interfaces in shared code with platform engine selection via DI
  • DI bootstrapping: single function that registers common modules and platform-specific modules
  • Compose MPP screen: shared UI components and platform-specific window/host setup

FAQ

Use expect/actual for small, stable abstractions (file I/O, secure storage, platform-specific features). Avoid wrapping large platform SDKs; instead, isolate and expose minimal interfaces.

How do I manage database migrations across targets with SQLDelight?

Keep the schema and migration scripts in shared code. Provide platform-specific SQLDelight drivers via expect/actual and initialize the database through your DI entry point during app startup.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational