Skip to main content
skill CX Codex

swiftui-advanced — Claude Code skill: what it does, how to install

swiftui-advanced — a Claude Code skill providing advanced SwiftUI workflows for multi-gesture composition, layout adaptation, architecture choice, and profiling.

MIT ★ 233 updated 2026-01-18

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add johnrogers/claude-swift-engineering
/plugin install swift-engineering@claude-swift-engineering
Open on GitHub

What swiftui-advanced does

This skill equips Claude Code with decision frameworks for non-trivial SwiftUI engineering. It outlines how to compose gestures via .simultaneously, .sequenced, or .exclusively, when to swap between ViewThatFits and AnyLayout, and how to track dimensions safely using .onGeometryChange.

The guidance relies on focused reference files spanning gestures, layouts, architecture choices, and Instruments 26 profiling routines. It flags known traps such as render loops sparked by .onGeometryChange updates or heavy processing placed straight inside the view body.

Architecture selection is strict: smaller apps follow @Observable with State-as-Bridge, while codebases requiring deep testability are directed toward TCA.

What it helps with

  • compose gestures using simultaneous, sequenced, or exclusive chains
  • decide between TCA, MVVM, and State-as-Bridge for app architecture
  • switch dynamic interfaces smoothly using AnyLayout instead of ViewThatFits
  • prevent circular layout recalculations triggered by onGeometryChange

Example prompts for the agent

  • Compose a drag and a long press gesture using the sequenced pattern
  • Which architecture suits this SwiftUI view: TCA or Observable MVVM?
  • Fix view body re-evaluations and isolate heavy computations

How to install swiftui-advanced

1Plugin marketplace

/plugin marketplace add johnrogers/claude-swift-engineering
/plugin install swift-engineering@claude-swift-engineering

This installs the whole swift-engineering plugin with all its skills

2Skills CLI (Vercel)

npx skills add johnrogers/claude-swift-engineering --skill swiftui-advanced -a claude-code

3Manually: put the files in place

~/.claude/skills/swiftui-advanced/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/swiftui-advanced/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about swiftui-advanced

How to install swiftui-advanced in Claude Code?

Add the repository using /plugin marketplace add johnrogers/claude-swift-engineering, then run /plugin install swift-engineering@claude-swift-engineering.

What does swiftui-advanced do?

It guides Claude Code on implementing complex SwiftUI tasks, including gesture sequencing, responsive layouts, Instruments profiling, and architectural structuring.

Why does it restrict ViewThatFits usage?

It flags that ViewThatFits remeasures on every layout cycle, recommending AnyLayout instead whenever animating transitions between horizontal and vertical stacks.

Source text

SKILL.md · MIT
---
name: swiftui-advanced
description: Use when implementing gesture composition (simultaneous, sequenced, exclusive), adaptive layouts (ViewThatFits, AnyLayout, size classes), or choosing architecture patterns (MVVM vs TCA vs vanilla, State-as-Bridge). Covers advanced SwiftUI patterns beyond basic views.
---

# SwiftUI Advanced

Advanced SwiftUI patterns for gesture composition, adaptive layouts, architecture decisions, and performance optimization.

## 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.

| Reference | Load When |
|-----------|-----------|
| **[Gestures](references/gestures.md)** | Composing multiple gestures, GestureState, custom recognizers |
| **[Adaptive Layout](references/adaptive-layout.md)** | ViewThatFits, AnyLayout, size classes, iOS 26 free-form windows |
| **[Architecture](references/architecture.md)** | MVVM vs TCA decision, State-as-Bridge, property wrapper selection |
| **[Performance](references/performance.md)** | Instruments 26, view body optimization, unnecessary updates |

## Core Workflow

1. **Identify pattern category** from user's question
2. **Load relevant reference** for detailed patterns and code examples
3. **Apply pattern** following the decision trees and anti-patterns
4. **Verify** using provided checklists or profiling guidance

## Decision Trees

### Gesture Composition
- Both gestures at same time? -> `.simultaneously`
- One must complete before next? -> `.sequenced`
- Only one should win? -> `.exclusively`

### Layout Adaptation
- Pick best-fitting variant? -> `ViewThatFits`
- Animated H/V switch? -> `AnyLayout`
- Need actual dimensions? -> `onGeometryChange`

### Architecture Selection
- Small app, Apple patterns? -> @Observable + State-as-Bridge
- Complex presentation logic? -> MVVM with @Observable
- Rigorous testability needed? -> TCA

## Common Mistakes

1. **Gesture composition order matters** — `.simultaneously` and `.sequenced` have different trigger timing. Swapping them silently changes behavior. Understand gesture semantics before using.

2. **ViewThatFits over-used** — ViewThatFits remeasures on every view change. For animated H/V switches, use `AnyLayout` instead. Use ViewThatFits only for static variant selection.

3. **onGeometryChange triggering unnecessary updates** — Reading geometry changes geometry, which triggers updates, which changes geometry... circular. Use `.onGeometryChange` only with proper state management to avoid loops.

4. **Architecture mismatch mid-project** — Starting with @Observable + State-as-Bridge then realizing you need TCA is expensive. Choose architecture upfront based on complexity (small app = @Observable, complex = TCA).

5. **Ignoring view body optimization** — Computing expensive calculations in view body repeatedly kills performance. Move calculations to properties or models. Profile with Instruments 26 before optimizing prematurely.

© John Rogers (@johnrogers) · MIT · johnrogers/claude-swift-engineering

Similar skills

All skills for Mobile →

From the same set33

The whole set →
swift-engineer swift-engineer — a Claude subagent that writes vanilla Swift for models, services, networking and persistence when the plan rules out TCA. CX Codex ★ 233repo stars grdb Guides Claude Code in writing direct SQLite queries, schema migrations, and reactive observations with GRDB.swift on iOS and macOS. CX Codex +1 ★ 233repo stars swift-diagnostics The swift-diagnostics skill guides investigations into navigation, build, and memory issues in iOS and macOS projects. Use it to follow diagnostic checks before changing code. CX Codex +1 ★ 233repo stars localization Walks the agent through iOS localization: String Catalogs, plural forms, locale-aware formats and right-to-left layout. CX Codex +1 ★ 233repo stars haptics Add tactile responses for confirmations, errors, and custom patterns in an iOS app. The skill helps choose between UIKit feedback generators and Core Haptics. CX Codex +1 ★ 233repo stars storekit Walks an agent through StoreKit 2 purchases: the .storekit config, a StoreManager, transaction verification and SwiftUI product views. CX Codex +1 ★ 233repo stars swift-code-reviewer swift-code-reviewer inspects Swift and iOS implementations for concurrency safety, HIG rules, TCA patterns, and security before testing. CX Codex ★ 233repo stars ios-26-platform The ios-26-platform skill guides iOS 26 feature work in SwiftUI and helps preserve support for iOS 17/18. Use it when updating an interface or handling backward compatibility. CX Codex +1 ★ 233repo stars

Project sponsors

Companies that keep this analytics open