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がスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
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
@MainActoror move into an actor. - Background work: move expensive work into a
@concurrentasync function on anonisolatedtype or use anactorto guard mutable state. - Sendable errors: prefer immutable/value types; add
Sendableconformance only when correct; avoid@unchecked Sendableunless you can prove thread safety.
Reference material
- See
references/swift-6-2-concurrency.mdfor Swift 6.2 changes, patterns, and examples. - See
references/swiftui-concurrency-tour-wwdc.mdfor 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
コメント
- …
このリポジトリの他のスキル
beeper
7.4kローカルの Beeper のチャット履歴を検索して、メッセージを見つけ、あいまいなヒントがどのチャットや連絡先を指すかを特定するようエージェントを支援します。
cloudflare-registrar
7.4kCloudflare Registrar のドメインの価格と空き状況を確認し、確認の手順を経てドメインを登録または一覧表示するようエージェントを支援します。
codexbar
7.4kCodex、Claude、Kimi などの AI サービスの、残りの利用量を、上限、クレジット、リセット時刻を含めて確認するようエージェントを支援します。
create-cli
7.4k人にもスクリプトにも使いやすいように、コマンドラインツールのコマンド、フラグ、ヘルプの文章、出力、エラーを設計するようエージェントを支援します。
似ているスキル
android-clean-architecture
280kエージェントがAndroidプロジェクトを効率よく整理できるようにします。コードを構造化して、保守や新機能の開発をしやすくします。
compose-multiplatform-patterns
280kエージェントがKMPプロジェクトでCompose MultiplatformとJetpack Composeのパターンを使えるようにします。状態管理、ナビゲーション、テーマ設定、パフォーマンスを扱います。
dart-flutter-patterns
280kエージェントがDartとFlutterのアプリ向けのコードを書けるようにします。最新のパターンを使い、堅牢で管理しやすいアプリを作ります。