Agent skill

Swift Concurrency Performance

by Livsy90 in Livsy90/iOS-Performance-Agent-Skills

A skill your agent uses when reviewing Swift Concurrency performance and responsiveness, including task explosions, actor hopping, MainActor bottlenecks, cancellation, AsyncSequence cleanup…

MITAuto-check passedDevelopment

Install Swift Concurrency Performance

skills CLI
$ npx skills add Livsy90/iOS-Performance-Agent-Skills --skill swift-concurrency-performance -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Livsy90/iOS-Performance-Agent-Skills swift-concurrency-performance --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Livsy90/iOS-Performance-Agent-Skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/swift-concurrency-performance .claude/skills/swift-concurrency-performance && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
swift-concurrency-performance
GitHub stars
117
Token cost
~2.9k tokens
SKILL.md length
1,414 words
Files
13 (incl. references)
Skills in repo
6
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when reviewing Swift Concurrency performance and responsiveness, including task explosions, actor hopping, MainActor bottlenecks, cancellation, AsyncSequence cleanup…

  • Works in 11 steps: Identify the user-visible symptom: UI… → Locate the async boundary: Task, task… → Determine the lifetime owner: view, view… → …
  • Reviewing Swift Concurrency performance and responsiveness
  • SKILL.md covers Purpose, When to use this skill, When not to use this skill and Core workflow, plus 5 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Swift Concurrency Performance is an agent skill from Livsy90/iOS-Performance-Agent-Skills. Use this skill when reviewing Swift Concurrency performance and responsiveness, including task explosions, actor hopping, MainActor bottlenecks, cancellation, AsyncSequence cleanup, continuations, reentrancy, executor behavior, blocking async work, or async work that affects UI latency. Do not use it for general async/await syntax questions unless performance, responsiveness, cancellation, or lifetime is part of the task.

Its SKILL.md is about 2.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 14 other files, including reference files (for example `agents/openai.yaml`, `references/actor-reentrancy.md` and `references/asyncsequence-and-stream-cleanup.md`).

It sits in Development, covering Async programming and Smart contract auditing. It works with Swift. The repository describes itself as: A collection of AI-agent skills for reviewing, diagnosing, and improving performance in iOS applications. The licence is MIT.

When your agent uses it

  • Reviewing Swift Concurrency performance and responsiveness
  • Including task explosions
  • MainActor bottlenecks
  • AsyncSequence cleanup

Example prompts

  • “/swift-concurrency-performance”

Workflow steps

11 steps, taken from the first numbered list in SKILL.md.

  1. Identify the user-visible symptom: UI stall, slow interaction, low throughput, memory growth, duplicate work, leaked task, missed…
  2. Locate the async boundary: Task, task group, actor method, MainActor, continuation, stream, lifecycle callback, delegate bridge, or legacy…
  3. Determine the lifetime owner: view, view model, service, actor, request, app session, stream consumer, or detached background process.
  4. Separate required work from optional or deferrable work.
  5. Check whether concurrency is being used to express structure, isolation, and cancellation rather than as a vague performance fix.
  6. Look for blocking work inside async contexts.
  7. Check whether work that affects UI state is isolated narrowly and whether CPU-heavy work is kept off the main actor.
  8. Check cancellation propagation, especially across task groups, streams, continuations, loops, and navigation lifetimes.
  9. Check for actor reentrancy after every await inside actor-isolated methods.
  10. Propose the smallest safe change that improves lifetime, cancellation, isolation, or throughput.
  11. Include a validation path before calling the change a performance improvement.

What it can do on your machine

Read from SKILL.md and the folder at commit c259885. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Swift Concurrency Performance loads about 2.9k tokens when it runs, and up to ~66k if it reads all its reference files. Until then it costs about 114 tokens; SKILL.md has 1,414 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~114
When it runs · the whole SKILL.md, loaded when a task matches
~2.9k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~66k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Livsy90/iOS-Performance-Agent-Skills at commit c259885, republished under its MIT licence (© Livsy90). 1,414 words, ~2,855 tokens.

