SwiftUI Expert Agent Skill

License: MIT Agent Skills

A Claude Code skill that guides writing, reviewing, and improving SwiftUI code — correct state management, modern APIs, view composition, performance, animations, accessibility, and iOS 26+ Liquid Glass styling.

Who is this for?

iOS developers who want AI-assisted guidance on:

  • Choosing the right property wrapper (@State, @Binding, @Observable, @Bindable)
  • Extracting and composing views following best practices
  • Replacing deprecated APIs with modern equivalents (iOS 18/26)
  • Optimizing performance and list identity
  • Loading data correctly (.task/.task(id:), offloading heavy work with @concurrent)
  • Applying correct animation and gesture patterns
  • Building custom layouts with the Layout protocol
  • Structuring app lifecycle and scenes, and persisting state (@AppStorage/@SceneStorage/SwiftData)
  • Adding accessibility and adaptive layout
  • Adopting Liquid Glass (iOS 26+) following HIG

Installation

Install via skills.sh:

npx skills add SwiftyJourney/swiftui-expert-skill

Compatible Agents

What the Skill Covers

Area Topics
State & Data Flow Property wrappers, persistence (@AppStorage/@SceneStorage/SwiftData/PreferenceKey), data loading (.task/.task(id:), @concurrent)
View Structure & Layout Composition and extraction, list identity, the custom Layout protocol
Modern APIs & Navigation iOS 18/26 replacements, NavigationStack/NavigationSplitView, scroll, text & localization
App Structure App protocol, scenes, WindowGroup, scenePhase
Performance Structural identity, view-update cost, AsyncImage/image optimization
Animation & Interaction Implicit/explicit, transitions, PhaseAnimator/KeyframeAnimator, gestures
Accessibility & Platform Semantic styling, @ScaledMetric, VoiceOver, iOS 26 Liquid Glass

Quick Start

Try these prompts:

Review this SwiftUI view for state management issues.
This view body is 200 lines. Help me break it down.
Update this code to use modern SwiftUI APIs.

The agent will follow the skill's workflow decision tree, reference the correct guide, provide corrected code, and explain why each pattern is preferred.

Skill File Structure

skills/swiftui-expert/                # the skill — this is what ships
├── SKILL.md                        # Hub: behavior contract, diagnostic table, reference router
└── references/
    ├── state-management.md             # Property wrapper selection guide
    ├── data-persistence.md             # @AppStorage, @SceneStorage, SwiftData, PreferenceKey
    ├── data-loading-and-tasks.md       # .task/.task(id:) entry points, @concurrent, cancellation
    ├── view-composition.md             # View extraction rules and patterns
    ├── layout-protocol.md              # Layout negotiation, custom Layout, alignment guides
    ├── modern-apis.md                  # iOS 18/26 API replacements
    ├── performance-patterns.md         # Optimization techniques and anti-patterns
    ├── list-patterns.md                # Stable identity, ForEach, LazyVStack
    ├── navigation-patterns.md          # NavigationStack, programmatic navigation
    ├── app-lifecycle-and-scenes.md     # App protocol, scenes, WindowGroup, scenePhase
    ├── animation-basics.md             # withAnimation, implicit/explicit
    ├── animation-transitions.md        # AnyTransition, matched geometry
    ├── animation-advanced.md           # PhaseAnimator, KeyframeAnimator
    ├── gestures.md                     # Gesture types, @GestureState, composition & precedence
    ├── scroll-patterns.md              # scrollPosition, scrollTargetBehavior
    ├── text-formatting.md              # AttributedString, formatting, localization
    ├── image-optimization.md           # AsyncImage, caching strategies
    ├── accessibility-patterns.md       # Semantic styling, @ScaledMetric, VoiceOver
    └── liquid-glass.md                 # iOS 26 Liquid Glass API and HIG guidance
evals/                              # Trigger eval queries + output-quality tests (repo-only)
.claude-plugin/                     # plugin + marketplace manifests (repo-only)

Related Skills

Credits

  • Natalia Panferova (Nil Coalescing) — "SwiftUI Fundamentals" and "The SwiftUI Way", which informed the patterns, performance, layout, gesture, and lifecycle guidance
  • Matteo Manferdini — SwiftUI view composition methodology
  • Apple — SwiftUI documentation, WWDC sessions, and Human Interface Guidelines

License

MIT — see LICENSE.