Android di
Skill ComeOnOliver/skillshub/skills/HoangNguyen0403/agent-skills-standard/android-di
Standards for Hilt Setup, Scoping, and Modules. Use when setting up Hilt dependency injection, component scoping, or modules in Android. (triggers: **/*Module.kt, **/*Component.kt, @HiltAndroidApp, @Inject, @Provides, @Binds)From its SKILL.md
npx -y skills add ComeOnOliver/skillshub --skill android-diAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
SKILL.md
1.1 KB, 193 tokens by cl100k_base, as published. Nobody here has run it
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
- No Manual Dagger Components: Use Hilt — it generates all the wiring.
- No Field Injection in Logic: Use constructor injection; field injection only in Android components.
References
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.