Agent skill · avdlee

swift-concurrency

Diagnose Swift Concurrency issues, refactor callback-based code to async/await, and guide Swift 6 migration when working with tasks, actors, @MainActor, Sendable, data races, thread safety, or concurrency-related compiler and linter warnings.

What it needs

About 7k tokens when loaded.

What this skill does

Swift Concurrency Fast Path Before proposing a fix: 1. Analyze Package.swift or .pbxproj to determine Swift language mode, strict concurrency level, default isolation, and upcoming features. Do this always, not only for migration work. 2. Capture the exact diagnostic and offending symbol. 3. Determine the isolation boundary: @MainActor, custom actor, actor instance isolation, or nonisolated. 4. 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 @MainActor only when that prefix truly needs main-actor access; otherwise use Task { @concurrent in ... } and hop back with MainActor.run only 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") SWIFTSTRICTCONCURRENCY Default isolation .defaultIsolation(MainActor.self) SWIFTDEFAULTACTORISOLATION Upcoming features .enableUpcomingFeature("NonisolatedNonsendingByDefault") SWIFTUPCOMINGFEATURE Approachable Concurrency N/A (use individual upcoming features) SWIFTAPPROACHABLECONCURRENCY Xcode 26 note: New projects created in Xcode 26 will often start with SWIFTDEFAULTACTORISOLATION = MainActor and SWIFTAPPROACHABLECONCURRENCY = YES enabled by default. Treat these as likely defaults for newly created projects, not as confirmed settings. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills avdlee/swift-concurrency--32e09f

View the source on GitHub

Browse the @skills marketplace