/ios-swift-skills:swift-concurrency-migrationfrom ios-swift-skills
Plans, implements, debugs, and verifies migrations from callback-, delegate-, Dispatch-, or permissive-concurrency Swift code to Swift 6 strict concurrency. Covers build settings, actors, Sendable boundaries, cancellation, and structured tasks for Apple-platform apps and Swift packages.
Ships in ios-swift-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Migrate from evidence, one isolation boundary at a time. Preserve behavior before changing architecture, and keep every target buildable between migration waves.
Determine the compiler, language mode, deployment targets, and effective settings for every affected target. Do not infer them from the newest syntax in one file.
xcodebuild -version
xcrun swiftc --version
xcodebuild -list -project App.xcodeproj
xcodebuild -showBuildSettings -project App.xcodeproj -target App \
| rg 'SWIFT_VERSION|SWIFT_STRICT_CONCURRENCY|SWIFT_DEFAULT_ACTOR_ISOLATION|SWIFT_APPROACHABLE_CONCURRENCY|IPHONEOS_DEPLOYMENT_TARGET|MACOSX_DEPLOYMENT_TARGET'
For a package, inspect // swift-tools-version, each target's swiftSettings, and the resolved compiler:
swift package dump-package
swift --version
Record separately:
If the request is diagnostic-driven, reproduce one exact compiler message before changing code. Read the migration and diagnostic playbook before making a multi-target plan.
Use these defaults deliberately:
| Code | Preferred ownership | Reason |
|---|---|---|
| UI and UI-observed mutable state | @MainActor | Keep presentation state in one domain |
| Independent shared mutable subsystem | Custom actor | Serialize its state without a manual queue |
| Immutable values crossing domains | Sendable struct or enum | Make the boundary explicit and reviewable |
| CPU-heavy async operation that must leave the caller's actor | @concurrent | State the execution intent explicitly |
| General library operation whose caller chooses isolation | nonisolated where appropriate | Avoid imposing an app-specific actor |
Swift 6.2 approachable concurrency and main-actor default isolation can reduce annotations in app targets. Do not enable main-actor default isolation blindly in reusable library targets. Change one target at a time and capture the before/after effective settings.
async does not mean background. It permits suspension; actor isolation determines where synchronous portions execute. A main-actor-isolated async function still performs its synchronous CPU work on the main actor. Use @concurrent only with a Swift 6.2-or-newer toolchain and only for work that genuinely must run on the concurrent executor.
Sendable; avoid sending framework objects or mutable reference types.@MainActor and cohesive mutable services to actors.async let or task groups.Prefer a small number of coherent isolation domains. Do not turn every class into an actor or add Task merely to silence an error.
@MainActor or whether only a narrow update should hop there.let snapshot or move mutation behind an actor.await and revalidate invariants.Treat @unchecked Sendable, nonisolated(unsafe), and @preconcurrency as documented, temporary bridges. Require a concrete safety argument, the narrowest possible scope, a removal condition, and a test. Never apply them in bulk.
Use async let for a fixed number of sibling operations and task groups for a dynamic number. Their parent scope owns completion, errors, and cancellation. Use unstructured Task only at synchronous-to-asynchronous lifecycle boundaries, store long-lived handles, and cancel them explicitly.
Cancellation is cooperative. Check Task.checkCancellation() in CPU loops, allow cancellation-aware suspension points to throw, and do not convert CancellationError into a user-visible failure. A timeout race must cancel the losing child.
Use a checked continuation for exactly-one callbacks and an AsyncStream for repeated callbacks. Cover success, failure, cancellation, and the callback-never-arrives path. Resume a continuation exactly once.
For delegates, first establish the callback's documented executor. Capture Sendable values before hopping to an actor. Use MainActor.assumeIsolated only when the API contract guarantees main-actor delivery; it is a runtime assertion that traps when wrong. Read testing and legacy bridge patterns before changing a delegate or continuation.
Compile using the real scheme or package settings, not only an isolated snippet. Add focused strict-concurrency typechecks for dependency-free examples, but treat them as a supplement to the full build.
Test:
Use runtime race tools as supporting evidence, never as proof that unchecked isolation is safe.
For a migration that uses newer concurrency features, check the Swift compiler version, language mode and target settings. Use runtime availability checks for OS APIs and a separate build path for syntax or declarations the older toolchain cannot compile.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub fal3/swift-apple-skills --plugin ios-swift-skills14 skills in this plugin
/app-intents-widgetsDesign, implement, debug, and verify stable App Intents and WidgetKit integrations, including AppIntent, AppEntity, AppEnum, entity queries, AppShortcutsProvider, dependency injection, shared extension data, widget timelines, relevance, controls, Live Activity selection, deep links, handoff, confirmation, and privacy. Use when exposing app actions to Siri or Shortcuts, building configurable or interactive widgets, sharing state with extensions, or choosing the correct system surface for an action. Do not use for ordinary in-app buttons, generic SwiftUI layout, background scheduling without a widget or intent, SiriKit-only legacy work with no migration request, or Live Activity push-server implementation as the sole task./apple-evaluationsBuild, review, and debug generative AI quality regression suites with Apple's Evaluations framework, including Evaluation, datasets, metrics, Swift Testing integration, calibrated model judges, and tool-call trajectories. Use when measuring an Apple-platform intelligence feature, comparing prompts or models, or diagnosing misleading evaluation results. Do not use for ordinary deterministic unit tests, UI automation, performance profiling alone, model training, or an unrelated vendor's evaluation framework.Other plugins' skills for the same job