Swift Concurrency Migration

Swift Concurrency Migration

Guide for migrating Swift codebases to modern Swift Concurrency (async/await, actors, structured concurrency).

Claude / Claude Code
GitHub Copilot
Cursor
VS Code
OpenAI Codex
DevelopmentDeveloper

What it does

Migrating a Swift codebase to async/await is not a mechanical substitution. Completion handlers and async/await have different memory semantics — naive migration creates data races, stranded continuations, and retain cycles that only appear under load. Claude without this skill generates async/await code that compiles but has subtle concurrency bugs: actors used incorrectly, Task cancellation not propagated, or MainActor annotations placed in ways that deadlock. This skill loads the correct Swift Concurrency migration patterns: actor isolation, structured concurrency, Task hierarchies, and the specific SwiftUI integration patterns. Made by kylehughes.

Use case

Migrating a Swift codebase from completion handlers, delegates, and DispatchQueue patterns to modern Swift Concurrency (async/await, actors, AsyncSequence). Especially important for large codebases where incorrect migration causes intermittent crashes.

The Prompt

Copy and use immediately
"Migrate this completion handler chain to async/await without creating data races."
"Convert this DispatchQueue-based caching layer to use an actor."
"This async code has a subtle data race — find and fix it."
"Add proper Task cancellation to this long-running operation."
"Migrate this delegate pattern to AsyncSequence."

How to use

  1. 1

    Provide the existing synchronous or callback-based code.

  2. 2

    Claude migrates incrementally, explaining the concurrency model decisions at each step.

  3. 3

    For data races: describe the symptoms. Claude identifies the actor isolation issue and generates the corrected code.

Input / Output

Input

Existing Swift code using completion handlers, delegates, DispatchQueue, or other pre-concurrency patterns.

Output

Swift Concurrency code with correct actor isolation, structured Task hierarchies, proper cancellation handling, and no data races. Each migration decision is explained.

Added 15 Mar 2026Submitted by kylehughes👁 42📋 0

Details

Platforms
Claude / Claude CodeGitHub CopilotCursorVS CodeOpenAI Codex
Category
Development
License
apache-2.0

Stats

📋 Copies0
👁 Views42
👍 Upvotes0

Install with skills.sh

npx skillsadd kylehughes/skills/swift-concurrency-migration

Requires skills.sh CLI

Community Notes

Sign in with GitHub to leave a note.

No notes yet. Be the first to contribute.