kotlin-data-kmp-data-layer

Identify best practices for Kotlin Multiplatform data layers with repositories and data sources.

1|Updated Apr 22, 2026
One-click install
npx skills add https://github.com/cedric-champeix/SpoonFeeder --skill kotlin-data-kmp-data-layer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kotlin-data-kmp-data-layer
Source: https://github.com/cedric-champeix/SpoonFeeder/tree/main/.claude/skills/kotlin-data-kmp-data-layer
Command: npx skills add https://github.com/cedric-champeix/SpoonFeeder --skill kotlin-data-kmp-data-layer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Use when implementing or reviewing KMP data layers, including repositories, data sources, source-of-truth design, API exposure, conflict resolution, error handling, and main-safe data operations.

Core Features & Use Cases

  • Clear ownership of application data with a single source of truth per repository, enabling reliable reconciliation across sources.
  • Clean separation between repositories and their data sources, with immutable domain models exposed to the rest of the app.
  • Scalable coordination of multiple sources (network, DB, cache) and deterministic data flow.

Quick Start

Create a minimal KMP data-layer skeleton with a repository and a data-source pair to demonstrate coordination.

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?

To design a Kotlin Multiplatform data layer with a single source of truth, establish clear repository ownership over local and remote data sources, expose immutable domain models, and enforce deterministic conflict resolution.

What is the best way to separate repositories and data sources in KMP?

The best way to separate repositories and data sources in KMP is to encapsulate source coordination within repositories while exposing only immutable domain models to the rest of the application for scalable data flow.

How do I handle conflict resolution between remote and local data sources in Kotlin Multiplatform?

Handle conflict resolution between remote and local data sources in Kotlin Multiplatform by designating a single source of truth per repository to reliably reconcile network, database, and cache updates.

Does a KMP data layer require suspend and Flow APIs for main-safe operations?

Yes, a KMP data layer requires suspend and Flow APIs to guarantee main-safe data operations, ensuring that network and database coordination does not block the main thread.

How do I structure explicit error handling in a Kotlin Multiplatform repository?

Structure explicit error handling in a Kotlin Multiplatform repository by mapping data source failures to deterministic domain outcomes, ensuring robust conflict resolution and clear ownership across remote and local sources.