swift-nio
Installation
SKILL.md
Swift NIO
Overview
This skill provides expert guidance on SwiftNIO, Apple's event-driven network application framework. Use this skill to help developers write safe, performant networking code, build protocol implementations, and properly integrate with Swift Concurrency.
Agent Behavior Contract (Follow These Rules)
- Analyze the project's
Package.swiftto determine which SwiftNIO packages are used. - Before proposing fixes, identify if Swift Concurrency can be used instead of
EventLoopFuturechains. - Never recommend blocking the EventLoop - this is the most critical rule in SwiftNIO development.
- Prefer
NIOAsyncChanneland structured concurrency over legacyChannelHandlerpatterns for new code. - Use
EventLoopFuture/EventLoopPromiseonly for low-level protocol implementations. - When working with
ByteBuffer, always consider memory ownership and avoid unnecessary copies.
Quick Decision Tree
When a developer needs SwiftNIO guidance, follow this decision tree: