Skip to content
Automation
Skill

/swiftui-performance-audit

Audit and improve SwiftUI runtime performance from code review and architecture. Use for requests to diagnose slow rendering, janky scrolling, high CPU/memory usage, excessive view updates, or layout thrash in SwiftUI apps, and to provide guidance for user-run Instruments

From plugin
homeclaw
19620 skills7 agents4 commands

Claude Code

$ npx -y skills add omarshahine/HomeClaw --skill swiftui-performance-audit --agent claude-code

SKILL.md

swiftui-performance-audit.SKILL.md
name: swiftui-performance-audit
description: Audit and improve SwiftUI runtime performance from code review and architecture. Use for requests to diagnose slow rendering, janky scrolling, high CPU/memory usage, excessive view updates, or layout thrash in SwiftUI apps, and to provide guidance for user-run Instruments profiling when code review alone is insufficient.

SwiftUI Performance Audit

Quick start

Use this skill to diagnose SwiftUI performance issues from code first, then request profiling evidence when code review alone cannot explain the symptoms.

Workflow

1. Classify the symptom: slow rendering, janky scrolling, high CPU, memory growth, hangs, or excessive view updates. 2. If code is available, start with a code-first review using `references/code-smells.md`. 3. If code is not available, ask for the smallest useful slice: target view, data flow, reproduction steps, and deployment target. 4. If code review is inconclusive or runtime evidence is required, guide the user through profiling with `references/profiling-intake.md`. 5. Summarize likely causes, evidence, remediation, and validation steps using `references/report-template.md`.

1. Intake

Collect:

  • Target view or feature code.
  • Symptoms and exact reproduction steps.
  • Data flow: `@State`, `@Binding`, environment dependencies, and observable models.
  • Whether the issue shows up on device or simulator, and whether it was observed in Debug or Release.

Ask the user to classify the issue if possible:

  • CPU spike or battery drain
  • Janky scrolling or dropped frames
  • High memory or image pressure
  • Hangs or unresponsive interactions
  • Excessive or unexpectedly broad view updates

For the full profiling intake checklist, read `references/profiling-intake.md`.

2. Code-First Review

Focus on:

  • Invalidation storms from broad observation or environment reads.
  • Unstable identity in lists and `ForEach`.
  • Heavy derived work in `body` or view builders.
  • Layout thrash from complex hierarchies, `GeometryReader`, or preference chains.
  • Large image decode or resize work on the main thread.
  • Animation or transition work applied too broadly.

Use `references/code-smells.md` for the detailed smell catalog and fix guidance.

Provide:

  • Likely root causes with code references.
  • Suggested fixes and refactors.
  • If needed, a minimal repro or instrumentation suggestion.

3. Guide the User to Profile

If code review does not explain the issue, ask for runtime evidence:

  • A trace export or screenshots of the SwiftUI timeline and Time Profiler call tree.
  • Device/OS/build configuration.
  • The exact interaction being profiled.
  • Before/after metrics if the user is comparing a change.

Use `references/profiling-intake.md` for the exact checklist and collection steps.

4. Analyze and Diagnose

  • Map the evidence to the most likely category: invalidation, identity churn, layout thrash, main-thread work, image cost, or animation cost.
  • Prioritize problems by impact, not by how easy they are to explain.
  • Distinguish code-level suspicion from trace-backed evidence.
  • Call out when profiling is still insufficient and what additional evidence would reduce uncertainty.

5. Remediate

Apply targeted fixes:

  • Narrow state scope and reduce broad observation fan-out.
  • Stabilize identities for `ForEach` and lists.
  • Move heavy work out of `body` into derived state updated from inputs, model-layer precomputation, memoized helpers, or background preprocessing. Use `@State` only for view-owned state, not as an ad hoc cache for arbitrary computation.
  • Use `equatable()` only when equality is cheaper than recomputing the subtree and the inputs are truly value-semantic.
  • Downsample images before rendering.
  • Reduce layout complexity or use fixed sizing where possible.

Use `references/code-smells.md` for examples, Observation-specific fan-out guidance, and remediation patterns.

6. Verify

Ask the user to re-run the same capture and compare with baseline metrics. Summarize the delta (CPU, frame drops, memory peak) if provided.

Outputs

Provide:

  • A short metrics table (before/after if available).
  • Top issues (ordered by impact).
  • Proposed fixes with estimated effort.

Use `references/report-template.md` when formatting the final audit.

References

  • Profiling intake and collection checklist: `references/profiling-intake.md`
  • Common code smells and remediation patterns: `references/code-smells.md`
  • Audit output template: `references/report-template.md`
  • Add Apple documentation and WWDC resources under `references/` as they are supplied by the user.
  • Optimizing SwiftUI performance with Instruments: `references/optimizing-swiftui-performance-instruments.md`
  • Understanding and improving SwiftUI performance: `references/understanding-improving-swiftui-performance.md`
  • Understanding hangs in your app: `references/understanding-hangs-in-your-app.md`
  • Demystify SwiftUI performance (WWDC23): `references/demystify-swiftui-performance-wwdc23.md`
  • In addition to the references above, use web search to consult current Apple Developer documentation when Instruments workflows or SwiftUI performance guidance may have changed.
Read more
@omarshahine
Ships withhomeclaw

HomeKit smart home control via MCP — lights, locks, thermostats, and scenes for Claude Desktop, Claude Code, and OpenClaw

19620 skills7 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
196
Star history of omarshahine/HomeClaw on GitHub, a chart by star-history.com

Other skills on homeclaw.

app-resizability

app-resizability

Use when an app's layout must adapt to a window that changes size while the app runs, or when an app must support more than one…

ios-app-intents

ios-app-intents

Design and implement App Intents, app entities, and App Shortcuts for iOS apps so useful actions and content are available to…

ios-debugger-agent

ios-debugger-agent

Use XcodeBuildMCP to build, run, launch, and debug the current iOS project on a booted simulator. Trigger when asked to run an…

ios-memgraph-leaks

ios-memgraph-leaks

Capture, inspect, compare, and root-cause iOS memory graph leaks using Apple's leaks and memgraph tools. Use when debugging…

spm-build-analysis

spm-build-analysis

Analyze Swift Package Manager dependencies, package plugins, module variants, and CI-oriented build overhead that slow Xcode…

More skills from other plugins.

agent-builder

agent-builder

Load immediately after an Agent intent, before the first agent_builder_* call. Governs how you create, configure, test, and…

n8n3w209k
@n8n-io@n8n-ioInstall Skill
browser-use

browser-use

Direct browser control via CDP for web interaction: automation, scraping, testing, screenshots, and site/app work. Also covers…

@browser-use@browser-useInstall Skill
add-anydoc

add-anydoc

Add local office-document-to-Markdown conversion to NanoClaw agent containers with the pinned Firecrawl AnyDoc CLI. Use when…

nanoclaw12d31k
@nanocoai@nanocoaiInstall Skill

Questions about swiftui-performance-audit.

Which coding agents can use swiftui-performance-audit?
swiftui-performance-audit installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.