
Swift Concurrency Pro
Run a structured Swift 6 concurrency review on async/await, actors, and cancellation before merge or release.
Overview
Swift Concurrency Pro is an agent skill most often used in Ship (also Build) that reviews Swift code for async/await correctness, actor isolation, and Swift 6 concurrency pitfalls.
Install
npx skills add https://github.com/twostraws/swift-concurrency-agent-skill --skill swift-concurrency-proWhat is this skill?
- 11-step review process from hotspots.md through diagnostics.md and async test patterns
- Reference modules for actors, structured vs unstructured tasks, cancellation, async streams, and bridging
- Swift 6.2 concurrency behavior checks via new-features.md
- Strict-concurrency error mapping through diagnostics.md
- Reports only genuine problems—explicit anti-nitpick guidance
- 11-step review process across bundled reference markdown files
- Swift 6.2 concurrency feature cross-check via new-features.md
Adoption & trust: 5.7k installs on skills.sh; 450 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your Swift codebase uses async/await and actors but you lack a consistent review pass for reentrancy, cancellation, and Swift 6 strict-concurrency errors.
Who is it for?
Solo Swift and Apple-platform builders shipping Swift 6 targets who want agent-led concurrency reviews with bundled hotspot and diagnostic references.
Skip if: Non-Swift projects or beginners who only need syntax tutorials without production concurrency review depth.
When should I use this skill?
Reading, writing, or reviewing Swift concurrency code for correctness and modern API usage.
What do I get? / Deliverables
You get a focused concurrency review report grounded in reference docs, highlighting real defects—not style noise—before you ship or merge.
- Concurrency-focused review findings
- Mapped fixes for strict-concurrency diagnostics when applicable
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Canonical shelf is Ship review because the skill is invoked when examining concurrency correctness in existing Swift code. review matches Paul Hudson’s checker workflow: hotspots, Swift 6.2 features, and reference-guided inspection without nitpicking.
Where it fits
After adding async SwiftUI data loads, run the hotspot scan before opening a PR.
Pre-merge pass on actor reentrancy and cancellation in new concurrency code.
Validate async test patterns when XCTest suites use structured tasks.
Triage production race reports by cross-checking bug-patterns and diagnostics references.
How it compares
Concurrency-only checker with reference-guided steps, not a general SwiftUI layout or networking integration skill.
Common Questions / FAQ
Who is swift-concurrency-pro for?
Indie iOS, macOS, and Swift server developers who write or review async/await code and want Paul Hudson’s structured concurrency audit workflow.
When should I use swift-concurrency-pro?
In Ship review before merge, in Build when adding async features, or when strict-concurrency diagnostics need mapped fixes and test pattern checks.
Is swift-concurrency-pro safe to install?
Check the Security Audits panel on this page; the skill is MIT-licensed reference-driven review text with no mandatory shell or network from the skill itself.
SKILL.md
READMESKILL.md - Swift Concurrency Pro
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: 1. Scan for known-dangerous patterns using `references/hotspots.md` to prioritize what to inspect. 1. Check for recent Swift 6.2 concurrency behavior using `references/new-features.md`. 1. Validate actor usage for reentrancy and isolation correctness using `references/actors.md`. 1. Ensure structured concurrency is preferred over unstructured where appropriate using `references/structured.md`. 1. Check unstructured task usage for correctness using `references/unstructured.md`. 1. Verify cancellation is handled correctly using `references/cancellation.md`. 1. Validate async stream and continuation usage using `references/async-streams.md`. 1. Check bridging code between sync and async worlds using `references/bridging.md`. 1. Review any legacy concurrency migrations using `references/interop.md`. 1. Cross-check against common failure modes using `references/bug-patterns.md`. 1. If the project has strict-concurrency errors, map diagnostics to fixes using `references/diagnostics.md`. 1. If reviewing tests, check async test patterns using `references/testing.md`. If doing a partial review, load only the relevant reference files. ## Core Instructions - Target Swift 6.2 or later with strict concurrency checking. - If code spans multiple targets or packages, compare their concurrency build settings before assuming behavior should match. - Prefer structured concurrency (task groups) over unstructured (`Task {}`). - Prefer Swift concurrency over Grand Central Dispatch for new code. GCD is still acceptable in low-level code, framework interop, or performance-critical synchronous work where queues and locks are the right tool – don't flag these as errors. - If an API offers both `async`/`await` and closure-based variants, always prefer `async`/`await`. - Do not introduce third-party concurrency frameworks without asking first. - Do not suggest `@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. ## Output Format Organize findings by file. For each issue: 1. State the file and relevant line(s). 2. Name the rule being violated. 3. Show a brief before/after code fix. Skip files with no issues. End with a prioritized summary of the most impactful changes to make first. Example output: ### DataLoader.swift **Line 18: Actor reentrancy – state may have changed across the `await`.** ```swift // 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.** ```swift // 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) } } ``` ### Summary 1. **Correctness (high):** Actor reentrancy bug on line 18 may cause duplicate downloads and a force-unwrap crash. 2. **