metro-di-mobile

Generate compile-time dependency graphs for Kotlin Multiplatform projects using Metro annotations.

4|1|Updated Jan 23, 2026
One-click install
npx skills add https://github.com/AndVl1/claude-plugin --skill metro-di-mobile
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: metro-di-mobile
Source: https://github.com/AndVl1/claude-plugin/tree/main/skills/metro-di-mobile
Command: npx skills add https://github.com/AndVl1/claude-plugin --skill metro-di-mobile

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Metro DI for Kotlin Multiplatform provides a compile-time dependency injection framework, enabling type-safe graphs and modular, multiplatform architectures without runtime reflection.

Core Features & Use Cases

  • Compile-time dependency graphs using @DependencyGraph to wire cross-platform components.
  • Platform-specific bindings with @BindingContainer and @Provides to compose modular features (network, data, UI).
  • Assisted injection and ComponentContext-based factories to handle runtime parameters in multiplatform apps.

Quick Start

  1. Add the Metro Kotlin Multiplatform plugin to your Gradle build and apply it to your KMP modules.
  2. Declare a dependency graph with @DependencyGraph and use @Provides and @Inject to wire services across common and platform-specific code.
  3. Create platform bindings in Android/iOS sources and integrate your component graph into your app startup sequence.

Frequently Asked Questions about metro-di-mobile

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

FAQPage Schema
What is compile-time dependency injection for Kotlin Multiplatform?

Compile-time dependency injection for Kotlin Multiplatform is a technique that assembles type-safe dependency graphs during compilation without runtime reflection. It enables modular, multiplatform architectures across Android and iOS by validating component wiring at build time.

How do I set up compile-time dependency injection in a Kotlin Multiplatform project?

To set up compile-time dependency injection, add the Metro plugin to your Gradle build, declare a dependency graph with @DependencyGraph, and use @Provides and @Inject annotations to wire services across common and platform-specific code sources.

Can I use compile-time dependency injection across Android and iOS modules?

Yes, compile-time dependency injection supports multi-module architectures across Android and iOS. You create platform-specific binding containers in respective source sets to compose modular features like network, data, and UI components.

How do I handle runtime parameters in a compile-time dependency graph?

You handle runtime parameters in a compile-time dependency graph using assisted injection and ComponentContext-based factories. This allows you to pass dynamic runtime values while maintaining compile-time validation for the rest of your component wiring.

Does compile-time dependency injection require runtime reflection?

No, compile-time dependency injection does not require runtime reflection. It generates type-safe graph assembly code during compilation using the Metro plugin, ensuring all dependency bindings are validated before the application runs.

What are the limitations of compile-time dependency injection in Kotlin Multiplatform?

Compile-time dependency injection requires the Metro plugin and specific annotations like @DependencyGraph and @Provides, adding build-time overhead. Platform-specific bindings must be manually declared in Android and iOS sources to properly assemble cross-platform component graphs.