Swift Patterns

Swift Patterns is a skill for Claude Code, Codex from AmariahAK/atlarix-skills. It costs 2 tokens per session (354 once invoked), scanned A, original, Apache-2.0.

A collection of patterns for Swift projects, including SwiftPM packages and iOS or macOS apps. It covers project structure, asynchronous work, value types, errors, and tests.

In plain words
What is it for?
Use it when organizing Swift packages or apps, writing async code, handling errors, reviewing APIs, and running deterministic tests.
Why use it?
It helps avoid common Swift problems such as blocking the main app thread, unsafe shared state, ignored cancellation, and unreliable tests.

Skill for Claude CodeCodex

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

Good fit Use it when organizing Swift packages or apps, writing async code, handling errors, reviewing APIs, and running deterministic tests.

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

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/amariahak/atlarix-skills/swift/github.svg)](https://agentmods.dev/skills/amariahak/atlarix-skills/swift)
Your own site
<a href="https://agentmods.dev/skills/amariahak/atlarix-skills/swift"><img src="https://agentmods.dev/badge/skills/amariahak/atlarix-skills/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 Patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/amariahak/atlarix-skills/swift"><img src="https://agentmods.dev/badge/skills/amariahak/atlarix-skills/swift.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 354 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.00002 $0.00354
Opus 5 $0.00001 $0.00177
Sonnet 5 $0.00000 $0.00071
Haiku 4.5 $0.00000 $0.00035

Measured 8d ago against content hash b52bded54192, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, 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 8d 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/SKILL.md · 57 lines

What it actually says

Swift Patterns

When to use this skill

Use this skill when working on Swift projects (SwiftPM packages, iOS/macOS apps) and you want consistent patterns for concurrency, structure, and safety.

Core patterns

SwiftPM structure

  • Package.swift is the source of truth
  • keep targets small and focused
  • avoid circular dependencies between targets

Concurrency (async/await)

Rules:

  • use async/await for IO
  • keep cancellation in mind
  • avoid blocking work on the main thread

Value types by default

Prefer:

  • struct for value semantics
  • class when identity/shared mutable state is required

Error handling

  • throw typed errors where helpful
  • add context at boundaries

Testing

  • keep tests deterministic
  • prefer unit tests for pure logic

Atlarix tool notes

  • Explore: inspect Package.swift and target layout.
  • Build: run swift test or Xcode build scripts depending on project.
  • Debug: follow crash logs and stack traces; find the first app frame.
  • Review: check concurrency correctness and API clarity.

Common mistakes to avoid

  • Doing heavy work on the main thread
  • Overusing reference types
  • Ignoring cancellation

Mini-checklist

  • Targets are small and layered
  • Concurrency is used correctly
  • Tests run reliably
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. 8d ago First seen · 57 lines · 2 tokens per session scan A b52bded54192

Subscribe to this mod's changes

Swift Patterns is a skill published in the GitHub repository AmariahAK/atlarix-skills (2 stars, last pushed 5d ago), licensed Apache-2.0. It adds 2 tokens to every session and 354 once invoked, about $0.0000 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

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

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

using-xtool

This skill should be used when building iOS apps with xtool (Xcode-free iOS development), creating xtool projects, adding app extensions, or configuring xtool.yml. Triggers on "xtool", "SwiftPM iOS", "iOS on Linux", "iOS on Windows", "Xcode-free", "app extension", "widget extension", "share extension". Covers project…

2389-research/xtool · 93 tokens

moai-lang-swift

Swift 6.0 enterprise development with async/await, SwiftUI, Combine, and Swift Concurrency. Advanced patterns for iOS, macOS, server-side Swift, and enterprise mobile applications with Context7 MCP integration.

mosif16/codex-Skills · 51 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