performance-audit
Skill538 starsChanged 4 months agoMITView on GitHub
Audit and improve SwiftUI runtime performance. Use for requests to diagnose slow rendering, janky scrolling, high CPU/memory usage, excessive view updates, or layout thrash in SwiftUI apps.
7 other projects use a version of this.
Adopted by
Most recently taken up by
- aprameyak/coding-skillstheir own version, first seen Oct 2, 2026
- greglas75/zuvotheir own version, first seen Sep 6, 2026
- dtsong/agentic-counciltheir own version, first seen Jun 10, 2026
- ironbee-ai/ironbee-devtools-skillstheir own version, first seen May 16, 2026
- sitharaj88/claude-skillstheir own version, first seen Mar 2, 2026
- BigPapiCB/Universal-Claude-Skillstheir own version, first seen Feb 6, 2026
Used with
Projects with it also use api-design and security-audit.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
MicrosoftSkillapi-design
Guide for designing and documenting RESTful APIs. Use when asked to design an API, create endpoints, or document an API.
Also in 3 projects that use this
CloudflareSkillsecurity-audit
Security guidance and vulnerability review for codebases, APIs, services, CLI tools, libraries, and daemons. Use for security questions, focused reviews, vulnerability research, security audits, or pen tests. Run the complete workflow only for explicit codebase audit or pen-test requests, full/comprehensive/end-to-end reviews, or requested report artifacts.
Also in 3 projects that use this
Other versions7 projects use a version of this.
Word for word · 1
- patrickserrano/skills★ 13100% same
Edited · 0
None found.
Wrote their own version · 6
- greglas75/zuvo★ 8same name
- ironbee-ai/ironbee-devtools-skills★ 3same name
- aprameyak/coding-skills★ 1same name
- BigPapiCB/Universal-Claude-Skills★ 1same name
- sitharaj88/claude-skills★ 1same name
- dtsong/agentic-council★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository28 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- animation-vocabularySkill
- apple-designSkill
- app-screenshot-debugSkill
- ascSkill
- bump-versionSkill
- check-ghostty-updateSkill
- code-cleanSkill
- conventional-commitSkill
- dia-source-analysisSkill
- docSkill
- emil-design-engSkill
- find-animation-opportunitiesSkill
- improve-animationsSkill
- ios-rebuild-devSkill
- issue-creatorSkill
- macos-rebuild-devSkill
- native-app-profilingSkill
- og-generationSkill
- pick-ui-librarySkill
- prototypeSkill
- review-animationsSkill
- review-copySkill
- Swift Performance Optimization SkillSkill
- termio-bug-reportSkill
- termioSkill
- testflight-releaseSkill
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 5 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
If user provides code: Start with Code-First Review
- Distinctive: line 15
If user only describes symptoms: Ask for minimal code/context, then Code-First Review
- Distinctive: line 40
If code review is inconclusive, explain how to collect data:
- Distinctive: line 42
Use SwiftUI template in Instruments (Release build)
- Distinctive: line 173
Ask user to re-run same capture and compare with baseline:
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
SwiftUI Performance Audit
Overview
Audit SwiftUI view performance from instrumentation and baselining to root-cause analysis and concrete remediation steps.
Workflow Decision Tree
- If user provides code: Start with Code-First Review
- If user only describes symptoms: Ask for minimal code/context, then Code-First Review
- If code review is inconclusive: Guide user to profile with Instruments
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 (
idchurn,UUID()per render) - Heavy work in
body(formatting, sorting, image decoding) - Layout thrash (deep stacks,
GeometryReader, preference chains) - Large images without downsampling
- Over-animated hierarchies (implicit animations on large trees)
Provide
- Likely root causes with code references
- Suggested fixes and refactors
- Minimal repro or instrumentation suggestion if needed
2. Guide User to Profile
If code review is inconclusive, explain how to collect data:
- Use SwiftUI template in Instruments (Release build)
- Reproduce the exact interaction (scroll, navigation, animation)
- Capture SwiftUI timeline and Time Profiler
- Export or screenshot relevant lanes and call tree
Ask for:
- Trace export or screenshots
- Device/OS/build configuration
3. Common Code Smells (and Fixes)
Expensive formatters in body
Bad:
var body: some View {
let formatter = NumberFormatter() // Slow allocation every render
Text(formatter.string(from: value))
}Good:
final class Formatters {
static let number = NumberFormatter()
}
var body: some View {
Text(Formatters.number.string(from: value))
}Computed properties with heavy work
Bad:
var filtered: [Item] {
items.filter { $0.isEnabled } // Runs every body eval
}Good:
@State private var filtered: [Item] = []
.onChange(of: items) {
filtered = items.filter { $0.isEnabled }
}Sorting/filtering in ForEach
Bad:
ForEach(items.sorted(by: sortRule)) { item in
Row(item)
}Good:
let sortedItems = items.sorted(by: sortRule) // Compute once
ForEach(sortedItems) { item in
Row(item)
}Unstable identity
Bad:
ForEach(items, id: \.self) { item in // \.self may not be stable
Row(item)
}Good:
ForEach(items, id: \.stableID) { item in
Row(item)
}Image decoding on main thread
Bad:
Image(uiImage: UIImage(data: data)!)Good:
// Decode/downsample off main thread, cache the result
@State private var image: UIImage?
.task {
image = await ImageLoader.load(data: data, targetSize: size)
}Broad dependencies in observable models
Bad:
@Observable class Model {
var items: [Item] = []
}
var body: some View {
Row(isFavorite: model.items.contains(item)) // Entire array dependency
}Good:
// Granular view models or per-item state to reduce update fan-out4. Remediation Strategies
| Issue | Fix |
| Broad state changes | Narrow scope with @State/@Observable closer to leaves |
| Unstable identities | Use stable, unique IDs for ForEach |
| Heavy work in body | Precompute, cache, move to @State |
| Expensive subtrees | Use equatable() or value wrappers |
| Large images | Downsample before rendering |
| Layout complexity | Reduce nesting, use fixed sizing where possible |
5. Verify
Ask user to re-run same capture and compare with baseline:
- CPU usage
- Frame drops
- Memory peak
Output Format
Provide:
- Metrics table (before/after if available)
- Top issues (ordered by impact)
- Proposed fixes with estimated effort
Profiling Commands
# Build for profiling
xcodebuild -scheme MyApp -configuration Release -destination 'platform=iOS Simulator,name=iPhone 15 Pro' build
# Open in Instruments
open -a InstrumentsInstruments Checklist
- Use Release build (not Debug)
- Select SwiftUI template
- Reproduce exact problematic interaction
- Look at SwiftUI timeline for body evaluations
- Check Time Profiler for hot spots
- Note frame rate drops in Animation timeline
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

