본문으로 건너뛰기
cccskills
무료GitHub에 공개

swift-concurrency-pro

Review Swift async/await code, which runs tasks without blocking while waiting. Check shared state, task structure, cancellation, streams, and migration issues, then receive file-specific findings with before-and-after fixes and a prioritized summary.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

Reviews Swift code for concurrency correctness, modern API usage, and common async/await pitfalls. Use when reading, writing, or reviewing Swift concurrency code.

설치 방법 보기

이럴 때 유용합니다

  • Checking actor isolation and shared-state handling
  • Reviewing task structure and cancellation
  • Investigating strict concurrency compiler errors
  • Reviewing migration from legacy asynchronous APIs

포함된 파일(16)

  • SKILL.md5.4 KB
  • agents/openai.yaml380 B
  • assets/swift-concurrency-pro-icon.png2.7 KB
  • assets/swift-concurrency-pro-icon.svg1.5 KB
  • references/actors.md5.4 KB
  • references/async-streams.md2.1 KB
  • references/bridging.md2.9 KB
  • references/bug-patterns.md4.1 KB
  • references/cancellation.md3.6 KB
  • references/diagnostics.md4.4 KB
  • references/hotspots.md2.3 KB
  • references/interop.md3.6 KB
  • references/new-features.md7.7 KB
  • references/structured.md3.0 KB
  • references/testing.md8.1 KB
  • references/unstructured.md2.4 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Review Swift concurrency code for correctness, modern API usage, and adherence to project conventions. Report only genuine problems - do not nitpick or invent issues.

Review process:

  1. Scan for known-dangerous patterns using references/hotspots.md to prioritize what to inspect.
  2. Check for recent Swift 6.2 concurrency behavior using references/new-features.md.
  3. Validate actor usage for reentrancy and isolation correctness using references/actors.md.
  4. Ensure structured concurrency is preferred over unstructured where appropriate using references/structured.md.
  5. Check unstructured task usage for correctness using references/unstructured.md.
  6. Verify cancellation is handled correctly using references/cancellation.md.
  7. Validate async stream and continuation usage using references/async-streams.md.
  8. Check bridging code between sync and async worlds using references/bridging.md.
  9. Review any legacy concurrency migrations using references/interop.md.
  10. Cross-check against common failure modes using references/bug-patterns.md.
  11. If the project has strict-concurrency errors, map diagnostics to fixes using references/diagnostics.md.
  12. If reviewing tests, check async test patterns using references/testing.md.

If doing a partial review, load only the relevant reference files.

Core Instructions

  • Target Swift 6.2 or later with strict concurrency checking.
  • If code spans multiple targets or packages, compare their concurrency build settings before assuming behavior should match.
  • Prefer structured concurrency (task groups) over unstructured (Task {}).
  • Prefer Swift concurrency over Grand Central Dispatch for new code. GCD is still acceptable in low-level code, framework interop, or performance-critical synchronous work where queues and locks are the right tool – don't flag these as errors.
  • If an API offers both async/await and closure-based variants, always prefer async/await.
  • Do not introduce third-party concurrency frameworks without asking first.
  • Do not suggest @unchecked Sendable to fix compiler errors. It silences the diagnostic without fixing the underlying race. Prefer actors, value types, or sending parameters instead. The only legitimate use is for types with internal locking that are provably thread-safe.

Output Format

Organize findings by file. For each issue:

  1. State the file and relevant line(s).
  2. Name the rule being violated.
  3. Show a brief before/after code fix.

Skip files with no issues. End with a prioritized summary of the most impactful changes to make first.

Example output:

DataLoader.swift

Line 18: Actor reentrancy – state may have changed across the await.

// Before
actor Cache {
    var items: [String: Data] = [:]

    func fetch(_ key: String) async throws -> Data {
        if items[key] == nil {
            items[key] = try await download(key)
        }
        return items[key]!
    }
}

// After
actor Cache {
    var items: [String: Data] = [:]

    func fetch(_ key: String) async throws -> Data {
        if let existing = items[key] { return existing }
        let data = try await download(key)
        items[key] = data
        return data
    }
}

Line 34: Use withTaskGroup instead of creating tasks in a loop.

// Before
for url in urls {
    Task { try await fetch(url) }
}

// After
try await withThrowingTaskGroup(of: Data.self) { group in
    for url in urls {
        group.addTask { try await fetch(url) }
    }

    for try await result in group {
        process(result)
    }
}

Summary

  1. Correctness (high): Actor reentrancy bug on line 18 may cause duplicate downloads and a force-unwrap crash.
  2. Structure (medium): Unstructured tasks in loop on line 34 lose cancellation propagation.

End of example.

References

  • references/hotspots.md - Grep targets for code review: known-dangerous patterns and what to check for each.
  • references/new-features.md - Swift 6.2 changes that alter review advice: default actor isolation, isolated conformances, caller-actor async behavior, @concurrent, Task.immediate, task naming, and priority escalation.
  • references/actors.md - Actor reentrancy, shared-state annotations, global actor inference, and isolation patterns.
  • references/structured.md - Task groups over loops, discarding task groups, concurrency limits.
  • references/unstructured.md - Task vs Task.detached, when Task {} is a code smell.
  • references/cancellation.md - Cancellation propagation, cooperative checking, broken cancellation patterns.
  • references/async-streams.md - AsyncStream factory, continuation lifecycle, back-pressure.
  • references/bridging.md - Checked continuations, wrapping legacy APIs, @unchecked Sendable.
  • references/interop.md - Migrating from GCD, Mutex/locks, completion handlers, delegates, and Combine.
  • references/bug-patterns.md - Common concurrency failure modes and their fixes.
  • references/diagnostics.md - Strict-concurrency compiler errors, protocol conformance fixes, and likely remedies.
  • references/testing.md - Async test strategy with Swift Testing, race detection, avoiding timing-based tests.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Review Apple platform app code for potential App Store rejection issues before submission. Check privacy, payments, safety, performance, and design using guideline references, risk categories, code examples, and a pre-submission checklist.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Checking an app before App Store submission
  • Reviewing payments and subscriptions
  • Checking privacy and account deletion
jacklandrin/OnlySwitch6천2026년 10월 21일 업데이트

Trigger OnlySwitch built-in actions from plain-language requests on macOS. The skill selects the matching action ID and opens an app link to toggle settings or run actions such as emptying the trash.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Toggling Keep Awake
  • Switching dark mode
  • Emptying the trash
jacklandrin/OnlySwitch6천2026년 10월 21일 업데이트

Write and review unit and integration tests with Swift Testing. Check assertions, asynchronous behavior, and test structure, or convert existing XCTest tests using guidance on modern APIs and project conventions.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Writing unit and integration tests
  • Reviewing tests for asynchronous code
  • Migrating existing XCTest tests
jacklandrin/OnlySwitch6천2026년 10월 21일 업데이트

Review SwiftUI code for outdated APIs, data flow, navigation, accessibility, and performance. Receive findings grouped by file, with line references, brief before-and-after fixes, and a prioritized summary of the changes that matter most.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Reviewing existing SwiftUI code
  • Updating deprecated APIs
  • Checking VoiceOver and Dynamic Type support
jacklandrin/OnlySwitch6천2026년 10월 21일 업데이트

Turn specifications into a detailed implementation plan before coding. Break work into small tasks with exact file paths, code, test commands, and interfaces so another developer or agent can follow the plan.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Planning a feature before coding
  • Preparing a development handoff
  • Breaking requirements into testable tasks
jacklandrin/OnlySwitch6천2026년 10월 21일 업데이트

jacklandrin의 스킬 모두 보기

이 스킬의 문제 신고