swift-concurrency
Diagnose data races, convert callback-based code to async/await, implement actor isolation patterns, resolve Sendable conformance issues, and guide Swift 6 migration. Use when developers mention: (1) Swift Concurrency, async/await, actors, or tasks, (2) "use Swift Concurrency" or "modern concurrency patterns", (3) migrating to Swift 6, (4) data races or thread safety issues, (5) refactoring closures to async/await, (6) @MainActor, Sendable, or actor isolation, (7) concurrent code architecture or
Security Assessment
Detected risks:
About swift-concurrency
The `swift-concurrency` skill provides expert guidance for diagnosing and resolving concurrency-related issues in Swift code. It focuses on detecting data races, converting callback-based code to the modern async/await paradigm, enforcing actor isolation patterns, and addressing Sendable conformance problems. The skill also supports developers in migrating projects to Swift 6, ensuring that concurrency features are used correctly and safely. By analyzing project settings, language modes, and isolation boundaries, it helps prevent unsafe thread access and guarantees that UI-bound and background tasks are handled appropriately.
FAQ
When should I use this skill?
Use this skill when you encounter Swift concurrency concepts, such as async/await, actors, tasks, or thread safety issues, and when refactoring legacy closures or migrating to Swift 6.
Does it require any specific project configuration?
Yes, it works best when Swift language version, strict concurrency settings, and default actor isolation are known, as these settings affect concurrency behavior and migration guidance.
Can it automatically apply fixes across multiple modules?
No, Quick Fix Mode is intended for localized issues where isolation boundaries are clear. Cross-module or public API changes should be handled carefully and are not suitable for automatic fixes.
Is using @MainActor a safe default solution?
No, @MainActor should only be applied when the code is truly UI-bound. Blanket application is discouraged; alternative approaches like Task.detached or structured concurrency may be preferable depending on context.
What types of diagnostics can it help resolve?
It addresses errors like 'main actor-isolated cannot be used from a nonisolated context,' actor-isolated type protocol conformance issues, and non-Sendable values crossing actor boundaries.
All Files
16 filesInstall swift-concurrency
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
avdlee/swift-concurrency-agent-skill