Individual skill
swift-concurrency
Diagnose Swift Concurrency issues, refactor callback-based code to async/await, and guide Swift 6 migration when working with tasks, actors, @MainActor, Sendable, data races, thread safety, or concurrency-related compiler and linter warnings.
skills/swift-concurrency/SKILL.md
Source commit 3b1580d8398e0b5408b3bf0bada0e941a1cfc642
What was checked
- Matches the observed repository HEAD
- Yes
- Scanner rules are current
- Yes
- Repository scan complete
- Yes
- Skill scan complete
- Yes
- Observed behavior
- Network or broad shell
- Last checked
- Nov 9, 2026
These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.
Install this skill
Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.
An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.
Repository context
- Repository stars (not skill ratings)
- 1,713
- Repository last updated
- Nov 6, 2026
- License
- MIT
Observed agent integration: No specific integration evidence. Standard SKILL.md installation does not imply verified compatibility.
- agent-skills Repository topic
- async-await Repository topic
- swift Repository topic
- swift-actor Repository topic
- swift-concurrency Repository topic
- engineering Derived category
- data Derived category
Files and excerpt
File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.
Browse files
SKILL.mdcore · 12,852 bytesagents/openai.yamlasset · 249 bytesassets/logo-small.pngasset · 4,283 bytesassets/logo.pngasset · 26,017 bytesreferences/_index.mddoc · 2,150 bytesreferences/actors.mddoc · 17,545 bytesreferences/async-algorithms.mddoc · 20,705 bytesreferences/async-await-basics.mddoc · 7,686 bytesreferences/async-sequences.mddoc · 17,136 bytesreferences/core-data.mddoc · 14,888 bytesreferences/glossary.mddoc · 7,081 bytesreferences/linting.mddoc · 5,334 bytesreferences/memory-management.mddoc · 12,736 bytesreferences/migration.mddoc · 33,770 bytesreferences/observation.mddoc · 14,420 bytesreferences/performance.mddoc · 15,490 bytesreferences/sendable.mddoc · 13,603 bytesreferences/tasks.mddoc · 17,019 bytesreferences/testing.mddoc · 13,757 bytesreferences/threading.mddoc · 16,440 bytes
Read excerpt
# Swift Concurrency
## Fast Path
Before proposing a fix:
1. Analyze `Package.swift` or `.pbxproj` to determine Swift language mode, strict concurrency level, default isolation, and upcoming features. Do this always, not only for migration work.
2. Capture the exact diagnostic and offending symbol.
3. Determine the isolation boundary: `@MainActor`, custom actor, actor instance isolation, or `nonisolated`.
4. Confirm whether the code is UI-bound or intended to run off the main actor. When spawning unstructured tasks, inspect the synchronous prefix (everything before the first `await`): start on `@MainActor` only when that prefix truly needs main-actor access; otherwise use `Task { @concurrent in ... }` and hop back with `MainActor.run` only after the suspension. A trivial non-main line (for example, `print`) followed by main-actor work in the same prefix is not a reason to use `@concurrent`. For delayed retries, timers, and backoff tasks, separate the waiting from the UI mutation. The sleep often belongs off the main actor even when the final state update belongs on it.
Project settings that change concurrency behavior:
| Setting | SwiftPM (`Package.swift`) | Xcode (`.pbxproj`) |
|---|---|---|