kmm-architecture

Guide MVVM and Clean Architecture layer placement in Kotlin Multiplatform projects.

1|Updated Apr 24, 2026
One-click install
npx skills add https://github.com/dimitriRemoiville/cc-mobile --skill kmm-architecture
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kmm-architecture
Source: https://github.com/dimitriRemoiville/cc-mobile/tree/main/plugins/cc-mobile-kmm/skills/kmm-architecture
Command: npx skills add https://github.com/dimitriRemoiville/cc-mobile --skill kmm-architecture

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

MVVM and Clean Architecture guidance for Kotlin Multiplatform projects, clarifying how to place code and layer responsibilities across shared and native targets.

Core Features & Use Cases

  • Provides a practical blueprint for organizing commonMain, data, domain, and presentation layers in KMM.
  • Helps decide whether code should live in commonMain, androidMain, or iosMain based on dependencies and platform needs.
  • Use case: when designing a feature, you load the shared layer boundaries to ensure consistent cross-platform behavior.

Quick Start

Structure new features by placing domain logic in commonMain, repository interfaces in commonMain, and platform-specific implementations in androidMain or iosMain as appropriate.

Frequently Asked Questions about kmm-architecture

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a KMM project with MVVM and Clean Architecture?

To structure a KMM project with MVVM and Clean Architecture, place domain models, use cases, and repository interfaces in commonMain, with platform-specific implementations in androidMain or iosMain bound via dependency management.

Where should ViewModels and domain logic live in a Kotlin Multiplatform module?

In a Kotlin Multiplatform module, domain logic and ViewModels belong in commonMain to align with cross-platform UI layers, ensuring consistent behavior across both Android and iOS targets.

How do I decide if code belongs in commonMain, androidMain, or iosMain?

Decide whether code belongs in commonMain, androidMain, or iosMain by evaluating its platform dependencies; shared domain and data contracts go in commonMain, while platform-specific implementations reside in native targets.

Can I use Clean Architecture layering for shared KMM features across platforms?

Yes, you can apply Clean Architecture layering for shared KMM features by organizing commonMain into domain, data, and presentation layers, using repository interfaces to bridge platform-specific implementations.

What is the best way to bind platform-specific implementations in a Kotlin Multiplatform shared module?

The best way to bind platform-specific implementations in a Kotlin Multiplatform shared module is using dependency management to connect native androidMain and iosMain code to shared repository interfaces in commonMain.

Why separate repository interfaces in commonMain from implementations in native targets?

Separating repository interfaces in commonMain from implementations in native targets isolates platform dependencies, allowing shared domain logic to interact with data sources without coupling to Android or iOS specifics.