swift-concurrency

Featured

Swift concurrency: async/await, Actor, Task, Sendable patterns.

AI & Automation 425 stars 46 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 93/100

Stars 20%
88
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
93
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Swift Structured Concurrency Pattern catalog for Swift's structured concurrency model: async/await, Actors, TaskGroups, AsyncSequence, Sendable, and cancellation. Load the reference file matching the developer's question. ## Reference Loading Table | Signal | Reference File | Content | |--------|---------------|---------| | async/await, Task, Sendable | references/fundamentals.md | async/await patterns, Task/Task.detached, Sendable/@Sendable | | Actor, @MainActor, nonisolated | references/actor-isolation.md | Actor isolation, MainActor UI confinement, nonisolated opt-out | | TaskGroup, AsyncSequence, AsyncStream, cancellation | references/task-patterns.md | Structured concurrency, rate-limited groups, streams, cancellation | | Failure modes, common mistakes | references/preferred-patterns.md | Blocking MainActor, task leaking, actor reentrancy hazard | ## Key Conventions - **Prefer structured concurrency** -- use `TaskGroup` over loose `Task { }` whenever possible; structured tasks propagate cancellation and errors automatically. - **Mark types Sendable** -- enable strict concurrency checking (`-strict-concurrency=complete`) and resolve all warnings before they become errors in Swift 6. - **Use actors for shared mutable state** -- avoid manual locks; actors provide compiler-verified safety. - **Cancel what you create** -- every `Task` stored in a property should have a corresponding cancellation path. - **Minimize @MainActor surface** -- isolate only the UI layer; keep...

Details

Author
notque
Repository
notque/vexjoy-agent
Created
6 months ago
Last Updated
yesterday
Language
Python
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Featured

swift

Swift development: concurrency patterns, async/await, actors, testing with XCTest and Swift Testing framework.

425 Updated yesterday
notque
AI & Automation Listed

swift-concurrency

Resolve Swift concurrency compiler errors, adopt approachable concurrency (SE-0466), and write data-race-safe async code. Use when fixing Sendable conformance errors, actor isolation warnings, or strict concurrency diagnostics; when adopting default MainActor isolation, @concurrent, nonisolated(nonsending), or Task.immediate; when designing actor-based architectures, structured concurrency with TaskGroup, or background work offloading; or when migrating from @preconcurrency to full Swift 6 strict concurrency.

3 Updated today
eric-sabe
Data & Documents Listed

swift-concurrency

Use for any Swift Concurrency question on Apple platforms. Triggers on: actor reentrancy (stale state after await), AsyncStream lifecycle (continuation.finish, onTermination), TaskGroup memory and task throttling (activeProcessorCount), Sendable conformance across actor boundaries (non-Sendable third-party types), SWIFT_STRICT_CONCURRENCY=complete error triage ('Sending X risks causing data races'), Swift 6 / 6.2 migration (nonisolated caller-side isolation, @concurrent), cooperative pool blocking, async/await patterns, and continuation misuse. Also covers @MainActor isolation, structured concurrency, and converting callbacks to async/await. Use whenever the query mentions actor, AsyncStream, TaskGroup, Sendable, nonisolated, withCheckedContinuation, or Swift 6.

11 Updated 1 weeks ago
rusel95