Skip to content
Skillpedia
Websites & UI (frontend)48k · #4299

swiftui-performance-audit

Helps your agent analyze SwiftUI code performance. It identifies bottlenecks and suggests improvements to make apps faster.

What it does

This tool helps find and fix issues that make your SwiftUI apps slow or unresponsive. It analyzes your code and, if needed, asks for performance testing data to pinpoint the cause.

When to use it

  • ✓Your SwiftUI app is slow to display information.
  • ✓Scrolling in lists or tables is janky or choppy.
  • ✓The app uses too much memory or CPU without a clear reason.

Example of what to ask your AI

“My SwiftUI app stutters when scrolling a long list, what could be the cause?”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/swiftui-performance-audit/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/swiftui-performance-audit/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

First, the tool examines your code for common mistakes that lead to slowness. If that's not enough, it will guide you to run specific performance tests on your device to gather more data.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add sickn33/agentic-awesome-skills --skill swiftui-performance-audit

Or download just the file:

curl -L https://raw.githubusercontent.com/sickn33/agentic-awesome-skills/main/plugins/agentic-awesome-skills-claude/skills/swiftui-performance-audit/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

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.

When to Use

  • When the user reports slow rendering, janky scrolling, layout thrash, or high CPU in SwiftUI.
  • When you need a code-first audit plus Instruments guidance if profiling evidence is required.

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.

…

FAQ

What is 'layout thrash'?

It's when the app repeatedly tries to adjust the size and position of elements on the screen, which wastes time and makes everything sluggish.

What are 'invalidation storms'?

These are situations where many parts of the screen are updated simultaneously without good reason, causing performance problems.

Do I need to be a programmer to use this?

You don't need to be an expert. The tool is designed to help identify problems even if you're not an experienced programmer, but understanding basic code concepts is helpful.

Details

Original description by the author

Audit SwiftUI performance issues from code review and profiling evidence.

repo: sickn33/agentic-awesome-skills

Popularity

GitHub stars
48k
Ranking position
#4299
License
MIT
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills