swift-concurrency
Installation
Summary
Diagnose data races, migrate to async/await, and resolve Swift 6 concurrency issues with structured guidance.
- Analyzes project settings (language mode, strict concurrency level, default isolation) before proposing fixes to ensure recommendations match your build configuration
- Covers all major concurrency diagnostics: main actor isolation, actor conformance, Sendable violations, and SwiftLint warnings with smallest-safe-fix strategies
- Provides Quick Fix Mode for localized, single-file issues and escalates to deeper reference guides when isolation boundaries cross modules or unsafe escape hatches are needed
- Includes Swift 6 migration validation loop: build, fix one error category, rebuild, test, then proceed to prevent cascading regressions
- Routes to 15+ reference documents covering async/await basics, task lifecycle, actor patterns, Sendable conformance, testing, Core Data, and performance optimization
SKILL.md
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 delayed retries, timers, and backoff tasks, separate the waiting from the UI mutation. The sleep often belongs off the main actor even when the final state update belongs on it.
Project settings that change concurrency behavior:
| Setting | SwiftPM (Package.swift) |
Xcode (.pbxproj) |
|---|---|---|
| Language mode | swiftLanguageVersions or -swift-version (// swift-tools-version: is not a reliable proxy) |
Swift Language Version |
| Strict concurrency | .enableExperimentalFeature("StrictConcurrency=targeted") |
SWIFT_STRICT_CONCURRENCY |
| Default isolation | .defaultIsolation(MainActor.self) |
SWIFT_DEFAULT_ACTOR_ISOLATION |
| Upcoming features | .enableUpcomingFeature("NonisolatedNonsendingByDefault") |
SWIFT_UPCOMING_FEATURE_* |
Installs
10.9K
Repository
avdlee/swift-co…nt-skillGitHub Stars
1.5K
First Seen
Jan 21, 2026
Security Audits