mcpbeat

Android Di

hoangnguyen0403/android-di

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.

1k tokens
context cost
the whole folder, loaded on every use
3
files
instructions only
0
copies elsewhere
how many repositories repackaged it
536
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/HoangNguyen0403/agent-skills-standard --skill android-di

What comes with it

4 567 bytes besides the instruction
evals/evals.json
references/files.md

The instruction itself

7 sections, as written by the author

Android Dependency Injection (Hilt)

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

  • Module Templates

How to use it

Copy the folder

Take hoangnguyen0403/android-di from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.