Download SKILL.mdSave it as .claude/skills/swift-concurrency-performance/SKILL.md (or your agent's skills folder). This skill also uses 12 other files; get the full folder from GitHub.
name
swift-concurrency-performance
description
Use this skill when reviewing Swift Concurrency performance and responsiveness, including task explosions, actor hopping, MainActor bottlenecks, cancellation, AsyncSequence cleanup, continuations, reentrancy, executor behavior, blocking async work, or async work that affects UI latency. Do not use it for general async/await syntax questions unless performance, responsiveness, cancellation, or lifetime is part of the task.

Swift Concurrency Performance

Purpose

Use this skill to review, diagnose, and improve Swift Concurrency code when async work affects UI responsiveness, throughput, memory, cancellation, task lifetime, actor contention, or correctness under load.

This skill is not a general Swift Concurrency tutorial. It is a performance and responsiveness review workflow.

When to use this skill

Use this skill when the task involves:

  • UI stalls, slow interactions, hangs, or frame drops related to async work;
  • excessive Task creation, task groups, detached tasks, or unstructured concurrency;
  • MainActor bottlenecks, actor hopping, actor queue buildup, or actor contention;
  • cancellation that does not stop work, navigation leaks, or tasks outliving their owner;
  • AsyncSequence, AsyncStream, long-running streams, buffering, or producer cleanup;
  • continuation bridges, delegate/callback wrappers, or async wrappers around legacy APIs;
  • blocking calls inside async contexts, semaphores, synchronous I/O, locks, or cooperative pool starvation;
  • actor reentrancy, duplicate in-flight work, cache stampedes, or inconsistent actor state after await;
  • Swift 6 isolation behavior, explicit isolation, @concurrent, nonisolated, or Sendable boundaries;
  • Instruments traces, logs, or production signals that point to concurrency-related latency, memory growth, or throughput loss.

When not to use this skill

Do not use this skill for:

  • basic async/await syntax questions with no performance, lifetime, or responsiveness concern;
  • general architecture discussions where concurrency is not part of the critical path;
  • purely SwiftUI rendering issues unless async lifecycle work contributes to the symptom;
  • launch performance unless async startup work, task lifetime, or actor isolation is part of the launch path;
  • runtime-level allocation, ARC, generics, or existential costs unless they interact with concurrency behavior;
  • server-side concurrency questions unless the task is specifically about Swift Concurrency performance patterns.

Prefer another skill when a more specific domain dominates the task:

  • use ios-launch-performance for app startup, first frame, first interaction, pre-main, dyld, or SDK launch work;
  • use swiftui-performance for SwiftUI invalidation, identity, layout, scrolling, or body cost;
  • use ios-performance-profiling when the main task is choosing or interpreting profiling tools;
  • use swift-runtime-performance for allocations, ARC traffic, dispatch, existentials, generics, or copy-on-write costs.

Core workflow

  1. Identify the user-visible symptom: UI stall, slow interaction, low throughput, memory growth, duplicate work, leaked task, missed cancellation, actor contention, or blocked cooperative threads.
  2. Locate the async boundary: Task, task group, actor method, MainActor, continuation, stream, lifecycle callback, delegate bridge, or legacy blocking API.
  3. Determine the lifetime owner: view, view model, service, actor, request, app session, stream consumer, or detached background process.
  4. Separate required work from optional or deferrable work.
  5. Check whether concurrency is being used to express structure, isolation, and cancellation rather than as a vague performance fix.
  6. Look for blocking work inside async contexts.
  7. Check whether work that affects UI state is isolated narrowly and whether CPU-heavy work is kept off the main actor.
  8. Check cancellation propagation, especially across task groups, streams, continuations, loops, and navigation lifetimes.
  9. Check for actor reentrancy after every await inside actor-isolated methods.
  10. Propose the smallest safe change that improves lifetime, cancellation, isolation, or throughput.
  11. Include a validation path before calling the change a performance improvement.

Decision rules

  • Treat async as suspension, not as automatic background execution.
  • Do not assume concurrency improves performance. More tasks can increase scheduling overhead, memory pressure, actor contention, and cancellation complexity.
  • Prefer structured concurrency when the parent owns the lifetime of the work.
  • Use unstructured tasks only when the lifetime is deliberately independent and cancellation ownership is explicit.
  • Use Task.detached only as an explicit escape hatch from inherited context, priority, task-local values, and actor isolation.
  • Bound parallel work when the input size can grow.
  • Keep MainActor work short and focused on UI state, presentation coordination, and main-thread-only APIs.
  • Move CPU-heavy work outside main-actor isolation, but do not cross isolation boundaries casually.
  • Batch actor calls on hot paths when repeated hops dominate latency.
  • After an await inside an actor, assume actor state may have changed.
  • Use checked continuations by default and verify every path resumes exactly once.
  • Treat stream termination and producer cleanup as part of the API contract.
  • Prefer cancellation-aware loops and pipelines for long-running or high-volume work.
  • Connect every performance claim to evidence or a validation plan.

Gotchas

  • Do not recommend adding async or Task simply because code is slow.
  • Do not move work off the MainActor if the API or UI state must remain main-actor isolated.
  • Do not leave CPU-heavy computation in a @MainActor type just because the type also owns UI state.
  • Do not use Task.detached to silence isolation errors without explaining the lifetime, cancellation, priority, and data-safety consequences.
  • Do not create one child task per item for large or unbounded collections without limiting concurrency.
  • Do not swallow cancellation with broad catch blocks.
  • Do not assume cancelling a parent automatically stops legacy callbacks, streams, delegates, or manually retained producers.
  • Do not wrap a blocking API in async if the underlying work still blocks a cooperative executor thread.
  • Do not treat actor isolation as a duplicate-work prevention mechanism when the actor method suspends during a cache miss.
  • Do not use unsafe continuations unless profiling shows checked continuation overhead matters and the resume contract is proven.
  • Do not call an optimization successful without before/after validation.
Show full SKILL.md (566 more words)Show less

Reference routing

Read these only when relevant:

  • references/concurrency-runtime.md — read when the task needs the mental model for tasks, suspension, cooperative executors, actor executors, priorities, structured concurrency, or why blocking async code is harmful.
  • references/mainactor-responsiveness.md — read when the task involves MainActor, @MainActor types, UI state, view models, main-thread stalls, @concurrent, or moving CPU-heavy work away from UI isolation.
  • references/task-lifetime-and-structure.md — read when the task involves structured concurrency, unstructured tasks, task ownership, Task {}, Task.detached, view/view-model lifetimes, or tasks that outlive their owner.
  • references/cancellation-and-task-lifetime.md — read when the task involves navigation cancellation, long-running work, cancellation propagation, cancellation swallowed by catch, task groups, streams, or cancellation tests.
  • references/bounded-task-groups.md — read when the task involves withTaskGroup, withThrowingTaskGroup, parallel mapping, fan-out work, memory spikes, or limiting concurrency.
  • references/actor-reentrancy.md — read when the task involves actor-isolated state, duplicate network requests, cache stampedes, state checks before and after await, or actor queue buildup.
  • references/swift-6-isolation.md — read when the task involves Swift 6 isolation behavior, default actor isolation, @concurrent, nonisolated, Sendable boundaries, or migration-related performance regressions.
  • references/blocking-legacy-apis.md — read when the task involves semaphores, synchronous file I/O, blocking networking, locks, callback APIs, old SDKs, or async wrappers around blocking work.
  • references/continuation-safety.md — read when the task involves withCheckedContinuation, withCheckedThrowingContinuation, delegate bridges, callback wrappers, timeout paths, cancellation paths, or exactly-once resume guarantees.
  • references/asyncsequence-and-stream-cleanup.md — read when the task involves AsyncSequence, AsyncStream, AsyncThrowingStream, long-running streams, buffering, producer lifetime, onTermination, or for await loops.
  • references/diagnostics-and-instruments.md — read when the user provides traces, logs, measurements, production signals, or asks how to validate concurrency-related performance changes.

Validation expectations

Recommend validation that matches the suspected issue:

  • use Instruments when the symptom involves UI stalls, actor contention, task lifetime, blocked threads, or high task counts;
  • use signposts when comparing before/after latency across async boundaries;
  • use cancellation tests when work should stop after navigation, deallocation, timeout, or parent cancellation;
  • use memory graphs or allocation instruments when streams, task groups, or long-lived tasks may retain producers or large values;
  • use logs with task identifiers or request identifiers when checking duplicate in-flight work;
  • use XCTest performance tests only when the workload is repeatable enough to produce meaningful comparisons;
  • use production metrics when local traces cannot reproduce tail latency or rare stuck tasks.

Do not present a concurrency refactor as a performance win unless there is a clear validation path.

Output expectations

When reviewing code, respond with:

  1. Finding — the likely concurrency performance, lifetime, isolation, or responsiveness issue.
  2. Why it matters — the impact on UI latency, throughput, memory, cancellation, actor contention, or correctness.
  3. Evidence — the code pattern, trace symptom, lifecycle mismatch, missing cancellation path, blocking call, actor hop pattern, or continuation/stream contract issue.
  4. Recommended change — the smallest safe change first; avoid broad rewrites unless the design itself causes the issue.
  5. Trade-offs — what the change improves and what it may complicate.
  6. Validation — how to verify the result with Instruments, signposts, cancellation tests, logs, memory tools, UI behavior, or production metrics.

When the task asks for an investigation plan, respond with:

  1. the symptom to reproduce;
  2. the suspected async boundary;
  3. the likely lifetime or isolation owner;
  4. the first trace or log to collect;
  5. the signal that would confirm or reject the hypothesis;
  6. the smallest next code area to inspect.

When the task asks for an explanation, keep it practical:

  1. explain the model briefly;
  2. show one concrete iOS or Swift example only if needed;
  3. name the common misconception;
  4. include a validation or debugging technique. :::

© Livsy90, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 12 other files (references) in swift-concurrency-performance of Livsy90/iOS-Performance-Agent-Skills.

  • SKILL.md
  • agents/openai.yaml
  • references/actor-reentrancy.md
  • references/asyncsequence-and-stream-cleanup.md
  • references/blocking-legacy-apis.md
  • references/bounded-task-groups.md
  • references/cancellation-and-task-lifetime.md
  • references/concurrency-runtime.md
  • references/continuation-safety.md
  • references/diagnostics-and-instruments.md
  • references/mainactor-responsiveness.md
  • references/swift-6-isolation.md
  • references/task-lifetime-and-structure.md

Open the folder on GitHubat commit c259885

Compare with similar skills

Swift Concurrency Performance next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Swift Concurrency Performance compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Swift Concurrency Performance this skillLivsy90/iOS-Performance-Agent-Skills117—~2.9kAutomated safety check: PassMIT
Stellar iOS Mac SDKSoneso/stellar-ios-mac-sdk132—~4.3kAutomated safety check: PassApache-2.0
Swift Concurrencyhenrypldev/react-native-nitro-mlx1003 repos~3.1kAutomated safety check: PassMIT
Swift Concurrency ExpertDimillian/Skills4k—~1.1kAutomated safety check: PassMIT
Swift Concurrencysupabitapp/supaterm172—~3.3kAutomated safety check: PassCustom licence
Swift Concurrencynimblehq/ios-templates110—~1.7kAutomated safety check: PassMIT

Similar skills

  • Stellar iOS Mac SDK

    Soneso/stellar-ios-mac-sdk

    Guides Stellar blockchain development in Swift using stellar-ios-mac-sdk.

    132 GitHub stars~4.3k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Swift Concurrency

    henrypldev/react-native-nitro-mlx

    Diagnose Swift Concurrency issues, refactor callback-based code to async/await, and guide Swift 6 migration when working with tasks, actors, @MainActor, Sendable, data races, thread safety, or…

    100 GitHub starsUsed in 3 repos~3.1k tokens
    DevelopmentAuto-check passed
  • Swift Concurrency Expert

    Dimillian/Skills

    Swift Concurrency review and remediation for Swift 6.2+. An agent skill from Dimillian/Skills.

    4k GitHub stars~1.1k tokensUpdated 6 mo ago
    DevelopmentAuto-check passed
  • Swift Concurrency

    supabitapp/supaterm

    Diagnose data races, convert callback-based code to async/await, implement actor isolation patterns, resolve Sendable conformance issues, and guide Swift 6 migration.

    172 GitHub stars~3.3k tokensUpdated 17 days ago
    DevelopmentAuto-check passed
  • Swift Concurrency

    nimblehq/ios-templates

    Write, review, or fix Swift 6 concurrency code using actors, Sendable, structured concurrency, and the strict data-race-safety model.

    110 GitHub stars~1.7k tokensUpdated 2 mo ago
    DevelopmentAuto-check passed
  • Architecture rules for cmux's move to Swift Packages: acyclic whole-domain packages, minimal public API, group folders, Xcode project wiring and Swift 6 concurrency.

    28k GitHub starsUsed in 1 repo~4.2k tokens
    DevelopmentAuto-check passed

More from Livsy90/iOS-Performance-Agent-Skills

  • iOS Perceived Performance

    Livsy90/iOS-Performance-Agent-Skills

    A skill your agent uses for product-level iOS responsiveness and loading/feedback flows, including perceived latency, time to first feedback, progressive rendering, loading states, skeletons…

    117 GitHub stars~2.7k tokensUpdated 3 mo ago
    Auto-check passed
  • iOS Performance Profiling

    Livsy90/iOS-Performance-Agent-Skills

    A skill your agent uses when choosing, running, or interpreting iOS performance profiling workflows, including Instruments traces, signposts, XCTest metrics, MetricKit, Xcode Organizer, hangs…

    117 GitHub stars~3.3k tokensUpdated 3 mo ago
    Auto-check passed
  • Swift Runtime Performance

    Livsy90/iOS-Performance-Agent-Skills

    A skill your agent uses when reviewing Swift code for runtime-level performance costs, including heap allocation, ARC traffic, stack vs heap storage, closure capture contexts, method dispatch…

    117 GitHub stars~4.3k tokensUpdated 3 mo ago
    Auto-check passed
  • iOS Launch Performance

    Livsy90/iOS-Performance-Agent-Skills

    A skill your agent uses when diagnosing iOS app launch performance, startup regressions, first-frame readiness, or early responsiveness.

    117 GitHub stars~4k tokensUpdated 3 mo ago
    Auto-check passed
  • Swiftui Performance

    Livsy90/iOS-Performance-Agent-Skills

    A skill your agent uses when reviewing or fixing SwiftUI performance issues, including unnecessary invalidation, unstable identity, broad state dependencies, expensive body work, heavy rows…

    117 GitHub stars~1.6k tokensUpdated 3 mo ago
    Auto-check passed

Works with

Questions about Swift Concurrency Performance

What does Swift Concurrency Performance do?

A skill your agent uses when reviewing Swift Concurrency performance and responsiveness, including task explosions, actor hopping, MainActor bottlenecks, cancellation, AsyncSequence cleanup…. Swift Concurrency Performance is an agent skill from Livsy90/iOS-Performance-Agent-Skills. Use this skill when reviewing Swift Concurrency performance and responsiveness, including task explosions, actor hopping, MainActor bottlenecks, cancellation, AsyncSequence cleanup, continuations, reentrancy, executor behavior, blocking async work, or async work that affects UI latency.

When should I use Swift Concurrency Performance?

Swift Concurrency Performance fits situations like: reviewing Swift Concurrency performance and responsiveness; including task explosions; mainActor bottlenecks; asyncSequence cleanup.

How do I install Swift Concurrency Performance in Claude Code?

Run `npx skills add Livsy90/iOS-Performance-Agent-Skills --skill swift-concurrency-performance -a claude-code`. Or copy the skill folder (swift-concurrency-performance in Livsy90/iOS-Performance-Agent-Skills) into .claude/skills/swift-concurrency-performance in your project. Claude Code loads it when a task matches its description.

How do I install Swift Concurrency Performance in Codex?

Run `npx skills add Livsy90/iOS-Performance-Agent-Skills --skill swift-concurrency-performance -a codex`. Or copy the skill folder (swift-concurrency-performance in Livsy90/iOS-Performance-Agent-Skills) into .agents/skills/swift-concurrency-performance in your project. Codex loads it when a task matches its description.

Can I use Swift Concurrency Performance in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Livsy90/iOS-Performance-Agent-Skills --skill swift-concurrency-performance -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/swift-concurrency-performance, .gemini/skills/swift-concurrency-performance, .github/skills/swift-concurrency-performance and .opencode/skills/swift-concurrency-performance in your project.

What does Swift Concurrency Performance need to run?

SKILL.md names no scripts, command-line tools or credentials: Swift Concurrency Performance is instructions for the agent only.

Does Swift Concurrency Performance access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Swift Concurrency Performance safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Swift Concurrency Performance use?

Swift Concurrency Performance is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Swift Concurrency Performance use?

About 2.9k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 63k tokens, read only when the agent opens those files.

What are the alternatives to Swift Concurrency Performance?

Skills that share tags, products or a category with Swift Concurrency Performance: Stellar iOS Mac SDK (Soneso/stellar-ios-mac-sdk, 132 stars), Swift Concurrency (henrypldev/react-native-nitro-mlx, 100 stars), Swift Concurrency Expert (Dimillian/Skills, 4k stars) and Swift Concurrency (supabitapp/supaterm, 172 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Swift Concurrency Performance?

Livsy90 (a GitHub user) maintains it in Livsy90/iOS-Performance-Agent-Skills, which has 117 GitHub stars. The repository holds 6 skills in this directory. The repository was last updated on July 12, 2026.

Source: Livsy90/iOS-Performance-Agent-Skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.