retrofit-networking

Standardize Android network calls with Retrofit services and a shared OkHttp client.

1|Updated Apr 24, 2026
One-click install
npx skills add https://github.com/dimitriRemoiville/cc-mobile --skill retrofit-networking
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: retrofit-networking
Source: https://github.com/dimitriRemoiville/cc-mobile/tree/main/plugins/cc-mobile-android/skills/retrofit-networking
Command: npx skills add https://github.com/dimitriRemoiville/cc-mobile --skill retrofit-networking

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Android apps rely on network calls that are error-prone and boilerplate heavy. This Skill standardizes Retrofit services and OkHttp configuration to provide a clean, testable networking layer and consistent error handling.

Core Features & Use Cases

  • Typed API interfaces: Define Retrofit services with suspend functions and typed parameters.
  • DTO + Domain Mapping: Use kotlinx.serialization DTOs and mapping to domain models.
  • Error Handling: Centralized mapping of HTTP errors to domain errors at the repository boundary.
  • Use Case: Create a repository method to fetch a list of orders and handle errors consistently.

Quick Start

Configure a Retrofit service for an endpoint and wire up an OkHttp client with a logging interceptor in debug mode.

Frequently Asked Questions about retrofit-networking

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

FAQPage Schema
How do I standardize Retrofit networking with OkHttp on Android?

Standardize Retrofit networking by implementing typed suspend functions for API interfaces and configuring a shared singleton OkHttp client with safe logging and proper auth handling. This enforces a clean, testable networking layer across your Android app.

What's the best way to handle Retrofit HTTP errors at the repository boundary?

Handle Retrofit HTTP errors by centralized mapping to domain errors at the repository boundary. This approach intercepts network failures and HTTP errors, translating them into consistent domain-level error types before they reach the UI.

How do I map Retrofit DTOs to domain models using kotlinx.serialization?

Map Retrofit DTOs to domain models by defining serializable data classes with kotlinx.serialization, then converting them to domain objects. This separates network response structures from internal business logic.

Does this Retrofit setup support suspend functions and typed annotations?

Yes, this Retrofit setup fully supports suspend functions and typed parameters for API interfaces. It enforces coroutine-based asynchronous network calls, ensuring thread safety and structured concurrency in Android.

Why use a singleton OkHttp client with Retrofit for Android network calls?

Use a singleton OkHttp client to share connection pools, interceptors, and thread pools across all Retrofit services. This reduces memory overhead and ensures consistent configuration for logging and authentication handling.