Agent skill

Swiftui Patterns

by johnrogers in johnrogers/claude-swift-engineering

A skill your agent uses when implementing iOS 17+ SwiftUI patterns: @Observable/@Bindable, MVVM architecture, NavigationStack, lazy loading, UIKit interop, accessibility (VoiceOver/Dynamic Type)…

MITAuto-check passedMobile

Install Swiftui Patterns

skills CLI
$ npx skills add johnrogers/claude-swift-engineering --skill swiftui-patterns -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install johnrogers/claude-swift-engineering swiftui-patterns --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/johnrogers/claude-swift-engineering.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/swift-engineering/skills/swiftui-patterns .claude/skills/swiftui-patterns && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
swiftui-patterns
GitHub stars
231
Token cost
~1.1k tokens
SKILL.md length
402 words
Files
13 (incl. references)
Skills in repo
17
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when implementing iOS 17+ SwiftUI patterns: @Observable/@Bindable, MVVM architecture, NavigationStack, lazy loading, UIKit interop, accessibility (VoiceOver/Dynamic Type)…

  • Works in 5 steps: Use @Observable for model classes (no… → Use @State for view-owned models,… → Use .task { } for async work… → …
  • Implementing iOS 17+ SwiftUI patterns: @Observable/@Bindable
  • SKILL.md covers Overview, Quick Reference, Core Workflow and Reference Loading Guide, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Swiftui Patterns is an agent skill from johnrogers/claude-swift-engineering. Use when implementing iOS 17+ SwiftUI patterns: @Observable/@Bindable, MVVM architecture, NavigationStack, lazy loading, UIKit interop, accessibility (VoiceOver/Dynamic Type), async operations (.task/.refreshable), or migrating from ObservableObject/@StateObject.

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 13 other files, including reference files (for example `references/accessibility.md`, `references/async-patterns.md` and `references/composition.md`).

It sits in Mobile, covering iOS development. It works with SwiftUI and iOS. The repository describes itself as: A collection of agents and skills to aid in the planning, implementation, documentation and testing of Swift/TCA code. The licence is MIT.

When your agent uses it

  • Implementing iOS 17+ SwiftUI patterns: @Observable/@Bindable
  • MVVM architecture
  • NavigationStack
  • Accessibility (VoiceOver/Dynamic Type)

Example prompts

  • “/swiftui-patterns”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Use @Observable for model classes (no @Published needed)
  2. Use @State for view-owned models, @Bindable for passed models
  3. Use .task { } for async work (auto-cancels on disappear)
  4. Use NavigationStack with NavigationPath for programmatic navigation
  5. Apply .accessibilityLabel() and .accessibilityHint() to interactive elements

What it can do on your machine

Read from SKILL.md and the folder at commit 1dc2cf4. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Swiftui Patterns loads about 1.1k tokens when it runs, and up to ~7k if it reads all its reference files. Until then it costs about 70 tokens; SKILL.md has 402 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~70
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from johnrogers/claude-swift-engineering at commit 1dc2cf4, republished under its MIT licence (© johnrogers). 402 words, ~1,066 tokens.

Download SKILL.mdSave it as .claude/skills/swiftui-patterns/SKILL.md (or your agent's skills folder). This skill also uses 12 other files; get the full folder from GitHub.
name
swiftui-patterns
description
Use when implementing iOS 17+ SwiftUI patterns: @Observable/@Bindable, MVVM architecture, NavigationStack, lazy loading, UIKit interop, accessibility (VoiceOver/Dynamic Type), async operations (.task/.refreshable), or migrating from ObservableObject/@StateObject.

SwiftUI Patterns (iOS 17+)

SwiftUI 17+ removes ObservableObject boilerplate with @Observable, simplifies environment injection with @Environment, and introduces task-based async patterns. The core principle: use Apple's modern APIs instead of reactive libraries.

Overview

Quick Reference

NeedUse (iOS 17+)NOT
Observable model@ObservableObservableObject
Published propertyRegular property@Published
Own state@State@StateObject
Passed model (binding)@Bindable@ObservedObject
Environment injectionenvironment(_:)environmentObject(_:)
Environment access@Environment(Type.self)@EnvironmentObject
Async on appear.task { }.onAppear { Task {} }
Value changeonChange(of:initial:_:)onChange(of:perform:)

Core Workflow

  1. Use @Observable for model classes (no @Published needed)
  2. Use @State for view-owned models, @Bindable for passed models
  3. Use .task { } for async work (auto-cancels on disappear)
  4. Use NavigationStack with NavigationPath for programmatic navigation
  5. Apply .accessibilityLabel() and .accessibilityHint() to interactive elements

Reference Loading Guide

ALWAYS load reference files if there is even a small chance the content may be required. It's better to have the context than to miss a pattern or make a mistake.

ReferenceLoad When
ObservableCreating new @Observable model classes
State ManagementDeciding between @State, @Bindable, @Environment
EnvironmentInjecting dependencies into view hierarchy
View ModifiersUsing onChange, task, or iOS 17+ modifiers
Migration GuideUpdating iOS 16 code to iOS 17+
MVVM ObservableSetting up view model architecture
NavigationProgrammatic or deep-link navigation
PerformanceLists with 100+ items or excessive re-renders
UIKit InteropWrapping UIKit components (WKWebView, PHPicker)
AccessibilityVoiceOver, Dynamic Type, accessibility actions
Async PatternsLoading states, refresh, background tasks
CompositionReusable view modifiers or complex conditional UI
Show full SKILL.md (158 more words)Show less

Common Mistakes

  1. Over-using @Bindable for passed models — Creating @Bindable for every property causes unnecessary view reloads. Use @Bindable only for mutable model properties that need two-way binding. Read-only computed properties should use regular properties.

  2. State placement errors — Putting model state in the view instead of a dedicated @Observable model causes view logic to become tangled. Always separate model and view concerns.

  3. NavigationPath state corruption — Mutating NavigationPath incorrectly can leave it in inconsistent state. Use navigationDestination(for:destination:) with proper state management to avoid path corruption.

  4. Missing .task cancellation — .task handles cancellation on disappear automatically, but nested Tasks don't. Complex async flows need explicit cancellation tracking to avoid zombie tasks.

  5. Ignoring environment invalidation — Changing environment values at parent doesn't invalidate child views automatically. Use @Environment consistently and understand when re-renders happen based on observation.

  6. UIKit interop memory leaks — UIViewRepresentable and UIViewControllerRepresentable can leak if delegate cycles aren't broken. Weak references and explicit cleanup are required.

© johnrogers, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 12 other files (references) in plugins/swift-engineering/skills/swiftui-patterns of johnrogers/claude-swift-engineering.

  • SKILL.md
  • references/accessibility.md
  • references/async-patterns.md
  • references/composition.md
  • references/environment.md
  • references/migration-guide.md
  • references/mvvm-observable.md
  • references/navigation.md
  • references/observable.md
  • references/performance.md
  • references/state-management.md
  • references/uikit-interop.md
  • references/view-modifiers.md

Open the folder on GitHubat commit 1dc2cf4

Compare with similar skills

Swiftui Patterns next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Swiftui Patterns compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Swiftui Patterns this skilljohnrogers/claude-swift-engineering231—~1.1kAutomated safety check: PassMIT
Update Swiftui APIsAvdLee/SwiftUI-Agent-Skill3.7k—~1.2kAutomated safety check: PassMIT
Swiftui Liquid Glassharperreed/dotfiles3348 repos~941Automated safety check: PassNone
Swiftui Expert Skillomarshahine/HomeClaw1764 repos~2.8kAutomated safety check: PassMIT
Hig Project Contextraintree-technology/hig-doctor1435 repos~1.2kAutomated safety check: PassMIT
Liquid Glass DesignAstraFoundry/KumoApp2905 repos~2.3kAutomated safety check: PassAGPL-3.0

Similar skills

  • Update Swiftui APIs

    AvdLee/SwiftUI-Agent-Skill

    Scan Apple's SwiftUI documentation for deprecated APIs and update the SwiftUI Expert Skill with modern replacements.

    3.7k GitHub stars~1.2k tokensUpdated yesterday
    MobileAuto-check passed
  • Swiftui Liquid Glass

    harperreed/dotfiles

    Implement, review, or improve SwiftUI features using the iOS 26+ Liquid Glass API.

    334 GitHub starsUsed in 8 repos~941 tokens
    MobileAuto-check passed
  • Swiftui Expert Skill

    omarshahine/HomeClaw

    A skill your agent uses when writing, reviewing, or refactoring SwiftUI code for iOS or macOS, including state management, view composition, performance, Liquid Glass adoption, or Instruments .trace…

    176 GitHub starsUsed in 4 repos~2.8k tokens
    MobileAuto-check passed
  • Hig Project Context

    raintree-technology/hig-doctor

    Create or update a shared Apple design context document that other HIG skills use to tailor guidance.

    143 GitHub starsUsed in 5 repos~1.2k tokens
    MobileAuto-check passed
  • Liquid Glass Design

    AstraFoundry/KumoApp

    iOS 26 Liquid Glass design system — dynamic glass material with blur, reflection, and interactive morphing for SwiftUI, UIKit, and WidgetKit.

    290 GitHub starsUsed in 5 repos~2.3k tokens
    MobileAuto-check passed
  • Live-Device iOS QA

    garrytan/gstack

    Tests a SwiftUI app on a real iPhone connected by USB, reading the Swift source and then looping through screenshot, analysis and action to find bugs.

    136k GitHub stars~10k tokensUpdated today
    MobileAuto-check: notes

More from johnrogers/claude-swift-engineering

All 17 skills in this repo
  • Localization

    johnrogers/claude-swift-engineering

    A skill your agent uses when implementing internationalization (i18n), String Catalogs, pluralization, or right-to-left layout support.

    231 GitHub stars~749 tokensUpdated 8 mo ago
    Auto-check passed
  • Storekit

    johnrogers/claude-swift-engineering

    A skill your agent uses when implementing in-app purchases, StoreKit 2 subscriptions, consumables, non-consumables, or transaction handling.

    231 GitHub stars~799 tokensUpdated 8 mo ago
    Auto-check passed
  • Swift Style

    johnrogers/claude-swift-engineering

    Swift code style conventions for clean, readable code. An agent skill from johnrogers/claude-swift-engineering.

    231 GitHub stars~828 tokensUpdated 8 mo ago
    Auto-check passed
  • Composable Architecture

    johnrogers/claude-swift-engineering

    A skill your agent uses when building features with TCA (The Composable Architecture), structuring reducers, managing state, handling effects, navigation, or testing TCA features.

    231 GitHub stars~982 tokensUpdated 8 mo ago
    Auto-check passed
  • Foundation Models

    johnrogers/claude-swift-engineering

    A skill your agent uses when implementing on-device AI with Apple's Foundation Models framework (iOS 26+), building summarization/extraction/classification features, or using @Generable for…

    231 GitHub stars~869 tokensUpdated 8 mo ago
    Auto-check passed
  • Grdb

    johnrogers/claude-swift-engineering

    A skill your agent uses when writing raw SQL with GRDB, complex joins across 4+ tables, window functions, ValueObservation for reactive queries, or dropping down from SQLiteData for performance.

    231 GitHub stars~719 tokensUpdated 8 mo ago
    Auto-check passed

Works with

Categories

Questions about Swiftui Patterns

What does Swiftui Patterns do?

A skill your agent uses when implementing iOS 17+ SwiftUI patterns: @Observable/@Bindable, MVVM architecture, NavigationStack, lazy loading, UIKit interop, accessibility (VoiceOver/Dynamic Type)…. Swiftui Patterns is an agent skill from johnrogers/claude-swift-engineering.refreshable), or migrating from ObservableObject/@StateObject.

When should I use Swiftui Patterns?

Swiftui Patterns fits situations like: implementing iOS 17+ SwiftUI patterns: @Observable/@Bindable; MVVM architecture; navigationStack; accessibility (VoiceOver/Dynamic Type).

How do I install Swiftui Patterns in Claude Code?

Run `npx skills add johnrogers/claude-swift-engineering --skill swiftui-patterns -a claude-code`. Or copy the skill folder (plugins/swift-engineering/skills/swiftui-patterns in johnrogers/claude-swift-engineering) into .claude/skills/swiftui-patterns in your project. Claude Code loads it when a task matches its description.

How do I install Swiftui Patterns in Codex?

Run `npx skills add johnrogers/claude-swift-engineering --skill swiftui-patterns -a codex`. Or copy the skill folder (plugins/swift-engineering/skills/swiftui-patterns in johnrogers/claude-swift-engineering) into .agents/skills/swiftui-patterns in your project. Codex loads it when a task matches its description.

Can I use Swiftui Patterns in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add johnrogers/claude-swift-engineering --skill swiftui-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/swiftui-patterns, .gemini/skills/swiftui-patterns, .github/skills/swiftui-patterns and .opencode/skills/swiftui-patterns in your project.

What does Swiftui Patterns need to run?

SKILL.md names no scripts, command-line tools or credentials: Swiftui Patterns is instructions for the agent only.

Does Swiftui Patterns access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Swiftui Patterns safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Swiftui Patterns use?

Swiftui Patterns is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Swiftui Patterns use?

About 1.1k tokens (SKILL.md is roughly 4.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 6k tokens, read only when the agent opens those files.

What are the alternatives to Swiftui Patterns?

Skills that share tags, products or a category with Swiftui Patterns: Update Swiftui APIs (AvdLee/SwiftUI-Agent-Skill, 3.7k stars), Swiftui Liquid Glass (harperreed/dotfiles, 334 stars), Swiftui Expert Skill (omarshahine/HomeClaw, 176 stars) and Hig Project Context (raintree-technology/hig-doctor, 143 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Swiftui Patterns?

johnrogers (a GitHub user) maintains it in johnrogers/claude-swift-engineering, which has 231 GitHub stars. The repository holds 17 skills in this directory. The repository was last updated on January 18, 2026.

Source: johnrogers/claude-swift-engineering on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.