swiftui-view-architect

swiftui-view-architect is a skill for Claude Code, Codex from Xopoko/build-swift-apps. It costs 36 tokens per session (522 once invoked), scanned A, original, MIT.

A skill for breaking oversized SwiftUI view files into smaller, dedicated views while keeping data flow and dependencies explicit. SwiftUI is Apple's framework for declaring app interfaces in Swift.

In plain words
What is it for?
Use it to refactor SwiftUI screens, extract subviews, organize state and bindings, move actions out of view bodies, and apply Observation correctly.
Why use it?
Large view files can mix layout, state, actions, and business logic, making changes harder to understand and maintain. The skill separates these responsibilities while preserving the root view structure.

Skill for Claude CodeCodex

Written for Claude Code and Codex: shipped in a Claude Code plugin, but also agents/openai.yaml present.

Part of the build-swift-apps plugin — 61 skills, 3 commands, 3 MCP servers shipped together

Good fit Use it to refactor SwiftUI screens, extract subviews, organize state and bindings, move actions out of view bodies, and apply Observation correctly.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/xopoko/build-swift-apps/swiftui-view-architect
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 Xopoko/build-swift-apps --skill swiftui-view-architect
Clone the repo
git clone --depth 1 https://github.com/Xopoko/build-swift-apps

Made for: Claude Code, Codex.

Or install build-swift-apps, the plugin that ships this one along with the rest of its 61 skills, 3 commands, 3 MCP servers.

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-view-architect

README.md
[![agentmods](https://agentmods.dev/badge/skills/xopoko/build-swift-apps/swiftui-view-architect/github.svg)](https://agentmods.dev/skills/xopoko/build-swift-apps/swiftui-view-architect)
Your own site
<a href="https://agentmods.dev/skills/xopoko/build-swift-apps/swiftui-view-architect"><img src="https://agentmods.dev/badge/skills/xopoko/build-swift-apps/swiftui-view-architect/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 swiftui-view-architect

Your own site · 80×15
<a href="https://agentmods.dev/skills/xopoko/build-swift-apps/swiftui-view-architect"><img src="https://agentmods.dev/badge/skills/xopoko/build-swift-apps/swiftui-view-architect.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 522 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00036 $0.00522
Opus 5 $0.00018 $0.00261
Sonnet 5 $0.00007 $0.00104
Haiku 4.5 $0.00004 $0.00052

Measured 11d ago against content hash 47a07ebbb087, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

swiftui-view-architect 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 11d 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/swiftui-view-architect/SKILL.md · 53 lines

How it starts

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

SwiftUI View Architect

Default to vanilla SwiftUI: local state in views, shared dependencies in environment/services, business logic outside view bodies, and view models only when requested or already present.

Ordering

Preserve stronger local conventions; otherwise order stored members top-to-bottom:

  1. environment
  2. let inputs
  3. @State/other stored properties
  4. non-view computed vars
  5. init
  6. body
  7. view builders/helpers
  8. actions/async helpers

Rules

  • Prefer MV over MVVM. Do not introduce a view model just to mirror local state or wrap environment dependencies.
  • Split long bodies into dedicated View types with explicit inputs/bindings/callbacks. Keep computed some View helpers small and rare.
  • Extract non-trivial button actions and side effects from body; call private methods, and move real domain logic into services/models.
  • Keep a stable root view tree. Avoid top-level if/else swapping entire root branches; localize conditions in sections/modifiers/overlays/toolbars.
  • If a view model exists, prefer non-optional state initialized in init:
    @State private var viewModel: SomeViewModel
    init(dependency: Dependency) {
      _viewModel = State(initialValue: SomeViewModel(dependency: dependency))
    }
    
  • For @Observable owners on iOS 17+, store as @State and pass explicitly. For iOS 16 or earlier, use @StateObject owner and @ObservedObject injection.
  • Keep behavior/layout intact unless the user asked for a product change.

Workflow

  1. Reorder the view.
  2. Move inline actions/effects out of body.
  3. Extract meaningful sections into dedicated subviews; move reusable/independent subviews to files.
  4. Stabilize root structure.
  5. Normalize view model and Observation usage.
  6. Build/test the touched surface.

Large Views

For ~300+ line files, split aggressively into section views and small private helpers. // MARK: extensions can organize actions/helpers but are not a substitute for extracting real subviews.

Read the full file on GitHub · 53 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 11d ago First seen · 53 lines · 36 tokens per session scan A 47a07ebbb087

Subscribe to this mod's changes

swiftui-view-architect is a skill published in the GitHub repository Xopoko/build-swift-apps (45 stars, last pushed 13d ago), licensed MIT. It adds 36 tokens to every session and 522 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-30.

Related

Other skills, from other repositories

flutter-codestyle

Custom Instructions: Senior Flutter & Dart Engineer.

GulajavaMinistudio/awesome-copilot-id · 13 tokens

ios-agent-skill

Expert iOS/Swift developer behavior for AI coding agents. Use when writing, reviewing, or refactoring Swift, SwiftUI, UIKit, or SwiftData code; when designing iOS app architecture (MVVM, Clean Architecture, coordinators, routing); when building UI that must meet Apple's Human Interface Guidelines, contrast, dark-mode…

Nagarjuna2997/ios-agent-skill · 167 tokens

bootstrap-ios

Bootstrap agents for iOS, iPadOS, macOS, Swift, SwiftUI, SwiftData/Core Data, Swift Testing, Xcode build/test/debug, Simulator, App Intents, or XcodeBuildMCP work. Use before building, fixing, refactoring, QAing, or setting up Apple-platform repos, and when asked to load/install Ray's iOS skills or bootstrap iOS.

RayFernando1337/rayfernando-skills · 84 tokens

swiftui-skills

Apple-authored SwiftUI and platform guidance extracted from Xcode. Helps AI agents write idiomatic, Apple-native SwiftUI with reduced hallucinations.

ameyalambat128/swiftui-skills · 34 tokens

ios-standards

Swift 6.0+ standards — strict concurrency, @MainActor isolation, @Observable (not ObservableObject), and modern SwiftUI architecture for iOS 26+. Use when writing or reviewing Swift code, structuring ViewModels and services, or resolving concurrency and isolation design questions. Trigger on "Swift 6", "strict…

markdavidgan/apple-dev-skills · 90 tokens

uikit-expert

Write, review, or improve UIKit code following best practices for view controller lifecycle, Auto Layout, collection views, navigation, animation, memory management, and modern iOS 18–26 APIs. Use when building new UIKit features, refactoring existing views or view controllers, reviewing code quality, adopting modern…

zinxj/uikit-expert-skill · 95 tokens