swift-concurrency
Skill3 starsChanged 2 months agoMITView on GitHub
Implement, diagnose, review, or migrate Swift code involving async/await, actors, tasks, cancellation, Sendable, isolation diagnostics, continuations, AsyncSequence, or async tests. Use for Swift concurrency compiler errors and runtime race or task-lifetime problems. Do not use for ordinary synchronous Swift work, unrelated build failures, or project-specific migration policy when a more specific project skill applies.
25 other projects use a version of this.
Adopted by
Most recently taken up by
- tornikegomareli/Skillstheir own version, first seen Nov 8, 2026
- uinaf/slopwaketheir own version, first seen Nov 3, 2026
- VelimirMueller/claude-skillstheir own version, first seen Nov 1, 2026
- VelimirMueller/ai-development-skillstheir own version, first seen Nov 1, 2026
- The-Artificer-of-Ciphers-LLC/skills-from-the-artificertheir own version, first seen Nov 1, 2026
- Samueladewole/claude-skillstheir own version, first seen Oct 13, 2026
Used with
Projects with it also use swiftdata, swiftui-expert-skill and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
Prisma-Labs-DevSkillswiftdata
API reference: SwiftData. Query for @Model, ModelContext, @Query, schema migrations.
Also in 3 projects that use this
xfstudioSkillswiftui-expert-skill
Write, review, or improve SwiftUI code following best practices for state management, view composition, performance, modern APIs, Swift concurrency, and iOS 26+ Liquid Glass adoption. Use when building new SwiftUI features, refactoring existing views, reviewing code quality, or adopting modern SwiftUI patterns.
Also in 8 projects that use this
pluginagentmarketplaceSkillswift-testing
Test Swift applications - XCTest, Swift Testing, UI tests, mocking, TDD, CI/CD
Also in 4 projects that use this
eugenepyvovarovSkillswift-concurrency-expert
Swift Concurrency review and remediation for Swift 6.2+. Use when asked to review Swift Concurrency usage, improve concurrency compliance, or fix Swift concurrency compiler errors in a feature or file.
Also in 4 projects that use this
AvdLeeSkillswift-testing-expert
Expert guidance for Swift Testing: test structure, #expect/#require macros, traits and tags, parameterized tests, test plans, parallel execution, async waiting patterns, and XCTest migration. Use when writing new Swift tests, modernizing XCTest suites, debugging flaky tests, or improving test quality and maintainability in Apple-platform or Swift server projects.
Also in 3 projects that use this
dadederkSkillios-accessibility
Expert guidance on iOS accessibility best practices, patterns, and implementation. Use when developers mention: (1) iOS accessibility, VoiceOver, Dynamic Type, or assistive technologies, (2) accessibility labels, traits, hints, or values, (3) automated accessibility testing, auditing, or manual testing, (4) Switch Control, Voice Control, or Full Keyboard Access, (5) inclusive design or accessibility culture, (6) making apps work for users with disabilities.
Also in 3 projects that use this
Other versions25 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 25
- Provenance-Emu/Provenance★ 6.4ksame name
- pluk-inc/markdown-preview★ 2.8ksame name
- pluk-inc/md-preview.app★ 2.8ksame name
- AvdLee/Swift-Concurrency-Agent-Skill★ 1.7ksame name
- AFK-surf/OpenBridge★ 430same name
- Prisma-Labs-Dev/apple-skills★ 336same name
- jamesrochabrun/skills★ 209same name
- pepicrft/fuckingapproachableswiftconcurrency★ 156same name
- wendylabsinc/claude-skills★ 62same name
- nonameplum/agent-skills★ 17same name
15 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository17 other files it gives its agents.
- config/AGENTS.mdAGENTS.md
- analyzeSkill
- app-resizabilitySkill
- code-reviewSkill
- device-interactionSkill
- figmaSkill
- git-commitSkill
- gitlab-glabSkill
- git-redateSkill
- jira-task-contextSkill
- jira-updateSkill
- mr-comment-resolutionSkill
- pragmatic-testingSkill
- resolve-merge-conflictsSkill
- tddSkill
- verifySkill
- xcodebuild-xcsiftSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
22 rules. 0 are common, 13 are distinctive, and 9 are very specific to this project.
0
Common
Most of the 24 edited versions we read keep these.
13
Distinctive
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Before giving version-sensitive advice or changing code, inspect the smallest relevant set of settings:
- Distinctive: line 20
Do not assume that the package tools version, Swift language mode, compiler version, and default actor isolation are the same thing.
- Distinctive: line 31
Prefer fixes in this order:
- Very specific: line 33
Keep work in its rightful isolation domain and pass immutable Sendable values.
- Distinctive: line 35
Add precise annotations to declarations or protocol requirements where they express the API contract.
- Very specific: line 36
Use sending only when ownership transfer matches the actual lifetime of the value.
- Distinctive: line 37
Use compatibility escapes only as a last resort.
- Very specific: line 39
Never apply @MainActor to an entire type or module solely because it removes errors.
- Very specific: line 43
Prefer structured child tasks: direct await, async let, and task groups.
- Very specific: line 44
Use unstructured Task only when bridging from synchronous code or when an explicit owner manages its lifetime, cancellation, errors, and …
- Very specific: line 46
Use Task.detached only when deliberately discarding actor context, task-local values, and inherited priority is correct.
- Very specific: line 48
Never block a cooperative executor with semaphores or synchronous waits.
- Very specific: line 49
Treat await as a possible suspension and interleaving point, not evidence of a thread switch.
- Very specific: line 54
Before using @preconcurrency, @unchecked Sendable, nonisolated(unsafe), or MainActor.assumeIsolated:
- Distinctive: line 56
document the concrete invariant that makes the operation safe
- Distinctive: line 61
Do not add a package dependency, change strict-concurrency settings, or change default actor isolation merely to avoid fixing diagnostics …
- Distinctive: line 65
Read only the references needed for the task, resolving paths relative to this skill:
- Distinctive: line 78
After changing concurrency code:
- Distinctive: line 81
Run focused tests that exercise ordering, cancellation, error propagation, or lifetime—not merely the happy-path result.
- Distinctive: line 82
Use Thread Sanitizer or Instruments when runtime races, hangs, excessive task creation, or performance are part of the problem.
- Distinctive: line 83
Verify supported Swift language modes separately when a package intentionally supports more than one.
- Distinctive: line 86
Follow the project's Xcode verification route.
“Common” is measured: kept by at least 6 in 10 of the 24 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Swift Concurrency
Reason from the project's actual isolation model and compiler configuration. Do not apply concurrency annotations merely to silence diagnostics.
Intake
Before giving version-sensitive advice or changing code, inspect the smallest relevant set of settings:
- SwiftPM: tools version,
swiftLanguageModes, targetswiftSettings,.defaultIsolation(...), strict-concurrency settings, and upcoming features inPackage.swift. - Xcode:
SWIFT_VERSION,SWIFT_STRICT_CONCURRENCY,SWIFT_DEFAULT_ACTOR_ISOLATION, andSWIFT_UPCOMING_FEATURE_*in project settings. - The exact compiler diagnostic and the declaration plus call sites on both sides of the reported isolation boundary.
- Deployment targets when a proposed API has OS availability constraints.
Do not assume that the package tools version, Swift language mode, compiler version, and default actor isolation are the same thing. If a required setting cannot be determined, state the assumption and ask only when it materially changes the solution.
Diagnostic method
- Identify every relevant isolation domain:
@MainActor, another global actor, an actor instance, task isolation, or nonisolated code. - Identify mutable state and who owns it.
- Mark values that cross an isolation boundary and determine whether they are
Sendable, proven disconnected forsending, or should not cross at all. - Account for suspension and actor reentrancy; values read before
awaitmay be stale afterward. - Decide whether the operation needs serialization, parallelism, or simply asynchronous waiting.
- Fix the model at the narrowest stable boundary, then compile before addressing secondary diagnostics.
Prefer fixes in this order:
- Keep work in its rightful isolation domain and pass immutable
Sendablevalues. - Give shared mutable state one clear owner, often an actor or an existing global actor.
- Add precise annotations to declarations or protocol requirements where they express the API contract.
- Use
sendingonly when ownership transfer matches the actual lifetime of the value. - Use compatibility escapes only as a last resort.
Never apply @MainActor to an entire type or module solely because it removes errors. UI state commonly belongs on MainActor; networking, storage, parsing, and CPU-heavy work do not automatically belong there.
Execution rules
- Prefer structured child tasks: direct
await,async let, and task groups. - Use unstructured
Taskonly when bridging from synchronous code or when an explicit owner manages its lifetime, cancellation, errors, and result. Taskinherits surrounding isolation; it is not a generic “background thread” primitive.- Use
Task.detachedonly when deliberately discarding actor context, task-local values, and inherited priority is correct. - Cancellation is cooperative. Propagate
CancellationError, check cancellation in long loops, and cancel owned long-lived tasks. - Never block a cooperative executor with semaphores or synchronous waits. Never hold a lock across an
await. - Treat
awaitas a possible suspension and interleaving point, not evidence of a thread switch. - Measure before changing isolation for performance.
@concurrentselects generic-executor semantics on supporting toolchains; it does not promise a particular thread.
Unsafe and compatibility features
Before using @preconcurrency, @unchecked Sendable, nonisolated(unsafe), or MainActor.assumeIsolated:
- document the concrete invariant that makes the operation safe
- scope the escape as narrowly as possible
- explain why a checked design is not currently practical
- identify removal work; create an external ticket only when explicitly authorized
Do not add a package dependency, change strict-concurrency settings, or change default actor isolation merely to avoid fixing diagnostics unless the user explicitly requested that migration or dependency change.
Reference routing
Read only the references needed for the task, resolving paths relative to this skill:
references/isolation-and-sendability.md: actors, global actors, reentrancy,Sendable,sending, and unsafe escapes.references/tasks-and-cancellation.md: structured and unstructured tasks, cancellation, errors, priorities, and task lifetime.references/diagnostics-and-migration.md: common diagnostics, build settings, Swift language-mode migration,@concurrent, and default isolation.references/async-streams-and-continuations.md: callback bridging, continuations,AsyncSequence, and stream lifetime.references/testing.md: deterministic tests for async and actor-isolated behavior using XCTest or Swift Testing.references/core-data.md: Core Data confinement,NSManagedObjectID, snapshots, and advanced executor integration.
For compiler- or SDK-sensitive syntax, prefer the available Xcode MCP Apple-documentation and Swift-snippet tools over memory. Do not load every reference preemptively.
Verification
After changing concurrency code:
- Re-run the focused compiler diagnostic or build with the same settings that produced it.
- Run focused tests that exercise ordering, cancellation, error propagation, or lifetime—not merely the happy-path result.
- Use Thread Sanitizer or Instruments when runtime races, hangs, excessive task creation, or performance are part of the problem.
- Verify supported Swift language modes separately when a package intentionally supports more than one.
- Report unsafe escapes, assumptions, untested scheduling behavior, and unavailable verification tools.
Follow the project's Xcode verification route. A successful build proves only that the checked configuration compiled; it does not prove cancellation, ordering, lifetime, or race freedom at runtime.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

