swift-networking — Claude Code skill: what it does, how to install
swift-networking guides Network.framework implementation in Swift, handling low-level TCP and UDP traffic, concurrency queues, and connection state transitions.
MIT ★ 233 updated 2026-01-18
/plugin marketplace add johnrogers/claude-swift-engineering
/plugin install swift-engineering@claude-swift-engineeringWhat swift-networking does
This skill instructs Claude Code on building network logic using Apple's Network.framework. It covers both legacy NWConnection pipelines for iOS 12+ and modern NetworkConnection setups using structured concurrency for iOS 26+. In addition, it provides direct patterns for migrating away from raw BSD sockets, CFSocket, and URLSession streams.
The logic specifically targets queue discipline. Network calls like receive() must stay off the UI thread, and queue conflicts that trigger deadlocks are caught early. State change handlers for .waiting, .ready, and .failed are treated as mandatory, paired with exponential backoff on retryable failures.
A clear operational boundary applies: standard HTTPS, HTTP, and WebSocket traffic stays on URLSession, reserving Network.framework exclusively for custom framing, UDP, and peer-to-peer protocols.
What it helps with
- implement TCP, UDP, or QUIC channels with NWConnection
- handle cellular to Wi-Fi handoffs and connection viability changes
- migrate socket code from CFSocket or SCNetworkReachability
- troubleshoot TLS handshake failures and receive timeouts
Example prompts for the agent
- Set up an NWConnection TCP client with dedicated queue error handling
- Migrate this socket stream to NetworkConnection using async/await
- Debug connection drops during Wi-Fi transitions in this network service
How to install swift-networking
1Plugin marketplace
/plugin marketplace add johnrogers/claude-swift-engineering/plugin install swift-engineering@claude-swift-engineeringThis installs the whole swift-engineering plugin with all its skills
2Skills CLI (Vercel)
npx skills add johnrogers/claude-swift-engineering --skill swift-networking -a claude-code3Manually: put the files in place
~/.claude/skills/swift-networking/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/swift-networking/
1Skills CLI (Vercel)
npx skills add johnrogers/claude-swift-engineering --skill swift-networking -a codex2Manually: put the files in place
.agents/skills/swift-networking/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add johnrogers/claude-swift-engineering --skill swift-networking -a cursor2Manually: put the files in place
.cursor/skills/swift-networking/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install johnrogers/claude-swift-engineering plugins/swift-engineering/skills/swift-networking2Manually: put the files in place
.github/skills/swift-networking/SKILL.md1Skills CLI (Vercel)
npx skills add johnrogers/claude-swift-engineering --skill swift-networking -a gemini-cli2Platform CLI
gemini skills install https://github.com/johnrogers/claude-swift-engineering --path plugins/swift-engineering/skills/swift-networkingManually: put the files in place
.devin/skills/swift-networking/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.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 swift-networking
How to install swift-networking in Claude Code?
Run /plugin marketplace add johnrogers/claude-swift-engineering, followed by /plugin install swift-engineering@claude-swift-engineering in your session.
What does swift-networking do?
It provides Claude Code with reference architectures and migration paths for Apple's Network.framework across TCP, UDP, and QUIC transports.
When does it recommend URLSession over Network.framework?
It prescribes URLSession for standard HTTP, HTTPS, and WebSocket traffic, saving Network.framework for custom framing, low-latency gaming, and raw UDP needs.
Source text
SKILL.md · MIT
--- name: swift-networking description: Use when implementing Network.framework connections (NWConnection, NetworkConnection), debugging connection failures, migrating from sockets/URLSession streams, or handling network transitions. Covers UDP/TCP patterns, structured concurrency networking (iOS 26+), and common anti-patterns. --- # Swift Networking Network.framework is Apple's modern networking API for TCP/UDP connections, replacing BSD sockets with smart connection establishment, user-space networking, and seamless mobility handling. ## Reference Loading Guide **ALWAYS load reference files if there is even a small chance the content may be required.** It's better to have the context than to miss a pattern or make a mistake. | Reference | Load When | |-----------|-----------| | **[Getting Started](references/getting-started.md)** | Setting up NWConnection for TCP/UDP, choosing between APIs | | **[Connection States](references/connection-states.md)** | Handling `.waiting`, `.ready`, `.failed` transitions | | **[iOS 26+ Networking](references/ios26-networking.md)** | Using NetworkConnection with async/await, TLV framing, Coder protocol | | **[Migration Guide](references/migration.md)** | Moving from sockets, CFSocket, SCNetworkReachability, URLSession | | **[Troubleshooting](references/troubleshooting.md)** | Debugging timeouts, TLS failures, connection issues | ## Core Workflow 1. Choose transport (TCP/UDP/QUIC) based on use case 2. Create NWConnection (iOS 12+) or NetworkConnection (iOS 26+) 3. Set up state handler for connection lifecycle 4. Start connection on appropriate queue 5. Send/receive data with proper error handling 6. Handle network transitions (WiFi to cellular) ## When to Use Network.framework vs URLSession - **URLSession**: HTTP, HTTPS, WebSocket, simple TCP/TLS streams - **Network.framework**: UDP, custom protocols, low-level control, peer-to-peer, gaming ## Common Mistakes 1. **Ignoring state handlers** — Creating an NWConnection without a state change handler means you never learn when it's ready or failed. Always implement the state handler first. 2. **Blocking the main thread** — Never call `receive()` on the main queue. Use a background DispatchQueue or Task for all network operations. 3. **Wrong queue selection** — Using the wrong queue (UI queue for network work, or serial queue for concurrent reads) causes deadlocks or silent failures. Always explicit your queue choice. 4. **Not handling network transitions** — WiFi/cellular switches or network loss aren't always detected automatically. Implement viability checks and state monitoring for robust apps. 5. **Improper error recovery** — Network errors need retry logic with backoff. Immediately failing on transient errors (timeouts, temporary loss) creates poor UX.
© John Rogers (@johnrogers) · MIT · johnrogers/claude-swift-engineering