Skip to main content
skill CX Codex

guide-swift-concurrency — Claude Code skill: how to install

Guides AI agents through reviewing and writing concurrent Swift 6.2 code under strict concurrency checks. It flags actor reentrancy bugs, unsafe tasks, and GCD patterns.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add Prisma-Labs-Dev/apple-skills --skill guide-swift-concurrency -a claude-code
Open on GitHub

What guide-swift-concurrency does

The skill configures the coding agent with a 12-step review routine for concurrent Swift code, originating from Paul Hudson's guide. Instead of vague feedback, it references targeted guides covering actor reentrancy, cooperative cancellation via withTaskCancellationHandler, and AsyncStream back-pressure.

Under the hood, the skill enforces strict design choices. The agent will not recommend @unchecked Sendable to quiet compiler diagnostics. Instead, it pushes for value types, actor isolation, or sending parameters. It also flags unstructured Task {} blocks in favor of task groups.

The instructions target Swift 6.2 or later with strict concurrency checking enabled. Applying these rules to an older Swift codebase without strict isolation mode will produce compiler warnings around @concurrent and isolated deinits.

What it helps with

  • resolve strict concurrency compiler errors without resorting to @unchecked Sendable
  • migrate legacy GCD dispatch queues and completion handlers to task groups
  • audit actor implementations for isolation leaks and reentrancy bugs
  • verify cancellation handling inside custom AsyncStream pipelines

Example prompts for the agent

  • Review this actor for reentrancy issues and Swift 6.2 isolation compliance
  • Migrate this legacy GCD completion handler method to structured concurrency
  • Fix this strict-concurrency Sendable error without using @unchecked Sendable

How to install guide-swift-concurrency

1Skills CLI (Vercel)

npx skills add Prisma-Labs-Dev/apple-skills --skill guide-swift-concurrency -a claude-code

2Manually: put the files in place

~/.claude/skills/guide-swift-concurrency/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/guide-swift-concurrency/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about guide-swift-concurrency

How to install guide-swift-concurrency in Claude Code?

Run npx skills add Prisma-Labs-Dev/apple-skills --skill guide-swift-concurrency -a claude-code. This imports the skill into your Claude Code environment.

What is the main purpose of guide-swift-concurrency?

It provides structured rules and reference patterns for writing and auditing concurrent Swift code, focusing on Swift 6.2 strict concurrency diagnostics and actor isolation.

Does this skill allow using GCD?

It prefers modern Swift concurrency for new code, but permits GCD in low-level implementations, framework interop, or performance-critical synchronous routines.

Source text

SKILL.md · MIT
---
name: guide-swift-concurrency
description: Swift concurrency patterns — actors, structured concurrency, cancellation, async streams, GCD migration, strict-concurrency diagnostics, common bug patterns. Use when writing, reviewing, or debugging concurrent Swift code.
type: guide
origin: https://github.com/twostraws/Swift-Concurrency-Agent-Skill
license: MIT
---

> **Guide Skill** — This is an expert workflow/pattern guide, not API reference documentation.
> Originally from [twostraws/Swift-Concurrency-Agent-Skill](https://github.com/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

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

© Prisma-Labs-Dev · MIT · Prisma-Labs-Dev/apple-skills

Similar skills

All skills for Programming languages →

From the same set22

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor