SwiftUI Expert Guide
Actionable expert guidance for building, reviewing, and profiling SwiftUI apps.
No malware, credential theft, or covert exfiltration red flags are visible. The skill asks the agent to confirm the Instruments target and scopes trace output to a specified path. However, recording with xctrace, writing files, and external installation commands create side effects without consistent permission disclosure, sensitive-data handling, data-flow transparency, rollback guidance, or explicit confirmation at each consequential step, so points are deducted.
The operating rules, workflows, topic router, fallback guidance, and trace stop mechanism are broadly coherent. Static material does not establish that all referenced files and scripts exist or run, and provides no committed tests, CI coverage, or consistently diagnosable feedback for abnormal inputs. The score is reduced under the static calibration cap and uncertainty.
The name, audience, and SwiftUI/iOS/macOS, review, refactoring, implementation, and Instruments scenarios are clear, with recognizable trace triggers and some non-fit guidance. Complete non-fit boundaries, Chinese-language behavior, tool-environment compatibility, and mainland-China reachability are not specified; installation and external documentation partly depend on overseas services, so points are deducted.
SKILL.md has useful progressive structure through operating rules, workflows, topic routing, checklists, and references. The README supplies several installation paths, MIT metadata, and version-related notes. Clear maintenance ownership, update path, changelog, and complete dependency/troubleshooting notes for referenced scripts and files are missing, so points are deducted.
The material covers state management, performance, accessibility, animation, charts, and trace analysis, and its examples can usually be converted into actionable review guidance. The core value is plausible, but representative outputs, execution results, and comparative benefit over alternatives are not verified; referenced scripts and files are also not fully evidenced. The static ceiling therefore limits the score.
Some Apple WWDC links, API availability annotations, and concrete code examples provide audit trails. There is no committed test suite, real CI execution evidence, or broad corroboration across independent sources, and many claims lack item-level attribution, so static verifiability remains limited.
- The referenced latest-apis document, trace scripts, and other resources are not fully included in the supplied material; verify their presence, versions, and permissions before installation or execution.
- Instruments traces may contain application-performance and user-behavior information; confirm the target, output location, and sensitivity before recording, and do not upload traces without consent.
- Some APIs, WWDC materials, and installation paths depend on Apple, GitHub, or other overseas services; verify mainland-China reachability and prepare offline or local alternatives.
- Compile and SDK-test examples before relying on them, especially iOS 26+ APIs, Charts APIs, and image-processing code.
What it does & when to use it
This Agent Skill supports SwiftUI development for iOS and macOS, covering state management, view composition, list identity, environment usage, localization, animation, accessibility, and performance. It instructs the agent to consult the relevant reference files for each task and to check current APIs before making recommendations. It also includes xctrace-based Instruments workflows for recording and analyzing hangs, hitches, CPU hotspots, and excessive SwiftUI updates. It is a good fit for teams that want an AI coding tool to apply modern SwiftUI practices consistently.
The agent reads references/latest-apis.md first, then loads topic-specific references for state management, view structure, performance, lists, animation, accessibility, macOS, Liquid Glass, or other applicable areas. For SwiftUI code, it checks property-wrapper choices, stable ForEach identity, availability gating, animation usage, preview data, and other correctness rules, then suggests or performs changes according to the request. When a .trace file is provided, it can run scripts/analyze_trace.py to inspect Time Profiler, Hangs, Animation Hitches, SwiftUI updates, and SwiftUI cause graphs. For recording requests, it can run scripts/record_trace.py around xctrace, including device discovery, process attachment, stop-file control, and .trace output.
- An iOS or macOS developer is implementing a SwiftUI feature and wants help defining state ownership and data flow.
- A team is reviewing or refactoring SwiftUI code and needs checks for deprecated APIs, property wrappers, and invalidation scope.
- A developer is building lists, ForEach views, scrolling, navigation, sheets, or animations and wants to avoid identity and update problems.
- A team is adopting iOS 26+ APIs or Liquid Glass and needs #available checks with sensible fallbacks.
- A developer has an Instruments .trace file and wants a prioritized plan based on main-thread coverage, hot symbols, and SwiftUI cause graphs.
- A product team needs guidance on localization, VoiceOver, Dynamic Type, or chart accessibility in SwiftUI.
Pros & cons
- Covers a broad SwiftUI surface, from state and view structure to performance, accessibility, charts, and macOS scenes.
- Provides task-specific reference files and a concrete correctness checklist.
- Includes trace recording, scoped analysis, cause-graph inspection, and source-mapping workflows for Instruments traces.
- Does not mandate MVVM, VIPER, or another architecture, making it usable with existing project structures.
- Released under the MIT License and follows the Agent Skills open format.
- The strongest guidance depends on loading the repository's reference files in addition to SKILL.md.
- Trace recording and analysis require the macOS/Xcode toolchain and xctrace, so that workflow is not fully portable.
- SwiftUI Instruments data is empty for iOS Simulator, requiring the Time Profiler template instead.
- The supplied material does not document an independent test suite or cross-tool validation results.
How to install
Install the specific skill from the repository with:
npx skills add https://github.com/avdlee/swiftui-agent-skill --skill swiftui-expert-skill
Alternatively, clone the repository and install or symlink the swiftui-expert-skill/ folder according to the target tool's official skill-directory instructions. For Codex/OpenAI-compatible tools, the README provides:
cp -R swiftui-expert-skill/ "$CODEX_HOME/skills/swiftui-expert-skill"
The repository also documents installation paths for Claude Code, Cursor, and pi; their exact locations are determined by each tool's documentation.
How to use
After installation, explicitly invoke the skill in your coding tool. For example:
Use the swiftui expert skill and review the current SwiftUI code for state-management and performance improvements
For trace analysis, provide a .trace path. For recording, specify whether to attach to a running app, launch an app, or record all processes, and provide a device name or UDID when appropriate. The workflow selects the SwiftUI template for real devices and the Time Profiler template for iOS Simulator.