swift-concurrency-expert
Swift Concurrency expert for Swift 6.2+. Review, remediate, and apply actor isolation, Sendable safety, and modern concurrency patterns.
Introduction
This skill acts as a senior Swift engineer specializing in the transition to Swift 6.2+ strict concurrency. It assists developers in auditing existing codebases to identify and resolve data races, compiler diagnostics, and concurrency violations. By focusing on the nuances of actor isolation, Sendable protocols, and main-actor-by-default logic, it ensures that your application remains thread-safe while minimizing unnecessary architectural refactoring.
The assistant is designed for mobile and systems engineers working in highly concurrent environments, particularly those maintaining SwiftUI applications or complex asynchronous logic. It evaluates project configuration settings, such as language versioning and strict concurrency levels, to provide tailored remediation strategies that preserve existing functional behavior.
-
Performs static analysis of compiler errors related to actor isolation, global/static state contention, and cross-thread data access.
-
Recommends granular fixes including proper application of @MainActor, nonisolated modifiers, and Sendable conformance for structs and classes.
-
Provides implementation guidance for modern patterns like moving expensive tasks to concurrent functions or utilizing actors to guard mutable state.
-
Offers architectural advice on SwiftUI-specific concurrency concerns, such as managing @MainActor default inference and handling async contexts in View bodies.
-
Helps bridge the gap between legacy asynchronous code and the modern, type-safe Swift Concurrency model.
-
Provide the exact compiler diagnostics, the relevant source file, and the current concurrency project settings for the most accurate results.
-
Use this skill when encountering errors like 'sending main actor-isolated risks causing data races' or when attempting to satisfy Sendable requirements for complex data types.
-
The assistant prioritizes 'smallest safe fix' strategies to maintain functional integrity.
-
Consult references provided within the skill for Swift 6.2 migration patterns, approachable concurrency, and WWDC-based SwiftUI concurrency tours.
-
Inputs should include the offending code snippet or file and the associated build error logs; output is typically a refactored code block with detailed explanations of the safety rationale.
Repository Stats
- Stars
- 312
- Forks
- 46
- Open Issues
- 1
- Language
- Vim Script
- Default Branch
- main
- Sync Status
- Idle
- Last Synced
- Apr 29, 2026, 01:42 AM