swift

swift is a skill for Claude Code, Codex from nimadorostkar/Claude-Skills-collection. It costs 43 tokens per session (845 once invoked), scanned A, original, MIT.

A Swift coding guide for Apple platforms and server-side Swift. It covers value-based data, optionals, protocols, modern concurrency, and SwiftUI state management.

In plain words
What is it for?
Use it to write Swift, migrate callbacks to async/await, fix concurrency warnings, design SwiftUI view models, and investigate memory growth.
Why use it?
It helps avoid crashes from missing values, data races, retain cycles, and confusing UI state.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to write Swift, migrate callbacks to async/await, fix concurrency warnings, design SwiftUI view models, and investigate memory growth.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/nimadorostkar/claude-skills-collection/swift
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 nimadorostkar/Claude-Skills-collection --skill swift
Clone the repo
git clone --depth 1 https://github.com/nimadorostkar/Claude-Skills-collection

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/nimadorostkar/claude-skills-collection/swift/github.svg)](https://agentmods.dev/skills/nimadorostkar/claude-skills-collection/swift)
Your own site
<a href="https://agentmods.dev/skills/nimadorostkar/claude-skills-collection/swift"><img src="https://agentmods.dev/badge/skills/nimadorostkar/claude-skills-collection/swift/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

Your own site · 80×15
<a href="https://agentmods.dev/skills/nimadorostkar/claude-skills-collection/swift"><img src="https://agentmods.dev/badge/skills/nimadorostkar/claude-skills-collection/swift.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 845 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00043 $0.00845
Opus 5 $0.00022 $0.00423
Sonnet 5 $0.00009 $0.00169
Haiku 4.5 $0.00004 $0.00085

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

Security

Grade A, and why

swift 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/languages/swift/SKILL.md · 93 lines

How it starts

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

Swift

Purpose

Write Swift that leans on value semantics and the concurrency model rather than fighting them: structs by default, actors for shared mutable state, and no force-unwrapping.

When to Use

  • Writing Swift for Apple platforms or server-side Swift.
  • Migrating callback or Combine code to async/await.
  • Resolving data-race warnings under strict concurrency checking.
  • Designing SwiftUI state and view models.
  • Diagnosing retain cycles and memory growth.

Capabilities

  • Value vs reference semantics and copy-on-write.
  • Optional handling: guard let, optional chaining, Result types.
  • Protocol-oriented design with associated types and generics.
  • Structured concurrency: async let, task groups, actors, Sendable.
  • SwiftUI: @State, @Observable, and unidirectional data flow.

Inputs

  • Source target, Swift version, minimum deployment target.
  • Concurrency checking level (minimal, targeted, complete).

Outputs

  • Code free of force-unwraps and implicit unwrapped optionals.
  • Concurrency that compiles cleanly under strict checking.
  • View models with a single source of truth.

Workflow

  1. Prefer structs — Reach for a class only when identity or shared mutation is required.
  2. Eliminate optionals early — Unwrap once at the boundary with guard; the rest of the function works with non-optionals.
  3. Isolate mutable state — Any shared mutable state becomes an actor or is confined to the main actor.
  4. Model async explicitly — Replace completion handlers with async functions; use task groups for concurrency.
  5. Gate — Build with strict concurrency checking and treat warnings as errors.

Best Practices

  • ! is a crash waiting for a user to find it. The only acceptable uses are IBOutlets and genuinely proven invariants with a comment.
  • Capture lists ([weak self]) on every escaping closure that captures self in a class.
  • Mark types Sendable deliberately; suppressing the warning with @unchecked Sendable requires a documented reason.
  • SwiftUI views are cheap and disposable — put logic in the model, not the view body.
  • Prefer async let for a fixed set of concurrent calls; use TaskGroup when the count is dynamic.
  • Long-running work never runs on the main actor.

Read the full file on GitHub · 93 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 · 93 lines · 43 tokens per session scan A 739b17505aa3

Subscribe to this mod's changes

swift is a skill published in the GitHub repository nimadorostkar/Claude-Skills-collection (26 stars, last pushed 24d ago), licensed MIT. It adds 43 tokens to every session and 845 once invoked, about $0.0002 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-09-03.

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

neo-swift-ui

Use this skill when building, debugging, refactoring, or reviewing SwiftUI apps or views for iOS 16+ and related Apple platforms. Trigger for NavigationStack, Observation/state flow, view composition, previews, performance, accessibility, and SwiftUI architecture.

Benknightdark/neo-skills · 57 tokens

neo-swift

Use this skill when writing, reviewing, debugging, or modernizing Swift code for iOS, macOS, server-side Swift, or shared packages. Trigger for Swift 5+ language features, structured concurrency, memory safety, protocols/generics, SwiftUI integration, and performance-sensitive code.

Benknightdark/neo-skills · 63 tokens

wear-compose-m3

Expert guidance for working with Wear OS Compose Material3. Use this skill when creating, updating, or migrating Wear OS projects. This includes the androidx.wear.compose.material3, androidx.wear.compose.foundation, and androidx.wear.compose.navigation3 libraries. Also working with core components such as AppScaffold…

android/skills · 101 tokens

kotlin-specialist

Provides idiomatic Kotlin implementation patterns including coroutine concurrency, Flow stream handling, multiplatform architecture, Compose UI construction, Ktor server setup, and type-safe DSL design. Use when building Kotlin applications requiring coroutines, multiplatform development, or Android with Compose.…

Jeffallan/claude-skills · 86 tokens

kotlin-tooling-agp9-migration

Migrates Kotlin Multiplatform (KMP) projects to Android Gradle Plugin 9.0+. Handles plugin replacement (com.android.kotlin.multiplatform.library), module splitting, DSL migration, and the new default project structure. Use when upgrading AGP, when build fails due to KMP+AGP incompatibility, or when the user mentions…

Kotlin/kotlin-agent-skills · 105 tokens