koin-patterns

Configure Android dependency injection with Koin modules, scopes, and ViewModels.

61|17|Updated Feb 2, 2026
One-click install
npx skills add https://github.com/ahmed3elshaer/everything-claude-code-mobile --skill koin-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: koin-patterns
Source: https://github.com/ahmed3elshaer/everything-claude-code-mobile/tree/main/skills/koin-patterns
Command: npx skills add https://github.com/ahmed3elshaer/everything-claude-code-mobile --skill koin-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Android apps often require clean, scalable DI to manage dependencies across features without tight coupling. This Skill provides pragmatic Koin patterns to wire modules, scopes, and ViewModels in a maintainable way.

Core Features & Use Cases

  • Module-based DI: Define AppModule, NetworkModule, and feature modules to organize dependencies.
  • Scopes & ViewModel injection: Support scoped singletons and viewModel injections for Android components.
  • Use Case composition: Compose repositories, use cases, and ViewModels within Koin modules for clean architecture.
  • Use Case example: Example shows Home feature wiring HomeRepository, GetItemsUseCase, and HomeViewModel with get() dependencies.

Quick Start

  • Add Koin dependencies to your Gradle files.
  • Create modules like AppModule, NetworkModule, and HomeModule as shown.
  • Start Koin in Application and inject ViewModels using koinViewModel() in Compose or by activity/fragment injection.

Frequently Asked Questions about koin-patterns

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

FAQPage Schema
How do I set up dependency injection in Android with Koin modules?

Dependency injection with Koin uses module definitions to organize dependencies. Create modules like AppModule, NetworkModule, and feature modules, then start Koin in your Application class and inject dependencies into ViewModels and Android components using koinViewModel() in Compose or activity/fragment injection.

Can I use Koin scopes with ViewModels in Android?

Koin supports scoped injections and ViewModel injection together. You can define scoped singletons within modules and inject ViewModels using parameterized dependencies, qualifiers, and get() calls to compose repositories and use cases for clean architecture.

What's the best way to organize dependencies across Android feature modules?

Organize dependencies by creating separate modules for each concern—AppModule for application-level setup, NetworkModule for API clients, and feature modules like HomeModule for feature-specific repositories, use cases, and ViewModels wired together through Koin.

How do I inject parameterized ViewModels with Koin in Android?

Parameterized ViewModels in Koin are defined within modules using scoped injections and get() dependencies. Compose repositories and use cases as constructor parameters, then inject using koinViewModel() in Compose or standard activity/fragment injection patterns.

Does Koin work with both Compose and traditional Android activity-based injection?

Koin supports both Compose and traditional Android injection patterns. Use koinViewModel() for Compose and standard Koin injection in activities and fragments, enabling flexible wiring across different UI frameworks within the same modular architecture.