android-di-koin

Configure Koin DI modules and ViewModel injection for Android and Kotlin Multiplatform.

Updated Apr 14, 2026
One-click install
npx skills add https://github.com/kvithayathil/agent-resources --skill android-di-koin
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: android-di-koin
Source: https://github.com/kvithayathil/agent-resources/tree/main/skills/android/android-di-koin
Command: npx skills add https://github.com/kvithayathil/agent-resources --skill android-di-koin

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Manually configuring Koin dependency injection for Android and Kotlin Multiplatform projects leads to inconsistent module setups, improper ViewModel injection, runtime crashes, and unnecessary boilerplate code.

Core Features & Use Cases

  • Per-layer Koin module definitions: Create separate, properly named modules for data, presentation, and core layers to organize dependency bindings.
  • Correct module assembly: Register all DI modules in the :app module to avoid circular dependencies and ensure proper Koin initialization.
  • Compose ViewModel injection: Use koinViewModel() in root composables to eliminate manual dependency passing and follow Android Compose best practices.
  • Use Case: For a notes feature, use this skill to define data and presentation Koin modules, register them in the Application class, and inject NoteListViewModel into the root composable with minimal boilerplate.

Quick Start

Use the android-di-koin skill to set up complete Koin dependency injection for your new notes feature, including defining data and presentation modules, registering them in the Application class, and injecting the NoteListViewModel into the root composable.

Frequently Asked Questions about android-di-koin

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

FAQPage Schema
How do I set up Koin dependency injection for Android Compose ViewModels?

To set up Koin dependency injection for Android Compose, define per-layer Koin modules and use the koinViewModel() function in root composables to inject ViewModels without manually passing dependencies.

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

The best way to organize Koin modules in a Kotlin Multiplatform project is to create separate, properly named modules for data, presentation, and core layers, then assemble and register all modules in the :app module.

Why does my Koin dependency injection configuration cause runtime crashes?

Koin dependency injection runtime crashes often stem from inconsistent module setups or improper ViewModel injection, which can be fixed by following standard naming conventions and correct module assembly in the :app module.

How do I configure singleton, ViewModel, and factory scopes in Koin?

To configure singleton, ViewModel, and factory scopes in Koin, use constructor-reference overloads for concise module definitions, ensuring adherence to Koin best practices and proper scoping across your application.

Can I use Koin for dependency injection in Kotlin Multiplatform apps?

Yes, you can use Koin for dependency injection in Kotlin Multiplatform apps to eliminate boilerplate, define per-layer modules, and inject ViewModels into Compose root composables across shared code.

When do I need to define separate Koin modules for data and presentation layers?

You need to define separate Koin modules for data and presentation layers to organize dependency bindings, avoid circular dependencies, and ensure proper Koin initialization during module assembly in the :app module.