What problem does it solve?
This Skill provides a standard pattern for implementing repositories that talk to remote APIs, ensuring a clean separation between interfaces and implementations and enforcing safe remote calls.
Core Features & Use Cases
- Interface + Implementation split: Define XxxRepository and XxxRepositoryImpl with suspend functions returning ApiResult<T>.
- Safe API calls: Wrap every remote API call with safeApiCall and ensure Retrofit-based responses map to ApiResult.
- Hilt binding: Provide a RepositoryModule binding to inject XxxRepositoryImpl as XxxRepository and bind to Singleton scope.
- Use Case: When building a feature that interacts with a backend, create a dedicated remote repository that handles network calls and error handling, without mixing in Room/DAO logic.
Quick Start
Create an XxxRepository interface and an XxxRepositoryImpl implementation, add a RepositoryModule binding, and ensure all remote calls are wrapped with safeApiCall.