AN

Android Dependency Injection (Hilt)

Enforce Hilt best practices for dependency injection, including annotations, modules, and component usage.

Install

mkdir -p .claude/skills/android-dependency-injection-hilt && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/10528" && unzip -o skill.zip -d .claude/skills/android-dependency-injection-hilt && rm skill.zip

Installs to .claude/skills/android-dependency-injection-hilt

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Standards for Hilt Setup, Scoping, and Modules
46 charsno explicit “when” trigger
Beginner

Key capabilities

  • Annotate `Application` class with `@HiltAndroidApp`
  • Annotate Activities/Fragments with `@AndroidEntryPoint`
  • Use `@Binds` for module binding when possible
  • Explicitly define `InstallIn` for modules
  • Prefer constructor injection over field injection
  • Use `@AssistedInject` for runtime parameters

How it works

The skill applies Hilt standards by annotating application components, configuring modules with `@Binds` and `InstallIn`, and preferring constructor injection for dependencies.

Inputs & outputs

You give it
Android application code requiring dependency injection setup
You get back
Hilt-compliant Android application code with proper annotations and module configurations

When to use Android Dependency Injection (Hilt)

  • Setting up Hilt
  • Refactoring DI modules
  • Validating dependency injection code

About this skill

Android Dependency Injection (Hilt)

Priority: P0

Implementation Guidelines

Setup

  • App: Must annotate Application class with @HiltAndroidApp.
  • Entries: Annotate Activities/Fragments with @AndroidEntryPoint.

Modules

  • Binding: Use @Binds (abstract class) over @Provides when 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

When not to use it

  • When manually creating Dagger components
  • When performing field injection in logic classes
  • When the project does not use Hilt for dependency injection

Limitations

  • Discourages manual Dagger component creation
  • Restricts field injection to Android components only
  • Focuses specifically on Hilt implementation guidelines

How it compares

This skill enforces specific Hilt best practices and anti-patterns, guiding developers to write more efficient and maintainable DI code compared to ad-hoc Dagger implementations.

Compared to similar skills

Android Dependency Injection (Hilt) side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
Android Dependency Injection (Hilt) (this skill)05moNo flagsBeginner
flowmvi16moNo flagsAdvanced
kotlin-multiplatform323moReviewAdvanced
backend-microservice-development23moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

More by li-lance

View all by li-lance

Android Navigation

li-lance

Standards for Jetpack Navigation Compose (Type-safe)

00

angular-ssr

li-lance

Implement Angular SSR with hydration, TransferState caching, and per-route render modes. Use when configuring Angular Universal SSR, client hydration, static prerendering, or preventing double-fetching. (triggers: **/*.server.ts, server.ts, hydration, transferState, afterNextRender, isPlatformServer

00

php-concurrency

li-lance

Implement concurrency and non-blocking I/O in modern PHP. Use when implementing concurrent requests, async processing, or non-blocking I/O in PHP. (triggers: **/*.php, Fiber, suspend, resume, non-blocking, async)

00

react-performance

li-lance

Optimize React rendering, bundle size, and data fetching performance. Use when optimizing React rendering performance, reducing re-renders, or improving bundle size. (triggers: **/*.tsx, **/*.jsx, waterfall, bundle, lazy, suspense, dynamic)

00

common-workflow-writing

li-lance

Rules for writing concise, token-efficient workflow and skill files. Prevents over-building that requires costly optimization passes. Use when creating or editing workflow files, SKILL.md files, or new skill definitions. (triggers: .agent/workflows/*.md, SKILL.md, create workflow, write workflow, ne

00

common-security-standards

li-lance

Enforce universal security protocols for safe, resilient software. Use when implementing authentication, encryption, authorization, input validation, secret management, or any security-sensitive feature across any language or framework. (triggers: **/*.ts, **/*.tsx, **/*.go, **/*.dart, **/*.java, **

00

You might also like

flowmvi

respawn-app

FlowMVI usage guidance. Use when working with FlowMVI stores/containers, plugin pipelines, composing stores, decorators, or authoring plugins.

11

kotlin-multiplatform

vitorpamplona

Platform abstraction decision-making for Amethyst KMP project. Guides when to abstract vs keep platform-specific, source set placement (commonMain, jvmAndroid, platform-specific), expect/actual patterns. Covers primary targets (Android, JVM/Desktop, iOS) with web/wasm future considerations. Integrates with gradle-expert for dependency issues. Triggers on: abstraction decisions ("should I share this?"), source set placement questions, expect/actual creation, build.gradle.kts work, incorrect placement detection, KMP dependency suggestions.

32156

backend-microservice-development

TencentBlueKing

后端微服务开发规范,涵盖目录结构、分层架构(API/Service/DAO)、依赖注入、配置管理、Spring Boot 最佳实践。当用户进行后端开发、创建新微服务、编写 Kotlin/Java 代码或设计服务架构时使用。

213

kotlin-coroutines

vitorpamplona

Advanced Kotlin coroutines patterns for AmethystMultiplatform. Use when working with: (1) Structured concurrency (supervisorScope, coroutineScope), (2) Advanced Flow operators (flatMapLatest, combine, merge, shareIn, stateIn), (3) Channels and callbackFlow, (4) Dispatcher management and context switching, (5) Exception handling (CoroutineExceptionHandler, SupervisorJob), (6) Testing async code (runTest, Turbine), (7) Nostr relay connection pools and subscriptions, (8) Backpressure handling in event streams. Delegates to kotlin-expert for basic StateFlow/SharedFlow patterns. Complements nostr-expert for relay communication.

311

extensions-api-migration

JetBrains

Migrates IdeaVim extensions from the old VimExtensionFacade API to the new @VimPlugin annotation-based API. Use when converting existing extensions to use the new API patterns.

13

trail-sense-database-persistence

kylecorry31

Add new Room database persistence to Trail-Sense Android app. Use when the user asks to create, add, or implement database persistence for a model, including Entity, DAO, Repository, and AppDatabase migration. Covers entity-to-model mapping, index configuration, and standard CRUD operations.

10

Search skills

Search the agent skills registry