swift-concurrency-expert_skill

This skill reviews and remediates Swift concurrency issues in Swift 6.2+ code, applying actor isolation and Sendable safety with minimal behavior changes.
  • Python

2.5k

GitHub Stars

2

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill openclaw/skills --skill swift-concurrency-expert

  • _meta.json302 B
  • SKILL.md1.8 KB

Overview

This skill reviews and remediates Swift Concurrency usage for Swift 6.2+ projects. I apply actor isolation, Sendable correctness, and modern async/await patterns to resolve compiler errors and eliminate data races with minimal behavioral changes. The goal is safe, incremental fixes that preserve existing behavior and performance.

How this skill works

I start by collecting compiler diagnostics and locating the offending symbols and their current actor contexts. I triage whether code is UI-bound, shared mutable state, or background work, then choose the smallest safe remediation: actor annotations, moving state into actors, or redesigning to Sendable-safe types. Fixes are applied conservatively, preferring targeted annotations (e.g., @MainActor) or protocol isolation over broad, unchecked overrides.

When to use it

  • You get Swift 6.2+ concurrency compiler errors related to actor isolation or Sendable.
  • You need a code review focused on concurrency correctness and race conditions.
  • You want minimal-impact fixes to move a feature past compilation while preserving behavior.
  • You need help adapting UI code to @MainActor vs background execution.
  • You want guidance converting globals/static mutable state into actor-safe patterns.

Best practices

  • Capture exact compiler diagnostics and the symbols involved before changing code.
  • Prefer the least invasive fix that enforces safety: annotate members or extensions rather than marking everything unchecked.
  • Use actors to encapsulate mutable state; use @MainActor for UI-bound types and operations.
  • Prefer immutable/value types and correct Sendable conformance; avoid @unchecked Sendable except with a proven justification.
  • Document rationale for isolation choices so future maintainers understand why a symbol is isolated.

Example use cases

  • Fix a compiler error where a protocol conformance on a view model conflicts with @MainActor isolation by making the conformance isolated.
  • Resolve data races by moving shared global state into a dedicated actor with async accessors.
  • Convert a heavy computation accidentally running on the main thread into a nonisolated async function or dispatch it to a background actor.
  • Address Sendable errors by replacing reference types with value equivalents or adding explicit, justified Sendable conformances.

FAQ

Fixes aim to preserve observable behavior; when isolation requires API changes I surface options and prefer minimal, backward-compatible edits.

When is @unchecked Sendable acceptable?

Only when you can prove the type is thread-safe (immutable after init or externally synchronized). I avoid it by default and document any justified uses.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational