swift-concurrency-expert

Review and remediate Swift 6.2+ concurrency issues with actor isolation and Sendable safety.

1|Updated Jan 15, 2026
One-click install
npx skills add https://github.com/Pallepadehat/agentkit --skill swift-concurrency-expert
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: swift-concurrency-expert
Source: https://github.com/Pallepadehat/agentkit/tree/main/.agent/skills/swift-concurrency-expert
Command: npx skills add https://github.com/Pallepadehat/agentkit --skill swift-concurrency-expert

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Swift Concurrency review and remediation for Swift 6.2+ codebases to fix data-race safety issues and compiler errors.

Core Features & Use Cases

  • Review and remediate Swift Concurrency issues in Swift 6.2+ codebases by applying actor isolation, Sendable safety, and modern concurrency patterns with minimal behavior changes.
  • Use when UI-bound code, main-actor default settings, or background tasks require isolation or main-actor adjustments.
  • Reference patterns and guidance from the included references materials (references/swift-6-2-concurrency.md, references/approachable-concurrency.md, references/swiftui-concurrency-tour-wwdc.md).

Quick Start

Audit the project for Swift concurrency issues, identify data-race risks, and apply minimal fixes such as annotating UI-bound types with @MainActor, isolating conformance, and moving heavy work to @concurrent.

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 concurrency data-race errors in Swift 6.2?

Swift concurrency data-race errors in Swift 6.2 are resolved by applying actor isolation, Sendable conformance, and @MainActor annotations to unsafe types. Review your codebase for shared mutable state, annotate UI-bound code with @MainActor, mark non-Sendable types as Sendable when safe, and isolate protocol conformances. This enforces compile-time safety without changing behavior.

When should I use @MainActor in Swift concurrency?

@MainActor in Swift concurrency designates types and methods that must run on the main thread, typically UI components, view models, and app delegates. Use it for any code touching UIKit, SwiftUI state, or main-thread-only APIs. Swift 6.2 applies main-actor defaults to many framework types, so audit your codebase for conflicts.

What is Sendable conformance and why do I need it?

Sendable conformance in Swift concurrency marks types as safe to share across actor boundaries by guaranteeing immutability or synchronized access. Swift 6.2 requires explicit Sendable conformance for types passed between actors; without it, the compiler raises data-race errors. Mark value types and immutable classes as Sendable, or use isolated properties and locks for mutable shared state.

How do I migrate UI code to Swift 6.2 concurrency?

Migrate UI code to Swift 6.2 concurrency by annotating view controllers, view models, and delegates with @MainActor, replacing DispatchQueue.main calls with isolated methods, and ensuring SwiftUI @Published properties are Sendable. Move long-running tasks to background actors marked @concurrent. Use the included references on SwiftUI concurrency patterns for step-by-step guidance.

Can I use actor isolation with protocol implementations?

Yes, actor isolation works with protocol implementations through isolated conformance in Swift 6.2. Mark protocol methods as isolated(actor) to enforce that implementations run on a specific actor, particularly for Sendable protocols. This prevents data-race violations when protocol types cross actor boundaries.

What are common Swift concurrency issues beyond Sendable?

Common Swift concurrency issues beyond Sendable include unawaited async tasks, main-thread violations in background code, and unsafe access to shared mutable state. Swift 6.2 flags these as compiler errors. Apply @concurrent to offload work from the main actor, use Task groups for structured concurrency, and wrap mutable state in actors or serial dispatchers.