mcpField
G
guide-swift-concurrency

guide-swift-concurrency

github.com/prisma-labs-devDevelopment349454 installsUpdated 5w ago
Repository

About guide-swift-concurrency

guide-swift-concurrency is a workflow and pattern guide for reviewing and writing Swift concurrency code. It helps Swift developers identify genuine correctness issues and apply modern practices, with references covering Swift 6.2, actors, cancellation, streams, and testing.

Key features

  1. 01Review Swift concurrency code
  2. 02Check Swift 6.2 concurrency behavior
  3. 03Assess actors and isolation
  4. 04Prefer structured concurrency patterns
  5. 05Review cancellation and async streams
  6. 06Guide concurrency migration and tests

Use cases

  1. 01Reviewing concurrency code for correctness
  2. 02Diagnosing strict-concurrency compiler errors
  3. 03Migrating GCD or callback-based code
  4. 04Checking async test patterns

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/prisma-labs-dev/apple-skills --skill guide-swift-concurrency

After installing, type/guide-swift-concurrencyin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
actors.md
async-streams.md
bridging.md
bug-patterns.md
cancellation.md
diagnostics.md
hotspots.md
interop.md
new-features.md
structured.md
testing.md
unstructured.md

Details

From the project README

Guide Skill — This is an expert workflow/pattern guide, not API reference documentation. Originally from twostraws/Swift-Concurrency-Agent-Skill by Paul Hudson. MIT License.

Swift Concurrency Patterns

Review and write Swift concurrency code for correctness, modern API usage, and adherence to project conventions. Report only genuine problems — do not nitpick or invent issues.

Core Instructions

  • Target Swift 6.2 or later with strict concurrency checking.
  • Prefer structured concurrency (task groups) over unstructured (Task {}).
  • Prefer Swift concurrency over GCD for new code. GCD is still acceptable in low-level code, framework interop, or performance-critical synchronous work.
  • Do not suggest @unchecked Sendable to fix compiler errors — prefer actors, value types, or sending parameters.

Review Process

  1. Scan for known-dangerous patterns using references/hotspots.md.
  2. Check for Swift 6.2 concurrency behavior using references/new-features.md.
  3. Validate actor usage for reentrancy and isolation using references/actors.md.
  4. Ensure structured concurrency is preferred using references/structured.md.
  5. Check unstructured task usage using references/unstructured.md.
  6. Verify cancellation handling using references/cancellation.md.
  7. Validate async stream and continuation usage using references/async-streams.md.
  8. Check bridging code between sync and async using references/bridging.md.
  9. Review legacy concurrency migrations using references/interop.md.
  10. Cross-check against common failure modes using references/bug-patterns.md.
  11. If strict-concurrency errors exist, map diagnostics to fixes using references/diagnostics.md.
  12. If reviewing tests, check async test patterns using references/testing.md.

If doing partial work, load only the relevant reference files.

References

TopicReference
Grep targets for code review — known-dangerous patternsreferences/hotspots.md
Swift 6.2: default isolation, @concurrent, Task.immediate, isolated deinitreferences/new-features.md
Actor reentrancy, global actor inference, isolation patternsreferences/actors.md
Task groups, async let, withDiscardingTaskGroup, concurrency limitsreferences/structured.md
Task vs Task.detached, when Task {} is a code smellreferences/unstructured.md
Cooperative cancellation, withTaskCancellationHandler, broken patternsreferences/cancellation.md
AsyncStream.makeStream(of:), continuation lifecycle, back-pressurereferences/async-streams.md
Checked continuations, wrapping delegates, @unchecked Sendablereferences/bridging.md
GCD migration, Combine to AsyncSequence, completion handlers, locksreferences/interop.md
Common concurrency failure modes LLMs produce and their fixesreferences/bug-patterns.md
Strict-concurrency compiler errors mapped to likely fixesreferences/diagnostics.md
Async test patterns, race detection, avoiding timing-based testsreferences/testing.md

Comments

Markdown supported