hilt

Installation
SKILL.md

Prerequisites

  • Project MUST use Jetpack Compose as its UI toolkit.
  • Project MUST be configured with Dagger Hilt for Dependency Injection.
  • Project MUST use Kotlin Symbol Processing (KSP) or Kapt for incremental annotation processing.

1. Clean Architecture Boundaries

To preserve strict layer isolation in the project, Hilt dependencies must conform to the following architectural rules:

  • The :domain Module: This module must remain completely agnostic of Hilt, Dagger, or any Android framework classes (such as Context). No DI annotations are allowed in this module. All domain entities, use-case contracts, and repository interfaces are defined here purely.
  • The :usecases Module: Business use cases or interactors must resolve their domain repository dependencies purely via constructor injection using the @Inject annotation. They are not allowed to declare modules or access Android context.
  • The :data Module: This module contains repository implementations, network service adapters, and local databases. Hilt modules with @Binds or @Provides reside here to wire repository interfaces to their concrete implementations.
  • The :app Module: Serves as the central orchestrator (@HiltAndroidApp). Registers application-level Android entry points (@AndroidEntryPoint or @HiltViewModel), and initializes system components like WorkManager and Firebase Cloud Messaging (FCM).

2. Structural Module Guidelines & Optimizations

Installs
4
First Seen
Sep 16, 2026