home / skills / shotaiuchi / dotclaude / context-kmp
This skill assists Kotlin Multiplatform development tasks by guiding shared module creation, expect/actual usage, and Koin/SQLDelight/Ktor setup.
npx playbooks add skill shotaiuchi/dotclaude --skill context-kmpReview the files below or copy the command above to add this skill to your agents.
---
name: context-kmp
description: >-
Kotlin Multiplatform development context. Apply when working with
shared/ or commonMain/, expect/actual declarations, .kt files in
multiplatform modules, Koin, SQLDelight, Ktor, Compose Multiplatform.
user-invocable: false
---
# Kotlin Multiplatform Context Rule
Auto-applied context when working on KMP development tasks.
## When to Apply
Apply this context when:
- Creating shared modules in KMP
- Using expect/actual declarations
- Setting up Koin, SQLDelight, or Ktor
- Implementing Compose Multiplatform UI
## Reference Documents
Read and apply patterns from:
| Document | Purpose |
|----------|---------|
| [Clean Architecture](../../references/common/clean-architecture.md) | Layer separation principles |
| [Testing Strategy](../../references/common/testing-strategy.md) | Test patterns and coverage |
| [Kotlin Conventions](../../references/languages/kotlin/conventions.md) | Naming, structure, idioms |
| [Library Patterns](../../references/languages/kotlin/library-patterns.md) | Koin, SQLDelight, Ktor usage |
| [Feature Patterns](../../references/languages/kotlin/feature-patterns.md) | Feature module structure |
| [KMP Architecture](../../references/languages/kotlin/kmp-architecture-patterns.md) | Multiplatform patterns |
## External References
| Resource | URL |
|----------|-----|
| Kotlin Multiplatform | https://kotlinlang.org/docs/multiplatform.html |
| Compose Multiplatform | https://www.jetbrains.com/lp/compose-multiplatform/ |
| Kotlin Coroutines | https://kotlinlang.org/docs/coroutines-overview.html |
This skill provides a focused Kotlin Multiplatform (KMP) development context to apply when working on shared modules, expect/actual declarations, and multiplatform UI. It guides usage patterns for common KMP libraries like Koin, SQLDelight, Ktor, and Compose Multiplatform. Use it to keep architecture, testing, and Kotlin conventions consistent across targets.
When enabled, the skill inspects project layout for shared/, commonMain/, and .kt files inside multiplatform modules and assumes expect/actual patterns are in play. It recommends layered architecture, dependency injection setup, multiplatform database and network patterns, and Compose Multiplatform UI approaches. It references established conventions and testing strategies to produce code and suggestions that fit KMP best practices.
When should I use expect/actual versus platform-specific modules?
Use expect/actual when behavior must differ by platform but share an API; use platform modules when entire implementations and dependencies are large or platform-only.
Where should dependency injection configuration live?
Declare DI bindings for shared abstractions in commonMain and provide platform-specific bindings (drivers, clients) via actual implementations or platform modules.