swift-concurrency

Diagnose and fix Swift 6.2+ concurrency issues involving actor isolation and Sendable safety.

Updated Apr 30, 2026
One-click install
npx skills add https://github.com/onymchat/onym-ios --skill swift-concurrency-onymchat
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: swift-concurrency
Source: https://github.com/onymchat/onym-ios/tree/main/.claude/skills/swift-concurrency
Command: npx skills add https://github.com/onymchat/onym-ios --skill swift-concurrency-onymchat

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Swift concurrency can introduce data races and complex isolation boundaries; this Skill provides a structured guide to diagnose, migrate, and implement modern Swift concurrency patterns safely.

Core Features & Use Cases

  • Guidance on default MainActor isolation and isolated conformances to reduce boilerplate.
  • Triage workflows and concrete checks for Sendable safety, actor isolation, and task cancellation.
  • Migration patterns for structured concurrency, transactional observations, and concurrent offloading.

Quick Start

Follow this guide to safely migrate a UI module to default MainActor isolation and offload CPU-bound work to @concurrent functions.

Frequently Asked Questions about swift-concurrency

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

FAQPage Schema
How do I fix Swift concurrency data races and Sendable safety errors?

Fix Swift concurrency data races by applying structured triage workflows to diagnose actor isolation boundaries and validate Sendable compliance. This provides concrete checks to safely resolve data races and complex isolation conflicts.

How do I migrate my iOS app to default MainActor isolation in Swift 6?

Migrate to default MainActor isolation in Swift 6 by following structured guidance to reduce boilerplate and define nonisolated behavior. This safely transitions UI modules to modern Swift concurrency patterns while maintaining isolation boundaries.

What is the best way to offload CPU-bound work using Swift structured concurrency?

Offload CPU-bound work in Swift structured concurrency by delegating tasks to @concurrent functions and utilizing Task.immediate. This pattern safely moves heavy processing off the MainActor to prevent UI freezing without violating Sendable safety.

Does this Swift concurrency migration approach support isolated conformances and transactional observations?

Yes, this Swift concurrency migration approach explicitly supports isolated conformances and transactional observations. It defines requirements for implementing these patterns safely, reducing boilerplate while ensuring strict actor isolation and Sendable compliance.

When should I use actor isolation instead of nonisolated behavior for Swift concurrency?

Use actor isolation when managing shared mutable state across concurrent contexts to prevent data races, and apply nonisolated behavior for stateless operations. This distinction ensures safe default isolation boundaries and proper structured concurrency patterns.