Skip to content
Back to skills

Android Di

ASecurity

Configure Hilt dependency injection with proper scoping, modules, and constructor injection in Android. Use when setting up Hilt DI, defining modules, or configuring component scoping.

  • 549 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added June 6, 2026
development

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned June 6, 2026

npx -y skills add HoangNguyen0403/agent-skills-standard --skill android-di --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Android Di?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Android Di
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/hoangnguyen0403-android-di/badge)](https://www.skillsdirectory.com/skills/hoangnguyen0403-android-di)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: android-di
description: Configure Hilt dependency injection with proper scoping, modules, and constructor injection in Android. Use when setting up Hilt DI, defining modules, or configuring component scoping.
metadata:
  triggers:
    files:
    - '**/*Module.kt'
    - '**/*Component.kt'
    keywords:
    - "@HiltAndroidApp"
    - "@Inject"
    - "@Provides"
    - "@Binds"
---
# Android Dependency Injection (Hilt)

## **Priority: P0**

## 1. Bootstrap Hilt

- Annotate `Application` class with `@HiltAndroidApp`.
- Annotate Activities/Fragments with `@AndroidEntryPoint`.

See [module templates](references/files.md) 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](references/files.md) 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

- [Module Templates](references/files.md)

Files in this skill

  • SKILL.md1.3 KB
  • evals/evals.json2.9 KB
  • references/files.md1.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.