kotlin-multiplatform-library-fundamentals

Create Kotlin Multiplatform library modules with explicit API and JVM toolchain configuration.

Updated Feb 20, 2026
One-click install
npx skills add https://github.com/KrystianYCSilva/math-theory-lib --skill kotlin-multiplatform-library-fundamentals
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kotlin-multiplatform-library-fundamentals
Source: https://github.com/KrystianYCSilva/math-theory-lib/tree/main/.codex/skills/kotlin-multiplatform-library-fundamentals
Command: npx skills add https://github.com/KrystianYCSilva/math-theory-lib --skill kotlin-multiplatform-library-fundamentals

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides a reproducible workflow and scaffolding for creating robust Kotlin Multiplatform libraries that are compatible with JVM (Java 8), iOS, and JavaScript and that enforce a stable, explicit API surface to avoid cross-platform integration issues.

Core Features & Use Cases

  • Project scaffolding: Automates creation of conventional source sets and a preconfigured build.gradle.kts to jumpstart a new KMP module.
  • Build and API guidance: Prescribes explicit API mode, JVM toolchain set to Java 8, and multi-target definitions to maintain binary compatibility and consistent artifacts.
  • iOS interoperability advice: Practical guidance to avoid common pitfalls when exposing Kotlin APIs to Swift/Objective-C, including handling generics, sealed classes, and suspend functions.
  • Use Case: Use this Skill when you need to deliver a shared utility or SDK that must integrate with legacy JVM applications and native iOS and JS consumers without runtime or ABI surprises.

Quick Start

Run the scaffolding script to create a new KMP module and then inspect the generated build configuration and source sets.

Frequently Asked Questions about kotlin-multiplatform-library-fundamentals

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

FAQPage Schema
How do I scaffold a Kotlin Multiplatform library for iOS, JVM, and JavaScript targets?

Scaffold a Kotlin Multiplatform library by running the generation script to create conventional source sets and a preconfigured build.gradle.kts for JVM, iOS, and JavaScript targets. This ensures API stability and cross-platform compatibility.

What is explicit API mode in Kotlin Multiplatform and when do I need it for library development?

Explicit API mode in Kotlin Multiplatform enforces a stable API surface by requiring explicit visibility modifiers and return types. You need it for library development to avoid accidental API exposure and maintain binary compatibility across platform consumers.

Does this Kotlin Multiplatform scaffolding support Java 8 compatibility for legacy JVM applications?

Yes, the Kotlin Multiplatform scaffolding supports Java 8 compatibility by aligning the JVM toolchain to Java 8. This allows your shared library to integrate with legacy JVM applications without runtime issues.

How do I expose Kotlin Multiplatform sealed classes and suspend functions to Swift?

To expose Kotlin Multiplatform sealed classes and suspend functions to Swift, follow the provided iOS interoperability guidance to handle generics and asynchronous functions. This helps avoid common pitfalls when exposing Kotlin APIs to Objective-C consumers.

What are common limitations when configuring iOS interoperability in a KMP library?

Common limitations when configuring iOS interoperability in a KMP library include handling Swift/Objective-C consumers with complex generics, sealed classes, and suspend functions. The scaffolding provides specific guidance to navigate these cross-platform integration pitfalls.

What's the best way to configure platform-specific dependencies in a Kotlin Multiplatform module?

The best way to configure platform-specific dependencies in a Kotlin Multiplatform module is to place them in the generated conventional source sets. The scaffolding script preconfigures these sets to ensure correct dependency placement for JVM, iOS, and JavaScript targets.