kmp-domain

Identify Kotlin Multiplatform domain layer guidelines for immutable models and use cases.

1|Updated Nov 26, 2025
One-click install
npx skills add https://github.com/niltsiar/kotlin_multiplatform_pokedex --skill kmp-domain
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kmp-domain
Source: https://github.com/niltsiar/kotlin_multiplatform_pokedex/tree/main/.agents/kmp-domain
Command: npx skills add https://github.com/niltsiar/kotlin_multiplatform_pokedex --skill kmp-domain

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Domain layer patterns for Kotlin Multiplatform: immutable data classes, use case guidelines, domain exceptions, and pure business logic. Use when planning cross-platform domain design, ensuring clean boundaries and testable core.

Core Features & Use Cases

  • Immutable domain models and pure business logic that are platform-agnostic
  • Guidance on when to create use cases vs calling repositories directly
  • Domain exceptions (e.g., UnauthenticatedException, PurchaseRequiredException) and boundary mappings

Quick Start

Summarize the domain layer guidelines and apply them to a sample Kotlin Multiplatform module.

Frequently Asked Questions about kmp-domain

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

FAQPage Schema
How do I design a Kotlin Multiplatform domain layer with immutable data classes?

Kotlin Multiplatform domain layer design requires immutable data classes for domain models and pure business logic, ensuring strict immutability and separation of concerns across shared and feature modules.

When should I create use cases instead of calling repositories directly in KMP?

Create use cases instead of calling repositories directly when you need to encapsulate complex business logic, maintain pure domain modeling, and ensure testable core boundaries in your Kotlin Multiplatform architecture.

What is the best way to handle domain exceptions in Kotlin Multiplatform?

The best way to handle domain exceptions in Kotlin Multiplatform is through explicit exception definitions, such as UnauthenticatedException or PurchaseRequiredException, combined with strict boundary mappings for pure domain modeling.

Does Kotlin Multiplatform domain modeling require platform-agnostic business logic?

Yes, Kotlin Multiplatform domain modeling requires platform-agnostic business logic, enforcing pure functions and strict separation of concerns to ensure the core domain remains testable and independent of platform specifics.

How do I map boundaries and use fakes for testing in a KMP domain layer?

To map boundaries and use fakes for testing in a KMP domain layer, define repository interfaces explicitly within the domain and implement pure business logic that can be tested using boundary fakes.

Why use immutable domain models for cross-platform app development?

Immutable domain models are used for cross-platform app development to guarantee pure business logic, prevent side effects, and maintain strict separation of concerns across shared and feature modules.