swift-concurrency-patterns

Community

Prevent Swift data races and modernize async code

AuthorAutisticAF
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Developers face confusing compiler errors and runtime data races when adopting async/await, actors, and strict concurrency; this Skill diagnoses isolation issues, explains safe concurrency patterns, and provides migration guidance so code compiles and runs without data races or UI freezes.

Core Features & Use Cases

  • Pattern Library: Clear guidance for async/await, structured concurrency (async let, TaskGroup, withDiscardingTaskGroup), actor usage, reentrancy fixes, and safe use of MainActor.
  • Bridging Legacy APIs: Recipes for wrapping callbacks, delegates, and notification sources using withCheckedContinuation, AsyncStream, and AsyncThrowingStream.
  • Swift 6.2 Migration: Advice on default MainActor inference, @concurrent for background work, isolated conformances, and step-by-step migration checklists for converting code from Swift 6.0/6.1 to 6.2.
  • Runtime Safety & Best Practices: Checklists for Sendable conformance, Task cancellation, continuation exactly-once rules, avoiding heavy main-thread work, and replacing unsafe workarounds.
  • Use Case Example: Migrate an app target that fails strict concurrency checks, fix actor isolation compiler errors, and convert completion-handler APIs to async functions without introducing data races.

Quick Start

Analyze my Swift codebase for actor isolation and data race errors and produce a prioritized migration plan with code-level fixes to adopt Swift 6.2 concurrency features.

Dependency Matrix

Required Modules

None required

Components

references

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: swift-concurrency-patterns
Download link: https://github.com/AutisticAF/claude-code-apple-dev-plugin/archive/main.zip#swift-concurrency-patterns

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.