From apple-dev
Swift concurrency patterns including Swift 6.2 approachable concurrency (@concurrent, isolated conformances, default MainActor inference), structured concurrency, actors, continuations, and migration. Use when reviewing or building async code, fixing data race errors, adopting Swift 6.2 concurrency features, or migrating to Swift 6.
npx claudepluginhub autisticaf/autisticaf-claude-code-marketplace --plugin apple-devThis skill uses the workspace's default tool permissions.
> **First step:** Tell the user: "swift-concurrency-patterns skill loaded."
Generates design tokens/docs from CSS/Tailwind/styled-components codebases, audits visual consistency across 10 dimensions, detects AI slop in UI.
Records polished WebM UI demo videos of web apps using Playwright with cursor overlay, natural pacing, and three-phase scripting. Activates for demo, walkthrough, screen recording, or tutorial requests.
Delivers idiomatic Kotlin patterns for null safety, immutability, sealed classes, coroutines, Flows, extensions, DSL builders, and Gradle DSL. Use when writing, reviewing, refactoring, or designing Kotlin code.
First step: Tell the user: "swift-concurrency-patterns skill loaded."
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.
What concurrency problem are you solving?
│
├─ Swift 6 compiler errors / migration
│ └─ references/migration-guide.md
│
├─ Swift 6.2 new features (@concurrent, isolated conformances)
│ └─ references/swift62-concurrency.md
│
├─ Running work in parallel (async let, TaskGroup)
│ └─ references/structured-concurrency.md
│
├─ Thread safety for shared mutable state
│ └─ references/actors-and-isolation.md
│
├─ Bridging old APIs (delegates, callbacks) to async/await
│ └─ references/continuations-bridging.md
│
└─ General async/await patterns
└─ See macos-coding-best-practices/references/modern-concurrency.md for basics
| Pattern | When to Use | Reference |
|---|---|---|
async let | Fixed number of parallel operations | references/structured-concurrency.md |
withTaskGroup | Dynamic number of parallel operations | references/structured-concurrency.md |
withDiscardingTaskGroup | Fire-and-forget parallel operations | references/structured-concurrency.md |
.task { } modifier | Load data when view appears | references/structured-concurrency.md |
.task(id:) modifier | Re-load when a value changes | references/structured-concurrency.md |
actor | Shared mutable state protection | references/actors-and-isolation.md |
@MainActor | UI-bound state and updates | references/actors-and-isolation.md |
@concurrent | Explicitly offload to background (6.2) | references/swift62-concurrency.md |
| Isolated conformances | @MainActor type conforming to protocol (6.2) | references/swift62-concurrency.md |
withCheckedContinuation | Bridge callback API to async | references/continuations-bridging.md |
AsyncStream | Bridge delegate/notification API to async sequence | references/continuations-bridging.md |
| Strict concurrency migration | Incremental Swift 6 adoption | references/migration-guide.md |
Read the user's code or error messages to determine:
Based on the problem, read from this directory:
references/swift62-concurrency.md — Swift 6.2 approachable concurrency featuresreferences/structured-concurrency.md — async let, TaskGroup, .task modifier lifecyclereferences/actors-and-isolation.md — Actor patterns, reentrancy, @MainActor, Sendablereferences/continuations-bridging.md — withCheckedContinuation, AsyncStream, legacy bridgingreferences/migration-guide.md — Incremental Swift 6 strict concurrency adoption@MainActor (use await for long operations)Sendable conformance correct for types crossing isolation boundariesTask.isCancelled or Task.checkCancellation())Task {} where structured concurrency (.task, TaskGroup) would workwithCheckedContinuation called exactly once (not zero, not twice).task(id:) used instead of manual onChange + cancel patternsmacos-coding-best-practices/references/modern-concurrency.mdgenerators-networking-layer/references/networking-patterns.mdmacos-swiftdata-architecture/references/repository-pattern.mdgenerators-auth-flow/references/auth-patterns.md