跳到正文
TakoAPI
返回技能列表

swift-concurrency-expert

由 steipete 提供

iOS & macOS Development
2.5k下载量由 clawskills.sh 提供
5星标
0浏览量
0 个赞登录后即可为这个技能点赞
—暂无评分
你的评分

简介

Swift Concurrency review and remediation.

描述

该技能的功能

Reviews and fixes Swift Concurrency issues in Swift 6.2+ codebases. Applies actor isolation, Sendable safety, and modern concurrency patterns with minimal behavior changes. Targets data-race safety compliance based on compiler diagnostics and actor context.

Swift 6 concurrency errors are easy to suppress incorrectly; this skill applies the smallest safe fix based on compiler diagnostics and actor context rather than blanket workarounds.

何时使用

  • Fixing Swift 6 compiler concurrency errors in a feature branch
  • Annotating UI-bound types with @MainActor
  • Auditing actor isolation across a SwiftUI view model
  • Replacing @unchecked Sendable with correct value-type conformance
  • Moving global state into actor-protected properties

示例工作流

输入

User asks: Fix the Swift concurrency errors in my networking layer

智能体
  1. 1

    Capture exact compiler diagnostics and identify offending symbols

  2. 2

    Determine actor context — whether code is UI-bound or runs off the main actor

  3. 3

    Select the appropriate fix: @MainActor annotation, actor isolation, or Sendable conformance

  4. 4

    Apply the minimal change that satisfies data-race safety without altering behavior

  5. 5

    Verify no new warnings are introduced by the changes

输出

Updated Swift files with correct actor isolation and Sendable conformance, resolving all concurrency compiler errors

安装

clawhub install steipete/swift-concurrency-expert

运行 CLI 命令,或把这段提示词粘贴到 Claude Code、Cursor、Codex 或你在用的任意编程智能体里。

链接