swift-concurrency
This skill helps developers resolve Swift concurrency compiler diagnostics, data-race warnings, and isolation boundary issues. It provides structured guidance for refactoring callback-based code to async/await patterns and supports Swift 6 migration across tasks, actors, @MainActor, Sendable conformance, and thread-safety concerns. The skill emphasizes smallest-safe-change fixes grounded in project settings and isolation context.
Swift Concurrency diagnoses concurrency errors, guides async/await refactoring, and supports Swift 6 migration with isolation and Sendable fixes.
AI-generated summary based on this skill's SKILL.md
Install
AvdLee/Swift-Concurrency-Agent-Skill/swift-concurrency
git clone https://github.com/AvdLee/Swift-Concurrency-Agent-Skill
cp -r Swift-Concurrency-Agent-Skill/swift-concurrency ~/.claude/skills/swift-concurrencyFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
What does swift-concurrency help with?
swift-concurrency helps developers resolve Swift concurrency compiler diagnostics, data-race warnings, and isolation boundary issues. It provides structured guidance for refactoring callback-based code to async/await patterns and supports Swift 6 migration across tasks, actors, @MainActor, Sendable conformance, and thread-safety concerns, emphasizing smallest-safe-change fixes grounded in project settings and isolation context.
How can swift-concurrency help diagnose and fix compiler errors?
swift-concurrency diagnoses and fixes Swift concurrency compiler errors and data-race warnings by analyzing isolation boundaries, actor conformance, and Sendable requirements. It identifies where strict concurrency checks are failing and recommends targeted fixes that respect your project's current settings, helping you resolve warnings without unnecessary refactoring.
How do I refactor callback-based code to async await in Swift?
swift-concurrency guides async await refactoring by mapping callback patterns to modern concurrency constructs. It shows how to replace completion handlers with async functions, convert nested callbacks to sequential await calls, and leverage async let for concurrent operations, all while maintaining correctness and addressing any data-race warnings that emerge.
What actor isolation and @MainActor concepts does swift-concurrency cover?
swift-concurrency explains actor isolation, @MainActor, and Sendable requirements as core Swift 6 concurrency tools. It clarifies how actors prevent data races through isolation, when to use @MainActor for UI updates, how to make types Sendable, and how to diagnose and fix isolation boundary violations in your code.
How does swift-concurrency support Swift 6 migration with strict concurrency?
swift-concurrency supports Swift 6 migration by helping you enable strict concurrency checking and resolve the resulting compiler warnings systematically. It guides you through actor adoption, Sendable conformance, task structuring, and @MainActor placement, ensuring your project compiles cleanly under strict concurrency rules.
Which concurrency tools should I use—Task, async let, TaskGroup, or actor?
swift-concurrency helps you choose the right concurrency tool by analyzing your use case. It recommends Task for fire-and-forget work, async let for concurrent sibling operations, TaskGroup for dynamic task collections, and actors for shared mutable state. It also covers @MainActor for UI-bound code and structured concurrency best practices.
SKILL.md
rendered from the published skill — quoted content, verbatim
Swift Concurrency
Fast Path
Before proposing a fix:
- Analyze
Package.swiftor.pbxprojto determine Swift language mode, strict concurrency level, default isolation, and upcoming features. Do this always, not only for migration work. - Capture the exact diagnostic and offending symbol.
- Determine the isolation boundary:
@MainActor, custom actor, actor instance isolation, ornonisolated. - Confirm whether the code is UI-bound or intended to run off the main actor. When spawning unstructured tasks, inspect the synchronous prefix (everything before the first
await): start on@MainActoronly when that prefix truly needs main-actor access; otherwise useTask { @concurrent in ... }and hop back withMainActor.runonly after the suspension. A trivial non-main line (for example,print) followed by main-actor work in the same prefix is not a reason to use@concurrent. For
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 15 files
swift-concurrency/SKILL.md
swift-concurrency/references/_index.md
swift-concurrency/references/actors.md
swift-concurrency/references/async-algorithms.md
swift-concurrency/references/async-await-basics.md
swift-concurrency/references/async-sequences.md
swift-concurrency/references/core-data.md
swift-concurrency/references/glossary.md
swift-concurrency/references/linting.md
swift-concurrency/references/memory-management.md
swift-concurrency/references/migration.md
swift-concurrency/references/performance.md
swift-concurrency/references/sendable.md
swift-concurrency/references/tasks.md
swift-concurrency/references/testing.md