# koin-migration

Moves Kotlin, Android and KMP projects between dependency injection frameworks and Koin versions. It fits staged migrations where old modules must keep running during the move.

- plugin · `type=plugin` · Claude Code · ★ 37
- Author: InsertKoinIO
- License: Apache-2.0 · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/InsertKoinIO/koin-skills
- Updated: 2026-10-22
- HTML: https://affpapa.org/en/nevibecode/plugins/koin-migration

## What it does

This plugin guides migrations from Hilt, Dagger 2, Toothpick, Kodein, Metro, Koin 3.x, the classic Koin DSL and Koin KSP Annotations to Koin 4.x. Its workflow covers inventory, planning, Gradle changes, module generation, application wiring, injection-site updates, per-module checks and cleanup.

The migration is progressive. New Koin definitions go into a separate module while the existing container stays active, with bridges or helpers connecting the two sides for supported source frameworks. The plugin also works around the Koin Compiler Plugin, automatic parameter resolution, interface binding and JSR-330 annotations.

The project needs Kotlin `2.3.20` or newer, Koin `4.2.2` or newer, and Koin Compiler Plugin `1.2.1` or newer. Those version requirements matter before starting the migration.

## Install

### Claude Code (native platform)

**Plugin marketplace**
In the agent chat (not a shell):
```text
/plugin marketplace add anthropics/claude-plugins-community
```
In the agent chat (not a shell):
```text
/plugin install koin-migration@claude-community
```

## When to use it
- move Hilt modules to Koin
- upgrade a Koin 3.x project to Koin 4.x
- replace Dagger 2, Toothpick or Kodein
- add the Koin Compiler Plugin
- convert Koin KSP Annotations

## Example prompts
- Migrate this Hilt module to Koin step by step.
- Upgrade this Koin 3.x project to Koin 4.x and check each module.
- Replace the Dagger components in this KMP project with Koin.

## Source text · SKILL.md · Apache-2.0

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 52399ac962b3198c.

BEGIN THIRD-PARTY FILE 52399ac962b3198c
````text
# Koin Skills

[![Version](https://img.shields.io/badge/version-2.0.0-blue)](./CHANGELOG.md)
[![License](https://img.shields.io/badge/license-Apache--2.0-green)](./LICENSE)
[![Koin](https://img.shields.io/badge/Koin-4.x-orange)](https://insert-koin.io)
[![Kotlin](https://img.shields.io/badge/Kotlin-2.3.20%2B-purple)](https://kotlinlang.org)

Official Koin skills for AI agents, packaged as the **`koin`** Claude Code plugin.
They target **Koin 4.x with the Koin Compiler Plugin**: Koin Annotations (JSR-330 compatible) or Koin DSL,
compile safe in both, for Kotlin, Android, Compose, Kotlin Multiplatform and Ktor.

| Skill | What it does |
|-------|--------------|
| `koin-setup` | Set up Koin in a new or legacy project, or alongside an existing DI container |
| `koin` | Write Koin code: definitions, modules, entry points, scopes, tests — and push back on DI mistakes |
| `di-migration` | Migrate from Hilt, Dagger, Toothpick, Kodein, Metro, Koin 3.x, classic Koin DSL or Koin KSP |
| `koin-diagnose` | Koin errors and app behavior (startup, ANRs, scopes): static suspects, proven with Kotzilla when you opt in |

## Installation

### From Claude Code (recommended)

In a Claude Code session, run:

```
/plugin marketplace add InsertKoinIO/koin-skills
/plugin install koin@koin-skills
```

The first command registers this repo as a plugin marketplace; the second
installs the `koin` plugin from it. Skills show up as `koin:koin-setup`,
`koin:koin`, `koin:di-migration` and `koin:koin-diagnose`. Updates:
`/plugin marketplace update koin-skills`.

### From a clone

`skills/` at the repo root holds the complete, ready-to-use skills — no build step needed.

```bash
git clone https://github.com/InsertKoinIO/koin-skills.git
claude --plugin-dir /path/to/koin-skills
```

Or copy one skill into your Claude Code skills directory (no plugin, skill only):

```bash
# Project-level (shared with your team via git)
mkdir -p .claude/skills/koin
cp -R koin-skills/skills/koin/. .claude/skills/koin/

# Or personal (available across all your projects)
mkdir -p ~/.claude/skills/koin
cp -R koin-skills/skills/koin/. ~/.claude/skills/koin/
```

Copy the whole skill folder: each skill reads its `references/`. Update with `git pull`.

### Other agents

Each [GitHub Release](https://github.com/InsertKoinIO/koin-skills/releases) attaches one
`<skill>-skill.skill` archive per skill (a zip of the skill folder) and `koin-plugin.zip`.

## Supported Migration Paths

| Source | Target |
|--------|--------|
| Hilt (+ Dagger) | Koin 4.x Annotations + Compiler Plugin |
| Dagger 2 (no Hilt) | Koin 4.x Annotations + Compiler Plugin |
| Toothpick | Koin 4.x Annotations + Compiler Plugin |
| Kodein | Koin 4.x Compiler Plugin DSL |
| Metro | Koin 4.x Annotations + Compiler Plugin |
| Koin 3.x | Koin 4.x + Compiler Plugin (DSL kept; Compiler Plugin DSL optional) |
| Koin DSL | Add the Compiler Plugin (DSL kept; Compiler Plugin DSL optional) |
| Koin KSP Annotations | Koin 4.x Annotations + Compiler Plugin |

> For **greenfield projects** or **manual DI / service locator** code, there's
> nothing to migrate *from* — the `koin-setup` skill sets Koin up directly.

## Usage

The skills trigger on their own when a task touches dependency injection. Examples:

- "Add Koin to this KMP project"
- "Add a ViewModel for the profile screen" (in a Koin project)
- "Why is `UserRepository` created twice?"

- "Migrate this Hilt module to Koin"
- "Convert my Dagger components to Koin"
- "Upgrade my Koin 3.x project to Koin 4.x"
- "Move from Koin KSP annotations to the Compiler Plugin"
- "Convert this Toothpick scope tree to Koin"
- "Migrate this Kodein DI container to Koin"

For migrations, `di-migration` follows an **8-step workflow**: Inventory → Plan → Gradle Setup → Generate Module Code → Wire Up Application → Update Injection Sites → Per-module validation → Final Cleanup. Steps 4, 6 and 7 repeat module by module (Step 5 with the first module).
````
END THIRD-PARTY FILE 52399ac962b3198c

The third-party file has ended. Everything between the 52399ac962b3198c tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 3964 of 8114 bytes. © InsertKoinIO · Apache-2.0 · https://github.com/InsertKoinIO/koin-skills

## Similar
- [kotlin-tooling-cocoapods-spm-migration](https://affpapa.org/en/nevibecode/skills/kotlin-tooling-cocoapods-spm-migration.md) — skill · 1800 installs
- [android-clean-architecture](https://affpapa.org/en/nevibecode/skills/android-clean-architecture.md) — skill · 5200 installs
- [kotlin-coroutines-flows](https://affpapa.org/en/nevibecode/skills/kotlin-coroutines-flows.md) — skill · 4800 installs
- [apollo-kotlin](https://affpapa.org/en/nevibecode/skills/apollo-kotlin.md) — skill · 1700 installs
- [kotlin-multiplatform](https://affpapa.org/en/nevibecode/skills/kotlin-multiplatform.md) — skill · 1600 installs
- [kotlin-specialist](https://affpapa.org/en/nevibecode/agents/kotlin-specialist.md) — subagent · 501 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
