swift-code-review
БесплатноБез исполняемых скриптовНе проверенReviews Swift code for concurrency safety, error handling, memory management, and common mistakes. Use when reviewing .swift files for async/await patterns…
от existential-birds★ 92 звезды на GitHubОб этом скилле
Swift Code Review
Review Workflow
Follow this sequence in order. Do not emit findings until every Pass below is satisfied.
Swift / toolchain baseline — Establish language and tooling context:
Package.swift// swift-tools-versionand per-targetswiftSettings(includingNonisolatedNonsendingByDefault,InferIsolatedConformances, orMainActordefault isolation); for Xcode,SWIFT_VERSIONand Swift 6.2SWIFT_DEFAULT_ACTOR_ISOLATION/ approachable concurrency build settings; note if review is single-file only.
Pass: You state a concrete Swift language version or mode (e.g. Swift 6.2 withMainActordefault isolation, Swift 6 language mode, tools 5.10) before advice that depends on strict concurrency, approachable concurrency, migration-only syntax, or SDK availability.Read surrounding code — For each changed
.swiftfile, read the full enclosing type, function, method, or property that contains the edits, not only the diff hunk.
Pass: At least one full enclosing symbol (type or member) containing the change was read per changed file.Scope the checklist — Using Quick Reference, decide which Review Checklist rows and references apply; open those reference files; skip rows clearly unrelated to the diff.
Pass: The review (or working notes) lists which checklist areas you applied, or marks areas N/A with a one-line reason tied to the diff (e.g. “no SwiftUI / @Observable in change”).Pre-report verification — Load and follow
review-verification-protocolat review-verification-protocol.
Pass: That skill’s Hard gates (sequenced) are satisfied for each finding you will report (full symbol read, usage search before “unused”, caller checked before “missing handling”, severity calibrated,[FILE:LINE]proof).
Hard gates (same sequence, shorter)
| Step | Objective pass condition |
|---|---|
| 1 | Swift version/mode and default actor isolation settings (or explicit single-file limitation) recorded before version- or SDK-gated advice. |
| 2 | Full enclosing symbol read per changed file, not diff-only. |
| 3 | Checklist areas + references listed or N/A with diff-tied reason. |
| 4 | review-verification-protocol completed for every reported issue. |
Output format
Report findings as:
[FILE:LINE] ISSUE_TITLE
Severity: Critical | Major | Minor | Informational
Description of the issue and why it matters.
Quick Reference
| Issue Type | Reference |
|---|---|
| async/await, actors, Sendable, Task, Swift 6.2 isolation | references/concurrency.md |
| @Observable, @ObservationIgnored, observation tracking | references/observable.md |
| throws, typed throws, CancellationError, Result | references/error-handling.md |
| Force unwraps, IUOs, retain cycles, unowned traps | references/common-mistakes.md |
Review Checklist
- No force unwraps (
!) ortry!on runtime data (network, user input, files) - Escaping closures stored as properties (and long-lived
Taskloops) use[weak self];unownedonly when lifetime is strictly guaranteed - Delegate properties are
weak - Independent async operations use
async letorTaskGroup - Long-running
Taskloops check cancellation (try Task.checkCancellation()orTask.isCancelled) and don't swallowCancellationError - Swift 6.2 isolation settings respected (
@concurrentfor CPU-bound offloads underNonisolatedNonsendingByDefault; don't flag missing@MainActorif target usesSWIFT_DEFAULT_ACTOR_ISOLATION = MainActor) - Actors have mutable state to protect (no stateless actors) and guard invariants across
awaitsuspension points -
Sendable/@unchecked Sendabletypes are genuinely thread-safe (backed by real synchronization) - Errors handled explicitly (no silent
Taskfailures or broadcatchswallowingCancellationError) - Non-tracked/injected/Combine properties in
@Observableclasses use@ObservationIgnored - Nested observed reference types inside
@Observablemodels are also@Observable
When to Load References
- Reviewing async/await, actors,
Sendable, or Swift 6.2 concurrency → references/concurrency.md - Reviewing
@Observablemacro design orwithObservationTracking→ references/observable.md - Reviewing typed throws,
CancellationError, or error propagation → references/error-handling.md - Reviewing force unwraps, retain cycles,
unowned, or IUOs → references/common-mistakes.md
Review Questions
- Are independent async operations running concurrently with
async letorTaskGroup? - Cou
Установить swift-code-review в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл swift-code-review?
Reviews Swift code for concurrency safety, error handling, memory management, and common mistakes. Use when reviewing .swift files for async/await patterns, actor isolation, Sendable conformance, or general Swift best practices.
Как установить скилл swift-code-review?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл swift-code-review запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic