swift-language

swift-language is a skill for Claude Code from Dev869/swift-tothemax. It costs 167 tokens per session (2,264 once invoked), scanned A, original, MIT.

A reference guide for writing, reviewing, refactoring, and debugging modern Swift code, including Swift 6 features and Swift Package Manager projects.

In plain words
What is it for?
Use it for Swift applications, libraries, server software, embedded systems, and cross-platform code involving C, C++, or Objective-C.
Why use it?
It helps developers handle Swift language rules, concurrency, performance, errors, testing, and interoperability without piecing together guidance from many sources.

Skill for Claude Code

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

Part of the swift-tothemax plugin — 8 skills shipped together

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.

agentmods
npx agentmods add skills/dev869/swift-tothemax/swift-language
Any agent
npx skills add Dev869/swift-tothemax --skill swift-language
Clone the repo
git clone --depth 1 https://github.com/Dev869/swift-tothemax

Made for: Claude Code.

Or install swift-tothemax, the plugin that ships this one along with the rest of its 8 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 swift-language

README.md
[![agentmods](https://agentmods.dev/badge/skills/dev869/swift-tothemax/swift-language.svg)](https://agentmods.dev/skills/dev869/swift-tothemax/swift-language)
Your own site
<a href="https://agentmods.dev/skills/dev869/swift-tothemax/swift-language"><img src="https://agentmods.dev/badge/skills/dev869/swift-tothemax/swift-language.svg" alt="Measured on agentmods" height="20"></a>
Per session 167 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,264 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00167 $0.02264
Opus 5 $0.00084 $0.01132
Sonnet 5 $0.00033 $0.00453
Haiku 4.5 $0.00017 $0.00226

Measured 6d ago against content hash 34b9278192cb, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

swift-language 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 6d 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/swift-language/SKILL.md · 98 lines

How it starts

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

Swift to the Max

Expert-level guidance for modern Swift. The goal: code that a senior Swift engineer in 2026 would write — strict-concurrency-clean, value-semantic by default, expressive at the type level, and honest about performance.

Version landscape (mid-2026)

Version Status Headline features
Swift 5.10 legacy last 5.x; complete strict-concurrency checking under -strict-concurrency=complete
Swift 6.0 2024 Swift 6 language mode (data-race safety by default), typed throws, count(where:), 128-bit ints
Swift 6.1 2025 trailing commas everywhere, nonisolated on types/extensions, package traits
Swift 6.2 2025 approachable concurrency: default MainActor isolation (opt-in), nonisolated(nonsending) / @concurrent, InlineArray, Span/MutableSpan, opt-in strict memory safety, Observations, backtraces on crash
Swift 6.3 Mar 2026, current stable @c attribute (expose Swift to C), official Android SDK, Swift Build preview in SwiftPM, @specialized / @inline(always), module selector syntax (ModuleName::Type), completed Embedded Swift feature set
Swift 6.4 WWDC26 beta await in defer, Iterable protocol (borrowing iteration), anyAppleOS availability shorthand, @diagnose, Swift Testing ↔ XCTest interop, unified URL implementation

Default to Swift 6 language mode semantics unless the project's Package.swift / build settings say otherwise. Check // swift-tools-version: and swiftLanguageModes: before assuming. Never emit code using a beta-only (6.4) feature without flagging it as such.

Non-negotiable defaults

These apply to essentially all new Swift code; deviate only when the surrounding codebase clearly does otherwise, and say so.

  • Value types first. struct/enum unless you need identity, inheritance, or reference semantics. If you reach for class, ask whether it should be an actor or final class.
  • Strict concurrency clean. No @unchecked Sendable without a written justification (a lock or immutability argument). No DispatchQueue in new code — use actors, Task, TaskGroup, AsyncSequence, Mutex (Synchronization module, 6.0+).
  • some before any. Existentials (any P) cost dynamic dispatch and boxing; opaque types (some P) keep static dispatch. Use any only when you genuinely need heterogeneity.
  • Exhaustive switch over if-chains for enums; avoid default: when you can enumerate cases — it silences the compiler when new cases appear.
  • No force unwraps / force try in production paths. ! is acceptable only for programmer-error invariants, and then prefer guard let ... else { preconditionFailure("why") } so the invariant is documented.
  • Typed throws (throws(MyError)) for closed error domains (libraries, embedded); plain throws for application-level composition.
  • guard for early exit, one happy path at low indentation.
  • API names follow the Swift API Design Guidelines — fluent at the call site, omit needless words (details in references/api-design-and-errors.md).

Read the full file on GitHub · 98 lines

Files

What ships with it

9 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 6d ago First seen · 98 lines · 167 tokens per session scan A 34b9278192cb

Subscribe to this mod's changes

swift-language is a skill published in the GitHub repository Dev869/swift-tothemax (7 stars, last pushed 2mo ago), licensed MIT. It adds 167 tokens to every session and 2,264 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

combine

Route Combine implementation tasks to the correct Knowledge Contracts -- the Publisher/Subscriber protocol pair, sink(receiveCompletion:receiveValue:)/sink(receiveValue:) and retaining the returned AnyCancellable; @Published/ObservableObject and the synthesized objectWillChange publisher; PassthroughSubject vs.…

caglarbaranbora/Apple-Agent-Kit · 0 tokens

swiftui

Route SwiftUI implementation tasks to the correct Knowledge Contracts — view composition, view identity in ForEach/List, modifier order, NavigationStack/NavigationPath, NavigationSplitView, stack/spacing layout, safe area handling, lazy grids/stacks, GeometryReader pitfalls, @State/@Binding, the @Observable macro…

caglarbaranbora/Apple-Agent-Kit · 249 tokens

foundation

Route Swift Foundation framework implementation tasks to the correct Knowledge Contracts -- date/time formatting, measurement and unit formatting, Codable encoding and custom conformance, and FileManager app sandbox directories. Use when working with DateFormatter, ISO8601DateFormatter, Date.FormatStyle, .formatted()…

caglarbaranbora/Apple-Agent-Kit · 133 tokens

generators

Code generator skills that produce production-ready Swift code for common app components. Use when user wants to add logging, analytics, onboarding, review prompts, networking, authentication, paywalls, settings, persistence, error monitoring, CI/CD pipelines, localization, push notifications, deep linking, testing…

rshankras/claude-code-apple-skills · 176 tokens

attributed-string

AttributedString patterns for rich text formatting, alignment, selection, and SwiftUI integration. Use when working with styled text, text editing, or AttributedString APIs.

rshankras/claude-code-apple-skills · 37 tokens

coding-best-practices

Reviews Swift/iOS code for adherence to modern Swift idioms, Apple platform best practices, architecture patterns, and code quality standards. Use when user mentions best practices, code review, clean code, refactoring, or wants to improve code quality.

rshankras/claude-code-apple-skills · 55 tokens