Skip to content
affaan-m avatar

Swift Concurrency 6 2

Swift 6.2 concurrency guide that runs code single-threaded by default and adds explicit background offloading with @concurrent.

CCM score
71 of 100
skills.sh installs
11.9K
GitHub stars
312.6K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers migrating from Swift 5.x or 6.0/6.1, resolving data-race errors, and designing MainActor-based app architecture
  • Includes patterns for async functions staying on the calling actor, isolated conformances, MainActor-protected globals, and @concurrent background work
  • Enforces explicit opt-in for background execution, requiring nonisolated types, the @concurrent attribute, and await at call sites
  • Designed for Xcode 26 projects that enable Approachable Concurrency build settings and MainActor default inference

Install

$ npx -y skills add affaan-m/ecc --skill swift-concurrency-6-2 -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

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 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 }

Details

Repository
github.com/affaan-m/ecc
Category
Mobile Apps
First seen
Jul 14, 2026

Questions

What does the swift-concurrency-6-2 skill do?

It teaches Swift 6.2 Approachable Concurrency, where code runs single-threaded by default and concurrency is added explicitly. It covers @concurrent for background offloading, isolated conformances for MainActor types, and MainActor default inference. It also helps resolve data-race compiler errors when migrating from Swift 5.x or 6.0/6.1.

How do I install the swift-concurrency-6-2 skill?

Run npx -y skills add affaan-m/ecc --skill swift-concurrency-6-2 -y in your project. The skill then lets your agent apply Swift 6.2 concurrency patterns to your code. It is listed in the Mobile Apps category, where it ranks in the top 100.

When should I use the swift-concurrency-6-2 skill?

Use it when migrating Swift 5.x or 6.0/6.1 projects to Swift 6.2, or when resolving data-race safety errors in Xcode 26. It also helps design MainActor-based app architecture and decide when to offload CPU-intensive work with @concurrent. Profiling before offloading is recommended by the skill.

More from affaan-m/ecc

All 257

Similar to Swift Concurrency 6 2

More Mobile Apps