Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
twostraws avatar

Swift Concurrency Pro

  • 7.9k installs
  • 499 repo stars
  • Updated May 17, 2026
  • twostraws/swift-concurrency-agent-skill

swift-concurrency-pro is an agent skill that reviews Swift concurrency code for correctness, Swift 6.2 API usage, actor isolation, and async/await pitfalls with actionable fixes.

About

The swift-concurrency-pro skill reviews Swift code for concurrency correctness, modern API usage, and common async/await pitfalls. Agents scan known-dangerous patterns from reference hotspots, validate Swift 6.2 behavior, actor reentrancy and isolation, structured versus unstructured tasks, cancellation handling, async streams, bridging between sync and async code, legacy GCD interop, bug patterns, strict-concurrency diagnostics, and async test patterns. Core rules target Swift 6.2 with strict checking, prefer structured concurrency and async/await over closure APIs, and reject @unchecked Sendable as a quick fix. Findings are organized by file with line references, violated rules, and before/after fixes, ending in a prioritized summary of high-impact changes. Partial reviews can load only relevant reference files. The skill reports genuine problems without nitpicking and accepts GCD in low-level or performance-critical interop. Use when reading, writing, or reviewing Swift concurrency code, migrating legacy patterns, or resolving strict-concurrency compiler errors.

  • Eleven-step review process covering actors, task groups, cancellation, async streams, and diagnostics.
  • Targets Swift 6.2 strict concurrency with structured concurrency preferred over unstructured Task loops.
  • Outputs per-file findings with rule names, line references, and before/after code fixes.
  • Loads reference files for hotspots, bug patterns, bridging, interop, and async testing.
  • Rejects @unchecked Sendable shortcuts in favor of actors, value types, or sending parameters.

Swift Concurrency Pro by the numbers

  • 7,915 all-time installs (skills.sh)
  • +267 installs in the week ending Jul 28, 2026 (Skillselion tracking)
  • Ranked #20 of 1,048 Mobile Development skills by installs in the Skillselion catalog
  • Security screen: LOW risk (skills.sh audit)
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
At a glance

swift-concurrency-pro capabilities & compatibility

Capabilities
actor reentrancy and isolation validation · structured concurrency versus unstructured task · cancellation and async stream lifecycle checks · swift 6.2 feature and diagnostic mapping · before/after fix output with prioritized summary
Use cases
code review · debugging · frontend
From the docs

What swift-concurrency-pro says it does

Prefer structured concurrency (task groups) over unstructured (`Task {}`).
SKILL.md
npx skills add https://github.com/twostraws/swift-concurrency-agent-skill --skill swift-concurrency-pro

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs7.9k
repo stars499
Security audit3 / 3 scanners passed
Last updatedMay 17, 2026
Repositorytwostraws/swift-concurrency-agent-skill

Is my Swift async/await code correct under strict concurrency, especially around actor reentrancy, task groups, and cancellation?

Review Swift concurrency code for actor reentrancy, structured concurrency, cancellation, and Swift 6.2 strict-concurrency diagnostics.

Who is it for?

Swift developers on Swift 6.2 or later reviewing or migrating concurrency code in app targets and packages.

Skip if: Skip for non-Swift stacks or teams wanting runtime profiling instead of static concurrency correctness review.

When should I use this skill?

User reads, writes, or reviews Swift concurrency code, hits strict-concurrency errors, or migrates from GCD or completion handlers.

What you get

A prioritized file-by-file review with violated rules, line citations, before/after fixes, and a summary of the highest-impact changes.

  • Concurrency issue report
  • Actor isolation validation notes

By the numbers

  • Skill metadata version 1.0 authored by Paul Hudson under MIT license
  • Review process references two bundled guides: hotspots.md and new-features.md for Swift 6.2

Files

SKILL.mdMarkdownGitHub ↗

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`.

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

Summary

1. Correctness (high): Actor reentrancy bug on line 18 may cause duplicate downloads and a force-unwrap crash. 2. Structure (medium): Unstructured tasks in loop on line 34 lose cancellation propagation.

End of example.

References

  • references/hotspots.md - Grep targets for code review: known-dangerous patterns and what to check for each.
  • 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.
  • references/actors.md - Actor reentrancy, shared-state annotations, global actor inference, and isolation patterns.
  • references/structured.md - Task groups over loops, discarding task groups, concurrency limits.
  • references/unstructured.md - Task vs Task.detached, when Task {} is a code smell.
  • references/cancellation.md - Cancellation propagation, cooperative checking, broken cancellation patterns.
  • references/async-streams.md - AsyncStream factory, continuation lifecycle, back-pressure.
  • references/bridging.md - Checked continuations, wrapping legacy APIs, @unchecked Sendable.
  • references/interop.md - Migrating from GCD, Mutex/locks, completion handlers, delegates, and Combine.
  • references/bug-patterns.md - Common concurrency failure modes and their fixes.
  • references/diagnostics.md - Strict-concurrency compiler errors, protocol conformance fixes, and likely remedies.
  • references/testing.md - Async test strategy with Swift Testing, race detection, avoiding timing-based tests.

Related skills

How it compares

Pick swift-concurrency-pro over general code-review skills when the diff is Swift-specific and actor or async/await correctness is the primary risk.

FAQ

What Swift version does swift-concurrency-pro target?

Swift 6.2 or later with strict concurrency checking enabled.

How are findings presented?

Per file with line numbers, the violated rule, a brief explanation, and a before/after code fix plus a prioritized summary.

Does it flag all GCD usage?

No. GCD remains acceptable in low-level interop or performance-critical synchronous work where queues and locks are appropriate.

Is Swift Concurrency Pro safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

Mobile Developmentfrontendtesting

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.