gcd-operations

gcd-operations is a skill for Claude Code from rusel95/ios-agent-skills. It costs 165 tokens per session (2,442 once invoked), scanned A, original, MIT.

An iOS and macOS guide for managing concurrent work with Grand Central Dispatch, Apple’s system for running tasks on queues, and OperationQueue.

In plain words
What is it for?
Use it when fixing dispatch queues, locks, DispatchGroup usage, reader-writer access, timers, file work, task dependencies, or code that also uses Swift Concurrency.
Why use it?
It helps prevent deadlocks, data races, too many threads, and mistakes when coordinating background work or shared data.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the ios-agent-skills plugin — 12 skills shipped together

Good fit Use it when fixing dispatch queues, locks, DispatchGroup usage, reader-writer access, timers, file work, task dependencies, or code that also uses Swift Concurrency.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/rusel95/ios-agent-skills/gcd-operations
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 rusel95/ios-agent-skills --skill gcd-operations
Clone the repo
git clone --depth 1 https://github.com/rusel95/ios-agent-skills

Made for: Claude Code.

Or install ios-agent-skills, the plugin that ships this one along with the rest of its 12 skills.

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 gcd-operations

README.md
[![agentmods](https://agentmods.dev/badge/skills/rusel95/ios-agent-skills/gcd-operations/github.svg)](https://agentmods.dev/skills/rusel95/ios-agent-skills/gcd-operations)
Your own site
<a href="https://agentmods.dev/skills/rusel95/ios-agent-skills/gcd-operations"><img src="https://agentmods.dev/badge/skills/rusel95/ios-agent-skills/gcd-operations/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 gcd-operations

Your own site · 80×15
<a href="https://agentmods.dev/skills/rusel95/ios-agent-skills/gcd-operations"><img src="https://agentmods.dev/badge/skills/rusel95/ios-agent-skills/gcd-operations.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 165 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,442 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.00165 $0.02442
Opus 5 $0.00082 $0.01221
Sonnet 5 $0.00033 $0.00488
Haiku 4.5 $0.00016 $0.00244

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

Security

Grade A, and why

gcd-operations 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 10d 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/gcd-operations/SKILL.md · 175 lines

How it starts

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

GCD & OperationQueue Concurrency

Enterprise-grade concurrency skill for Grand Central Dispatch and OperationQueue. Opinionated: prescribes serial queues by default, target queue hierarchies, labeled queues, NSLock/OSAllocatedUnfairLock for synchronization, barrier-based reader-writer on custom concurrent queues, and OperationQueue for dependency graphs. Apple has not deprecated any core GCD APIs — GCD remains appropriate for parallelism, system I/O, and performance-critical paths. This skill covers correct usage, deadly bug prevention, and coexistence with Swift Concurrency.

Concurrency Layers

Application Layer    -> OperationQueue for dependency graphs, cancellation, throttling.
Dispatch Layer       -> Serial queues for state protection, concurrent+barrier for R/W.
Synchronization      -> NSLock / OSAllocatedUnfairLock for short critical sections.
System I/O           -> DispatchSource (timers, file monitoring), DispatchIO (non-blocking file I/O).
Thread Pool          -> GCD manages threads. App targets 3-4 well-defined queue subsystems.

Quick Decision Trees

"Which queue type should I use?"

Do you need mutual exclusion (protecting shared state)?
+-- YES -> Serial queue (default). Simplest, safest.
+-- NO  -> Is this independent parallel work (image processing, batch transforms)?
    +-- YES -> Concurrent queue (custom) with barrier for any writes.
    +-- NO  -> Do you need dependency graphs, cancellation, or throttling?
        +-- YES -> OperationQueue with maxConcurrentOperationCount.
        +-- NO  -> Serial queue. When in doubt, serial.

"Which lock should I use?"

Which lock?
+-- iOS 16+ -> OSAllocatedUnfairLock (Apple's safe wrapper)
+-- iOS 18+ / Swift 6 -> Mutex from Synchronization framework
+-- Any iOS -> NSLock (safe, simple, recommended by Apple DTS)
NEVER: os_unfair_lock as direct Swift stored property (memory corruption).
NEVER: DispatchSemaphore as a mutex (no priority donation).

"Which QoS should I use?"

Read the full file on GitHub · 175 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. 10d ago First seen · 175 lines · 165 tokens per session scan A 172783882d7e

Subscribe to this mod's changes

gcd-operations is a skill published in the GitHub repository rusel95/ios-agent-skills (7 stars, last pushed 4mo ago), licensed MIT. It adds 165 tokens to every session and 2,442 once invoked, about $0.0008 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

argent-metro-debugger

Debug a JS runtime via CDP using argent debugger tools. Primary path is React Native via Metro (iOS / Android / Vega); a subset of the tools (debugger-connect, debugger-status, debugger-evaluate, debugger-log-registry) also drive a Chromium (CDP) app's renderer (an Electron app, or any Chromium browser exposing CDP)…

software-mansion/argent · 104 tokens

argent-react-native-optimization

Optimizes a React Native app by profiling first to find real bottlenecks, then sweeping for mechanical issues. Entry-point for all performance work. Use when the app feels slow, user asks to optimize, fix re-renders, reduce jank, or improve startup. Delegates to argent-react-native-profiler for measurement.

software-mansion/argent · 71 tokens

argent-native-profiler

Native profiling for CPU hotspots, UI hangs, memory issues. iOS via xctrace; Android via Perfetto. Use when diagnosing native-level performance issues.

software-mansion/argent · 37 tokens

igf

CLI interface for igf (Grapefruit) dynamic instrumentation server. Use to enumerate Frida devices, list apps, run hooks, query logs, access device file systems, inspect classes, dump memory, and perform mobile app security analysis.

ChiChou/grapefruit · 51 tokens

spm-build-analysis

Analyze Swift Package Manager dependencies, package plugins, module variants, and CI-oriented build overhead that slow Xcode builds. Use when a developer suspects packages, plugins, or dependency graph shape are hurting clean or incremental build performance, mentions SPM slowness, package resolution time, build…

AvdLee/Xcode-Build-Optimization-Agent-Skill · 87 tokens

Mobile Application Security

Android and iOS application security testing — static and dynamic analysis, APK/IPA inspection, OWASP MASVS/MASTG verification, secure-storage and transport review, and mobile malware triage for authorized assessments.

Masriyan/Claude-Code-CyberSecurity-Skill · 46 tokens