swift-concurrency

Installation
SKILL.md

Swift Concurrency

Treat isolation and cancellation as API contracts. Compile under the project's real Swift language and strict-concurrency settings.

Core rules

  • Prefer structured child tasks and task groups. Detached tasks require an explicit ownership and context-transfer justification.
  • Keep mutable shared state actor-isolated or otherwise synchronized; do not silence diagnostics with unchecked Sendable without proof.
  • Propagate cancellation through loops, AsyncSequence production, continuations, and I/O adapters.
  • Resume checked continuations exactly once on every path; retain cancellation handles for callback APIs.
  • Do not block cooperative executors with synchronous I/O or locks held across suspension.
  • Preserve actor isolation in public protocols and closures. Use @MainActor only for UI/main-thread state, not as a general race workaround.
  • Define ordering, buffering, backpressure, termination, and cleanup for AsyncStream/AsyncSequence adapters.
  • Treat task-local values and priorities as contextual hints, not durable business state.

Review sequence

Installs
2
First Seen
7 days ago
swift-concurrency — full-stack-skills/swift-skills