Swift Expert gives the agent a workflow for iOS, macOS, watchOS and tvOS code in Swift 5.9 and later: analyze the architecture, design protocols, implement with async/await and value types, optimize with Instruments and test with XCTest.
The skill pairs each pattern with its pitfall: async/await versus wrapped completion handlers, the Observable macro versus ObservableObject, protocols with associated types versus base classes, and actors versus manual locks. It also names build commands to run after each step.
What You Get
- A five-step workflow with build and test checkpoints
- Do and don’t examples for async/await, SwiftUI state, protocol-oriented repositories and actors
- A must-do list covering Sendable, value types, API Design Guidelines and profiling first
- A must-not list covering force unwrapping, retain cycles and ignored actor isolation warnings
- Reference files for SwiftUI, concurrency, protocols, memory and testing
Common Use Cases
- Building SwiftUI screens with Observable view models
- Fixing Sendable and actor isolation warnings
- Designing a repository layer with protocols and associated types
- Writing async XCTest cases for network code
What Makes It Unique
Each example shows the preferred pattern and the one to avoid in the same block, for modern Swift 5.9 features such as the Observable macro and actors. The compiler checks at fixed points, including a warnings-as-errors build that exposes concurrency problems early.
Under The Hood
The skill is a SKILL.md with five reference files that the agent loads by topic. It ships no scripts. The instructions tell the agent to run swift build, swift build -warnings-as-errors and swift test in your package, and to profile with Instruments, so it compiles code and writes build output in your project. The examples include a URLSession call to a sample API address, which is code to adapt and not something the skill runs.