last update
May 23, 2026
license
MITv1.0.0
format
SKILL.md
- Install
// Downloads SKILL.md into ~/.claude/skills/ios-swift-concurrency/
$ curl -fsSL --create-dirs -o ~/.claude/skills/ios-swift-concurrency/SKILL.md https://claudeskil.com/skills/ios-swift-concurrency/SKILL.md - Invoke
// Inside Claude Code, type the skill name as a slash command
> /ios-swift-concurrency help me ship this - Or just ask
// Claude loads the skill by itself when a request matches its description
> help me ship this
- name:
- Swift Concurrency Pro
- slug:
- ios-swift-concurrency
- version:
- v1.0.0
- license:
- MIT
- author:
- @chiragthummar16
- categories:
- tags:
- #swift#async-await#actors#concurrency#ios
- description:
async/await, actors, structured concurrency, task groups — modern Swift without the race conditions.
README.md
Swift Concurrency Pro
Swift Concurrency Pro is a coding assistant skill for iOS and macOS engineers moving real codebases onto async/await, actors, and structured concurrency. It focuses on the hard parts the compiler won't write for you: choosing the right isolation, eliminating data races flagged under strict concurrency checking, and converting legacy callback APIs without changing behavior. Aimed at developers shipping with Swift 5.9+ and preparing for the Swift 6 language mode.
When to use it
- You flipped on
-strict-concurrency=complete(or Swift 6 mode) and are drowning in "Sending value risks data races" and "non-Sendable type crossing actor boundary" errors. - You have
completionHandler-based code (URLSession, Core Data, delegate callbacks) you want to expose asasyncfunctions. - A
@MainActorclass is forcingawaithops everywhere and you need to figure out what actually belongs on the main actor. - Your async tests pass locally but flake in CI.
What it does
The skill reasons about isolation and rewrites accordingly. It wraps callbacks with withCheckedThrowingContinuation / withCheckedContinuation (and withTaskCancellationHandler when the underlying call is cancellable), and converts streams of callbacks into AsyncStream / AsyncThrowingStream. For parallel work it builds withTaskGroup / withThrowingTaskGroup rather than spraying detached Tasks. It picks isolation deliberately — @MainActor for UI/observable state, a custom actor for shared mutable state, nonisolated for pure helpers — and applies Sendable, @Sendable closures, or @unchecked Sendable (with justification) where boundaries demand it. Cancellation is handled with Task.checkCancellation() and Task.isCancelled instead of being silently dropped. Tests are written against async XCTest methods or Swift Testing's @Test, using await fulfillment(of:) rather than arbitrary sleep calls.
Example
curl -fsSL --create-dirs -o ~/.claude/skills/ios-swift-concurrency/SKILL.md https://claudeskil.com/skills/ios-swift-concurrency/SKILL.md
# then, in your project:
"Convert ImageLoader.load(url:completion:) to async/await and
make the cache access race-free under Swift 6 mode."
Typical output replaces the completion handler with:
func load(url: URL) async throws -> UIImage {
try await withCheckedThrowingContinuation { continuation in
legacyLoad(url: url) { result in
continuation.resume(with: result)
}
}
}
…and moves the cache into an actor so reads/writes are serialized.
Tips & gotchas
- A continuation must be resumed exactly once. The skill audits every path so you don't leak a hung task or crash on a double-resume.
Task { }inherits actor context;Task.detached { }does not — it flags places where detaching silently drops you off the main actor.@MainActoron a type isolates stored properties too, not just methods — overreaching it serializes more than you intend.
FAQ
Does it require Swift 6? No. It works in Swift 5.9+ and helps you adopt strict concurrency incrementally, one module at a time.
Will it use @unchecked Sendable to silence errors? Only as a last resort, with a comment explaining the invariant — it prefers real fixes (actors, value types, isolation).
Does it handle Combine? It can bridge Publisher to AsyncSequence via .values, but its focus is native concurrency.
$ cat reviews/