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
/plugin marketplace add johnrogers/claude-swift-engineering
/plugin install swift-engineering@claude-swift-engineeringWhat 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-engineeringThis 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-code3Manually: put the files in place
~/.claude/skills/swiftui-advanced/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/swiftui-advanced/
1Skills CLI (Vercel)
npx skills add johnrogers/claude-swift-engineering --skill swiftui-advanced -a codex2Manually: put the files in place
.agents/skills/swiftui-advanced/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add johnrogers/claude-swift-engineering --skill swiftui-advanced -a cursor2Manually: put the files in place
.cursor/skills/swiftui-advanced/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install johnrogers/claude-swift-engineering plugins/swift-engineering/skills/swiftui-advanced2Manually: put the files in place
.github/skills/swiftui-advanced/SKILL.md1Skills CLI (Vercel)
npx skills add johnrogers/claude-swift-engineering --skill swiftui-advanced -a gemini-cli2Platform CLI
gemini skills install https://github.com/johnrogers/claude-swift-engineering --path plugins/swift-engineering/skills/swiftui-advancedManually: put the files in place
.devin/skills/swiftui-advanced/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
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