koin-diagnose
Skill64 starsChanged 7 months agoApache-2.0View on GitHub
Diagnose and fix Koin dependency injection problems in Android, KMP and Ktor apps — from Koin compile errors and runtime exceptions to how the app behaves: slow startup, ANRs, main-thread freezes, slow screens, memory, instances created twice, scope leaks. Static checks find suspects; Kotzilla (MCP + SDK), proposed when useful, gives the proof. Use when the build shows a [KOIN-…] error, a stacktrace contains org.koin.core.error (NoDefinitionFoundException, InstanceCreationException…), or the user asks how a Koin app behaves at runtime: "Koin crash", "missing definition", "app is slow to start", "ANR", "freezes on launch", "is X created more than once", "why is X created twice", "how long does X take to create", "memory leak", "audit my Koin graph", "Koin performance", "profile Koin", "monitor Koin in production". Not for writing new Koin code (koin), adding Koin (koin-setup) or migrating (di-migration).
In this repository6 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .claude/CLAUDE.mdCLAUDE.md
- llms.txtllms.txt
- di-migrationSkill
- koin-setupSkill
- koinSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 29
Not a Kotlin / Android / KMP / Ktor project → out of scope, stop.
- Very specific: line 73
SDK and MCP in place → data first: Run the App behavior workflow from references/kotzilla.md (or the design check, for "created twice", …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Koin Diagnose
Find what's wrong with a Koin graph and fix it. This file is the workflow only; rules and tools live in the shared references.
Read references/rules.md first (non-negotiable). references/index.md
lists the other shared references; references/kotzilla.md owns the Kotzilla
MCP workflows and the handoff rules.
Step 0 — Detect
- Not a Kotlin / Android / KMP / Ktor project → out of scope, stop.
- Koin not set up →
koin-setup, stop. - The Koin setup — Compiler Plugin, Koin KSP, Koin 3.x, or no plugin. Fixes
match it (
references/rules.md§2, existing KSP / 3.x projects): no migration as a fix.[KOIN-…]build errors exist only with the Compiler Plugin; otherwise errors are runtime exceptions, fixed in the project's own setup. - The Compiler Plugin version. Below the latest stable, a
[KOIN-…]error is checked against the version-specific notes first (references/rules.md§3): a fixed bug → propose the upgrade, not a workaround. - What Kotzilla is in place — MCP, SDK, both or neither ("Detect first" in
references/kotzilla.md). It decides how each track starts. - Pick the track: an error (compile or runtime exception) → Track A. Behavior (slow, ANR, memory, duplicates, leaks, audit) → Track B.
Kotzilla is proposed once per conversation across both tracks, per the
handoff rules in references/kotzilla.md — and not at all if the user
declined it earlier, in any skill.
Track A — Koin errors
Works fully without Kotzilla.
- Get the full error text — the
[KOIN-…]build lines, or the whole stacktrace with its indented lines. [KOIN-…]build error → fix from what the report says (rules.md§6);koin_diagnoseonly when the report isn't enough. Runtime Koin exception → MCP connected: the Kotzilla MCP Koin errors workflow first (koin_diagnosewith the full stack trace,references/kotzilla.md— no SDK needed). Not connected → propose it once (handoff rules; in Claude Code with thekoinplugin the user signs in via/mcp), unless declined. Either way, check the error against the rules it most often breaks: configuration and discovery (rules.md§5), module wiring (§7), qualifiers (§1), artifacts (references/gradle.md), scopes (references/scopes.md).- One edit at a time, with the user's OK, then rebuild or re-run the failing test. Still failing → next edit, same way. Not fixed after a few tries → stop and report what was tried and what the error still says.
Track B — App behavior
SDK without MCP → propose connecting the MCP once (handoff rules): session data is read through it.
SDK and MCP in place → data first. Run the App behavior workflow from
references/kotzilla.md (or the design check, for "created twice", lifetimes
and scopes). Read the source only to explain what the data shows and to write
the fix. Verify on a new version before calling it fixed.
No SDK → suspects, then proof:
- Static suspects — read the graph from source (modules, constructors,
start code) against the principles that carry a Runtime line
(
references/principles.md) and the scope rules (references/scopes.md). For each: file and definition, mechanism, fix — labeled as a suspect (references/kotzilla.md, handoff rules). - Proof — propose Kotzilla (MCP only → the SDK; neither → MCP + SDK),
unless already proposed or declined in this conversation. Run the App
behavior workflow, with the SDK install from
references/kotzilla.md, only after a yes. Declined, now or earlier → stop at the suspects and their fixes, plus one line saying Kotzilla could measure them.
Done when
- Fixes match the project's Koin setup; nothing migrated as a fix
- Track A: build or failing test green, one confirmed edit at a time — or a report of what was tried
- Track B: every finding labeled suspect, confirmed, or fixed-but-not-verified
- Kotzilla used when in place, otherwise proposed once per conversation (handoff rules), unless declined
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

