Help us improve
Share bugs, ideas, or general feedback.
Reviews Swift code for concurrency correctness, modern async/await usage, actor isolation, structured concurrency, and common pitfalls. Use when reading, writing, or reviewing Swift concurrency code.
npx claudepluginhub twostraws/swift-concurrency-agent-skill --plugin swift-concurrency-proHow this skill is triggered — by the user, by Claude, or both
Slash command
/swift-concurrency-pro:swift-concurrency-pro [focus area][focus area]The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Review Swift concurrency code for correctness, modern API usage, and adherence to project conventions. Report only genuine problems - do not nitpick or invent issues.
Reviews and fixes Swift concurrency issues including actor isolation, Sendable safety, and async migration in Swift 6.2+ codebases.
Fixes Swift concurrency compiler errors, adopts approachable concurrency (SE-0466), and writes data-race-safe async code. Use when resolving Sendable conformance errors, actor isolation warnings, or migrating to Swift 6 strict concurrency.
Diagnoses Swift Concurrency issues, refactors callback code to async/await, and guides Swift 6 migration for tasks, actors, Sendable, and data races.
Share bugs, ideas, or general feedback.
Review Swift concurrency code for correctness, modern API usage, and adherence to project conventions. Report only genuine problems - do not nitpick or invent issues.
Review process:
${CLAUDE_SKILL_DIR}/references/hotspots.md to prioritize what to inspect.${CLAUDE_SKILL_DIR}/references/new-features.md.${CLAUDE_SKILL_DIR}/references/actors.md.${CLAUDE_SKILL_DIR}/references/structured.md.${CLAUDE_SKILL_DIR}/references/unstructured.md.${CLAUDE_SKILL_DIR}/references/cancellation.md.${CLAUDE_SKILL_DIR}/references/async-streams.md.${CLAUDE_SKILL_DIR}/references/bridging.md.${CLAUDE_SKILL_DIR}/references/interop.md.${CLAUDE_SKILL_DIR}/references/bug-patterns.md.${CLAUDE_SKILL_DIR}/references/diagnostics.md.${CLAUDE_SKILL_DIR}/references/testing.md.If doing a partial review, load only the relevant reference files.
Task {}).async/await and closure-based variants, always prefer async/await.@unchecked Sendable to fix compiler errors. It silences the diagnostic without fixing the underlying race. Prefer actors, value types, or sending parameters instead. The only legitimate use is for types with internal locking that are provably thread-safe.Organize findings by file. For each issue:
Skip files with no issues. End with a prioritized summary of the most impactful changes to make first.
Example output:
Line 18: Actor reentrancy – state may have changed across the await.
// Before
actor Cache {
var items: [String: Data] = [:]
func fetch(_ key: String) async throws -> Data {
if items[key] == nil {
items[key] = try await download(key)
}
return items[key]!
}
}
// After
actor Cache {
var items: [String: Data] = [:]
func fetch(_ key: String) async throws -> Data {
if let existing = items[key] { return existing }
let data = try await download(key)
items[key] = data
return data
}
}
Line 34: Use withTaskGroup instead of creating tasks in a loop.
// Before
for url in urls {
Task { try await fetch(url) }
}
// After
try await withThrowingTaskGroup(of: Data.self) { group in
for url in urls {
group.addTask { try await fetch(url) }
}
for try await result in group {
process(result)
}
}
End of example.
${CLAUDE_SKILL_DIR}/references/hotspots.md - Grep targets for code review: known-dangerous patterns and what to check for each.${CLAUDE_SKILL_DIR}/references/new-features.md - Swift 6.2 changes that alter review advice: default actor isolation, isolated conformances, caller-actor async behavior, @concurrent, Task.immediate, task naming, and priority escalation.${CLAUDE_SKILL_DIR}/references/actors.md - Actor reentrancy, shared-state annotations, global actor inference, and isolation patterns.${CLAUDE_SKILL_DIR}/references/structured.md - Task groups over loops, discarding task groups, concurrency limits.${CLAUDE_SKILL_DIR}/references/unstructured.md - Task vs Task.detached, when Task {} is a code smell.${CLAUDE_SKILL_DIR}/references/cancellation.md - Cancellation propagation, cooperative checking, broken cancellation patterns.${CLAUDE_SKILL_DIR}/references/async-streams.md - AsyncStream factory, continuation lifecycle, back-pressure.${CLAUDE_SKILL_DIR}/references/bridging.md - Checked continuations, wrapping legacy APIs, @unchecked Sendable.${CLAUDE_SKILL_DIR}/references/interop.md - Migrating from GCD, Mutex/locks, completion handlers, delegates, and Combine.${CLAUDE_SKILL_DIR}/references/bug-patterns.md - Common concurrency failure modes and their fixes.${CLAUDE_SKILL_DIR}/references/diagnostics.md - Strict-concurrency compiler errors, protocol conformance fixes, and likely remedies.${CLAUDE_SKILL_DIR}/references/testing.md - Async test strategy with Swift Testing, race detection, avoiding timing-based tests.