Peter Steinberger

Swift Concurrency Expert

开发编程v1.0.0
作者:Peter Steinberger更新于 2026-05-11swift-concurrency-expert@clawhub_steipete/swift-concurrency-expert
代码审查Bug 修复

据 AlphaMoat 统计,截至 2026-09,Swift Concurrency Expert 累计下载 4,056 次、获 5 个星标,在全部 5,078 个 AI 技能中排名第 2,510 位,在「开发编程」分类(577 个)中排名第 327 位。

累计安装
340
累计下载
4,056
星标
5
全站排名
#2,510
全站前 50% · 「开发编程」前 57%
平台累计安装累计下载星标评论
ClawHub ↗1334,0155-
SkillHub ↗3404,0565—

各平台的计数口径不同,统计时间不一致。

这个技能是做什么的

先确认编译诊断、actor 上下文与已启用的隔离模式,再考虑主 actor 隔离、状态保护、后台任务及正确的 Sendable 一致性。优先减少行为变化,避免未经证明的安全断言。部署前需审查修改并编译、测试项目。

资料发布于 2026-10-27

可以用来做什么

  • 诊断 Swift 并发错误

什么时候用

  • actor 隔离或 Sendable 诊断需要修复时

示例提示词

以下是根据技能文档生成的示例,不代表实际运行结果。

根据这个诊断提出尽量保留行为的最小并发修复。

月度数据趋势

累计下载4,056
2,8453,4964,1462026-03 · 累计下载 2,9352026-05 · 累计下载 3,3462026-06 · 累计下载 3,4952026-07 · 累计下载 3,7382026-08 · 累计下载 3,8762026-09 · 累计下载 4,05626-0326-09
星标5
4562026-03 · 星标 52026-05 · 星标 52026-06 · 星标 52026-07 · 星标 52026-08 · 星标 52026-09 · 星标 526-0326-09

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。

月份累计下载环比星标
2026-094,056—5
2026-083,876+3.7%5
2026-073,738+7.0%5
2026-063,495+4.5%5
2026-053,346—5
2026-032,935—5

SKILL.md 原文

以下是作者发布的原始文件,按纯文本显示,本站未做修改或审核;其中的链接不可点击,命令请核实后再运行。抓取于 2026-10-23。

1.8 KB · ClawHub v1.0.0
---
name: swift-concurrency-expert
description: Swift Concurrency review and remediation for Swift 6.2+. Use when asked to review Swift Concurrency usage, improve concurrency compliance, or fix Swift concurrency compiler errors in a feature or file.
---

# Swift Concurrency Expert

_Attribution: copied from @Dimillian’s `Dimillian/Skills` (2025-12-31)._

## Overview
展开全部(共 38 行)

Review and fix Swift Concurrency issues in Swift 6.2+ codebases by applying actor isolation, Sendable safety, and modern concurrency patterns with minimal behavior changes.

## Workflow

### 1. Triage the issue

- Capture the exact compiler diagnostics and the offending symbol(s).
- Identify the current actor context (`@MainActor`, `actor`, `nonisolated`) and whether a default actor isolation mode is enabled.
- Confirm whether the code is UI-bound or intended to run off the main actor.

### 2. Apply the smallest safe fix

Prefer edits that preserve existing behavior while satisfying data-race safety.

Common fixes:
- **UI-bound types**: annotate the type or relevant members with `@MainActor`.
- **Protocol conformance on main actor types**: make the conformance isolated (e.g., `extension Foo: @MainActor SomeProtocol`).
- **Global/static state**: protect with `@MainActor` or move into an actor.
- **Background work**: move expensive work into a `@concurrent` async function on a `nonisolated` type or use an `actor` to guard mutable state.
- **Sendable errors**: prefer immutable/value types; add `Sendable` conformance only when correct; avoid `@unchecked Sendable` unless you can prove thread safety.


## Reference material

- See `references/swift-6-2-concurrency.md` for Swift 6.2 changes, patterns, and examples.
- See `references/swiftui-concurrency-tour-wwdc.md` for SwiftUI-specific concurrency guidance.

「开发编程」分类下的热门技能

Peter Steinberger 的其他技能

数据月份:2026-09 · 下载/星标/安装数聚合自公开技能注册库(ClawHub、SkillHub),按月更新。口径说明见数据方法。