concurrency-patterns
Navigate Swift's modern concurrency model with patterns for async/await, structured task management, actor-based isolation, and Swift 6.2 features. This skill guides you through compiler errors, data race prevention, and migration strategies—whether you're bridging legacy APIs or adopting strict concurrency in new code.
Concurrency Patterns helps you fix Swift 6 strict concurrency compiler errors and data race issues with structured async/await and actor patterns.
AI-generated summary based on this skill's SKILL.md
Install
rshankras/claude-code-apple-skills/concurrency-patterns · repository language: Swift
git clone https://github.com/rshankras/claude-code-apple-skills
cp -r claude-code-apple-skills/skills/swift/concurrency-patterns ~/.claude/skills/concurrency-patternsFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
What does concurrency-patterns cover for Swift async/await?
concurrency-patterns guides you through Swift's modern concurrency model, including async/await patterns, structured task management with TaskGroup and async let, and actor-based isolation. The skill helps you navigate compiler errors, prevent data races, and adopt strict concurrency in both new and existing code.
How do I fix data race errors in Swift 6?
concurrency-patterns addresses Swift 6 compiler errors related to strict concurrency and data races by teaching isolation patterns, Sendable conformance, and actor design. The skill covers root causes of data races and provides strategies to resolve them—from simple value types to complex shared-state scenarios.
How can I bridge completion handlers to async/await?
concurrency-patterns includes patterns for bridging legacy callback and delegate APIs to async/await. You'll learn withCheckedContinuation, AsyncStream for delegate bridging, and other conversion techniques to modernize callback-based code without rewriting entire systems.
What structured concurrency patterns does concurrency-patterns teach?
concurrency-patterns covers async/await fundamentals, TaskGroup for parallel work, async let for concurrent binding, and actor-based thread safety. It also addresses task cancellation, MainActor for UI updates, and Swift 6.2 approachable concurrency features to help you write safe, efficient concurrent code.
How do I migrate existing code to Swift 6 concurrency?
concurrency-patterns provides a migration guide for adopting Swift 6's concurrency model. It covers Sendable conformance errors, actor reentrancy problems, custom actor executors, and strategies for incrementally updating callback-based and delegate-based code to modern structured concurrency.
How can I debug concurrency bugs like hangs and UI freezes?
concurrency-patterns helps you debug concurrency issues including hangs, reentrancy problems, and UI freezes. The skill covers task-local context tracing, concurrency instrumentation profiling, and best practices for identifying and fixing race conditions and deadlocks in your Swift code.
SKILL.md
rendered from the published skill — quoted content, verbatim
Swift Concurrency Patterns
Comprehensive guide for Swift concurrency covering async/await, structured concurrency, actors, and the Swift 6.2 "Approachable Concurrency" features. Focuses on patterns that prevent data races and common mistakes that cause crashes.
When This Skill Activates
- User has data race errors or actor isolation compiler errors
- User is migrating to Swift 6 strict concurrency
- User asks about async/await, actors, Sendable, TaskGroup, or MainActor
- User needs to bridge legacy completion-handler APIs to async/await
- User is working with Swift 6.2 features (@concurrent, isolated conformances)
- User has concurrency bugs (actor reentrancy, task cancellation, UI freezes)
Decision Tree
``` What concurrency problem are you solving? │ ├─ Swift 6 compiler errors /
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 7 files
skills/swift/concurrency-patterns/SKILL.md
skills/swift/concurrency-patterns/actors-and-isolation.md
skills/swift/concurrency-patterns/concurrency-internals.md
skills/swift/concurrency-patterns/continuations-bridging.md
skills/swift/concurrency-patterns/migration-guide.md
skills/swift/concurrency-patterns/structured-concurrency.md
skills/swift/concurrency-patterns/swift62-concurrency.md