swift-concurrency-review

swift-concurrency-review is a skill for Claude Code, Codex from stuartshields/claude-setup. It costs 112 tokens per session (2,175 once invoked), scanned A, original, MIT.

A focused review for Swift code that uses modern concurrency features such as await, actors, tasks, or main-thread isolation.

In plain words
What is it for?
Use it when reviewing changes involving actors, asynchronous tasks, timers, locks, or long-lived asynchronous streams.
Why use it?
It finds race conditions and cancellation bugs that the Swift compiler may not catch, including state being overwritten after an awaited operation.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Good fit Use it when reviewing changes involving actors, asynchronous tasks, timers, locks, or long-lived asynchronous streams.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/stuartshields/claude-setup/swift-concurrency-review
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add stuartshields/claude-setup --skill swift-concurrency-review
Clone the repo
git clone --depth 1 https://github.com/stuartshields/claude-setup

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for swift-concurrency-review

README.md
[![agentmods](https://agentmods.dev/badge/skills/stuartshields/claude-setup/swift-concurrency-review/github.svg)](https://agentmods.dev/skills/stuartshields/claude-setup/swift-concurrency-review)
Your own site
<a href="https://agentmods.dev/skills/stuartshields/claude-setup/swift-concurrency-review"><img src="https://agentmods.dev/badge/skills/stuartshields/claude-setup/swift-concurrency-review/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for swift-concurrency-review

Your own site · 80×15
<a href="https://agentmods.dev/skills/stuartshields/claude-setup/swift-concurrency-review"><img src="https://agentmods.dev/badge/skills/stuartshields/claude-setup/swift-concurrency-review.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 112 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,175 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00112 $0.02175
Opus 5 $0.00056 $0.01087
Sonnet 5 $0.00022 $0.00435
Haiku 4.5 $0.00011 $0.00217

Measured 9d ago against content hash 3cf0f393efa1, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

swift-concurrency-review scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/swift-concurrency-review/SKILL.md · 154 lines

How it starts

The opening of the file, as written. The whole thing — 154 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Swift Concurrency Review

Overview

Swift 6 strict concurrency catches data races at compile time but lets a class of semantic bugs through: state-overwrite races, TOCTOU around Task { }, and cancellation that doesn't actually prevent firing. This is a reviewer's checklist for those bug classes. Apply on any diff touching actor, @MainActor, await, Task {, lock-protected state, or deadline timers.

The Five Questions

1. After every await, is state re-checked — not just the index?

When an actor method suspends at await, any other method on the actor can run to completion before it resumes. Re-finding a record by id ≠ verifying its state is still what you expected.

// BAD
try await transport.send(message)
guard let idx = outbound.firstIndex(where: { $0.id == id }) else { return }
outbound[idx].direction = .delivered   // overwrites .cancelled / .deadlineMissed

// GOOD
try await transport.send(message)
guard let idx = outbound.firstIndex(where: { $0.id == id }),
      outbound[idx].direction == .sending else { return }
outbound[idx].direction = .delivered

Invariant: terminal states are sticky. Once a record is .cancelled / .expired / .deadlineMissed, no later success path may overwrite it. The guard encodes this invariant.

2. Is Task { } body reading mutable state, or is it snapshotted at spawn?

A Task { } body runs later, on some executor. Reading clock.now, self.count, or any mutable state inside the closure is a TOCTOU — the value is read at an arbitrary later moment, not at spawn.

// BAD — clock.now read inside the Task
task = Task { [weak self] in
    let seconds = max(0, deadline.timeIntervalSince(clock.now))
    try? await clock.sleep(for: seconds)
}

// GOOD — clock.now read before Task exists, captured as constant
let seconds = max(0, deadline.timeIntervalSince(clock.now))
task = Task { [weak self] in
    try? await clock.sleep(for: seconds)
}

Read the full file on GitHub · 154 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 154 lines · 112 tokens per session scan A 3cf0f393efa1

Subscribe to this mod's changes

swift-concurrency-review is a skill published in the GitHub repository stuartshields/claude-setup (2 stars, last pushed 3mo ago), licensed MIT. It adds 112 tokens to every session and 2,175 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

xcode-makefiles

Install strict Xcode Makefile tooling for iOS/macOS projects, including build/run/test scripts with AGENTNAME-based per-agent isolation under build/. Use when a project needs reproducible local CLI builds without full app scaffolding.

robertguss/claude-code-toolkit · 52 tokens

kotlin-reviewer

Use when reviewing a Kotlin/Spring Boot pull request, systematic checklist covering architecture, idioms, testing, security, and observability.

pranav8494/team-of-agents · 31 tokens

faces-review

Review Jakarta Faces code for common mistakes, anti-patterns, and rule violations.

omnifaces/claude-faces-expert · 18 tokens

swift-strict

Swift/SwiftUI strictness, clean code, and security rules. Use when writing, reviewing, or refactoring Swift code in iOS/macOS projects. Covers force unwrap prevention, @Observable vs ObservableObject patterns, access control, concurrency safety (@MainActor, actors, Sendable), error handling with typed enums, memory…

0xMassi/claude-skills · 87 tokens

swift-networking

Builds a protocol-based async/await networking layer with URLSession, testable abstractions, error handling, and mock support for Swift projects. Use when user says "add networking", "create an API layer", "fetch data from API", "build a network service", "add URLSession", "implement HTTP requests", "create a REST…

jeremieb/swift-unit-test-instructions · 82 tokens

swift-project-setup

Bootstraps a new Swift/SwiftUI/UIKit project with MVVM architecture, standard folder structure, testing targets, and CLAUDE.md configuration. Use when user says "create a new project", "setup a new app", "start a new iOS project", "scaffold a Swift project", "initialize an Xcode project", or "new SwiftUI app".

jeremieb/swift-unit-test-instructions · 80 tokens