← marketplace
engineersframeworksha:01b28eee0a352622manual
swiftui-performance-audit
Use when working with swiftUI performance: render, scroll, CPU/memory, updates, layout, Instruments from steipete/agent-scripts.
source: https://github.com/steipete/agent-scripts/tree/main/skills/swiftui-performance-audit ↗steipete/agent-scripts· ★ 3.8k
Install confidence
curl --create-dirs -fsSL https://skillmake.xyz/i/swiftui-performance-audit -o ~/.claude/skills/swiftui-performance-audit/SKILL.md
Pinned content
sha:01b28eee0a352622
Generated with
manual
Source
github.com
The file served at /api/marketplace/swiftui-performance-audit-01b28eee/raw matches this hash. Inspect before install, then copy the command.
5,189 chars · ~1,297 tokens
--- name: swiftui-performance-audit description: "Use when working with swiftUI performance: render, scroll, CPU/memory, updates, layout, Instruments from steipete/agent-scripts." source: https://github.com/steipete/agent-scripts/tree/main/skills/swiftui-performance-audit generated: 2026-05-27T20:56:41.405Z category: framework audience: engineers --- ## When to use - Using the swiftui-performance-audit skill's upstream workflow, guardrails, and local-tool assumptions. - Auditing commands or operational steps before changing swiftui performance audit behavior. - Needing a compact agent reference for swiftUI performance: render, scroll, CPU/memory, updates, layout, Instruments. ## Key concepts ### Overview Audit SwiftUI view performance end-to-end, from instrumentation and baselining to root-cause analysis and concrete remediation steps. ### Workflow Decision Tree If the user provides code, start with "Code-First Review." If the user only describes symptoms, ask for minimal code/context, then do "Code-First Review." If code review is inconclusive, go to "Guide the User to Profile" and ask for a trace or screenshots. ### 1. Code-First Review Collect: Target view/feature code. Data flow: state, environment, observable models. Symptoms and reproduction steps. Focus on: View invalidation storms from broad state changes. Unstable identity in lists (id churn, UUID() per render). Heavy work in body (formatting, sorting, image decoding). Layout thrash (deep stacks, GeometryReader, preference chains). Large images without downsampling or resizing. Over-animated hierarchies (implicit animations on large trees). Provide: Likely root... ### 2. Guide the User to Profile Explain how to collect data with Instruments: Use the SwiftUI template in Instruments (Release build). Reproduce the exact interaction (scroll, navigation, animation). Capture SwiftUI timeline and Time Profiler. Export or screenshot the relevant lanes and the call tree. Ask for: Trace export or screenshots of SwiftUI lanes + Time Profiler call tree. Device/OS/build configuration. ### 3. Analyze and Diagnose Prioritize likely SwiftUI culprits: View invalidation storms from broad state changes. Unstable identity in lists (id churn, UUID() per render). Heavy work in body (formatting, sorting, image decoding). Layout thrash (deep stacks, GeometryReader, preference chains). Large images without downsampling or resizing. Over-animated hierarchies (implicit animations on large trees). Summarize findings with evidence from traces/logs. ### 4. Remediate Apply targeted fixes: Narrow state scope (@State/@Observable closer to leaf views). Stabilize identities for ForEach and lists. Move heavy work out of body (precompute, cache, @State). Use equatable() or value wrappers for expensive subtrees. Downsample images before rendering. Reduce layout complexity or use fixed sizing where possible. ## API reference ``` npx skills add steipete/agent-scripts --skill swiftui-performance-audit ``` Install the swiftui-performance-audit skill from steipete/agent-scripts. ``` npx skills add steipete/agent-scripts --skill swiftui-performance-audit ``` ``` var body: some View {. ``` Command or snippet documented by the upstream swiftui-performance-audit skill. ``` var body: some View { let number = NumberFormatter() // slow allocation let measure = MeasurementFormatter() // slow allocation Text(measure.string(from: .init(value: meters, unit: .meters))) } ``` ``` final class DistanceFormatter {. ``` Command or snippet documented by the upstream swiftui-performance-audit skill. ``` final class DistanceFormatter { static let shared = DistanceFormatter() let number = NumberFormatter() let measure = MeasurementFormatter() } ``` ``` var filtered: [Item] {. ``` Command or snippet documented by the upstream swiftui-performance-audit skill. ``` var filtered: [Item] { items.filter { $0.isEnabled } // runs on every body eval } ``` ``` @State private var filtered: [Item] = []. ``` Command or snippet documented by the upstream swiftui-performance-audit skill. ``` @State private var filtered: [Item] = [] // update filtered when inputs change ``` ``` List {. ``` Command or snippet documented by the upstream swiftui-performance-audit skill. ``` List { ForEach(items.sorted(by: sortRule)) { item in Row(item) } } ``` ``` let sortedItems = items.sorted(by: sortRule). ``` Command or snippet documented by the upstream swiftui-performance-audit skill. ``` let sortedItems = items.sorted(by: sortRule) ``` ## Gotchas - Ask for:. - Prefer cached formatters in a model or a dedicated helper:. - Prefer precompute or cache on change:. - Prefer sort once before view updates:. - Prefer a prefiltered collection with stable identity. - Avoid id: \.self for non-stable values; use a stable ID. - Prefer decode/downsample off the main thread and store the result. - Prefer granular view models or per-item state to reduce update fan-out. --- Generated by SkillMake from https://github.com/steipete/agent-scripts/tree/main/skills/swiftui-performance-audit on 2026-05-27T20:56:41.405Z. Verify against source before relying on details.
File: ~/.claude/skills/swiftui-performance-audit/SKILL.md