swift-concurrency

Guide actor isolation, Sendable, and async/await usage in Swift 6.

1.1k|81|Updated Nov 30, 2025
One-click install
npx skills add https://github.com/CharlesWiltgen/Axiom --skill swift-concurrency
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: swift-concurrency
Source: https://github.com/CharlesWiltgen/Axiom/tree/main/.claude-plugin/plugins/axiom/skills/swift-concurrency
Command: npx skills add https://github.com/CharlesWiltgen/Axiom --skill swift-concurrency

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill guides developers through Swift 6 concurrency, helping you understand actor isolation, Sendable conformance, data race debugging, and how to effectively use async/await and different isolation levels to build responsive, thread-safe apps.

Core Features & Use Cases

  • Guided maturity path: From single-threaded to asynchronous to concurrent patterns with actor isolation.
  • Concurrency decision guidance: When to use @MainActor, nonisolated, @concurrent, or actor-isolated types.
  • Debugging concurrency: Diagnose data races, Sendable conformance issues, and actor isolation warnings in real apps.
  • Migration support: Help convert legacy code to modern Swift concurrency safely with tests.

Quick Start

Ask for a guided plan to convert a blocking function to an async/await version with proper actor isolation and a simple test plan.

Frequently Asked Questions about swift-concurrency

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

FAQPage Schema
How do I fix data race warnings in Swift concurrency?

Data races occur when multiple threads access shared memory unsafely. Swift 6 detects these via strict concurrency checking. Resolve them by isolating mutable state to actors, marking types as Sendable, and using async/await to coordinate access across isolation domains.

When should I use @MainActor versus actor isolation?

@MainActor isolates code to the main thread for UI updates and is required for UIKit/SwiftUI view properties. Actor isolation confines mutable state to a custom actor for background work. Choose @MainActor for UI-coupled logic and actors for concurrent, non-UI tasks.

How do I convert a blocking function to async/await with proper isolation?

Replace blocking calls with async alternatives, mark the function async, and await results. Apply actor isolation by making the function a member of an actor or @MainActor type. Add nonisolated for read-only helpers. Test with concurrent calls to verify no data races occur.

What does Sendable conformance do in Swift concurrency?

Sendable marks types as safe to pass across isolation boundaries and between threads. Value types and immutable reference types conform automatically. For mutable classes, adopt Sendable explicitly only if internal state is protected by locks or actor isolation.

Can I migrate legacy delegate patterns to async/await safely?

Yes. Replace delegate callbacks with async functions that suspend and resume when work completes. Use continuations or structured concurrency to bridge old callback-based APIs. Maintain actor isolation throughout to prevent data races during migration.

Why does my async code cause UI freezes even though it's not blocking?

Long-running CPU work on the main thread blocks UI updates even in async code. Offload heavy computation to a background actor using Task or DispatchQueue.global(), then return results to @MainActor for UI updates. Use proper isolation to keep threads responsive.