/ios-swift-skills:concurrency-expertfrom ios-swift-skills
Reviews and fixes Swift Concurrency issues in Swift 6.2+ codebases, applying actor isolation, Sendable safety, and modern concurrency patterns.
Ships in ios-swift-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Review and fix Swift Concurrency issues in Swift 6.2+ codebases by applying actor isolation, Sendable safety, and modern concurrency patterns with minimal behavior changes.
@MainActor, actor, nonisolated)Prefer edits that preserve existing behavior while satisfying data-race safety.
Common fixes:
| Issue | Fix |
|---|---|
| UI-bound types | Annotate the type or members with @MainActor |
| Protocol conformance on main actor types | Make conformance isolated: extension Foo: @MainActor SomeProtocol |
| Global/static state | Protect with @MainActor or move into an actor |
| Background work | Use @concurrent async function on a nonisolated type |
| Sendable errors | Prefer immutable/value types; add Sendable only when correct |
Swift 6.2 stays single-threaded by default until you choose to introduce concurrency:
// In Swift 6.2 with approachable concurrency enabled,
// this no longer produces a data race 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
}
// Safe - runs on main actor by default
return await photoProcessor.extractSticker(data: data, with: item.itemIdentifier)
}
}
Conformances that need main actor state are now supported:
protocol Exportable {
func export()
}
// Isolated conformance - safe because compiler ensures
// it's only used on the main actor
extension StickerModel: @MainActor Exportable {
func export() {
photoProcessor.exportAsPNG()
}
}
// Protect with @MainActor
@MainActor
final class StickerLibrary {
static let shared: StickerLibrary = .init()
}
// Or enable main-actor-by-default mode for the whole project
Use @concurrent to explicitly run code on the concurrent thread pool:
nonisolated struct PhotoProcessor {
@concurrent
func process(data: Data) async -> ProcessedPhoto? {
// Runs on background thread
}
}
// Caller adds await
processedPhotos[item.id] = await PhotoProcessor().process(data: data)
swift.org/migration@MainActor
final class ViewModel {
var items: [Item] = []
func load() async {
items = try await service.fetchItems()
}
}
nonisolated struct ImageProcessor {
@concurrent
static func resize(_ image: UIImage, to size: CGSize) async -> UIImage {
// Heavy work runs off main actor
}
}
actor Cache {
private var storage: [String: Data] = [:]
func get(_ key: String) -> Data? {
storage[key]
}
func set(_ key: String, value: Data) {
storage[key] = value
}
}
Enable in Xcode under Swift Compiler - Concurrency:
SWIFT_STRICT_CONCURRENCY = completeOr in Package.swift:
swiftSettings: [
.enableExperimentalFeature("StrictConcurrency")
]
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Generated from the plugin's indexed repository (patrickserrano/skills) — no native marketplace selected
npx claudepluginhub p/patrickserrano-ios-swift-skills10 skills in this plugin
/issue-fix-flowEnd-to-end GitHub issue fix workflow using gh CLI, local code changes, builds/tests, and git push. Use when asked to take an issue number, implement a fix, run builds/tests, commit with a closing message, and push./debugger-agentBuild, run, and debug iOS apps on a simulator. Use when asked to run an iOS app, interact with the simulator UI, capture logs, or diagnose runtime behavior./native-app-profilingProfile native macOS/iOS apps using Time Profiler via CLI (xctrace). Use when asked to identify performance hotspots, profile CPU usage, or diagnose slow code paths without opening Instruments./app-store-changelogCreate user-facing App Store release notes from git history. Use when asked to generate release changelog, App Store "What's New" text, or release notes based on git tags./macos-spm-app-packagingScaffold, build, and package SwiftPM-based macOS apps without Xcode project. Use when you need a from-scratch macOS app layout, SwiftPM targets/resources, custom .app bundle assembly, or signing/notarization steps outside Xcode./liquid-glassImplement, review, or improve SwiftUI features using the iOS 26+ Liquid Glass API. Use when asked to adopt Liquid Glass in SwiftUI UI, refactor to Liquid Glass, or review Liquid Glass usage.Other plugins' skills for the same job