hilt-providers

Implements Hilt dependency injection conventions for Android modules, repositories, ViewModels, and Workers.

Updated May 9, 2026
One-click install
npx skills add https://github.com/Bumh3rr/solvyx-app --skill hilt-providers-bumh3rr
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: hilt-providers
Source: https://github.com/Bumh3rr/solvyx-app/tree/main/.opencode/skill/hilt-providers
Command: npx skills add https://github.com/Bumh3rr/solvyx-app --skill hilt-providers-bumh3rr

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Android projects using Hilt often suffer from inconsistent dependency injection patterns, missing bindings, and scoping errors. This Skill provides the Solvyx project conventions for registering DAOs, repositories, Room databases, DataStore, and long-lived dependencies with Hilt. ## Core Features & Use Cases - Module Templates: Ready-to-use patterns for AppModule, RepositoryModule, NetworkModule, and WorkerModule with correct @Provides, @Binds, and @Singleton usage. - Injection Patterns: Covers constructor injection, @HiltViewModel ViewModels, @HiltWorker Workers with HiltWorkerFactory setup, and Proto DataStore provisioning. - Error Troubleshooting: A table of common Hilt errors (MissingBinding, unqualified Context injection, Worker injection failures) with concrete fixes, plus testing patterns with @HiltAndroidTest. - Use Case: When adding a new repository to the app, apply the binding pattern in RepositoryModule and constructor injection in the implementation class, avoiding scoping and qualifier mistakes. ## Quick Start Apply the Hilt conventions skill to register a new repository and its DAO in the appropriate Solvyx di modules.

Frequently Asked Questions about hilt-providers

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I provide a Room database with Hilt in Android?▼

Create an @Module object installed in SingletonComponent with a @Provides @Singleton method that builds the database via Room.databaseBuilder using @ApplicationContext. Add separate @Provides methods for each DAO that receive the database as a parameter.

When should I use @Binds versus @Provides in Hilt?▼

Use @Binds in an abstract class to map an interface to its implementation when the implementation has an @Inject constructor. Use @Provides only when you cannot annotate the constructor, such as for third-party classes or builder-based configuration.

How do I inject dependencies into a WorkManager Worker with Hilt?▼

Annotate the Worker with @HiltWorker and use @AssistedInject with @Assisted Context and WorkerParameters. Then configure HiltWorkerFactory in your Application class by implementing Configuration.Provider and setting the factory in the WorkManager configuration.

Why does Hilt throw a MissingBinding error?▼

MissingBinding occurs when no @Provides or @Binds method exists for the requested type in the correct component scope. Fix it by adding the binding to the appropriate module, or add an @Inject constructor to the class being requested.

Can I inject Context directly with Hilt?▼

No, injecting Context without a qualifier fails. Use @ApplicationContext for application-scoped needs like databases and DataStore, or @ActivityContext for activity-scoped dependencies, and never inject Application or Activity directly.