kotlin-data-kmp-data-layer

Design Kotlin Multiplatform data layers with repositories, sources, suspend, and Flow APIs.

63|6|Updated Mar 27, 2026
One-click install
npx skills add https://github.com/mmiani/kotlin-kmp-claude-agent-skills --skill kotlin-data-kmp-data-layer-mmiani
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kotlin-data-kmp-data-layer
Source: https://github.com/mmiani/kotlin-kmp-claude-agent-skills/tree/main/skills/kotlin-data-kmp-data-layer
Command: npx skills add https://github.com/mmiani/kotlin-kmp-claude-agent-skills --skill kotlin-data-kmp-data-layer-mmiani

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you design and review a cohesive data layer for Kotlin Multiplatform projects, clarifying ownership, source of truth, and boundaries between repositories and data sources.

Core Features & Use Cases

  • Establish clear ownership of application data and a single source of truth for each repository.
  • Define contract boundaries between data sources (network, database, in-memory) and the rest of the app.
  • Ensure main-safe APIs with suspend mutations, Flow observations, and consistent error handling across targets.

Quick Start

Create a canonical Kotlin Multiplatform data-layer blueprint for your project.

Frequently Asked Questions about kotlin-data-kmp-data-layer

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

FAQPage Schema
How do I design a Kotlin Multiplatform data layer with a single source of truth?

Kotlin Multiplatform data layer architecture separates data sources from repositories using clear contract boundaries. It coordinates network, database, and in-memory sources to enforce API shapes and maintain consistent data flow across mobile and shared codebases.

How to manage data flow in Kotlin Multiplatform repositories using coroutines?

Manage data flow in Kotlin Multiplatform repositories by using suspend functions for one-shot mutations and Flow for state observation. This approach ensures main-safe APIs and consistent error handling across all platform targets.

What's the best way to handle errors in a Kotlin Multiplatform shared data layer?

Handle errors in a Kotlin Multiplatform shared data layer by enforcing robust error handling within your repositories. Establishing strict contract boundaries between data sources ensures consistent error propagation across mobile and shared codebases.

Does Kotlin Multiplatform data layer architecture support testing across platforms?

Kotlin Multiplatform data layer architecture supports testability across platforms by defining clear contract boundaries between data sources and repositories. This isolation allows you to isolate dependencies and write robust tests for shared codebases.

When do I need to separate data sources from repositories in Kotlin Multiplatform?

Separate data sources from repositories in Kotlin Multiplatform when establishing clear ownership and contract boundaries. This separation defines the boundaries between network, database, and in-memory sources to ensure consistent data flow.