# Swiftui Expert Skill

Use when writing, reviewing, or refactoring SwiftUI code for iOS or macOS, including...

- Repository: https://github.com/AvdLee/SwiftUI-Agent-Skill (3804 stars)
- Category: Design
- License: MIT
- Last updated: 2026-10-06
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add AvdLee/SwiftUI-Agent-Skill --skill swiftui-expert-skill -g -a claude-code -y`
Codex: `npx skills add AvdLee/SwiftUI-Agent-Skill --skill swiftui-expert-skill -g -a codex -y`
Cursor: `npx skills add AvdLee/SwiftUI-Agent-Skill --skill swiftui-expert-skill -g -a cursor -y`
Gemini CLI: `npx skills add AvdLee/SwiftUI-Agent-Skill --skill swiftui-expert-skill -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add AvdLee/SwiftUI-Agent-Skill`

## Description

Use when writing, reviewing, or refactoring SwiftUI code for iOS or macOS, including state and `@Observable` data flow, view composition, resizable layouts, safe areas, display scale, performance, lists, environment, localization, animation, Liquid Glass, and API migration. Also use for iPhone Duo, foldable, or large-display layouts (`NavigationSplitView` on large displays, iPhone tab sidebar, two-column reflow, foldable grids, `ArrangementView`, `ReservedRegion`), hinge effects, vertical bars, `@State` initialization or synthesized-property diagnostics, `@ContentBuilder` ambiguity, `reorderable` drag/drop, custom `AsyncImage` `URLSession`, swipe actions outside List, item-bound `alert`/`confirmationDialog`, `ToolbarOverflowMenu`, `AnimatableValues`, Document APIs (`Document`/`DocumentReader`), and Instruments `.trace` capture or analysis.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# SwiftUI Expert Skill

## Operating Rules

- Treat each `View` type as an invalidation boundary: give it only the data it reads and keep frequently changing dependencies close to the smallest affected subtree
- Search `references/latest-apis.md` when writing, reviewing, or migrating API usage; look up only the APIs relevant to the task
- Replace hard-deprecated APIs with modern equivalents. During feature work, flag soft-deprecated APIs and leave them in place (see `references/soft-deprecation.md`)
- Prefer native SwiftUI APIs over UIKit/AppKit bridging unless bridging is necessary
- Focus on correctness and performance; do not enforce specific architectures (MVVM, VIPER, etc.)
- Encourage separating business logic from views for testability without mandating how
- Follow Apple's Human Interface Guidelines and API design patterns
- Only adopt Liquid Glass when explicitly requested by the user (see `references/liquid-glass.md`)
- Present performance optimizations as suggestions, not requirements
- Use `#available` gating with sensible fallbacks for version-specific APIs
- For layout and rendering inputs, read the value nearest the SwiftUI view that consumes it; do not substitute process-global screen state

## Task Workflow

### Review existing SwiftUI code
- Read the code under review and identify which topics apply
- Flag deprecated APIs (compare against `references/latest-apis.md`); replace hard-deprecated APIs, and flag soft-deprecated APIs without rewriting them unless the user asked to migrate
- Run the Topic Router below for each relevant topic
- Validate `#available` gating and fallback paths for version-specific features
- For broad codebase reviews, first identify smaller focus areas and present them one at a time; if the user requests a whole-codebase review, divide it into a TODO list

The rest: https://github.com/AvdLee/SwiftUI-Agent-Skill/blob/HEAD/skills/swiftui-expert-skill/SKILL.md
