swift6-concurrency

Installation
SKILL.md

Swift 6 / Strict Concurrency

When to invoke

  • Starting a new Swift iOS / macOS App project and deciding the language mode.
  • Writing Package.swift and setting swiftLanguageModes / SWIFT_STRICT_CONCURRENCY.
  • Adding a new third-party dependency and hitting concurrency warnings / errors.
  • User asks "how do I configure Swift 6 / complete concurrency / Sendable / actor / @preconcurrency".

Default decisions

  • Swift 6 language mode + complete concurrency checking, applied from the first line of code.
  • Default actor isolation is MainActor, following the Xcode 26 App project template (SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor + SWIFT_APPROACHABLE_CONCURRENCY = YES; the SwiftPM equivalent is swiftSettings: [.defaultIsolation(MainActor.self)], which requires // swift-tools-version: 6.2). Under this default an unannotated in-house type never leaves the main actor, so it does not need Sendable on its own account — Sendable is required only for a type that crosses into nonisolated code, an actor, or a module with a different isolation default. Declare it explicitly when it does (struct Foo: Sendable or final class Foo: Sendable — the latter only valid when the class is non-inheritable and every stored property is both Sendable and let; for classes with mutable state, prefer actor Foo or @unchecked Sendable with manual synchronisation).
  • Layer the isolation default per module (see swiftpm-modularization): keep MainActor as the default for UI/App modules; Engine/Domain modules that are pure logic set swiftSettings: [.defaultIsolation(nil)] so they stay nonisolated by default and avoid needless main-actor hops. Work that must run off the main actor is marked explicitly with @concurrent (SE-0461) rather than left to inference.
  • Protocols that cross actor boundaries (DI injection points) are declared Sendable, with methods async throws. Keep that requirement even when the implementation is an actor: the protocol's Sendable is not what fails when a non-Sendable framework type (AVAssetTrack, VNRequest) is involved — what fails is the value crossing the boundary:
Installs
13
GitHub Stars
18
First Seen
Jul 6, 2026