swift-coding-standards

swift-coding-standards is a skill for Claude Code, Codex from williamzujkowski/standards. It costs 23 tokens per session (1,924 once invoked), scanned A, original, MIT.

A guide to Swift coding practices for Apple applications, including naming, optionals, protocols, value types, and modern concurrency. Swift is Apple's programming language for platforms such as iOS and macOS.

In plain words
What is it for?
Use it when writing or reviewing Swift code for iPhone, iPad, Mac, Apple Watch, or Apple TV applications.
Why use it?
It helps keep Swift code consistent and reduces common mistakes when handling missing values, shared behavior, and concurrent work.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Good fit Use it when writing or reviewing Swift code for iPhone, iPad, Mac, Apple Watch, or Apple TV applications.

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

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-coding-standards

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/williamzujkowski/standards/swift"><img src="https://agentmods.dev/badge/skills/williamzujkowski/standards/swift.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 23 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,924 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.00023 $0.01924
Opus 5.5 $0.00009 $0.00770
Sonnet 5.5 $0.00005 $0.00385
Haiku 4.5 $0.00002 $0.00192

Measured yesterday against content hash 180cae5d08ed, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-30, from the pricing page.

Security

Grade A, and why

swift-coding-standards 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 yesterday.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/setup-swift-project.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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/coding-standards/swift/SKILL.md · 329 lines

How it starts

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

Swift Coding Standards

Learn Once, Write Anywhere: Master Swift coding standards for iOS, macOS, watchOS, and tvOS development with protocol-oriented design, value semantics, and modern concurrency.

Level 1: Quick Reference

Optionals Cheat Sheet

// Optional binding (safe unwrapping)
if let name = name { print("Hello, \(name)") }

// Guard statement (early exit)
guard let age = age else { return }

// Nil coalescing (default value)
let displayName = name ?? "Anonymous"

// Optional chaining
let count = user?.profile?.posts?.count

Essential Patterns

// Protocol definition with default implementation
protocol Drawable {
    var color: Color { get set }
    func draw()
}

extension Drawable {
    func draw() { print("Drawing with \(color)") }
}

// Struct with protocol conformance
struct Circle: Drawable {
    var color: Color
    var radius: Double
}

// Closure syntax
let doubled = numbers.map { $0 * 2 }

// Property wrapper
@State private var isPresented = false

Naming Conventions

// Types: PascalCase
class UserProfileViewController { }
struct NetworkRequest { }
protocol DataSource { }

// Variables/Functions: camelCase
var userName: String
func fetchUserProfile() { }

// Booleans: use is/has/should prefix
var isLoading: Bool
var hasCompletedOnboarding: Bool

Pre-Commit Checklist

  • SwiftLint passes with zero warnings
  • All optionals handled safely (no force unwrapping)
  • Access control specified (private, internal, public)
  • Memory cycles avoided (weak/unowned references)
  • Unit tests cover happy and error paths

Level 2: Implementation Guide

1. Optionals and Safety

Swift's optional system eliminates null pointer exceptions through compile-time safety.

// Safe unwrapping patterns
if let unwrapped = optionalValue {
    print(unwrapped)
}

// Multiple bindings
if let name = userName, let age = userAge, age >= 18 {
    print("\(name) is an adult")
}

// Guard for early exit
func processUser(_ user: User?) {
    guard let user = user else { return }
    print(user.name)
}

// Optional map/flatMap
let uppercasedName = userName.map { $0.uppercased() }
let userID = userIDString.flatMap { Int($0) }

Read the full file on GitHub · 329 lines

Files

What ships with it

8 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. yesterday First seen · 329 lines · 23 tokens per session scan A 180cae5d08ed

Subscribe to this mod's changes

swift-coding-standards is a skill published in the GitHub repository williamzujkowski/standards (18 stars, last pushed 1mo ago), licensed MIT. It adds 23 tokens to every session and 1,924 once invoked, about $0.0001 per session on Opus 5.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-29.

Related

Other skills, from other repositories

swift-expert

Expert-level Swift development for iOS, macOS with SwiftUI, Combine, and modern Swift 5.9+. Use when the user mentions iOS, macOS, SwiftUI, Combine, async await, or Apple platforms, or when the task involves Modern Swift Features, Basics and Optionals, Functions and Closures, or Structs and Classes.

personamanagmentlayer/pcl · 76 tokens

ios-expert

Expert in iOS development with SwiftUI, UIKit, Combine, and Apple ecosystem integration. Use when the user mentions mobile, Swift, SwiftUI, UIKit, Apple platforms, or Xcode, or when the task involves iOS App Architecture, SwiftUI Fundamentals, UIKit Essentials, or Combine Framework.

personamanagmentlayer/pcl · 64 tokens

swiftui-whats-new-27

New SwiftUI APIs, behaviors, and deprecations introduced in the 2027 OS releases (iOS 27, macOS 27, watchOS 27, tvOS 27, visionOS 27). Use when a SwiftUI view using @State fails to compile with "used before being initialized", "invalid redeclaration of synthesized property", or "extraneous argument label" errors after…

superagents-lab/xcode27-skills · 566 tokens

swift

Swift programming patterns for iOS and macOS.

miles990/claude-software-skills · 11 tokens

swift_expert

Swift and iOS/macOS specialist. Protocol-oriented programming and SwiftUI patterns.

ApexIQ/skillsmith · 20 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