{"id":"3d06fd5e-ee73-4638-92e5-6bb86ac2b545","shortId":"QFVUdM","kind":"skill","title":"swift-concurrency-expert","tagline":"Review and fix Swift concurrency issues such as actor isolation and Sendable violations.","description":"# Swift Concurrency Expert\n\n## Overview\n\nReview and fix Swift Concurrency issues in Swift 6.2+ codebases by applying actor isolation, Sendable safety, and modern concurrency patterns with minimal behavior changes.\n\n## When to Use\n- When the user asks to review Swift concurrency usage or fix compiler diagnostics.\n- When you need guidance on actor isolation, `Sendable`, `@MainActor`, or async migration.\n\n## Workflow\n\n### 1. Triage the issue\n\n- Capture the exact compiler diagnostics and the offending symbol(s).\n- Check project concurrency settings: Swift language version (6.2+), strict concurrency level, and whether approachable concurrency (default actor isolation / main-actor-by-default) is enabled.\n- Identify the current actor context (`@MainActor`, `actor`, `nonisolated`) and whether a default actor isolation mode is enabled.\n- Confirm whether the code is UI-bound or intended to run off the main actor.\n\n### 2. Apply the smallest safe fix\n\nPrefer edits that preserve existing behavior while satisfying data-race safety.\n\nCommon fixes:\n- **UI-bound types**: annotate the type or relevant members with `@MainActor`.\n- **Protocol conformance on main actor types**: make the conformance isolated (e.g., `extension Foo: @MainActor SomeProtocol`).\n- **Global/static state**: protect with `@MainActor` or move into an actor.\n- **Background work**: move expensive work into a `@concurrent` async function on a `nonisolated` type or use an `actor` to guard mutable state.\n- **Sendable errors**: prefer immutable/value types; add `Sendable` conformance only when correct; avoid `@unchecked Sendable` unless you can prove thread safety.\n\n### 3. Verify the fix\n\n- Rebuild and confirm all concurrency diagnostics are resolved with no new warnings introduced.\n- Run the test suite to check for regressions — concurrency changes can introduce subtle runtime issues even when the build is clean.\n- If the fix surfaces new warnings, treat each one as a fresh triage (return to step 1) and resolve iteratively until the build is clean and tests pass.\n\n### Examples\n\n**UI-bound type — adding `@MainActor`**\n\n```swift\n// Before: data-race warning because ViewModel is accessed from the main thread\n// but has no actor isolation\nclass ViewModel: ObservableObject {\n    @Published var title: String = \"\"\n    func load() { title = \"Loaded\" }\n}\n\n// After: annotate the whole type so all stored state and methods are\n// automatically isolated to the main actor\n@MainActor\nclass ViewModel: ObservableObject {\n    @Published var title: String = \"\"\n    func load() { title = \"Loaded\" }\n}\n```\n\n**Protocol conformance isolation**\n\n```swift\n// Before: compiler error — SomeProtocol method is nonisolated but the\n// conforming type is @MainActor\n@MainActor\nclass Foo: SomeProtocol {\n    func protocolMethod() { /* accesses main-actor state */ }\n}\n\n// After: scope the conformance to @MainActor so the requirement is\n// satisfied inside the correct isolation context\n@MainActor\nextension Foo: SomeProtocol {\n    func protocolMethod() { /* safely accesses main-actor state */ }\n}\n```\n\n**Background work with `@concurrent`**\n\n```swift\n// Before: expensive computation blocks the main actor\n@MainActor\nfunc processData(_ input: [Int]) -> [Int] {\n    input.map { heavyTransform($0) }   // runs on main thread\n}\n\n// After: hop off the main actor for the heavy work, then return the result\n// The caller awaits the result and stays on its own actor\nnonisolated func processData(_ input: [Int]) async -> [Int] {\n    await Task.detached(priority: .userInitiated) {\n        input.map { heavyTransform($0) }\n    }.value\n}\n\n// Or, using a @concurrent async function (Swift 6.2+):\n@concurrent\nfunc processData(_ input: [Int]) async -> [Int] {\n    input.map { heavyTransform($0) }\n}\n```\n\n## Reference material\n\n- See `references/swift-6-2-concurrency.md` for Swift 6.2 changes, patterns, and examples.\n- See `references/approachable-concurrency.md` when the project is opted into approachable concurrency mode.\n- See `references/swiftui-concurrency-tour-wwdc.md` for SwiftUI-specific concurrency guidance.\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.","tags":["swift","concurrency","expert","antigravity","awesome","skills","sickn33","agent-skills","agentic-skills","ai-agent-skills","ai-agents","ai-coding"],"capabilities":["skill","source-sickn33","skill-swift-concurrency-expert","topic-agent-skills","topic-agentic-skills","topic-ai-agent-skills","topic-ai-agents","topic-ai-coding","topic-ai-workflows","topic-antigravity","topic-antigravity-skills","topic-claude-code","topic-claude-code-skills","topic-codex-cli","topic-codex-skills"],"categories":["antigravity-awesome-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/sickn33/antigravity-awesome-skills/swift-concurrency-expert","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add sickn33/antigravity-awesome-skills","source_repo":"https://github.com/sickn33/antigravity-awesome-skills","install_from":"skills.sh"}},"qualityScore":"0.700","qualityRationale":"deterministic score 0.70 from registry signals: · indexed on github topic:agent-skills · 34460 github stars · SKILL.md body (4,392 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-04-22T06:51:57.361Z","embedding":null,"createdAt":"2026-04-18T21:45:41.605Z","updatedAt":"2026-04-22T06:51:57.361Z","lastSeenAt":"2026-04-22T06:51:57.361Z","tsv":"'0':455,498,517 '1':75,300 '2':147 '3':246 '6.2':30,96,507,524 'access':328,402,430 'actor':13,34,67,105,109,117,120,126,146,183,203,221,336,366,405,433,446,465,484 'ad':317 'add':231 'annot':171,350 'appli':33,148 'approach':102,537 'ask':52,581 'async':72,212,490,504,513 'automat':361 'avoid':237 'await':476,492 'background':204,435 'behavior':44,158 'block':443 'bound':138,169,315 'boundari':589 'build':281,306 'caller':475 'captur':79 'chang':45,272,525 'check':89,268 'clarif':583 'class':338,368,397 'clean':283,308 'clear':556 'code':134 'codebas':31 'common':165 'compil':60,82,384 'comput':442 'concurr':3,9,19,26,40,56,91,98,103,211,254,271,438,503,508,538,546 'confirm':131,252 'conform':180,187,233,380,392,410 'context':118,422 'correct':236,420 'criteria':592 'current':116 'data':162,322 'data-rac':161,321 'default':104,111,125 'describ':560 'diagnost':61,83,255 'e.g':189 'edit':154 'enabl':113,130 'environ':572 'environment-specif':571 'error':227,385 'even':278 'exact':81 'exampl':312,528 'exist':157 'expens':207,441 'expert':4,20,577 'extens':190,424 'fix':7,24,59,152,166,249,286 'foo':191,398,425 'fresh':295 'func':345,375,400,427,448,486,509 'function':213,505 'global/static':194 'guard':223 'guidanc':65,547 'heavi':468 'heavytransform':454,497,516 'hop':461 'identifi':114 'immutable/value':229 'input':450,488,511,586 'input.map':453,496,515 'insid':418 'int':451,452,489,491,512,514 'intend':140 'introduc':262,274 'isol':14,35,68,106,127,188,337,362,381,421 'issu':10,27,78,277 'iter':303 'languag':94 'level':99 'limit':548 'load':346,348,376,378 'main':108,145,182,331,365,404,432,445,458,464 'main-actor':403,431 'main-actor-by-default':107 'mainactor':70,119,178,192,198,318,367,395,396,412,423,447 'make':185 'match':557 'materi':519 'member':176 'method':359,387 'migrat':73 'minim':43 'miss':594 'mode':128,539 'modern':39 'move':200,206 'mutabl':224 'need':64 'new':260,288 'nonisol':121,216,389,485 'observableobject':340,370 'offend':86 'one':292 'opt':535 'output':566 'overview':21 'pass':311 'pattern':41,526 'permiss':587 'prefer':153,228 'preserv':156 'prioriti':494 'processdata':449,487,510 'project':90,533 'protect':196 'protocol':179,379 'protocolmethod':401,428 'prove':243 'publish':341,371 'race':163,323 'rebuild':250 'refer':518 'references/approachable-concurrency.md':530 'references/swift-6-2-concurrency.md':521 'references/swiftui-concurrency-tour-wwdc.md':541 'regress':270 'relev':175 'requir':415,585 'resolv':257,302 'result':473,478 'return':297,471 'review':5,22,54,578 'run':142,263,456 'runtim':276 'safe':151,429 'safeti':37,164,245,588 'satisfi':160,417 'scope':408,559 'see':520,529,540 'sendabl':16,36,69,226,232,239 'set':92 'skill':551 'skill-swift-concurrency-expert' 'smallest':150 'someprotocol':193,386,399,426 'source-sickn33' 'specif':545,573 'state':195,225,357,406,434 'stay':480 'step':299 'stop':579 'store':356 'strict':97 'string':344,374 'substitut':569 'subtl':275 'success':591 'suit':266 'surfac':287 'swift':2,8,18,25,29,55,93,319,382,439,506,523 'swift-concurrency-expert':1 'swiftui':544 'swiftui-specif':543 'symbol':87 'task':555 'task.detached':493 'test':265,310,575 'thread':244,332,459 'titl':343,347,373,377 'topic-agent-skills' 'topic-agentic-skills' 'topic-ai-agent-skills' 'topic-ai-agents' 'topic-ai-coding' 'topic-ai-workflows' 'topic-antigravity' 'topic-antigravity-skills' 'topic-claude-code' 'topic-claude-code-skills' 'topic-codex-cli' 'topic-codex-skills' 'treat':290,564 'triag':76,296 'type':170,173,184,217,230,316,353,393 'ui':137,168,314 'ui-bound':136,167,313 'uncheck':238 'unless':240 'usag':57 'use':48,219,501,549 'user':51 'useriniti':495 'valid':574 'valu':499 'var':342,372 'verifi':247 'version':95 'viewmodel':326,339,369 'violat':17 'warn':261,289,324 'whether':101,123,132 'whole':352 'work':205,208,436,469 'workflow':74","prices":[{"id":"2fd7549e-9140-46e6-ae18-3eabc3df6a5a","listingId":"3d06fd5e-ee73-4638-92e5-6bb86ac2b545","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"sickn33","category":"antigravity-awesome-skills","install_from":"skills.sh"},"createdAt":"2026-04-18T21:45:41.605Z"}],"sources":[{"listingId":"3d06fd5e-ee73-4638-92e5-6bb86ac2b545","source":"github","sourceId":"sickn33/antigravity-awesome-skills/swift-concurrency-expert","sourceUrl":"https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/swift-concurrency-expert","isPrimary":false,"firstSeenAt":"2026-04-18T21:45:41.605Z","lastSeenAt":"2026-04-22T06:51:57.361Z"}],"details":{"listingId":"3d06fd5e-ee73-4638-92e5-6bb86ac2b545","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"sickn33","slug":"swift-concurrency-expert","github":{"repo":"sickn33/antigravity-awesome-skills","stars":34460,"topics":["agent-skills","agentic-skills","ai-agent-skills","ai-agents","ai-coding","ai-workflows","antigravity","antigravity-skills","claude-code","claude-code-skills","codex-cli","codex-skills","cursor","cursor-skills","developer-tools","gemini-cli","gemini-skills","kiro","mcp","skill-library"],"license":"mit","html_url":"https://github.com/sickn33/antigravity-awesome-skills","pushed_at":"2026-04-22T06:40:00Z","description":"Installable GitHub library of 1,400+ agentic skills for Claude Code, Cursor, Codex CLI, Gemini CLI, Antigravity, and more. Includes installer CLI, bundles, workflows, and official/community skill collections.","skill_md_sha":"7a3c0444ac03e8423d91f889f7f7d64d180b4bd6","skill_md_path":"skills/swift-concurrency-expert/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/swift-concurrency-expert"},"layout":"multi","source":"github","category":"antigravity-awesome-skills","frontmatter":{"name":"swift-concurrency-expert","description":"Review and fix Swift concurrency issues such as actor isolation and Sendable violations."},"skills_sh_url":"https://skills.sh/sickn33/antigravity-awesome-skills/swift-concurrency-expert"},"updatedAt":"2026-04-22T06:51:57.361Z"}}