Agent skill

swiftui-expert

Write, review, or improve SwiftUI code.

15 files · 126.9 KB · Source ↗ · Raw SKILL.md · Markdown directory · Download skill.tgz

Copy the prompt. Paste it into your agent.

Verify the bytes and inspect the files before trusting a skill. A matching hash is not a safety review.

Read the install prompt
Full inline prompt for offline use

Includes SKILL.md. Supporting files still require a download.

Install from a shell

Run this in a terminal. It downloads the pinned archive, checks its SHA-256 digest, and extracts it into ~/.claude/skills, where Claude Code loads skills. For Codex and other agents that read ~/.agents/skills, edit the SKILLS_DIR line. If the skill is already installed, the command stops and changes nothing.

SwiftUI Expert

Overview

Use this skill to build, review, or improve SwiftUI features with correct state management, modern API usage, Swift concurrency best practices, optimal view composition, and iOS 26+ Liquid Glass styling. Prioritize native APIs, Apple design guidance, and performance-conscious patterns. This skill focuses on facts and best practices without enforcing specific architectural patterns.

Workflow Decision Tree

1) Review existing SwiftUI code

2) Improve existing SwiftUI code

3) Implement new SwiftUI feature

Core Guidelines

State Management

Modern APIs

Swift Best Practices

View Composition

Performance

Animations

Liquid Glass (iOS 26+)

Only adopt when explicitly requested by the user.

Quick Reference

Property Wrapper Selection (Modern)

Wrapper Use When
@State Internal view state (must be private), or owned @Observable class
@Binding Child modifies parent's state
@Bindable Injected @Observable needing bindings
let Read-only value from parent
var Read-only value watched via .onChange()

Legacy (Pre-iOS 17):

Wrapper Use When
@StateObject View owns an ObservableObject (use @State with @Observable instead)
@ObservedObject View receives an ObservableObject

Modern API Replacements

Deprecated Modern Alternative
foregroundColor() foregroundStyle()
cornerRadius() clipShape(.rect(cornerRadius:))
tabItem() Tab API
onTapGesture() Button (unless need location/count)
NavigationView NavigationStack
onChange(of:) { value in } onChange(of:) { old, new in } or onChange(of:) { }
fontWeight(.bold) bold()
GeometryReader containerRelativeFrame() or visualEffect()
showsIndicators: false .scrollIndicators(.hidden)
String(format: "%.2f", value) Text(value, format: .number.precision(.fractionLength(2)))
string.contains(search) string.localizedStandardContains(search) (for user input)

Liquid Glass Patterns

// Basic glass effect with fallback
if #available(iOS 26, *) {
    content
        .padding()
        .glassEffect(.regular.interactive(), in: .rect(cornerRadius: 16))
} else {
    content
        .padding()
        .background(.ultraThinMaterial, in: RoundedRectangle(cornerRadius: 16))
}

// Grouped glass elements
GlassEffectContainer(spacing: 24) {
    HStack(spacing: 24) {
        GlassButton1()
        GlassButton2()
    }
}

// Glass buttons
Button("Confirm") { }
    .buttonStyle(.glassProminent)

Review Checklist

State Management

Modern APIs (see references/modern-apis.md)

Sheets & Navigation (see references/sheet-navigation-patterns.md)

ScrollView (see references/scroll-patterns.md)

Text & Formatting (see references/text-formatting.md)

View Structure (see references/view-structure.md)

Performance (see references/performance-patterns.md)

List Patterns (see references/list-patterns.md)

Layout (see references/layout-best-practices.md)

Animations (see references/animation-basics.md, references/animation-transitions.md, references/animation-advanced.md)

Liquid Glass (iOS 26+)

References

Philosophy

This skill focuses on facts and best practices, not architectural opinions:

Files

15 files · 126.9 KB