/swift-performance-pro:swift-performance-profrom swift-performance-pro
Diagnoses and fixes SwiftUI performance issues using Instruments evidence. Covers render costs, retain cycles, main-thread blocking, launch time, and list optimization with concrete before/after code examples.
Ships in swift-performance-pro. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Find and fix performance problems with evidence, not guesses. Measure first.
Trigger: /swift-performance-pro.
body cheap and pure; recomputation is frequent.Keep body free of side effects and heavy compute.
❌ Sorting on every render
var body: some View {
List(items.sorted { $0.date > $1.date }) { Row($0) } // re-sorts each pass
}
✅ Sort once in the model
// model exposes already-sorted `items`
var body: some View { List(model.items) { Row($0) } }
Narrow observation so unrelated changes don't redraw everything. Split big views into small subviews so SwiftUI can diff precisely.
LazyVStack/List for long content, not eager VStack in a ScrollView.Identifiable IDs — index-based identity forces full rebuilds.AnyView in row builders; it defeats SwiftUI's diffing.❌ Strong self capture in a stored closure
manager.onUpdate = { self.refresh() } // cycle: manager → closure → self
✅
manager.onUpdate = { [weak self] in self?.refresh() }
Verify deinit runs. Use Instruments → Leaks / Allocations to confirm.
❌
let image = UIImage(data: hugeData) // decode on main → dropped frames
✅
let image = await Task.detached { UIImage(data: hugeData) }.value
Downsample large images to the display size instead of loading full-resolution.
init/onAppear; load it in .task.body.VStack where LazyVStack/List is needed.AnyView in hot row builders.self in stored closures (retain cycle).Per issue: file:line, the cost, before/after, and which Instrument confirms it. Lead with main-thread blockers.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
npx claudepluginhub laxrajpurohit/swift-skills-pro --plugin swift-performance-pro