/ios-swift-skills:performance-auditfrom ios-swift-skills
Audits SwiftUI view performance from code review to profiling. Diagnoses slow rendering, janky scrolling, high CPU/memory, excessive view updates, and layout thrash.
Ships in ios-swift-skills. 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.
Audit SwiftUI view performance from instrumentation and baselining to root-cause analysis and concrete remediation steps.
id churn, UUID() per render)body (formatting, sorting, image decoding)GeometryReader, preference chains)If code review is inconclusive, explain how to collect data:
Ask for:
bodyBad:
var body: some View {
let formatter = NumberFormatter() // Slow allocation every render
Text(formatter.string(from: value))
}
Good:
final class Formatters {
static let number = NumberFormatter()
}
var body: some View {
Text(Formatters.number.string(from: value))
}
Bad:
var filtered: [Item] {
items.filter { $0.isEnabled } // Runs every body eval
}
Good:
@State private var filtered: [Item] = []
.onChange(of: items) {
filtered = items.filter { $0.isEnabled }
}
Bad:
ForEach(items.sorted(by: sortRule)) { item in
Row(item)
}
Good:
let sortedItems = items.sorted(by: sortRule) // Compute once
ForEach(sortedItems) { item in
Row(item)
}
Bad:
ForEach(items, id: \.self) { item in // \.self may not be stable
Row(item)
}
Good:
ForEach(items, id: \.stableID) { item in
Row(item)
}
Bad:
Image(uiImage: UIImage(data: data)!)
Good:
// Decode/downsample off main thread, cache the result
@State private var image: UIImage?
.task {
image = await ImageLoader.load(data: data, targetSize: size)
}
Bad:
@Observable class Model {
var items: [Item] = []
}
var body: some View {
Row(isFavorite: model.items.contains(item)) // Entire array dependency
}
Good:
// Granular view models or per-item state to reduce update fan-out
| Issue | Fix |
|---|---|
| Broad state changes | Narrow scope with @State/@Observable closer to leaves |
| Unstable identities | Use stable, unique IDs for ForEach |
| Heavy work in body | Precompute, cache, move to @State |
| Expensive subtrees | Use equatable() or value wrappers |
| Large images | Downsample before rendering |
| Layout complexity | Reduce nesting, use fixed sizing where possible |
Ask user to re-run same capture and compare with baseline:
Provide:
# Build for profiling
xcodebuild -scheme MyApp -configuration Release -destination 'platform=iOS Simulator,name=iPhone 15 Pro' build
# Open in Instruments
open -a Instruments
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Generated from the plugin's indexed repository (patrickserrano/skills) — no native marketplace selected
npx claudepluginhub p/patrickserrano-ios-swift-skills10 skills in this plugin
/issue-fix-flowEnd-to-end GitHub issue fix workflow using gh CLI, local code changes, builds/tests, and git push. Use when asked to take an issue number, implement a fix, run builds/tests, commit with a closing message, and push./debugger-agentBuild, run, and debug iOS apps on a simulator. Use when asked to run an iOS app, interact with the simulator UI, capture logs, or diagnose runtime behavior./native-app-profilingProfile native macOS/iOS apps using Time Profiler via CLI (xctrace). Use when asked to identify performance hotspots, profile CPU usage, or diagnose slow code paths without opening Instruments./app-store-changelogCreate user-facing App Store release notes from git history. Use when asked to generate release changelog, App Store "What's New" text, or release notes based on git tags./macos-spm-app-packagingScaffold, build, and package SwiftPM-based macOS apps without Xcode project. Use when you need a from-scratch macOS app layout, SwiftPM targets/resources, custom .app bundle assembly, or signing/notarization steps outside Xcode./concurrency-expertSwift Concurrency review and remediation for Swift 6.2+. Use when asked to review Swift Concurrency usage, improve concurrency compliance, or fix Swift concurrency compiler errors.Other plugins' skills for the same job