koin

Automates Kotlin dependency injection with modules, definitions, and constructor DSL via startKoin.

1|1|Updated Nov 9, 2025
One-click install
npx skills add https://github.com/tianguzhe/zsh-config --skill koin
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: koin
Source: https://github.com/tianguzhe/zsh-config/tree/main/claude/skills/koin
Command: npx skills add https://github.com/tianguzhe/zsh-config --skill koin

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Koin simplifies dependency management in Kotlin, reducing boilerplate and wiring complexity across Android, Kotlin Multiplatform, and backend services.

Core Features & Use Cases

  • Constructor DSL, modules, and scopes to declare and organize dependencies.
  • Annotations-based DI to generate definitions and simplify usage.
  • Android ViewModel integration, Ktor server integration, and cross-platform support to share business logic.

Quick Start

Add Koin to your project via Gradle, define a module with singleton and factory definitions, start Koin with startKoin { modules(myModule) }, and inject dependencies in your components using by inject() or by viewModel().

Frequently Asked Questions about koin

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

FAQPage Schema
How do I set up Kotlin dependency injection using Koin?

Kotlin dependency injection using Koin starts by adding the Koin Gradle dependency, defining modules with singleton and factory definitions, calling startKoin { modules() }, and resolving dependencies via by inject().

Does Koin work for Kotlin Multiplatform and Android ViewModels?

Koin works across Android, Kotlin Multiplatform, and backend services, providing specific integrations for Android ViewModels via by viewModel() and Ktor server environments to enable shared dependency resolution.

What is the difference between single, factory, and scoped definitions in Koin?

Definitions in Koin manage lifecycle-scoped dependency resolution: single creates singletons, factory provides a new instance each time, and scoped restricts instances to a specific lifecycle scope.

Can I use annotations for dependency injection in Kotlin instead of a DSL?

Koin supports an optional annotations-based dependency injection mechanism alongside its constructor DSL, generating module definitions automatically to simplify wiring and reduce manual boilerplate.

What is the best way to organize Koin modules in a Kotlin Multiplatform project?

Organize Koin modules in a Kotlin Multiplatform project by grouping dependencies into modular declarations using the constructor DSL, applying scopes to manage lifecycle, and starting Koin to enable resolution.