swift-concurrency

Enforce actor isolation and Sendable usage in Swift codebases.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/rusel95/WhiteNoise --skill swift-concurrency-rusel95
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: swift-concurrency
Source: https://github.com/rusel95/WhiteNoise/tree/main/.claude/skills/swift-concurrency
Command: npx skills add https://github.com/rusel95/WhiteNoise --skill swift-concurrency-rusel95

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Swift concurrency issues can cause subtle crashes and hangs in production. This Skill guides engineers to prevent data races, cooperative pool deadlocks, and actor isolation problems, while providing migration strategies to Swift 6 and strict concurrency.

Core Features & Use Cases

  • Guidance on using actors for shared state, Mutex for synchronous code, and withDiscardingTaskGroup for memory-safe child tasks.
  • Migration workflows: leaf-module-first strategy, per-target flags, Sendable decisions, and testing patterns (TSan, clock injection, deterministic tests).
  • Patterns and references: region-based isolation, sending, nonisolated etc.

Quick Start

Audit your codebase for concurrency boundaries and start migrating leaf modules using actors, Mutex, and withDiscardingTaskGroup, then validate with strict concurrency checks.

Frequently Asked Questions about swift-concurrency

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate my Swift codebase to strict concurrency without causing data races?

Migrate Swift code to strict concurrency safely by enforcing actor isolation, correct Sendable usage, and structured concurrency, starting from leaf modules and validating with TSan and deterministic tests.

What is the best way to use actors and Sendable when upgrading to Swift 6?

Use actors for shared mutable state and Mutex for synchronous code in Swift 6, while conforming types to Sendable to satisfy strict concurrency compiler rules and prevent cross-module data races.

Does this Skill help with async/await and TaskGroup patterns for iOS and macOS apps?

Yes, it enforces async/await, TaskGroup, and AsyncStream patterns, specifically guiding withDiscardingTaskGroup for memory-safe child tasks and region-based isolation across iOS and macOS.

How do I resolve cooperative thread pool deadlocks and actor isolation problems?

Resolve cooperative thread pool deadlocks by applying structured concurrency patterns, using nonisolated and sending semantics, and enforcing correct actor isolation boundaries in your Swift codebase.

Can I enable strict concurrency checks per-target instead of app-wide during migration?

Yes, the Skill guides per-target flag usage and a leaf-module-first migration strategy, allowing you to satisfy SWIFT_STRICT_CONCURRENCY complete incrementally rather than app-wide.

What testing patterns should I use to validate Swift concurrency safety?

Validate Swift concurrency safety using Thread Sanitizer (TSan), clock injection, and deterministic tests to detect data races and verify actor isolation correctness during migration.