Skip to content

SwiftUI Performance Audit

Diagnoses and fixes slow or janky SwiftUI apps using code review and Instruments profiling

Stars
7,433
Licence
MIT
Files
5 files

What it does

This skill teaches an AI agent a structured method for finding why an iPhone or Mac app built with SwiftUI feels slow, stutters while scrolling, or uses too much CPU or memory. The agent first reads your view code looking for common causes such as broad state changes, unstable list identities, heavy work inside the view body, and oversized images. If that is inconclusive, it walks you through recording a trace in Apple's Instruments tool and then suggests specific fixes and a way to verify the improvement.

Great for

  • iOS or macOS developers whose SwiftUI screens stutter or drop frames
  • Teams preparing a release who want a checklist-driven performance review
  • Developers new to Instruments who need step-by-step profiling guidance

Skip it if

  • Non-SwiftUI apps (UIKit, React, Android), since the patterns and tools are specific to SwiftUI, and the skill will not apply correctly
  • Problems that are purely server-side or network latency, because the skill focuses on view rendering and CPU/memory in the client app

Try asking

  • “Here is my SwiftUI ContentView with a List of 5,000 items that stutters when I scroll. Can you audit it?”
  • “My feed hitches when new items load. I can only describe the symptom, so what should I capture in Instruments?”
  • “Review this view for expensive work inside body and suggest fixes with estimated effort.”
Step-by-step guide: how to use SwiftUI Performance AuditInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 5 original files, the MIT licence and an attribution note.

    swiftui-performance-audit.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip swiftui-performance-audit.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip swiftui-performance-audit.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Provide the full view code plus the state and model objects it depends on, so the agent can trace invalidation paths.
  • When possible, profile a Release build on a real device and share Instruments screenshots of the SwiftUI lane and Time Profiler call tree.
  • Ask for a before-and-after metrics table so you can confirm whether each fix actually helped.

What's inside

  • references/demystify-swiftui-performance-wwdc23.md
  • references/optimizing-swiftui-performance-instruments.md
  • references/understanding-hangs-in-your-app.md
  • references/understanding-improving-swiftui-performance.md
  • SKILL.md

Redistributed unmodified from steipete/agent-scripts under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.