Agent skill

Android Retrofit

by rcosteira79 in rcosteira79/android-skills

A skill your agent uses when setting up or working with Retrofit in Android — service interface definitions, coroutines integration, OkHttp configuration, Hilt module setup, and error handling in…

MITAuto-check passedDevelopment

Install Android Retrofit

skills CLI
$ npx skills add rcosteira79/android-skills --skill android-retrofit -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install rcosteira79/android-skills android-retrofit --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/rcosteira79/android-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/android-skills/skills/android-retrofit .claude/skills/android-retrofit && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
android-retrofit
GitHub stars
153
Token cost
~942 tokens
SKILL.md length
343 words
Files
1
Skills in repo
21
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when setting up or working with Retrofit in Android — service interface definitions, coroutines integration, OkHttp configuration, Hilt module setup, and error handling in…

  • Working with Retrofit in Android — service interface definitions
  • SKILL.md covers Service interface, OkHttp & JSON, Auth: interceptor, and the… and Error handling, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Coroutines integration

What it does

Android Retrofit is an agent skill from rcosteira79/android-skills. Use when setting up or working with Retrofit in Android — service interface definitions, coroutines integration, OkHttp configuration, Hilt module setup, and error handling in the repository layer.

Its SKILL.md is about 940 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Error handling. It works with Android. The repository describes itself as: Claude Code skills for Android & KMP development. The licence is MIT.

When your agent uses it

  • Working with Retrofit in Android — service interface definitions
  • Coroutines integration
  • OkHttp configuration
  • Hilt module setup

Example prompts

  • “/android-retrofit”

What it can do on your machine

Read from SKILL.md and the folder at commit 0f9af5a. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are kotlin).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Android Retrofit loads about 942 tokens when it runs. Until then it costs about 54 tokens; SKILL.md has 343 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~54
When it runs · the whole SKILL.md, loaded when a task matches
~942

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from rcosteira79/android-skills at commit 0f9af5a, republished under its MIT licence (© rcosteira79). 343 words, ~942 tokens.

