swift-patterns

swift-patterns is a skill for Claude Code, Codex from shahtuyakov/claude-setup. It costs 63 tokens per session (1,069 once invoked), scanned A, original, MIT.

A collection of coding patterns for building native iPhone and iPad apps with Swift and SwiftUI, Apple's tools for app interfaces.

In plain words
What is it for?
Use it when building screens, navigation, data storage, network requests, background work, or app state management.
Why use it?
It helps developers choose suitable structures and APIs for common app features and different iOS versions.

Skill for Claude CodeCodex

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

Good fit Use it when building screens, navigation, data storage, network requests, background work…

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

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-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/shahtuyakov/claude-setup/swift-patterns.svg)](https://agentmods.dev/skills/shahtuyakov/claude-setup/swift-patterns)
Your own site
<a href="https://agentmods.dev/skills/shahtuyakov/claude-setup/swift-patterns"><img src="https://agentmods.dev/badge/skills/shahtuyakov/claude-setup/swift-patterns.svg" alt="Measured on agentmods" height="20"></a>
Per session 63 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,069 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.00063 $0.01069
Opus 5 $0.00032 $0.00535
Sonnet 5 $0.00013 $0.00214
Haiku 4.5 $0.00006 $0.00107

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

Security

Grade A, and why

swift-patterns 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-patterns/SKILL.md · 161 lines

How it starts

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

Swift Patterns

Modern Swift and SwiftUI patterns for iOS development.

iOS Version Selection

Target Best For Stack
iOS 26+ New apps, latest features SwiftUI + SwiftData + @Observable + Foundation Models
iOS 17+ Broad compatibility with modern APIs SwiftUI + SwiftData + @Observable
iOS 15+ Maximum device coverage SwiftUI + Core Data + ObservableObject

Reference Files

Topic Load Use When
Project structure references/project-structure.md Setting up or organizing code
SwiftUI views references/swiftui-patterns.md Building UI components
State management references/state-management.md @Observable, ObservableObject, @State
Data persistence references/data-persistence.md SwiftData, Core Data, Keychain
Networking references/networking.md URLSession, API clients
Concurrency references/concurrency.md async/await, actors, tasks
Navigation references/navigation.md NavigationStack, coordinators
iOS 26 features references/ios26-features.md Liquid Glass, Foundation Models

Quick Start Patterns

Basic SwiftUI View (iOS 17+)

import SwiftUI

struct UserProfileView: View {
    @State private var viewModel = UserProfileViewModel()

    var body: some View {
        Group {
            if viewModel.isLoading {
                ProgressView()
            } else if let user = viewModel.user {
                VStack {
                    Text(user.name)
                        .font(.title)
                    Text(user.email)
                        .foregroundStyle(.secondary)
                }
            } else if let error = viewModel.error {
                ContentUnavailableView(
                    "Error",
                    systemImage: "exclamationmark.triangle",
                    description: Text(error.localizedDescription)
                )
            }
        }
        .task {
            await viewModel.loadUser()
        }
    }
}

Read the full file on GitHub · 161 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. 6d ago First seen · 161 lines · 63 tokens per session scan A c9e2628c88d9

Subscribe to this mod's changes

swift-patterns is a skill published in the GitHub repository shahtuyakov/claude-setup (13 stars, last pushed 8mo ago), licensed MIT. It adds 63 tokens to every session and 1,069 once invoked, about $0.0003 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-30.

Related

Other skills, from other repositories

jetpack-compose-expert

Use when working in a native Android Jetpack Compose project - build.gradle.kts with androidx.compose BOM or org.jetbrains.kotlin.plugin.compose, .kt files containing @Composable functions, MainActivity with setContent, or mentions of Compose, Material 3, recomposition, ViewModel, StateFlow, Hilt, Room, or Navigation…

Aarvion-AI/stackwise-skills · 145 tokens

swiftui-expert

Use when working in a native iOS/SwiftUI project - .swift files, an .xcodeproj or Package.swift, Xcode schemes, or mentions of SwiftUI, Swift 6, @Observable, SwiftData, NavigationStack, actors, or Swift Testing. Builds views and features, wires Observation-based state, fixes Swift 6 strict-concurrency errors, models…

Aarvion-AI/stackwise-skills · 151 tokens

build-android-binary

Compile a PAM control's Android Kotlin module into the runtime-loadable DEX for a .ppmplugin. Creates a staged Gradle build with the pinned wrapper and react-android compile dependency, verifies manifest/module/package alignment and runtime-loading constraints, builds the release AAR, then runs d8 --min-api 24. Writes…

microsoft/power-platform-skills · 150 tokens

kotlin-patterns

Kotlin: coroutines, Flow, sealed/data classes, null safety, Ktor, Compose, KMP. Triggers: Kotlin, coroutine, Flow, suspend, Ktor, Jetpack Compose, KMP, kotlinx.

softspark/ai-toolkit · 51 tokens

swift-patterns

Swift/iOS: SwiftUI, Combine, async/await, actors, SPM, Core Data, UIKit interop. Triggers: Swift, SwiftUI, Combine, iOS, Xcode, actor, Core Data, @MainActor, @State.

softspark/ai-toolkit · 57 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