swiftui-performance — Claude Code skill for SwiftUI profiling
Diagnoses slow SwiftUI rendering, scroll hitches, and unnecessary view updates. Use it to review code and investigate measurements in Instruments.
npx skills add dpearson2699/swift-ios-skills --skill swiftui-performance -a claude-codeWhat swiftui-performance does
This skill takes a SwiftUI performance issue from a repeatable symptom to a measured fix. It starts with code review, labels unconfirmed causes as hypotheses, and asks for a small reproduction, device, OS, and build details when they matter.
It guides profiling with the SwiftUI template in Instruments, preferably on a Release build and a real device. The analysis links costly view updates to Time Profiler and Hangs/Hitches data. It looks for unstable ForEach identity, work inside body, broad state reads, costly layout, and oversized images.
Suggested changes stay targeted: narrow state ownership, move expensive work out of body, preserve row identity, or downsample images before rendering. The skill then asks for the same capture again and compares CPU, frame drops, and memory peak when supplied. A Release run on a device is worth checking, because simulator-only results can mislead the diagnosis.
What it helps with
- trace scroll hitches in a SwiftUI list
- find excess
bodyupdates - stabilize
ForEachrow identity - move sorting or decoding out of
body - connect Instruments evidence to source code
Example prompts for the agent
- Review this SwiftUI screen: list scrolling hitches, and here are the
RowandForEachimplementations. - Show me how to capture an Instruments profile for this slow animation and what evidence to share.
- Investigate why this view's
bodyis recomputed frequently, then suggest measurements before changing code.
How to install swiftui-performance
1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill swiftui-performance -a claude-code2Manually: put the files in place
~/.claude/skills/swiftui-performance/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/swiftui-performance/
1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill swiftui-performance -a codex2Manually: put the files in place
.agents/skills/swiftui-performance/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill swiftui-performance -a cursor2Manually: put the files in place
.cursor/skills/swiftui-performance/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install dpearson2699/swift-ios-skills swiftui-performance2Manually: put the files in place
.github/skills/swiftui-performance/SKILL.md1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill swiftui-performance -a gemini-cli2Platform CLI
gemini skills install https://github.com/dpearson2699/swift-ios-skills --path skills/swiftui-performanceManually: put the files in place
.devin/skills/swiftui-performance/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill swiftui-performance -a opencodeClaude.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-performance
How do I install swiftui-performance in Claude Code?
Run npx skills add dpearson2699/swift-ios-skills --skill swiftui-performance -a claude-code, then run npx skills add dpearson2699/swift-ios-skills --skill swiftui-performance -a claude-code again. The skill file is placed at ~/.claude/skills/swiftui-performance/SKILL.md.
What does swiftui-performance do?
It helps diagnose and remediate SwiftUI runtime performance issues through code review, Instruments, and repeatable measurement. It separates code-based hypotheses from findings backed by a trace.
What profiling evidence does swiftui-performance use?
It uses the SwiftUI Instruments template and correlates its output with Time Profiler and Hangs/Hitches. In debug builds, Self._printChanges() can help identify the property that triggered a view update.