Expert guidance for any AI coding tool that supports the Agent Skills open format — safe concurrency, performance, and Swift 6+ migration.
Based on the comprehensive Swift Concurrency Course, distilled into actionable, concise references for agents.
- Teams migrating to Swift 6 / strict concurrency who need safe defaults and quick triage.
- Developers debugging data races, isolation errors, or flaky async tests.
- Anyone wanting performance-minded concurrency patterns (actors, tasks, Sendable, async streams).
- Install OpenSkills:
npm i -g openskills
cdinto your project directory.- Install this skill:
openskills install avdlee/Swift-Concurrency-Agent-Skill
- Sync into your
AGENTS.md:openskills sync
- Use the skill in your AI agent, for example:
Use the swift concurrency skill and analyze the current project for Swift Concurrency improvements
- Clone this repository.
- Install or symlink the
swift-concurrency/folder following your tool’s official skills installation docs (see links below). - Use your AI tool as usual and ask it to use the “swift-concurrency” skill for Swift Concurrency tasks.
Follow your tool’s official documentation, here are a few popular ones:
- Codex: Where to save skills
- Claude: Using Skills
- Cursor: Enabling Skills
How to verify:
Your agent should reference the triage/playbook in swift-concurrency/SKILL.md and jump into the relevant reference file for your error or task.
This skill gives your AI coding tool comprehensive Swift Concurrency guidance. It can:
- Choose the right tool for the job (async/await, actors, tasks, task groups)
- Understand when to use
@MainActor, custom actors, ornonisolated - Navigate isolation domains and prevent data races at compile time
- Apply
Sendableconformance correctly for value and reference types
- Avoid common pitfalls like actor reentrancy and retain cycles
- Prevent data races with proper isolation
- Handle task cancellation and error propagation correctly
- Manage memory safely in concurrent contexts
- Choose between serialized, asynchronous, and parallel execution
- Reduce actor contention and unnecessary suspension points
- Understand the tradeoffs of parallelism
- Step-by-step migration strategies for existing codebases
- Enable strict concurrency checking incrementally
- Rewrite closure-based code to async/await
- Migrate from Combine/RxSwift to Swift Concurrency
- Use migration tooling for upcoming Swift features
- Write reliable tests using Swift Testing (recommended) or XCTest
- Handle
@MainActorisolation in tests - Use
withMainSerialExecutorfor deterministic testing - Avoid flaky tests with proper async handling
- Safely pass data between isolation domains using
NSManagedObjectID - Implement the Data Access Object (DAO) pattern
- Use custom actor executors when needed
- Avoid common Core Data concurrency pitfalls
Expert Knowledge: Based on real-world experience migrating large production codebases to Swift 6, distilled from the comprehensive Swift Concurrency Course.
Non-Opinionated: Focuses on industry-standard best practices and compile-time safety, not architectural preferences. Works with any Swift project, coding style, or architecture.
Swift 6.2 Ready: Covers the latest Swift Concurrency features including:
- Default Actor Isolation
isolated deinit- Global Actor Conformance for protocols
nonisolated(nonsending)and@concurrent- Approachable Concurrency build settings
- Concurrency-safe notifications (iOS 26+)
Practical & Concise: Assumes your AI agent is already smart. Focuses on what developers need to know, not what they already understand. Includes code examples for every pattern.
swift-concurrency/
├── SKILL.md # Main skill file with decision trees
└── references/
├── async-await-basics.md # Fundamentals of async/await syntax
├── tasks.md # Task lifecycle, cancellation, priorities
├── sendable.md # Isolation domains and Sendable conformance
├── actors.md # Actor isolation, global actors, reentrancy
├── async-sequences.md # AsyncSequence and AsyncStream patterns
├── threading.md # Threads vs tasks, suspension points
├── memory-management.md # Retain cycles, weak self, isolated deinit
├── core-data.md # Core Data integration patterns
├── performance.md # Optimization with Xcode Instruments
├── testing.md # Testing concurrent code
├── migration.md # Step-by-step Swift 6 migration guide
├── glossary.md # Terms & concepts for Swift Concurrency
└── linting.md # Linting rules for strict concurrency
Found an issue or have a suggestion? Feel free to open a PR. This skill is maintained to reflect the latest Swift Concurrency best practices and will be updated as the language evolves.
Created by Antoine van der Lee, a Swift Concurrency expert and creator of the Swift Concurrency Course. With years of experience in Swift & Swift Concurrency, this skill distills practical knowledge into actionable guidance for AI assistants. He published tens of articles on Swift Concurrency on his blog called SwiftLee.
This skill is open-source and available under the MIT License. See LICENSE for details.