Download SKILL.mdSave it as .claude/skills/android-retrofit/SKILL.md (or your agent's skills folder).
name
android-retrofit
description
Use when setting up or working with Retrofit in Android — service interface definitions, coroutines integration, OkHttp configuration, Hilt module setup, and error handling in the repository layer.

Android Networking with Retrofit

Modern Retrofit setup for Android using coroutines, kotlinx.serialization, and Hilt. This reference covers the decisions that are easy to get wrong, not the standard boilerplate of service interfaces, Hilt module wiring, and the converter setup.

Service interface

Declare every endpoint as a suspend function. Return the body type directly — Retrofit throws HttpException on non-2xx, giving a clean try/catch at the repository boundary. Use Response<T> only when you need the status code, headers, or error body (e.g. server-side validation messages):

kotlin
// Direct body — throws HttpException on non-2xx; the common case
@GET("users/{user}/repos")
suspend fun listRepos(@Path("user") user: String): List<Repo>

// Response wrapper — only when you need code/headers/error body
@GET("users/{user}")
suspend fun getUser(@Path("user") user: String): Response<User>

Wrapping every endpoint in Response<T> "just in case" forces callers to check isSuccessful and handle a nullable body even when only the body matters — don't.

OkHttp & JSON

Standard wiring (in a Hilt @Module/@Provides @Singleton): HttpLoggingInterceptor with its level gated on BuildConfig.DEBUG, sensible connect/read timeouts, and the kotlinx.serialization converter (json.asConverterFactory("application/json".toMediaType())). For an API that's loose with its payloads, configure:

kotlin
Json { ignoreUnknownKeys = true; coerceInputValues = true; isLenient = true }

Auth: interceptor, and the throw-vs-proceed decision

Attach the token via an Interceptor, not a per-endpoint @Header — a single missed @Header parameter is an unauthenticated request that fails at runtime, not compile time. The part most often gotten wrong is what to do when the token is absent:

kotlin
class AuthInterceptor @Inject constructor(
    private val tokenProvider: TokenProvider,
) : Interceptor {
    override fun intercept(chain: Interceptor.Chain): Response {
        val token = tokenProvider.getToken()
            ?: throw IOException("Auth token unavailable") // fail fast — see note below
        val request = chain.request().newBuilder()
            .header("Authorization", "Bearer $token")
            .build()
        return chain.proceed(request)
    }
}

Throw vs proceed: Throw when all endpoints require auth — a missing token should surface immediately rather than silently producing a confusing 401. Proceed without the header only if the same OkHttpClient is shared between authenticated and public endpoints: ?: return chain.proceed(chain.request()). Silently proceeding when every call needs auth is a common mistake.

Error handling

The repository is the error boundary: catch HttpException/IOException there and map them to a domain error type — never let Retrofit/OkHttp exception types reach the ViewModel, and never expose Retrofit DTOs to it. Don't redefine the error hierarchy here; see android-skills:android-data-layer for the repository pattern and the shared DataError taxonomy.

Checklist

  • All service functions are suspend
  • Response<T> only when you need the status code, headers, or error body
  • OkHttpClient logging gated behind BuildConfig.DEBUG; sensible timeouts set
  • Auth applied via an Interceptor, with the token-absent policy chosen (throw vs proceed)
  • Network exceptions mapped to domain types at the repository; DTOs never reach the ViewModel

© rcosteira79, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in plugins/android-skills/skills/android-retrofit of rcosteira79/android-skills.

Open the folder on GitHubat commit 0f9af5a

Compare with similar skills

Android Retrofit next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Android Retrofit compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Android Retrofit this skillrcosteira79/android-skills153—~942Automated safety check: PassMIT
Crash Instrumentationnexus-labs-automation/mobile-observability116—~744Automated safety check: PassMIT
Quality Test Pilotnekomangaorg/Neko2.8k—~1.1kAutomated safety check: PassApache-2.0
Mole Bug Patternstw93/Mole70k—~2kAutomated safety check: PassGPL-3.0
Native Data FetchingCherryHQ/cherry-studio-app4k6 repos~2.9kAutomated safety check: NotesMIT
Android UI Visual Reviewpermissionlesstech/bitchat-android7.8k—~2.6kAutomated safety check: PassGPL-3.0

Similar skills

  • Crash Instrumentation

    nexus-labs-automation/mobile-observability

    Set up crash instrumentation with actionable context. An agent skill from nexus-labs-automation/mobile-observability.

    116 GitHub stars~744 tokensUpdated 1 mo ago
    DevOps & CloudAuto-check passed
  • Quality Test Pilot

    nekomangaorg/Neko

    Writes high-quality unit tests for Kotlin Android codebases to increase meaningful test coverage.

    2.8k GitHub stars~1.1k tokensUpdated yesterday
    Testing & QAAuto-check passed
  • A catalog of recurring bug shapes in the Mole Mac cleaner, used to review safety-sensitive diffs for deletion safety, unbounded commands, shell traps and weak tests.

    70k GitHub stars~2k tokensUpdated today
    DevelopmentAuto-check passed
  • Native Data Fetching

    CherryHQ/cherry-studio-app

    A skill your agent uses when implementing or debugging ANY network request, API call, or data fetching.

    4k GitHub starsUsed in 6 repos~2.9k tokens
    DevelopmentAuto-check: notes
  • Android UI Visual Review

    permissionlesstech/bitchat-android

    Analyze an Android pull request, branch, commit, or patch for user-visible changes and produce reproducible before/after screenshots from isolated builds.

    7.8k GitHub stars~2.6k tokensUpdated 4 days ago
    DevelopmentAuto-check passed
  • Guide for writing idiomatic Rust code based on Apollo GraphQL's best practices handbook.

    5.6k GitHub starsUsed in 3 repos~1.1k tokens
    DevelopmentAuto-check passed

More from rcosteira79/android-skills

All 21 skills in this repo
  • Guides writing correct, performant Compose and Compose Multiplatform UI across Android, desktop, iOS and web, from state and animation to design-to-code and crash fixes.

    153 GitHub stars~2.6k tokensUpdated 21 days ago
    Auto-check passed
  • Kotlin Multiplatform Boundaries

    rcosteira79/android-skills

    Helps choose how common Kotlin Multiplatform code reaches platform APIs: expect/actual, a common interface with platform bindings, or separate platform screens.

    153 GitHub stars~1.5k tokensUpdated 21 days ago
    Auto-check passed
  • Android Data Layer and Room in KMP

    rcosteira79/android-skills

    Sets out the repository pattern's error-propagation model for Android and Kotlin Multiplatform, plus the Room setup for commonMain.

    153 GitHub stars~1.2k tokensUpdated 21 days ago
    Auto-check passed
  • Android Debugging

    rcosteira79/android-skills

    Android and KMP debugging techniques for crashes, ANRs, memory leaks, R8 traces, Gradle failures and Compose recomposition, built on finding the root cause first.

    153 GitHub stars~2.6k tokensUpdated 21 days ago
    Auto-check passed
  • Android and KMP Baseline

    rcosteira79/android-skills

    Sets house defaults for Android and Kotlin Multiplatform work and routes to the right specialized skill for Compose, networking, testing or build tooling.

    153 GitHub stars~3k tokensUpdated 21 days ago
    Auto-check passed
  • Android Gradle Build Logic

    rcosteira79/android-skills

    Sets up Android Gradle convention plugins in a build-logic composite build, including the version catalog wiring and shared configuration that are easy to get wrong.

    153 GitHub stars~959 tokensUpdated 21 days ago
    Auto-check passed

Works with

Categories

Questions about Android Retrofit

What does Android Retrofit do?

A skill your agent uses when setting up or working with Retrofit in Android — service interface definitions, coroutines integration, OkHttp configuration, Hilt module setup, and error handling in…. Android Retrofit is an agent skill from rcosteira79/android-skills. Use when setting up or working with Retrofit in Android — service interface definitions, coroutines integration, OkHttp configuration, Hilt module setup, and error handling in the repository layer.

When should I use Android Retrofit?

Android Retrofit fits situations like: working with Retrofit in Android — service interface definitions; coroutines integration; okHttp configuration; hilt module setup.

How do I install Android Retrofit in Claude Code?

Run `npx skills add rcosteira79/android-skills --skill android-retrofit -a claude-code`. Or copy the skill folder (plugins/android-skills/skills/android-retrofit in rcosteira79/android-skills) into .claude/skills/android-retrofit in your project. Claude Code loads it when a task matches its description.

How do I install Android Retrofit in Codex?

Run `npx skills add rcosteira79/android-skills --skill android-retrofit -a codex`. Or copy the skill folder (plugins/android-skills/skills/android-retrofit in rcosteira79/android-skills) into .agents/skills/android-retrofit in your project. Codex loads it when a task matches its description.

Can I use Android Retrofit in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add rcosteira79/android-skills --skill android-retrofit -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/android-retrofit, .gemini/skills/android-retrofit, .github/skills/android-retrofit and .opencode/skills/android-retrofit in your project.

What does Android Retrofit need to run?

SKILL.md names no scripts, command-line tools or credentials: Android Retrofit is instructions for the agent only.

Does Android Retrofit access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Android Retrofit safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Android Retrofit use?

Android Retrofit is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Android Retrofit use?

About 942 tokens (SKILL.md is roughly 3.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Android Retrofit?

Skills that share tags, products or a category with Android Retrofit: Crash Instrumentation (nexus-labs-automation/mobile-observability, 116 stars), Quality Test Pilot (nekomangaorg/Neko, 2.8k stars), Mole Bug Patterns (tw93/Mole, 70k stars) and Native Data Fetching (CherryHQ/cherry-studio-app, 4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Android Retrofit?

rcosteira79 (a GitHub user) maintains it in rcosteira79/android-skills, which has 153 GitHub stars. The repository holds 21 skills in this directory. The repository was last updated on September 19, 2026.

Source: rcosteira79/android-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.