Agent Skillsmidudev/autoskills › android-networking-retrofit-okhttp

android-networking-retrofit-okhttp

GitHub

用于构建Android网络层,涵盖Retrofit与OkHttp集成、拦截器配置、API契约定义及弹性错误处理。适用于网络请求设置、接口映射等场景,强调类型安全、后台任务幂等性及数据隐私保护。

packages/autoskills/skills-registry/android-networking-retrofit-okhttp/SKILL.md midudev/autoskills

触发场景

Retrofit Android环境搭建 OkHttp拦截器实现 API错误映射处理

安装

npx skills add midudev/autoskills --skill android-networking-retrofit-okhttp -g -y
更多选项

非标准路径

npx skills add https://github.com/midudev/autoskills/tree/main/packages/autoskills/skills-registry/android-networking-retrofit-okhttp -g -y

不安装直接使用

npx skills use midudev/autoskills@android-networking-retrofit-okhttp

指定 Agent (Claude Code)

npx skills add midudev/autoskills --skill android-networking-retrofit-okhttp -a claude-code -g -y

安装 repo 全部 skill

npx skills add midudev/autoskills --all -g -y

预览 repo 内 skill

npx skills add midudev/autoskills --list

SKILL.md

Frontmatter
{
    "name": "android-networking-retrofit-okhttp",
    "metadata": {
        "tags": [
            "android",
            "networking",
            "retrofit",
            "okhttp"
        ],
        "owners": [
            "@android-agent-skills\/maintainers"
        ],
        "version": "0.1.0",
        "category": "data-platform",
        "triggers": {
            "exclude": [
                "fragment back stack",
                "compose semantics",
                "play store notes"
            ],
            "include": [
                "retrofit android setup",
                "okhttp interceptor android",
                "api error mapping android",
                "network client cleanup android",
                "retry timeout android api"
            ]
        },
        "test_targets": [
            "examples\/orbittasks-compose",
            "examples\/orbittasks-xml",
            "benchmarks\/triggers.jsonl"
        ]
    },
    "description": "Build Android networking stacks with Retrofit, OkHttp, interceptors, API contracts, and resilient error handling."
}

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

版本历史

  • 0ec7253 当前 2026-07-24 20:51

同 Skill 集合

packages/autoskills/skills-registry/accessibility/SKILL.md
packages/autoskills/skills-registry/adev-writing-guide/SKILL.md
packages/autoskills/skills-registry/agents-sdk/SKILL.md
packages/autoskills/skills-registry/android-architecture-clean/SKILL.md
packages/autoskills/skills-registry/android-compose-foundations/SKILL.md
packages/autoskills/skills-registry/android-coroutines-flow/SKILL.md
packages/autoskills/skills-registry/android-di-hilt/SKILL.md
packages/autoskills/skills-registry/android-gradle-build-logic/SKILL.md
packages/autoskills/skills-registry/android-kotlin-core/SKILL.md
packages/autoskills/skills-registry/android-testing-unit/SKILL.md
packages/autoskills/skills-registry/angular-developer/SKILL.md
packages/autoskills/skills-registry/aspnet-core/SKILL.md
packages/autoskills/skills-registry/aspnet-minimal-api-openapi/SKILL.md
packages/autoskills/skills-registry/astro/SKILL.md
packages/autoskills/skills-registry/azure-ai/SKILL.md
packages/autoskills/skills-registry/bash-defensive-patterns/SKILL.md
packages/autoskills/skills-registry/best-practices/SKILL.md
packages/autoskills/skills-registry/building-native-ui/SKILL.md
packages/autoskills/skills-registry/bun/SKILL.md
packages/autoskills/skills-registry/chrome-extension-development/SKILL.md
packages/autoskills/skills-registry/clerk-android/SKILL.md
packages/autoskills/skills-registry/clerk-astro-patterns/SKILL.md
packages/autoskills/skills-registry/clerk-backend-api/SKILL.md
packages/autoskills/skills-registry/clerk-chrome-extension-patterns/SKILL.md
packages/autoskills/skills-registry/clerk-custom-ui/SKILL.md
packages/autoskills/skills-registry/clerk-expo-patterns/SKILL.md
packages/autoskills/skills-registry/clerk-nextjs-patterns/SKILL.md
packages/autoskills/skills-registry/clerk-nuxt-patterns/SKILL.md
packages/autoskills/skills-registry/clerk-orgs/SKILL.md
packages/autoskills/skills-registry/clerk-react-patterns/SKILL.md
packages/autoskills/skills-registry/clerk-react-router-patterns/SKILL.md
packages/autoskills/skills-registry/clerk-setup/SKILL.md
packages/autoskills/skills-registry/clerk-swift/SKILL.md
packages/autoskills/skills-registry/clerk-tanstack-patterns/SKILL.md
packages/autoskills/skills-registry/clerk-testing/SKILL.md
packages/autoskills/skills-registry/clerk-vue-patterns/SKILL.md
packages/autoskills/skills-registry/clerk-webhooks/SKILL.md
packages/autoskills/skills-registry/cloudflare-deploy/SKILL.md
packages/autoskills/skills-registry/cloudflare/SKILL.md
packages/autoskills/skills-registry/composition-patterns/SKILL.md
packages/autoskills/skills-registry/containerize-aspnetcore/SKILL.md
packages/autoskills/skills-registry/core-data-expert/SKILL.md
packages/autoskills/skills-registry/csharp-docs/SKILL.md
packages/autoskills/skills-registry/csharp-mstest/SKILL.md
packages/autoskills/skills-registry/csharp-nunit/SKILL.md
packages/autoskills/skills-registry/csharp-tunit/SKILL.md
packages/autoskills/skills-registry/csharp-xunit/SKILL.md
packages/autoskills/skills-registry/dart-best-practices/SKILL.md
packages/autoskills/skills-registry/deno-deploy/SKILL.md

元信息

文件数
0
版本
0ec7253
Hash
9b420c87
收录时间
2026-07-24 20:51

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-07 19:20
浙ICP备14020137号-1 $访客地图$