swift-concurrency-review
Skill2 starsChanged 2 months agoMITView on GitHub
Use when reviewing async/await, actors, tasks, observation, Sendable diagnostics, or cancellation. Do not use for unrelated UI styling or synchronous API design.
In this repository17 other files it gives its agents.
- AGENTS.mdAGENTS.md
- apple-accessibility-reviewSkill
- apple-app-marketing-siteSkill
- apple-design-systemSkill
- apple-development-foundationSkill
- apple-error-statesSkill
- apple-platform-plannerSkill
- apple-security-privacy-reviewSkill
- codex-bootstrapSkill
- codex-skill-maintainerSkill
- ios-macos-platform-adaptationSkill
- maestro-apple-app-testingSkill
- reusable-code-extractorSkill
- swift-package-module-authorSkill
- swift-testing-verificationSkill
- swiftui-component-authorSkill
- swiftui-tab-navigationSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 13
Structured concurrency first: Prefer async functions, task groups, and child tasks tied to a scope.
- Very specific: line 14
Cancellation: Ensure long-running work checks cancellation (Task.checkCancellation / try Task.checkCancellation / cooperative exits) and …
- Distinctive: line 18
Observation pitfalls: Avoid redundant observation that performs heavy work on every change.
- Distinctive: line 25
Do not use this skill for pure styling or synchronous API bikeshedding.
- Very specific: line 29
When code changes, use swift-testing-verification and a strict-concurrency-aware build when the project enables it.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Swift concurrency review
Review concurrent Swift code in the consumer workspace. Prefer findings and a fix plan; change code only when the user authorized implementation.
Workflow
- Map isolation. List actor boundaries (
MainActor, custom actors), global/shared mutable state, and which types cross isolation. Note observation/@Observableobjects and where UI reads them. - Structured concurrency first. Prefer
asyncfunctions, task groups, and child tasks tied to a scope. Flag unstructuredTask { }that outlives the caller without ownership; require a written reason forTask.detached. - Cancellation. Ensure long-running work checks cancellation (
Task.checkCancellation/try Task.checkCancellation/ cooperative exits) and that callers can cancel. Avoid swallowingCancellationErroras success. - UI on the main actor. View updates, UIKit/AppKit bridging, and observable model mutations that drive UI should be main-actor isolated or explicitly hopped. Flag off-main UI mutation.
- Sendable at boundaries. Resolve compiler diagnostics at isolation edges; avoid
@unchecked Sendableunless the invariant is documented and enforced. Prefer value types or actor-owned state over shared classes. - Data races and reentrancy. Watch for mutable capture in concurrent closures, non-isolated mutable globals, and actor reentrancy assumptions (state may change across
await). - Observation pitfalls. Avoid redundant observation that performs heavy work on every change; keep expensive async work explicit and cancellable when views disappear.
- Findings format. For each issue: location, isolation problem, impact, recommended fix, and whether a test can lock it. Severity: blocking / should-fix / note.
Review-only vs fix
- Review-only: findings + recommended sequence; no product code changes.
- Authorized fixes: smallest isolation-correct change; add deterministic tests where practical.
- Do not use this skill for pure styling or synchronous API bikeshedding.
Verification
When code changes, use swift-testing-verification and a strict-concurrency-aware build when the project enables it. Report exact tools/commands and outcomes. Never claim a concurrency check passed without running it. List residual risk for untested race windows.
Inputs: concurrent code and compiler diagnostics when available. Output: a concurrency finding/fix set, deterministic tests where practical, and strict-concurrency build result. A review-only request does not change code.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

