mcpField
A
android-networking-retrofit-okhttp

android-networking-retrofit-okhttp

github.com/krutikjainDevelopment14277 installsUpdated 31w ago
Repository

About android-networking-retrofit-okhttp

A skill for Android developers building networking layers with Retrofit and OkHttp. It focuses on explicit API contracts, resilient error handling, and migration-safe patterns that respect data and persistence boundaries.

Key features

  1. 01Retrofit and OkHttp setup
  2. 02Interceptor configuration
  3. 03Typed API contracts
  4. 04Resilient error handling
  5. 05Offline and retry validation

Use cases

  1. 01Set up an Android API networking layer
  2. 02Map API failures to app errors
  3. 03Test stale-cache and retry behavior

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/krutikjain/android-agent-skills --skill android-networking-retrofit-okhttp

After installing, type/android-networking-retrofit-okhttpin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

agents/
openai.yaml
references/
official-links.md
patterns.md
scenarios.md
scripts/
run_examples.sh

Details

From the project README

Android Networking Retrofit OkHttp

When To Use

  • Use this skill when the request is about: retrofit android setup, okhttp interceptor android, api error mapping android.
  • Primary outcome: Build Android networking stacks with Retrofit, OkHttp, interceptors, API contracts, and resilient error handling.
  • Handoff skills when the scope expands:
  • android-serialization-offline-sync
  • android-security-best-practices

Workflow

  1. Confirm the data source, persistence boundary, sync model, and device capability involved.
  2. Model contracts explicitly before wiring network, storage, media, or background APIs.
  3. Apply the recommended AndroidX or platform pattern with migration-safe defaults.
  4. Validate offline, retry, and process death behavior against the sample apps and scenarios.
  5. Escalate security, performance, or release risk to the linked supporting skills when needed.

Guardrails

  • Prefer typed models and explicit serializers over ad-hoc maps or bundles.
  • Keep background work idempotent and cancellation-aware.
  • Do not leak storage, media, or networking details into presentation code.
  • Treat user data durability, privacy, and migration paths as part of the implementation.

Anti-Patterns

  • Blocking the main thread with disk or network calls.
  • Treating retryable sync failures as terminal user-facing errors.
  • Mixing cache models and wire models without a mapping layer.
  • Requesting broad storage or notification capabilities when a narrower API exists.

Examples

Happy path
  • Scenario: Model sync requests and network failures for task refresh.
  • Command: cd examples/orbittasks-compose && ./gradlew :app:testDebugUnitTest
Edge case
  • Scenario: Handle stale cache and retry behavior in the XML fixture.
  • Command: cd examples/orbittasks-xml && ./gradlew :app:testDebugUnitTest
Failure recovery
  • Scenario: Differentiate networking prompts from serialization, security, and offline-sync requests.
  • Command: python3 scripts/eval_triggers.py --skill android-networking-retrofit-okhttp

Done Checklist

  • The implementation path is explicit, minimal, and tied to the right Android surface.
  • Relevant example commands and benchmark prompts have been exercised or updated.
  • Handoffs to adjacent skills are documented when the request crosses boundaries.
  • Official references cover the chosen pattern and the main migration or troubleshooting path.

Official References

Comments

Markdown supported