ios-networking

ios-networking is a skill for Claude Code, Codex from koshkinvv/ios-agent-skills. It costs 174 tokens per session (2,237 once invoked), scanned A, original, MIT.

A set of rules and patterns for networking in iOS apps, Apple's mobile operating system. It covers Swift's async/await style, reusable API clients, authentication refresh, retries, caching, connectivity, and tests.

In plain words
What is it for?
Use it when building or reviewing URLSession-based API calls, OAuth token refresh, retry behavior, offline or connectivity handling, response caching, and network tests in Swift apps.
Why use it?
It prevents scattered network code, unsafe simultaneous token refreshes, incorrect handling of HTTP errors, and tests that do not exercise real request encoding.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when building or reviewing URLSession-based API calls, OAuth token refresh, retry behavior, offline or connectivity handling, response caching, and network tests in Swift apps.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/koshkinvv/ios-agent-skills/ios-networking
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add koshkinvv/ios-agent-skills --skill ios-networking
Clone the repo
git clone --depth 1 https://github.com/koshkinvv/ios-agent-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ios-networking

README.md
[![agentmods](https://agentmods.dev/badge/skills/koshkinvv/ios-agent-skills/ios-networking/github.svg)](https://agentmods.dev/skills/koshkinvv/ios-agent-skills/ios-networking)
Your own site
<a href="https://agentmods.dev/skills/koshkinvv/ios-agent-skills/ios-networking"><img src="https://agentmods.dev/badge/skills/koshkinvv/ios-agent-skills/ios-networking/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ios-networking

Your own site · 80×15
<a href="https://agentmods.dev/skills/koshkinvv/ios-agent-skills/ios-networking"><img src="https://agentmods.dev/badge/skills/koshkinvv/ios-agent-skills/ios-networking.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 174 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,237 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00174 $0.02237
Opus 5 $0.00087 $0.01118
Sonnet 5 $0.00035 $0.00447
Haiku 4.5 $0.00017 $0.00224

Measured 11d ago against content hash aa7fa643dde6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

ios-networking scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/ios-networking/SKILL.md · 210 lines

How it starts

The opening of the file, as written. The whole thing — 210 lines — stays where its author put it; the contents beside it link to each section on GitHub.

iOS Networking Skill

Core Rules

  1. Always use async/await (NOT completion handlers) for new networking code. Completion handlers are legacy — Swift Concurrency is the standard since iOS 15.
  2. Build a generic APIClient with an Endpoint protocol for type-safe requests. Never scatter raw URLSession calls throughout the codebase.
  3. Use actor-based TokenManager for thread-safe OAuth2 token refresh with deduplication. Never allow multiple simultaneous refresh requests.
  4. Handle ALL HTTP status codes properly:
    • 401 → refresh token, retry original request
    • 429 → respect Retry-After header, exponential backoff
    • 5xx → retry with exponential backoff + jitter
    • 4xx (other) → client error, do not retry
  5. Use URLProtocol mocking for tests (NOT mocking URLSession itself). URLProtocol intercepts at the transport layer and tests real serialization paths.
  6. Reuse URLSession instances — creating a session per request prevents HTTP/2 connection multiplexing and wastes memory.
  7. Use URLCache with .useProtocolCachePolicy as the default cache policy. Configure cache size explicitly for production apps.
  8. NWPathMonitor for connectivity awareness, NOT pre-flight checks. Never gate a request on reachability — just make the request and handle the error.
  9. Codable with .convertFromSnakeCase and custom date strategies. Avoid manual CodingKeys when snake_case conversion handles it.
  10. Keep ATS enabled. Use domain-specific exceptions in Info.plist only when absolutely necessary. Never disable ATS globally.

Decision Guide

Task Solution Reference
Simple GET/POST URLSession.shared.data(for:) urlsession.md
Multiple endpoints Generic APIClient + Endpoint protocol api-client.md
Auth with token refresh Actor-based TokenManager error-retry.md
Real-time data URLSessionWebSocketTask advanced.md
Large file download URLSession download task urlsession.md
Background upload Background URLSession configuration urlsession.md
Offline support URLCache + .returnCacheDataElseLoad advanced.md
Network status NWPathMonitor advanced.md
File upload MultipartFormData builder advanced.md
Dynamic JSON JSONValue enum api-client.md
Certificate pinning URLSessionDelegate advanced.md
GraphQL Apollo iOS 2.0 advanced.md

Read the full file on GitHub · 210 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 210 lines · 174 tokens per session scan A aa7fa643dde6

Subscribe to this mod's changes

ios-networking is a skill published in the GitHub repository koshkinvv/ios-agent-skills (6 stars, last pushed 5mo ago), licensed MIT. It adds 174 tokens to every session and 2,237 once invoked, about $0.0009 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

flutter

Use when building, structuring, testing or optimizing a Flutter app — feature-first layering, Riverpod 3 or Bloc, typed gorouter, freezed models, a dio data layer, Material 3, jank hunting, widget/golden tests. Targets Flutter 3.44 / Dart 3.12. NOT React Native (that is react-native), NOT Compose Multiplatform (that…

ericrisco/rsc-harness · 91 tokens

react-native

Use when writing the JS/TS inside a React Native or Expo app — screens, Expo Router navigation, lists, Reanimated gestures, platform forks, offline state, native modules — or killing jank and render storms. NOT eas build/submit/OTA/config-plugin (that is expo), NOT a Dart app (that is flutter), NOT web React/DOM (that…

ericrisco/rsc-harness · 90 tokens

compose-multiplatform

Use when building one shared Compose UI in Kotlin across Android, iOS, and desktop — commonMain @Composables, expect/actual, source-set placement, native interop, multiplatform ViewModel/navigation/Koin. NOT a single-platform native build (that is kotlin-android / swift-ios), and NOT Dart/Flutter cross-platform UI…

ericrisco/rsc-harness · 80 tokens

ios-accessibility

Production-grade iOS accessibility skill covering VoiceOver, Dynamic Type, color contrast, motion, Switch Control, Voice Control, and WCAG 2.2 compliance for both SwiftUI and UIKit. This skill should be used when creating new iOS screens or views, reviewing existing iOS code for accessibility, adding VoiceOver…

rusel95/ios-agent-skills · 253 tokens

ios-localization

Production-grade iOS localization skill covering String Catalogs (.xcstrings), CLDR pluralization, SwiftUI/UIKit localization APIs, RTL layout, date/number/currency formatting, and enterprise patterns (modular apps, white-label, accessibility localization). This skill should be used when creating or editing localized…

rusel95/ios-agent-skills · 265 tokens

ios-logging

Enterprise skill for iOS production error observability and logging (iOS 15+, Swift 5.5+). The trigger is OBSERVABILITY intent — the user wants errors captured and visible in production, not just handled. Use when: adding os.Logger or replacing print() with structured logging; setting up or integrating a crash SDK…

rusel95/ios-agent-skills · 183 tokens