swift-concurrency-6-2
Swift 6.2 Approachable Concurrency — single-threaded by default, @concurrent for explicit background offloading, isolated conformances for main actor types.
npx skills add mturac/everything-openai-codex --skill swift-concurrency-6-2 --agent codex
Same command for any agent — swap --agent for claude-code, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Swift 6.2 Approachable Concurrency Patterns for adopting Swift 6.2's concurrency model where code runs single-threaded by default and concurrency is introduced explicitly. Eliminates common data-race errors without sacrificing performance. ## When to Activate - Migrating Swift 5.x or 6.0/6.1 projects to Swift 6.2 - Resolving data-race safety compiler errors - Designing MainActor-based app architecture - Offloading CPU-intensive work to background threads - Implementing protocol conformances on MainActor-isolated types - Enabling Approachable Concurrency build settings in Xcode 26 ## Core Problem: Implicit Background Offloading In Swift 6.1 and earlier, async functions could be implicitly offloaded to background threads, causing data-race errors even in seemingly safe code: ```swift // Swift 6.1: ERROR @MainActor final class StickerModel { let photoProcessor = PhotoProcessor() func extractSticker(_ item: PhotosPickerItem) async throws -> Sticker? { guard let data = try await item.loadTransferable(type: Data.self) else { return nil } // Error: Sending 'self.photoProcessor' risks causing data races return await photoProcessor.extractSticker(data: data, with: item.itemIdentifier) } }
- When to Activate
- Core Problem: Implicit Background Offloading
- Core Pattern — Isolated Conformances
- Core Pattern — Global and Static Variables
- MainActor Default Inference Mode
- Core Pattern — @concurrent for Background Work
- Key Design Decisions
- Migration Steps
- Best Practices
- Anti-Patterns to Avoid
- When to Use
What does the swift-concurrency-6-2 skill do?
Swift 6.2 Approachable Concurrency — single-threaded by default, @concurrent for explicit background offloading, isolated conformances for main actor types.
How do I install it?
Run `npx skills add mturac/everything-openai-codex --skill swift-concurrency-6-2 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From mturac/everything-openai-codex, a repository with 84 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
