
swift-networking
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.
- Installs
- 159
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/johnrogers/claude-swift-engineering --skill swift-networking- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads swift-networking automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
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 | Setting up NWConnection for TCP/UDP, choosing between APIs |
| Connection States | Handling .waiting, .ready, .failed transitions |
| iOS 26+ Networking | Using NetworkConnection with async/await, TLV framing, Coder protocol |
| Migration Guide | Moving from sockets, CFSocket, SCNetworkReachability, URLSession |
| Troubleshooting | Debugging timeouts, TLS failures, connection issues |
Core Workflow
- Choose transport (TCP/UDP/QUIC) based on use case
- Create NWConnection (iOS 12+) or NetworkConnection (iOS 26+)
- Set up state handler for connection lifecycle
- Start connection on appropriate queue
- Send/receive data with proper error handling
- 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
-
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.
-
Blocking the main thread — Never call
receive()on the main queue. Use a background DispatchQueue or Task for all network operations. -
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.
-
Not handling network transitions — WiFi/cellular switches or network loss aren't always detected automatically. Implement viability checks and state monitoring for robust apps.
-
Improper error recovery — Network errors need retry logic with backoff. Immediately failing on transient errors (timeouts, temporary loss) creates poor UX.
FAQ
What does the swift-networking skill do?
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.
How do I install swift-networking?
Run npx skills add https://github.com/johnrogers/claude-swift-engineering --skill swift-networking in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/swift-networking/ (personal) or .claude/skills/swift-networking/ (project).
Which AI agents can use swift-networking?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is swift-networking safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains swift-networking?
It is published by johnrogers in johnrogers/claude-swift-engineering. It has 159 recorded installs.
More from johnrogers/claude-swift-engineering
swift-style
johnrogers/claude-swift-engineering
Swift code style conventions for clean, readable code. Use when writing Swift code to ensure consistent formatting, naming, organization, and idiomatic patterns.
ios-hig
johnrogers/claude-swift-engineering
Open the skill to read its SKILL.md instructions.
swiftui-patterns
johnrogers/claude-swift-engineering
Open the skill to read its SKILL.md instructions.
ios-26-platform
johnrogers/claude-swift-engineering
Open the skill to read its SKILL.md instructions.
composable-architecture
johnrogers/claude-swift-engineering
Use when building features with TCA (The Composable Architecture), structuring reducers, managing state, handling effects, navigation, or testing TCA features. Covers @Reducer, Store, Effect, TestStore, reducer composition, and TCA patterns.
swift-testing
johnrogers/claude-swift-engineering
Use when writing tests with Swift Testing (@Test,
Popular mobile skills
design-mobile-apps
designed-by-ai/skills
Design mobile app screens with Sleek, edit Sleek projects, and implement their designs in React Native or HTML.
ios-design
uizze.sh
Design and review iOS UI/UX for iPhone apps in SwiftUI, UIKit, or React Native. Use for mobile app design, screen redesigns, navigation flows, typography, forms, keyboard and safe-area layout, and accessibility checks. Apply Apple Human Interface Guidelines and consult real product references through the optional Uizze connection.
vercel-react-native-skills
vercel-labs/agent-skills
React Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or native platform APIs.
animate-expo
emilkowalski/skills
Build animations in React Native and Expo, making the decisions in the order that determines whether they feel right — should it animate, which thread it runs on, which properties, spring or timing, how the gesture hands off, how it degrades. Writes the implementation with Reanimated, Gesture Handler, Expo Router and expo-haptics. Use when animating anything in an Expo app, adding gestures, sheets, screen transitions, press feedback or haptics, or fixing motion that stutters on device. For web animation use animate.
xcode-project-setup
firebase/agent-skills
Safely modifies Xcode projects (.pbxproj) to add Swift Packages and link files. Use this skill whenever an iOS project needs dependencies installed (e.g. Firebase, Alamofire).
firebase-remote-config-basics
firebase/agent-skills
Manages Firebase Remote Config templates, feature flags, loading strategies, and SDKs (Android, iOS). Use when downloading/deploying remoteconfig JSON templates, managing version history/feature flags, setting in-app defaults, fetchAndActivate(), real-time listeners, or SDK setup. Don't use for Firebase Hosting, Auth, Firestore, Data Connect, Crashlytics, or App Hosting.