name: kmp-dependency-init description: > Initialize common industry-standard dependencies for a Kotlin Multiplatform (KMP) project. Automates the setup of Ktor, Koin, Coroutines, Serialization, and more by updating libs.versions.toml and build.gradle.kts with best-practice configurations.
KMP Dependency Initialization
Intent
Provide a repeatable way to bootstrap a KMP project with essential libraries:
- Networking: Ktor
- Dependency Injection: Koin
- Concurrency: Coroutines
- Data Handling: Serialization, DateTime
- UI Utilities: Coil (Multiplatform), Lifecycle
- Logging: Napier
Inputs
- Target path (optional): Project root directory. Default: current working directory.
- Behavior flags (optional):
--all: Install all common libraries (default).--minimal: Install only Coroutines and Serialization.
Workflow
- Detect project root and verify presence of
libs.versions.tomlandbuild.gradle.kts. - Inject Managed Blocks into
libs.versions.toml:[versions]section[libraries]section[plugins]section
- Update
composeApp/build.gradle.kts:- Apply
kotlinx-serializationplugin. - Inject dependency calls into
commonMain.
- Apply
- Validation: Ensure the project still syncs and builds.
Managed Markers
The skill uses the following markers to ensure idempotency:
# >>> kmp-dependency-init skill start# <<< kmp-dependency-init skill end
How to Run
bash scripts/init_dependencies.sh