Tooluck logoTooluck
SKILL.md

swift-concurrency

Agent skill fromAvdLee/Swift-Concurrency-Agent-Skill

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.

How to install swift-concurrency

install swift-concurrency
# install the Swift-Concurrency-Agent-Skill pack with the skills CLI
npx skills add AvdLee/Swift-Concurrency-Agent-Skill

# or add only this skill to Claude Code: copy the folder

skills/swift-concurrency/

# into

~/.claude/skills/swift-concurrency/ (all projects)

.claude/skills/swift-concurrency/ (one project)

skills/swift-concurrency/SKILL.md

MITFull file
1# Swift Concurrency
2
3## Fast Path
4
5Before proposing a fix:
6
71. 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.
82. Capture the exact diagnostic and offending symbol.
93. Determine the isolation boundary: `@MainActor`, custom actor, actor instance isolation, or `nonisolated`.
104. 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.
11
12Project settings that change concurrency behavior:
13
14| Setting | SwiftPM (`Package.swift`) | Xcode (`.pbxproj`) |
15|---|---|---|
16| Language mode | `swiftLanguageVersions` or `-swift-version` (`// swift-tools-version:` is not a reliable proxy) | Swift Language Version |
17| Strict concurrency | `.enableExperimentalFeature("StrictConcurrency=targeted")` | `SWIFT_STRICT_CONCURRENCY` |
18…

Excerpt shown under the repository's MIT license.

Keep exploring

Similar skill repositories

thedotmack /

claude-mem
116k

Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More

CCCXGHGM+135 skills

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates