language-swift

language-swift is a skill for Claude Code from lugassawan/swe-workbench. It costs 54 tokens per session (1,358 once invoked), scanned A, original, MIT.

A Swift coding guide covering optionals, value types, protocols, async code, actors, and result builders. It loads when you work on Swift or SwiftUI projects.

In plain words
What is it for?
Use it when building Swift or SwiftUI features, handling optional data, designing protocols, or coordinating concurrent tasks.
Why use it?
It helps prevent crashes from missing values and shared mutable state while keeping Swift types easier to reason about.

Skill for Claude Code

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

Part of the swe-workbench plugin — 62 skills, 26 commands, 23 agents, 5 hooks shipped together

Good fit Use it when building Swift or SwiftUI features, handling optional data, designing protocols, or coordinating concurrent tasks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/lugassawan/swe-workbench/language-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 lugassawan/swe-workbench --skill language-swift
Clone the repo
git clone --depth 1 https://github.com/lugassawan/swe-workbench

Made for: Claude Code.

Or install swe-workbench, the plugin that ships this one along with the rest of its 62 skills, 26 commands, 23 agents, 5 hooks.

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 language-swift

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/lugassawan/swe-workbench/language-swift"><img src="https://agentmods.dev/badge/skills/lugassawan/swe-workbench/language-swift.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 54 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,358 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00054 $0.01358
Opus 5.5 $0.00022 $0.00543
Sonnet 5.5 $0.00011 $0.00272
Haiku 4.5 $0.00005 $0.00136

Measured 3mo ago against content hash 35dc9b625df2, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

language-swift scanned grade A with 1 finding 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 3mo 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

protocol Fetchable { associatedtype Item; func fetch(id: String) async throws -> Item }
skills/language-swift/SKILL.md · 127 lines

How it starts

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

Swift

Optionals

  • ? makes absence explicit in the type — String? vs String.
  • if let / guard let unwrap safely. guard exits scope immediately — prefer it for preconditions.
  • ?? provides a default for nil. Never force-unwrap (!) in production unless the nil case is a programmer error that should crash loudly.
guard let email = user.email else { return }
let display = nickname ?? username

Value vs reference types

  • Default to struct — value semantics, copy-on-write, no shared-mutation bugs.
  • Use class only when identity matters (reference equality, inheritance), or when Objective-C interop requires it.
  • Use actor to encapsulate mutable state that must be safe to access from multiple async tasks.
actor Counter {
    private var count = 0
    func increment() { count += 1 }
    func value() -> Int { count }
}

Protocols and protocol-oriented design

  • Model capabilities as protocols, not class hierarchies. Hashable, Codable, Identifiable are the idiom.
  • Extension methods add behavior without subclassing.
  • some Protocol (opaque return type) keeps the concrete type private while preserving type identity.
  • any Protocol (existential) erases the type — use only when you need a heterogeneous collection.
protocol Fetchable { associatedtype Item; func fetch(id: String) async throws -> Item }
func loadFirst<F: Fetchable>(from source: F) async throws -> F.Item { try await source.fetch(id: "1") }

Concurrency — async/await

  • async/await replaces completion handlers. Mark any function that suspends as async.
  • async let for structured concurrency — values resolve when awaited, not when declared.
  • withTaskGroup for dynamic fan-out over a collection.
  • Task.checkCancellation() in long loops; cancellation is cooperative.
async let user  = fetchUser(id)
async let prefs = fetchPreferences(id)
let dashboard = try await Dashboard(user: user, prefs: prefs)
  • Mark types that cross concurrency boundaries as Sendable (or use @unchecked Sendable with a documented invariant).

Read the full file on GitHub · 127 lines

Files

What ships with it

1 file 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. 3mo ago First seen · 127 lines · 54 tokens per session scan A 35dc9b625df2

Subscribe to this mod's changes

language-swift is a skill published in the GitHub repository lugassawan/swe-workbench (3 stars, last pushed 2d ago), licensed MIT. It adds 54 tokens to every session and 1,358 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

language-swift compared with skills from other repositories

language-swift next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
language-swiftlugassawan/swe-workbenchSkill32d agoMITA54Claude Code
kotlin-androidericrisco/rsc-harnessSkill7093d agoMITA78Claude Code, Codex
new-mac-appdaveebbelaar/bamaSkill2.1k1mo agoMITA59Claude Code, Codex
language-idioms-refinertechygarg/latticeSkill219todayMITA92Claude Code
swift-code-reviewexistential-birds/beagleSkill925d agoApache-2.0A47Claude Code, Codex
build-ios-binarymicrosoft/power-platform-skillsSkill1.2ktodayMITC200Claude Code
wasmTheBeardedBearSAS/claude-craftSkill10819d agoMITA43Claude Code