hilt-di

Configure Hilt DI bindings, ViewModels, and entry points in Android apps.

1|Updated Apr 24, 2026
One-click install
npx skills add https://github.com/dimitriRemoiville/cc-mobile --skill hilt-di
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hilt-di
Source: https://github.com/dimitriRemoiville/cc-mobile/tree/main/plugins/cc-mobile-android/skills/hilt-di
Command: npx skills add https://github.com/dimitriRemoiville/cc-mobile --skill hilt-di

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Hilt DI wiring and usage across Android projects can become error-prone as complexity grows. This guide helps teams configure and maintain dependency injection so components can be constructed safely, tested effectively, and refactored with ease.

Core Features & Use Cases

  • Define DI bindings with @Module, @Binds, and @Provides to map interfaces to implementations.
  • Declare ViewModels with @HiltViewModel and retrieve them with hiltViewModel().
  • Annotate Activities/Fragments with @AndroidEntryPoint to enable injection.
  • Configure a Hilt-enabled Application with @HiltAndroidApp.
  • Write Hilt-aware tests to validate bindings and scopes.

Quick Start

Add Hilt to your Android project by annotating your Application with @HiltAndroidApp, annotate Components with @AndroidEntryPoint, and inject dependencies via @Inject or constructor parameters in your ViewModels.

Frequently Asked Questions about hilt-di

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

FAQPage Schema
How do I set up Hilt dependency injection in an Android app?

To set up Hilt dependency injection, annotate your Application with @HiltAndroidApp, annotate Activities and Fragments with @AndroidEntryPoint, and inject dependencies using @Inject or ViewModel constructor parameters.

How do I bind an interface to an implementation using Hilt?

You bind interfaces to implementations in Hilt by creating a class annotated with @Module and using either the @Binds annotation for interface mappings or the @Provides annotation for complex object construction.

How do I inject dependencies into an Android ViewModel with Hilt?

To inject dependencies into a ViewModel with Hilt, annotate the class with @HiltViewModel and add the required dependencies as constructor parameters, then retrieve it in your Composable or Activity using hiltViewModel().

Can I use Hilt to write tests for Android dependency injection bindings?

Yes, you can write Hilt-aware tests to validate your dependency injection bindings and scopes, ensuring that components are constructed safely and can be tested effectively across your Android project.

Why is my Hilt dependency injection failing to construct components?

Hilt DI errors often occur when Application annotation, component entry points, or proper interface bindings are missing or incorrectly configured, which prevents components from being constructed safely.