Guide for migrating Swift codebases to modern Swift Concurrency (async/await, actors, structured concurrency).
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.
"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."
Provide the existing synchronous or callback-based code.
Claude migrates incrementally, explaining the concurrency model decisions at each step.
For data races: describe the symptoms. Claude identifies the actor isolation issue and generates the corrected code.
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.
npx skillsadd kylehughes/skills/swift-concurrency-migration
Requires skills.sh CLI
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
Build Obsidian.md plugins following official API patterns, TypeScript best practices, and plugin review guidelines.
Techniques for context engineering with AI agents — managing context windows, prompt structure, and knowledge organisation.