Agent skill
Android Dependency Injection (Hilt)
Standards for Hilt Setup, Scoping, and Modules
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/di
Metadata
Additional technical details for this skill
- labels
-
android di hilt dagger
- triggers
-
{ "files": [ "**/*Module.kt", "**/*Component.kt" ], "keywords": [ "@HiltAndroidApp", "@Inject", "@Provides", "@Binds" ] }
SKILL.md
Android Dependency Injection (Hilt)
Priority: P0
Implementation Guidelines
Setup
- App: Must annotate
Applicationclass with@HiltAndroidApp. - Entries: Annotate Activities/Fragments with
@AndroidEntryPoint.
Modules
- Binding: Use
@Binds(abstract class) over@Provideswhen possible (smaller generated code). - InstallIn: Be explicit (
SingletonComponent,ViewModelComponent).
Construction
- Constructor Injection: Prefer over Field Injection (
@Inject constructor(...)). - Assisted Injection: Use for runtime parameters (
@AssistedInject).
Anti-Patterns
- Component Manual Creation:
**No Manual Dagger**: Use Hilt Standard. - Field Inject in Logic:
**No Field Inject**: Only in Android Components.
References
- Module Templates
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?