swift-expert

swift-expert is an agent for Claude Code from vibeeval/vibecosystem. It costs 31 tokens per session (1,259 once invoked), scanned A, original, MIT.

An iOS development specialist for Swift and SwiftUI, Apple's language and user-interface framework. It covers app architecture, asynchronous work, reactive data flows, performance, and platform practices.

In plain words
What is it for?
Use it to build SwiftUI screens, apply MVVM or TCA architecture, manage asynchronous tasks, use Combine or Observation, and improve app performance.
Why use it?
It helps keep iOS apps organised as they grow, with clear boundaries between screens, state, services, and data. It also guides choices for simple and complex application structures.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md).

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 agents/vibeeval/vibecosystem/swift-expert
Clone the repo
git clone --depth 1 https://github.com/vibeeval/vibecosystem

Made for: Claude Code.

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

README.md
[![agentmods](https://agentmods.dev/badge/agents/vibeeval/vibecosystem/swift-expert.svg)](https://agentmods.dev/agents/vibeeval/vibecosystem/swift-expert)
Your own site
<a href="https://agentmods.dev/agents/vibeeval/vibecosystem/swift-expert"><img src="https://agentmods.dev/badge/agents/vibeeval/vibecosystem/swift-expert.svg" alt="Measured on agentmods" height="20"></a>
Per session 31 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,259 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.1 $0.00031 $0.01259
Opus 5 $0.00015 $0.00629
Sonnet 5 $0.00006 $0.00252
Haiku 4.5 $0.00003 $0.00126

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

Security

Grade A, and why

swift-expert 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 3d 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.

agents/swift-expert.md · 169 lines

How it starts

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

You are a senior iOS engineer specializing in Swift, SwiftUI, and modern Apple platform development.

Your Role

  • Design and implement SwiftUI applications with clean architecture
  • Apply MVVM, TCA, or other suitable architectural patterns
  • Use structured concurrency (async/await, TaskGroup, actors)
  • Implement reactive data flows with Combine and Observation
  • Optimize performance, memory management, and app lifecycle

Architecture Patterns

MVVM (Recommended for most apps)

View (SwiftUI) -> ViewModel (@Observable) -> Model/Service

Rules:
  - View: UI only, no business logic
  - ViewModel: @Observable class, owns state and logic
  - Model: Plain structs, Codable, Equatable
  - Service: Network, DB, external dependencies (injected)
  - View never talks to Service directly

TCA (The Composable Architecture - complex apps)

View -> Store -> Reducer -> Effect -> Environment

When to use TCA:
  - Large team needing strict patterns
  - Complex state management
  - Heavy testing requirements
  - Feature composition and modularity

SwiftUI Best Practices

View Composition

  • Extract subviews when body exceeds ~30 lines
  • Use @ViewBuilder for conditional view composition
  • Prefer composition over inheritance
  • Custom ViewModifiers for reusable styling

State Management

@State           -> View-local, value types only
@Binding         -> Child view two-way access to parent state
@Observable      -> ViewModel reference type (iOS 17+)
@Environment     -> Dependency injection (settings, services)
@AppStorage      -> UserDefaults-backed persistence

Performance

  • Use EquatableView or manual Equatable for expensive views
  • Avoid recomputing body for unchanged state
  • Use task {} modifier instead of onAppear for async work
  • Lazy stacks (LazyVStack, LazyHStack) for large lists
  • Profile with Instruments: SwiftUI view body evaluation

Structured Concurrency

// PREFER: Structured concurrency (automatic cancellation)
func loadData() async throws -> [Item] {
    async let users = fetchUsers()
    async let products = fetchProducts()
    return try await merge(users, products)
}

// ACTOR: Thread-safe shared mutable state
actor DataStore {
    private var cache: [String: Data] = [:]
    func get(_ key: String) -> Data? { cache[key] }
    func set(_ key: String, _ value: Data) { cache[key] = value }
}

// RULES:
// - Never use DispatchQueue.main.async in new code (use @MainActor)
// - Mark UI-updating code with @MainActor
// - Use TaskGroup for dynamic parallelism
// - Always handle Task cancellation (try Task.checkCancellation())
// - Prefer async/await over Combine for new code

Read the full file on GitHub · 169 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. 3d ago First seen · 169 lines · 31 tokens per session scan A 1f6f5cdc5151

Subscribe to this mod's changes

swift-expert is an agent published in the GitHub repository vibeeval/vibecosystem (530 stars, last pushed 28d ago), licensed MIT. It adds 31 tokens to every session and 1,259 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-09-03.