From sundial-org-awesome-openclaw-skills-4
Audits SwiftUI view performance from code review and Instruments traces. Use for slow rendering, janky scrolling, high CPU/memory, excessive view updates, or layout thrash.
How this skill is triggered — by the user, by Claude, or both
Slash command
/sundial-org-awesome-openclaw-skills-4:swiftui-performance-auditThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
_Attribution: copied from @Dimillian’s `Dimillian/Skills` (2025-12-31)._
Attribution: copied from @Dimillian’s Dimillian/Skills (2025-12-31).
Audit SwiftUI view performance end-to-end, from instrumentation and baselining to root-cause analysis and concrete remediation steps.
Collect:
Focus on:
id churn, UUID() per render).body (formatting, sorting, image decoding).GeometryReader, preference chains).Provide:
Explain how to collect data with Instruments:
Ask for:
Prioritize likely SwiftUI culprits:
id churn, UUID() per render).body (formatting, sorting, image decoding).GeometryReader, preference chains).Summarize findings with evidence from traces/logs.
Apply targeted fixes:
@State/@Observable closer to leaf views).ForEach and lists.body (precompute, cache, @State).equatable() or value wrappers for expensive subtrees.Look for these patterns during code review.
bodyvar body: some View {
let number = NumberFormatter() // slow allocation
let measure = MeasurementFormatter() // slow allocation
Text(measure.string(from: .init(value: meters, unit: .meters)))
}
Prefer cached formatters in a model or a dedicated helper:
final class DistanceFormatter {
static let shared = DistanceFormatter()
let number = NumberFormatter()
let measure = MeasurementFormatter()
}
var filtered: [Item] {
items.filter { $0.isEnabled } // runs on every body eval
}
Prefer precompute or cache on change:
@State private var filtered: [Item] = []
// update filtered when inputs change
body or ForEachList {
ForEach(items.sorted(by: sortRule)) { item in
Row(item)
}
}
Prefer sort once before view updates:
let sortedItems = items.sorted(by: sortRule)
ForEachForEach(items.filter { $0.isEnabled }) { item in
Row(item)
}
Prefer a prefiltered collection with stable identity.
ForEach(items, id: \.self) { item in
Row(item)
}
Avoid id: \.self for non-stable values; use a stable ID.
Image(uiImage: UIImage(data: data)!)
Prefer decode/downsample off the main thread and store the result.
@Observable class Model {
var items: [Item] = []
}
var body: some View {
Row(isFavorite: model.items.contains(item))
}
Prefer granular view models or per-item state to reduce update fan-out.
Ask the user to re-run the same capture and compare with baseline metrics. Summarize the delta (CPU, frame drops, memory peak) if provided.
Provide:
Add Apple documentation and WWDC resources under references/ as they are supplied by the user.
references/optimizing-swiftui-performance-instruments.mdreferences/understanding-improving-swiftui-performance.mdreferences/understanding-hangs-in-your-app.mdreferences/demystify-swiftui-performance-wwdc23.mdnpx claudepluginhub joshuarweaver/cascade-ai-ml-agents-misc-2 --plugin sundial-org-awesome-openclaw-skills-4Audits SwiftUI performance via code review for issues like slow rendering, janky scrolling, high CPU/memory, excessive updates, and guides Instruments profiling.
Audits SwiftUI performance from code review and profiling evidence. Diagnoses slow rendering, janky scrolling, layout thrash, and excessive view updates.
Profiles, diagnoses, and remediates SwiftUI runtime performance using code review and Instruments. Use for slow rendering, hitches, excessive view updates, or list identity churn.