agentleFS
GDvegaGDvega/super-android-kotlin-firebase-skill/skills/networking-retrofit-ktor/SKILL.md

networking-retrofit-ktor

Skill2 starsChanged 5 months agoMITView on GitHub

Use for Retrofit, Ktor Client, OkHttp, interceptors, DTO mapping, error handling, retries, timeouts and repository-backed network integration.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 7 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Add tests with fakes or mock server when available.

    line 31
  2. Distinctive:

    Do not call network directly from UI.

    line 35
  3. Distinctive:

    Do not log tokens or secrets.

    line 36
  4. Distinctive:

    Keep DTOs out of domain unless intentionally shared.

    line 38
  5. Distinctive:

    Do not assume these companion skills are installed.

    line 53
  6. Distinctive:

    Use $super-android-kotlin-firebase to connect this screen to a REST API.

    line 91
  7. Distinctive:

    Use $super-android-kotlin-firebase to migrate a repository from Retrofit to Ktor.

    line 92

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Purpose

Integrate remote APIs without coupling UI to transport details.

When to use

  • Adding Retrofit or Ktor client.
  • Handling HTTP errors and retries.
  • Mapping DTOs to domain models.
  • Adding auth headers or interceptors.

Inputs to inspect

  • API contract and base URL handling.
  • Existing network stack.
  • Serialization library.
  • Error and retry requirements.
  • Security requirements for headers/logging.

Required workflow

  1. Reuse the existing network client if present.
  2. Define DTOs and service/client methods.
  3. Map DTOs to domain at the data boundary.
  4. Model errors and retry policy.
  5. Add tests with fakes or mock server when available.

Rules

  • Do not call network directly from UI.
  • Do not log tokens or secrets.
  • Avoid infinite retries.
  • Keep DTOs out of domain unless intentionally shared.
  • Respect coroutine cancellation.

Related existing skills

Local skills to invoke

  • android-architecture
  • kotlin-core
  • security-privacy
  • ui-state-design
  • testing

External companion skills to use when installed

Do not assume these companion skills are installed. Prefer the local skills above first, then consult Companion Skills for install and verification commands.

  • android/skills — use for official Android workflow alignment when a first-party companion skill exists for the task.

Files commonly touched

  • network module
  • DTOs
  • API service/client
  • repository implementation
  • interceptors
  • tests

Commands to validate

./gradlew test
./gradlew assembleDebug
./gradlew lint

Common mistakes to avoid

  • Returning raw Response to UI.
  • Logging Authorization headers.
  • No timeout policy.
  • Swallowing HTTP error details needed by UX.

Checklist

  • Client reused/configured.
  • Errors modeled.
  • DTO mapping tested.
  • Timeouts/retries explicit.
  • No secrets logged.

Example prompts

  • Use $super-android-kotlin-firebase to connect this screen to a REST API.
  • Use $super-android-kotlin-firebase to migrate a repository from Retrofit to Ktor.

Expected response style

Respond with: brief diagnosis, change plan, affected files, code or diff summary, validation commands, tests added or recommended, risks, and next step. For review tasks, lead with findings ordered by severity.

References

  • ../../docs/audits/FUENTES_LOCALES.md
  • references/network-boundaries.md
  • templates/network-repository-template.md

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.