Android Dependency Injection (Hilt)

SkillAI & models

Configure Hilt dependency injection with proper scoping, modules, and constructor injection in Android. Use when changing the production Hilt graph; defer test overrides, Room wiring, navigation-specific scopes, and generic DI explanations to their specific skills.

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the Android Dependency Injection (Hilt) skill

What this skill tells your AI

The instructions your AI receives, as published by hoangnguyen0403/agent-skills-standard in skills/android/android-di/SKILL.md and read by ahel’s review.

Priority: P0 (CRITICAL)

1. Bootstrap Hilt

  • Annotate Application class with @HiltAndroidApp.
  • Annotate Activities/Fragments with @AndroidEntryPoint.

See module templates for bootstrap and module examples.

2. Define Modules

  • Use @Binds (abstract class) over @Provides when possible — generates smaller code.
  • explicit with @InstallIn (SingletonComponent, ViewModelComponent).

See module templates for @Binds examples.

3. Prefer Constructor Injection

  • Use @Inject constructor(...) over field injection.
  • Use @AssistedInject for runtime parameters.

Anti-Patterns

  • No Manual Dagger Components: Use Hilt — it generates all wiring.
  • No Field Injection in Logic: Use constructor injection; field injection only in Android framework classes.

References

Signals

GitHub stars
565
Forks
164
Last commit
Sep 2026
Advanced
Catalog kind
skill
Gateway key
android-di
Source
github.com/hoangnguyen0403/agent-skills-standard