swift-patterns

swift-patterns is a skill for Claude Code, Codex from efremidze/swift-patterns-skill. It costs 38 tokens per session (1,828 once invoked), scanned A, original, MIT.

A set of guidance for building, reviewing, and refactoring SwiftUI interfaces, Apple's framework for making app screens in Swift. It covers state, navigation, performance, modern APIs, and testing.

In plain words
What is it for?
Use it to review or change SwiftUI screens, structure views, handle asynchronous work, implement navigation, improve list performance, and test features.
Why use it?
It helps prevent common problems such as incorrect screen state, unstable lists, outdated APIs, and hard-to-test view code.

Skill for Claude CodeCodex

Part of the swift-patterns plugin — 1 skill 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/efremidze/swift-patterns-skill/swift-patterns
Any agent
npx skills add efremidze/swift-patterns-skill --skill swift-patterns
Clone the repo
git clone --depth 1 https://github.com/efremidze/swift-patterns-skill

Made for: Claude Code, Codex.

Or install swift-patterns, the plugin that ships this one along with the rest of its 1 skill.

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/efremidze/swift-patterns-skill/swift-patterns.svg)](https://agentmods.dev/skills/efremidze/swift-patterns-skill/swift-patterns)
Your own site
<a href="https://agentmods.dev/skills/efremidze/swift-patterns-skill/swift-patterns"><img src="https://agentmods.dev/badge/skills/efremidze/swift-patterns-skill/swift-patterns.svg" alt="Measured on agentmods" height="20"></a>
Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,828 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 $0.00038 $0.01828
Opus 5 $0.00019 $0.00914
Sonnet 5 $0.00008 $0.00366
Haiku 4.5 $0.00004 $0.00183

Measured 4d ago against content hash 5bb473ddf2ba, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 4d 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.

swift-patterns/SKILL.md · 177 lines

How it starts

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

swift-patterns

Review, refactor, or build SwiftUI features with correct state management, modern API usage, optimal view composition, and performance-conscious patterns. Prioritize native APIs, Apple design guidance, and testable code structure. This skill focuses on facts and best practices without enforcing specific architectural patterns.

Workflow Decision Tree

1) Review existing SwiftUI code

→ Read references/workflows-review.md for review methodology

  • Check state management against property wrapper selection (see references/state.md)
  • Verify view composition and extraction patterns (see references/view-composition.md)
  • Audit list performance and identity stability (see references/lists-collections.md)
  • Validate modern API usage (see references/modern-swiftui-apis.md)
  • Check async work patterns with .task (see references/concurrency.md)
  • Verify navigation implementation (see references/navigation.md)
  • Use Review Response Template (below)

2) Refactor existing SwiftUI code

→ Read references/workflows-refactor.md for refactor methodology

  • Extract complex views using playbooks (see references/refactor-playbooks.md)
  • Migrate deprecated APIs to modern equivalents (see references/modern-swiftui-apis.md)
  • Optimize performance hot paths (see references/performance.md)
  • Restructure state ownership (see references/state.md)
  • Apply common patterns (see references/patterns.md)
  • Use Refactor Response Template (below)

3) Implement new SwiftUI features

  • Design data flow first: identify owned vs injected state (see references/state.md)
  • Structure views for optimal composition (see references/view-composition.md)
  • Use modern APIs only (see references/modern-swiftui-apis.md)
  • Handle async work with .task modifier (see references/concurrency.md)
  • Apply performance patterns early (see references/performance.md)
  • Implement navigation flows (see references/navigation.md)

4) Answer best practice questions

  • Load relevant reference file(s) based on topic (see Reference Files below)
  • Provide direct guidance with examples

Read the full file on GitHub · 177 lines

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. 4d ago First seen · 177 lines · 38 tokens per session scan A 5bb473ddf2ba

Subscribe to this mod's changes

swift-patterns is a skill published in the GitHub repository efremidze/swift-patterns-skill (9 stars, last pushed 5mo ago), licensed MIT. It adds 38 tokens to every session and 1,828 once invoked, about $0.0002 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

swift-architecture-skill

Swift iOS architecture guidance and playbooks for MVVM, MVI, TCA, Clean Architecture, VIPER, MVP, Coordinator, and Reactive patterns. Use when designing, implementing, refactoring, or reviewing the architecture of a SwiftUI or UIKit feature, module, or codebase.

efremidze/swift-architecture-skill · 65 tokens

antigravity-root

Enterprise-grade iOS development workflow for TTBaseUIKit-powered apps. Cross-functional product analysis | MVVM-C Architecture | UIKit + SwiftUI | TTViewCodable | TTBaseSUI | xcodebuild CLI Verification | Zero Regression | iOS 14+.

tqtuan1201/TTBaseUIKit · 57 tokens

test-modernizer

Modernize test suites to use modern Swift Testing features or migrate from XCTest.

superagents-lab/xcode27-skills · 19 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

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

swift-knowledge

Comprehensive Swift development knowledge for iOS/macOS applications, Swift packages, and modern Swift patterns. Use when working with: (1) xcodebuild commands and Xcode projects, (2) Swift Package Manager, (3) SwiftUI views and patterns, (4) Swift 6 concurrency (async/await, actors, Sendable), (5) XCTest and Swift…

hmohamed01/swift-developer · 113 tokens