swiftui-patterns

swiftui-patterns is a skill for Claude Code, Codex from Cyvid7-Darus10/claude-code-config. It costs 34 tokens per session (1,565 once invoked), scanned A, a copy of swiftui-patterns, MIT.

A pattern guide for building SwiftUI interfaces, the Apple framework for creating app screens in Swift. It covers screen structure, data flow, navigation, and rendering performance.

In plain words
What is it for?
Use it when building iPhone, iPad, or Mac interfaces with SwiftUI, including forms, navigation stacks, view models, shared dependencies, lists, and other complex views.
Why use it?
It helps developers choose suitable state-management tools and organize complex screens without creating confusing data flow or unnecessary rendering work.

Skill for Claude CodeCodex

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/cyvid7-darus10/claude-code-config/swiftui-patterns
Any agent
npx skills add Cyvid7-Darus10/claude-code-config --skill swiftui-patterns
Clone the repo
git clone --depth 1 https://github.com/Cyvid7-Darus10/claude-code-config

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/cyvid7-darus10/claude-code-config/swiftui-patterns.svg)](https://agentmods.dev/skills/cyvid7-darus10/claude-code-config/swiftui-patterns)
Your own site
<a href="https://agentmods.dev/skills/cyvid7-darus10/claude-code-config/swiftui-patterns"><img src="https://agentmods.dev/badge/skills/cyvid7-darus10/claude-code-config/swiftui-patterns.svg" alt="Measured on agentmods" height="20"></a>
Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,565 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 94% copy Near-identical to another mod 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.00034 $0.01565
Opus 5 $0.00017 $0.00783
Sonnet 5 $0.00007 $0.00313
Haiku 4.5 $0.00003 $0.00156

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

Security

Grade A, and why

swiftui-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 5d 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.

Origin

This is a copy

94% identical to swiftui-patterns — 3 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/swiftui-patterns/SKILL.md · 260 lines

How it starts

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

SwiftUI Patterns

Modern SwiftUI patterns for building declarative, performant user interfaces on Apple platforms. Covers the Observation framework, view composition, type-safe navigation, and performance optimization.

When to Activate

  • Building SwiftUI views and managing state (@State, @Observable, @Binding)
  • Designing navigation flows with NavigationStack
  • Structuring view models and data flow
  • Optimizing rendering performance for lists and complex layouts
  • Working with environment values and dependency injection in SwiftUI

State Management

Property Wrapper Selection

Choose the simplest wrapper that fits:

Wrapper Use Case
@State View-local value types (toggles, form fields, sheet presentation)
@Binding Two-way reference to parent's @State
@Observable class + @State Owned model with multiple properties
@Observable class (no wrapper) Read-only reference passed from parent
@Bindable Two-way binding to an @Observable property
@Environment Shared dependencies injected via .environment()

@Observable ViewModel

Use @Observable (not ObservableObject) — it tracks property-level changes so SwiftUI only re-renders views that read the changed property:

@Observable
final class ItemListViewModel {
    private(set) var items: [Item] = []
    private(set) var isLoading = false
    var searchText = ""

    private let repository: any ItemRepository

    init(repository: any ItemRepository = DefaultItemRepository()) {
        self.repository = repository
    }

    func load() async {
        isLoading = true
        defer { isLoading = false }
        items = (try? await repository.fetchAll()) ?? []
    }
}

View Consuming the ViewModel

struct ItemListView: View {
    @State private var viewModel: ItemListViewModel

    init(viewModel: ItemListViewModel = ItemListViewModel()) {
        _viewModel = State(initialValue: viewModel)
    }

    var body: some View {
        List(viewModel.items) { item in
            ItemRow(item: item)
        }
        .searchable(text: $viewModel.searchText)
        .overlay { if viewModel.isLoading { ProgressView() } }
        .task { await viewModel.load() }
    }
}

Read the full file on GitHub · 260 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. 5d ago First seen · 260 lines · 34 tokens per session scan A c27f90145101

Subscribe to this mod's changes

swiftui-patterns is a skill published in the GitHub repository Cyvid7-Darus10/claude-code-config (2 stars, last pushed 2mo ago), licensed MIT. It adds 34 tokens to every session and 1,565 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. It is 94% identical to swiftui-patterns, differing in 3 lines, and is treated as a copy.

Related

Other skills, from other repositories

agent-device

Automates Apple-platform apps (iOS, tvOS, macOS), Android devices, and Amazon Vega OS TV apps in Vega Virtual Devices. Use when navigating apps, taking snapshots/screenshots where supported, driving TV remotes, tapping, typing, scrolling, extracting UI info, collecting evidence, or planning agent-device CLI commands.

callstack/agent-device · 69 tokens

ios-simulator

Verify and debug native, React Native, Expo, or Flutter apps on an iOS Simulator with agent-device. Use when an agent needs to launch an app, inspect its live UI, tap, type, scroll, validate a code change, collect failure evidence, or reproduce a workflow on an iPhone or iPad Simulator.

callstack/agent-device · 69 tokens

dogfood

Systematically explore and test a mobile app on iOS/Android with agent-device to find bugs, UX issues, and other problems. Use when asked to dogfood, QA, exploratory test, find issues, bug hunt, or test this app on mobile.

callstack/agent-device · 55 tokens

mobile-use-setup

Set up a local-first Minitap mobile-use SDK project for iOS or Android, including local devices, BrowserStack, Minitap cloud devices, and supported LLM providers.

minitap-ai/mobile-use · 42 tokens

cocoplus-config

CocoPlus configuration SSOT — $cocoplus sync propagates cocoplus.toml into downstream artifacts; $cocoplus migrate-config converts legacy safety-config.json. Invoked via $cocoplus sync and $cocoplus migrate-config.

Snowflake-Labs/cocoplus · 56 tokens

designing-bench-task

Use when designing a new benchenv task suite, adding several new tasks to an existing suite, or critiquing a task-set proposal for a mobile-gym App — before any class FooTask(...) is written under benchenv/task/.

Purewhiter/mobilegym · 57 tokens