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 reside in this layer. They must resolve their domain repository dependencies purely via constructor injection using the @Inject annotation on the constructor. They are not allowed to declare modules or access Android context.
  • The :data Module: This module contains repository implementations, network service adapters (such as Retrofit/OkHttpClient), and local database architectures (such as Room). Hilt modules with @Binds or @Provides reside in this module to wire repository interfaces to their concrete implementations.
  • The :app Module: Serves as the central orchestrator that glues the entire application together. It defines the @HiltAndroidApp class, registers application-level Android entry points (@AndroidEntryPoint or @HiltViewModel), and initializes system components like background processes, WorkManager, and Firebase Cloud Messaging (FCM).

2. Structural Module Guidelines & Optimizations

Installs
2
First Seen
11 days ago
hilt — albertmartorell1975/android-ai-workflow-foundation