
Swift performance optimization
Guides profiling and fixing slow SwiftUI screens, lists, main-thread work and memory
Swift performance optimization is an open-source agent skill for developer tools. It is available on Claude Code.
- Scripts
- None
- Platforms
- Claude Code
- GitHub stars
- 20
- Last commit
- License
- MIT
- Listing updated
Similar skills
About Swift performance optimization
This skill steers an agent through diagnosing performance problems in Swift and SwiftUI apps. It insists on measuring with Instruments before changing code, and it offers a decision guide that maps symptoms such as scroll jank, hangs on user actions, memory growth and actor waits to the right tool or fix.
The workflow centers on Time Profiler and the Swift Concurrency instrument: the agent is told to invert the call tree, focus on main-thread self time, fix only the top offenders and re-measure. It also includes code patterns for keeping list rows lightweight, moving heavy computation into an actor away from the main actor, using @Observable view models, and loading images with AsyncImage phases. A short checklist closes the workflow.
The skill is a single SKILL.md with no scripts. It assumes a Swift codebase and Xcode, and it refers to a related memory-leak diagnosis skill for leak investigations.
When your agent uses it
Use when profiling slow SwiftUI screens, optimizing lists, reducing main-thread work, improving memory/CPU, or using Instruments Time Profiler or Swift Concurrency tools.
From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.
What it can access
From a static check of its 1 file (2 KB) on GitHub on 4 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.
Check another skill before you install it.
Install
This skill ships in the swift-modern-dev plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):
/plugin marketplace add pstuart/pstuart
/plugin install swift-modern-dev@pstuartOr copy only this skill to ~/.claude/skills/swift-performance-optimization:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/pstuart/pstuart.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/swift-performance-optimization &&
cp -R "$tmp/plugins/swift-modern-dev/skills/swift-performance-optimization" ~/.claude/skills/swift-performance-optimization &&
rm -rf "$tmp"For one project only, put the folder in .claude/skills/swift-performance-optimization inside it instead.
Copy the skill folder to ~/.agents/skills/swift-performance-optimization to use it in every repository:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/pstuart/pstuart.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/swift-performance-optimization &&
cp -R "$tmp/plugins/swift-modern-dev/skills/swift-performance-optimization" ~/.agents/skills/swift-performance-optimization &&
rm -rf "$tmp"For one repository only, put the folder in .agents/skills/swift-performance-optimization inside it instead.
Copy the skill folder to ~/.cursor/skills/swift-performance-optimization to use it in every project:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/pstuart/pstuart.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/swift-performance-optimization &&
cp -R "$tmp/plugins/swift-modern-dev/skills/swift-performance-optimization" ~/.cursor/skills/swift-performance-optimization &&
rm -rf "$tmp"For one project only, put the folder in .cursor/skills/swift-performance-optimization inside it instead.
Run in a terminal (add --scope workspace to install it for the current workspace only):
gemini skills install https://github.com/pstuart/pstuart.git --path plugins/swift-modern-dev/skills/swift-performance-optimizationOr copy the folder to ~/.gemini/skills/swift-performance-optimization yourself.
For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/swift-performance-optimization:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/pstuart/pstuart.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/swift-performance-optimization &&
cp -R "$tmp/plugins/swift-modern-dev/skills/swift-performance-optimization" ~/.copilot/skills/swift-performance-optimization &&
rm -rf "$tmp"For one project only, put the folder in .github/skills/swift-performance-optimization inside it instead.
Get the folder:
git clone --depth 1 https://github.com/pstuart/pstuart.gitThen copy pstuart/plugins/swift-modern-dev/skills/swift-performance-optimization into your agent's skills folder as swift-performance-optimization. Agents that support SKILL.md read one folder per skill.
What it does
- Symptom-based decision guide
- Maps scroll jank, action hangs, memory growth and actor waits to the appropriate investigation path.
- Instruments profiling workflow
- Walks through Time Profiler and Swift Concurrency analysis, from inverting the call tree to re-measuring.
- Main-actor offloading patterns
- Shows how to move heavy parsing or compute into an actor and keep view models on the main actor.
- Efficient SwiftUI lists
- Covers stable identity, lightweight row views and lazy containers for large collections.
- Async image loading
- Demonstrates AsyncImage with success, failure and placeholder phases.
- Pre-finish performance checklist
- Confirms the bottleneck was measured, main-actor work reduced and the fix re-profiled.
Good for
- Find why a SwiftUI list stutters while scrolling
- Track down a UI hang after a button tap
- Move heavy JSON parsing off the main thread
- Investigate steadily growing memory in an iOS app
- Review a SwiftUI screen for unnecessary main-actor work
Swift performance optimization FAQ
When does Swift performance optimization trigger?
When the task involves profiling slow SwiftUI screens, optimizing lists, reducing main-thread work, improving memory or CPU use, or using Instruments Time Profiler or Swift Concurrency tools.
Does Swift performance optimization need any scripts or extra tools?
It ships no scripts. It relies on Xcode Instruments and describes working with Time Profiler and the Swift Concurrency instrument.
Does Swift performance optimization change code automatically?
No. It gives the agent a measure-first workflow and code patterns to apply to the measured hot path.
How do I install Swift performance optimization in Claude Code?
Copy the skill folder from GitHub to ~/.claude/skills/swift-performance-optimization to use it in all your projects, or to .claude/skills/swift-performance-optimization in one project. Or install the swift-modern-dev plugin, which includes it: /plugin marketplace add pstuart/pstuart, then /plugin install swift-modern-dev@pstuart.
Does Swift performance optimization run scripts?
No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.
Which AI agents can use Swift performance optimization?
Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.
What are the best alternatives to Swift performance optimization?
The closest alternatives to Swift performance optimization are Axiom analyze swiftui performance, Performance, Memory leak diagnosis, Axiom performance and Axiom analyze swift performance.
Where this comes from
- Description: from the skill's own SKILL.md.
More from pstuart/pstuart

Reports git state, activity and build evidence across every project in a folder
- Open source
- 20 GitHub stars
- Developer tools

Checks web pages against WCAG 2.1 AA contrast, labels, keyboard and ARIA rules
- Open source
- 20 GitHub stars
- Developer tools

Guides an AI agent through building and reviewing Nuxt 4 apps with the app/ layout
- Open source
- 20 GitHub stars
- Developer tools

Walks an agent through a web application security audit checklist and report
- Open source
- 20 GitHub stars
- Security

Guides an agent to style Nuxt and Vue UIs with Tailwind CSS 4 utilities and @theme tokens
- Open source
- 20 GitHub stars
- Developer tools

Guides an agent to write and review strict TypeScript in Vue, Nuxt and Node code
- Open source
- 20 GitHub stars
- Developer tools



