android-di-hilt
Installation
SKILL.md
Android DI Hilt
When To Use
- Use this skill when the request is about: android hilt setup, inject viewmodel repository hilt, scope dependency in android.
- Primary outcome: Wire Android dependency injection with Hilt, scopes, testing overrides, and module ownership boundaries.
- Reach for this skill when the hard part is component ownership, bindings, scopes, entry points, or test replacement. If the request is only about networking APIs or reducer design, use the neighboring skill instead.
- Handoff skills when the scope expands:
android-testing-unitandroid-networking-retrofit-okhttp
Workflow
- Identify the injection boundary first: app-wide singleton, activity-retained, ViewModel, worker, service, or entry point from unsupported framework code.
- Decide what should be bound: constructor injection,
@Binds,@Provides, qualifiers, multibindings, or assisted injection. - Match lifetime to scope explicitly so dependencies do not outlive their owner or rebuild too often.
- Verify replacement strategy for tests with Hilt test modules, uninstall modules, or fakes at the right component boundary.
- Hand off API-specific or architectural questions only after the DI graph ownership is correct.
Guardrails
- Prefer constructor injection for app code you own.
- Use qualifiers and scope annotations deliberately; ambiguous bindings are a graph smell, not a convenience.
Related skills
More from krutikjain/android-agent-skills
android-testing-unit
Write fast, focused Android unit tests for reducers, use cases, repositories, and lifecycle-safe state holders.
189android-kotlin-core
Use Kotlin idioms safely in Android apps, including nullability, data classes, sealed types, extension functions, and collection pipelines.
185android-gradle-build-logic
Shape Android build logic with Gradle, version catalogs, plugins, convention patterns, and toolchain compatibility.
185android-networking-retrofit-okhttp
Build Android networking stacks with Retrofit, OkHttp, interceptors, API contracts, and resilient error handling.
183android-coroutines-flow
Use coroutines, Flow, structured concurrency, dispatchers, and cancellation-safe Android async pipelines.
181android-architecture-clean
Apply clean architecture boundaries, use cases, repositories, and lifecycle-aware presentation models in Android projects.
180