Community编程与开发github.com

dimillian/swift-concurrency-expert

用于Swift 6.2+的Swift并发审查与修复。当需要审查Swift并发使用情况、改进并发合规性或修复功能/文件中的Swift并发编译器错误时使用。具体操作包括添加Sendable一致性、应用@MainActor注解、解决Actor隔离警告、修复数据竞争诊断以及将完成处理器迁移至async/await。

swift-concurrency-expert 是什么?

该技能旨在帮助开发者对基于Swift 6.2及以上版本的项目进行全面的并发风险评估与自动化修复。它能够精准定位代码中的典型并发问题,例如缺少Sendable协议一致性、错误的Actor隔离、未标记的@MainActor边界以及未并发安全的数据访问。技能支持细致到文件或特定功能粒度的操作,可以自动应用代码修复,包括插入@MainActor注解、添加Sendable协议、转换闭包为异步函数、修正编译器提出的并发警告。它兼容主流的AI代码助手平台(如Claude Code、Cursor、Codex),通过在SKILL.md中描述的工具调用触发。用户可以针对检测到的编译器诊断,让技能自动生成最小化的修复方案,从而大幅降低手动重构工作量,也避免了隐藏的数据竞争风险。使用该技能时,建议将需要处理的文件路径或具体错误信息明确传递给AI,以获得最精准的建议。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/dimillian/skills/tree/main/skills/swift-concurrency-expert

Installed? Explore more 编程与开发 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

swift-concurrency-expert 是做什么的?

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. Concrete actions include adding Sendable conformance, applying @MainActor annotations, resolving actor isolation warnings, fixing data race diagnostics, and migrating completion handlers to async/await.

简介

该技能专为Swift 6.2及以上版本设计,专注于Swift并发的审查与修复。当需要审查Swift并发使用情况、改进并发合规性或修复某个功能或文件中的Swift并发编译器错误时,可调用此技能。具体操作包括:

  • 为类型添加Sendable一致性
  • 应用@MainActor注解
  • 解决Actor隔离警告
  • 修复数据竞争诊断
  • 将基于闭包的完成处理器迁移至async/await模式

用法

提示AI代理在以下场景中调用本技能:

  • 您需要审查整个文件或代码库的并发安全性。
  • 编译器报出关于actor隔离或数据竞争的警告/错误。
  • 您需要将旧的基于回调的异步代码转换为现代的async/await风格。

请将要审查的文件或代码片段提供给AI代理,AI将根据本技能规则自动提出并应用修复。

支持的平台

该技能旨在与支持自定义技能定义的AI代码助手协同工作,包括但不限于:

  • Claude Code
  • Cursor
  • Codex
  • 其他基于大型语言模型的编码助手

工作原理

skill markdown文件中提供了精确的规则,指导AI代理识别Swift中的并发问题。当将文件或错误信息传递给代理时,代理会:

  1. 分析Swift源代码,识别潜在的并发问题。
  2. 根据技能规则提出最合适的修复方案。
  3. 生成可应用的代码修复,或在交互式审查会话中解释必要的修改。

贡献

欢迎通过提交问题或拉取请求来改进此技能的定义。请确保任何更改都与Swift 6.2+版本保持一致。

Individual skills in this repo

This repo contains 7 individual skills — each has its own dedicated page.

dimillian/app-store-changelog

Create user-facing App Store release notes by collecting and summarizing all user-impacting changes since the last git tag (or a specified ref). Use when asked to generate a comprehensive release changelog, App Store "What's New" text, or release notes based on git history or tags.

dimillian/ios-debugger-agent

Use XcodeBuildMCP to build, run, launch, and debug the current iOS project on a booted simulator. Trigger when asked to run an iOS app, interact with the simulator UI, inspect on-screen state, capture logs/console output, or diagnose runtime behavior using XcodeBuildMCP tools.

dimillian/macos-spm-app-packaging

Scaffold, build, and package SwiftPM-based macOS apps without an Xcode project. Use when you need a from-scratch macOS app layout, SwiftPM targets/resources, a custom .app bundle assembly script, or signing/notarization/appcast steps outside Xcode.

dimillian/swiftui-liquid-glass

Implement, review, or improve SwiftUI features using the iOS 26+ Liquid Glass API. Use when asked to adopt Liquid Glass in new SwiftUI UI, refactor an existing feature to Liquid Glass, or review Liquid Glass usage for correctness, performance, and design alignment.

dimillian/swiftui-performance-audit

Audit and improve SwiftUI runtime performance from code review and architecture. Use for requests to diagnose slow rendering, janky scrolling, high CPU/memory usage, excessive view updates, or layout thrash in SwiftUI apps, and to provide guidance for user-run Instruments profiling when code review alone is insufficient.

dimillian/swiftui-ui-patterns

Best practices and example-driven guidance for building SwiftUI views and components, including navigation hierarchies, custom view modifiers, and responsive layouts with stacks and grids. Use when creating or refactoring SwiftUI UI, designing tab architecture with TabView, composing screens with VStack/HStack, managing @State or @Binding, building declarative iOS interfaces, or needing component-specific patterns and examples.

dimillian/swiftui-view-refactor

Refactor and review SwiftUI view files with strong defaults for small dedicated subviews, MV-over-MVVM data flow, stable view trees, explicit dependency injection, and correct Observation usage. Use when cleaning up a SwiftUI view, splitting long bodies, removing inline actions or side effects, reducing computed `some View` helpers, or standardizing `@Observable` and view model initialization patterns.

相关技能