swiftui-debugging
Diagnose SwiftUI performance issues including unnecessary re-renders, view identity problems, and slow body evaluations. Use when SwiftUI views are slow, janky, or re-rendering too often.
npx skills add rshankras/claude-code-apple-skills --skill swiftui-debugging --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# SwiftUI Performance Debugging Systematic guide for diagnosing and fixing SwiftUI performance problems: unnecessary view re-evaluations, identity issues, expensive body computations, and lazy loading mistakes. ## When This Skill Activates Use this skill when the user: - Reports slow or janky SwiftUI views - Sees excessive view re-renders or body re-evaluations - Asks about `Self._printChanges()` or view debugging - Has scrolling performance issues with lists or grids - Asks why a view keeps updating when nothing changed - Mentions `@Observable` or `ObservableObject` performance differences - Wants to understand SwiftUI view identity or diffing - Uses `AnyView` and asks about performance implications - Has a hang or stutter traced to SwiftUI rendering ## The Performance Loop Every investigation follows the same loop: **symptom -> measure -> identify -> optimize -> RE-MEASURE**. The last step is the one people skip -- an "optimization" that was never re-measured is a guess, and SwiftUI guesses are wrong often enough (a fix can shift cost elsewhere) that the loop is not optional. Never close a performance issue on the strength of the diff alone. ## Decision Tree ``` What SwiftUI perf
- When This Skill Activates
- The Performance Loop
- Decision Tree
- API Availability
- Top 5 Mistakes -- Quick Reference
- Lists, Tables, and ForEach: Identity Is the Cost Model
- Common Slow-Update Causes
- Debugging Tools
- Self.printChanges()
- Instruments SwiftUI Template
- The Redesigned SwiftUI Instrument (Instruments 26 -- WWDC25 306)
- Cause & Effect Graph: Why Did Body Run? (WWDC25 306)
- ossignpost for Custom Measurement
- Review Checklist
What does the swiftui-debugging skill do?
Diagnose SwiftUI performance issues including unnecessary re-renders, view identity problems, and slow body evaluations. Use when SwiftUI views are slow, janky, or re-rendering too often.
How do I install it?
Run `npx skills add rshankras/claude-code-apple-skills --skill swiftui-debugging --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From rshankras/claude-code-apple-skills, a repository with 589 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
