ios-networking — Claude Code skill: Swift URLSession networking
A skill that guides your coding agent through Swift networking on iOS and macOS: URLSession with async/await, error handling, retries and pagination.
npx skills add dpearson2699/swift-ios-skills --skill ios-networking -a claude-codeWhat ios-networking does
This skill shapes how the agent writes networking code in Swift apps. It covers async/await in URLSession, a protocol-based API client, error handling, pagination, reachability checks, session configuration, App Transport Security, a list of common mistakes and a review checklist.
One point drives the rest: URLSession throws only on transport failures, never on a 4xx or 5xx reply. So the status code gets checked before decoding, and a retry is allowed only for requests that are safe, idempotent or explicitly replayable. Token refresh must not loop. Durable background transfers skip the async conveniences and go through task creation plus delegate callbacks. Large downloads stream to disk via download(for:) instead of filling memory.
Network policy can be validated locally with fake URLProtocol setup: a clean 2xx, a malformed 2xx, a single 401 refresh, bounded 429 and 5xx retries, timeout and offline cases, cancellation, and a 4xx that must not be retried. If the app needs a predictable API client with clear error classes, this is the part worth reading first.
What it helps with
- build an API client on protocols instead of raw URLSession calls
- separate transport failures from 4xx and 5xx responses
- retry idempotent requests only
- stream big downloads to disk
- wire durable transfers through delegates
Example prompts for the agent
- Write an API client on URLSession with async/await and a dedicated error type
- Review the retry logic here so token refresh cannot loop
- Stream a response with
bytes(for:)and parse it line by line
How to install ios-networking
1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill ios-networking -a claude-code2Manually: put the files in place
~/.claude/skills/ios-networking/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/ios-networking/
1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill ios-networking -a codex2Manually: put the files in place
.agents/skills/ios-networking/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill ios-networking -a cursor2Manually: put the files in place
.cursor/skills/ios-networking/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install dpearson2699/swift-ios-skills ios-networking2Manually: put the files in place
.github/skills/ios-networking/SKILL.md1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill ios-networking -a gemini-cli2Platform CLI
gemini skills install https://github.com/dpearson2699/swift-ios-skills --path skills/ios-networkingManually: put the files in place
.devin/skills/ios-networking/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill ios-networking -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about ios-networking
How do I install ios-networking in Claude Code?
Run npx skills add dpearson2699/swift-ios-skills --skill ios-networking -a claude-code. The skill lands in ~/.claude/skills/ios-networking/SKILL.md.
What does ios-networking do?
It helps the agent write and review Swift networking for iOS and macOS: URLSession requests, uploads and downloads, streaming, error handling and pagination.
Do background transfers work with the async APIs?
The skill says no. Background sessions are driven by delegates, so you create tasks with downloadTask(with:) or uploadTask(with:fromFile:) and handle the callbacks.