← ClaudeAtlas

swift-concurrencylisted

Use for any Swift Concurrency question on Apple platforms. Triggers on: actor reentrancy (stale state after await), AsyncStream lifecycle (continuation.finish, onTermination), TaskGroup memory and task throttling (activeProcessorCount), Sendable conformance across actor boundaries (non-Sendable third-party types), SWIFT_STRICT_CONCURRENCY=complete error triage ('Sending X risks causing data races'), Swift 6 / 6.2 migration (nonisolated caller-side isolation, @concurrent), cooperative pool blocking, async/await patterns, and continuation misuse. Also covers @MainActor isolation, structured concurrency, and converting callbacks to async/await. Use whenever the query mentions actor, AsyncStream, TaskGroup, Sendable, nonisolated, withCheckedContinuation, or Swift 6.
christim427-rgb/ios-agent-skills · ★ 1 · AI & Automation · score 77
Install: claude install-skill christim427-rgb/ios-agent-skills
# Swift Concurrency Enterprise-grade skill for Swift Concurrency crash prevention, strict concurrency migration, and Swift 6.2 readiness. Opinionated: prescribes structured concurrency over unstructured, actors for shared mutable state, `@MainActor` for UI isolation, `Mutex` for synchronous critical sections, compile-time isolation over runtime hops, and `withCheckedContinuation` over `withUnsafeContinuation`. Every rule in this skill has broken a real production app. ## Concurrency Layers ```text Application Layer -> Structured concurrency: TaskGroup, async let, .task modifier Actor Layer -> actor for shared mutable state, @MainActor for UI state Async/Await Layer -> Cooperative, non-blocking async functions on the cooperative pool Sendable Layer -> Compile-time data-race safety at isolation boundary crossings Compiler Layer -> SWIFT_STRICT_CONCURRENCY=complete, Swift 6 language mode, TSan ``` ## Quick Decision Trees ### "What isolation does this type need?" ``` Does this type own mutable state shared across concurrency domains? +-- YES -> Does it need to update UI? | +-- YES -> @MainActor class/struct | +-- NO -> Is the state complex or involves await points? | +-- YES -> actor | +-- NO -> Mutex<State> (Swift 6+, iOS 18+) or NSLock wrapper +-- NO -> Is it a value type with only Sendable stored properties? +-- YES -> Implicitly Sendable (internal types only; public needs explicit conformance) +-- NO -> Can it be re