本文へスキップ
Skillpedia
モバイルアプリ7.4k · #13248

swift-concurrency-expert

できること

このスキルは、並行処理に関するコンパイラのエラーを診断し、アクター、メインスレッドの分離、共有データの安全な修正を適用します。Swift 6 のアプリで作業する開発者向けです。

使う場面

  • ✓Swift がアクター、分離、Sendable の型についてエラーを出すとき。
  • ✓バックグラウンドの作業を、メインスレッドから安全に移す必要があるとき。
  • ✓既存の Swift の並行処理の設定を確認してほしいとき。

スキルのリンク

https://github.com/steipete/agent-scripts/blob/main/skills/swift-concurrency-expert/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/steipete/agent-scripts/blob/main/skills/swift-concurrency-expert/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“Xcode が、私のビューモデルに Sendable のエラーを出しています。最小限の安全な変更で直してください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントは、コンパイラの正確なメッセージを取り出し、現在のアクターの設定を見つけ、動作を変えずに安全性を保つ最小の修正を適用します。スレッドの安全性を示せない限り、危険な近道は使いません。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Swift Concurrency Expert

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

Overview

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.
よくある質問

アプリの動きは変わりますか?

スキルは、データ競合の安全規則を満たしながら、動作の変更を最小限にすることを目指します。

安全性の確認を省く Sendable はいつ許されますか?

スキルによれば、スレッドの安全性を証明できる場合に限られます。

対象の Swift のバージョンは何ですか?

Swift 6.2 以降です。

詳細

作者による元の説明

Swift concurrency review/fix: compiler errors, Sendable, isolation, remediation.

repo: steipete/agent-scripts

人気

GitHubのスター
7.4k
ランキング
#13248
ライセンス
MIT
更新日
2026/10/30

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル