agentleFS
brbndonbrbndon/AppleDevelopmentFoundation/.agents/skills/swift-concurrency-review/SKILL.md

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.

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
  1. Very specific:

    Structured concurrency first: Prefer async functions, task groups, and child tasks tied to a scope.

    line 13
  2. Very specific:

    Cancellation: Ensure long-running work checks cancellation (Task.checkCancellation / try Task.checkCancellation / cooperative exits) and …

    line 14
  3. Distinctive:

    Observation pitfalls: Avoid redundant observation that performs heavy work on every change.

    line 18
  4. Distinctive:

    Do not use this skill for pure styling or synchronous API bikeshedding.

    line 25
  5. Very specific:

    When code changes, use swift-testing-verification and a strict-concurrency-aware build when the project enables it.

    line 29

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

  1. Map isolation. List actor boundaries (MainActor, custom actors), global/shared mutable state, and which types cross isolation. Note observation/@Observable objects and where UI reads them.
  2. Structured concurrency first. Prefer async functions, task groups, and child tasks tied to a scope. Flag unstructured Task { } that outlives the caller without ownership; require a written reason for Task.detached.
  3. Cancellation. Ensure long-running work checks cancellation (Task.checkCancellation / try Task.checkCancellation / cooperative exits) and that callers can cancel. Avoid swallowing CancellationError as success.
  4. 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.
  5. Sendable at boundaries. Resolve compiler diagnostics at isolation edges; avoid @unchecked Sendable unless the invariant is documented and enforced. Prefer value types or actor-owned state over shared classes.
  6. Data races and reentrancy. Watch for mutable capture in concurrent closures, non-isolated mutable globals, and actor reentrancy assumptions (state may change across await).
  7. Observation pitfalls. Avoid redundant observation that performs heavy work on every change; keep expensive async work explicit and cancellable when views disappear.
  8. 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.