swift-concurrency-expert

Review and fix Swift Concurrency issues in Swift 6.2+ codebases.

1|Updated Aug 9, 2026
One-click install
npx skills add https://github.com/OMIXEC/all-in-one-swift-skills --skill swift-concurrency-expert-omixec
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: swift-concurrency-expert
Source: https://github.com/OMIXEC/all-in-one-swift-skills/tree/main/skills/swift-concurrency-expert
Command: npx skills add https://github.com/OMIXEC/all-in-one-swift-skills --skill swift-concurrency-expert-omixec

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Swift 6.2+ strict concurrency checking produces data-race errors, Sendable violations, and actor isolation warnings that are difficult to diagnose and fix without breaking existing behavior. This Skill triages those compiler diagnostics and applies minimal, behavior-preserving fixes. ## Core Features & Use Cases - Diagnostic triage: Captures exact compiler errors, checks project concurrency settings (language version, strict concurrency level, approachable concurrency mode), and identifies the current actor context. - Targeted remediation: Applies the smallest safe fix such as adding @MainActor to UI-bound types, scoping protocol conformances with isolated conformances, protecting global state, adding Sendable conformance, or offloading work with @concurrent functions. - Iterative verification: Rebuilds, runs the test suite, and re-triages any new warnings until the build is clean. - Use Case: A developer migrating an app to Swift 6.2 hits "Sending 'self.photoProcessor' risks causing data races" errors; the Skill identifies the actor mismatch and resolves it with an isolated conformance or @concurrent offload. ## Quick Start Ask the agent to review this Swift file for Swift 6.2 concurrency errors and fix the data race and actor isolation warnings.

Frequently Asked Questions about swift-concurrency-expert

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix Swift 6 data race errors?▼

Fix Swift 6 data race errors by first identifying the actor context of the offending code, then applying the smallest safe fix: annotate UI-bound types with @MainActor, protect global state with the main actor or an actor, or add Sendable conformance to value types. Rebuild and run tests to confirm no regressions.

How to fix 'Sending risks causing data races' in Swift?▼

This error occurs when non-Sendable state crosses actor boundaries. In Swift 6.2, async functions stay on the caller's actor by default, which often resolves it; otherwise use an isolated conformance, move the work into a @concurrent function, or make the type Sendable.

What is approachable concurrency in Swift 6.2?▼

Approachable concurrency is an opt-in Swift 6.2 mode that infers main actor isolation by default, keeping code single-threaded unless you opt out. Enable it under Swift Compiler - Concurrency in Xcode build settings or via SwiftSettings in a SwiftPM manifest.

When should I use @concurrent vs @MainActor in Swift?▼

Use @MainActor for UI-bound types and shared mutable state that must stay on the main thread. Use @concurrent on async functions performing CPU-intensive work that should run on the concurrent thread pool, keeping the calling actor responsive.

Why does my protocol conformance fail on a @MainActor class?▼

A nonisolated protocol requirement cannot access main-actor state, so the compiler rejects the conformance. Swift 6.2 supports isolated conformances: declare the conformance as 'extension Foo: @MainActor SomeProtocol' so it is only used on the main actor.

When should I avoid @unchecked Sendable?▼

Avoid @unchecked Sendable unless you can prove the type is thread-safe, since it bypasses compiler verification of data-race safety. Prefer immutable value types or correct Sendable conformance, and use actors to guard genuinely mutable shared state.