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-unit
  • android-networking-retrofit-okhttp

Workflow

  1. Identify the injection boundary first: app-wide singleton, activity-retained, ViewModel, worker, service, or entry point from unsupported framework code.
  2. Decide what should be bound: constructor injection, @Binds, @Provides, qualifiers, multibindings, or assisted injection.
  3. Match lifetime to scope explicitly so dependencies do not outlive their owner or rebuild too often.
  4. Verify replacement strategy for tests with Hilt test modules, uninstall modules, or fakes at the right component boundary.
  5. 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
Installs
9
GitHub Stars
5.4K
First Seen
10 days ago