# swiftui-performance

Diagnoses slow SwiftUI rendering, scroll hitches, and unnecessary view updates. Use it to review code and investigate measurements in Instruments.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 4600 installs · ★ 1237
- Author: dpearson2699
- License: LicenseRef-Unknown · policy=link-only · description only; the file stays with the author
- Source: https://github.com/dpearson2699/swift-ios-skills/tree/HEAD/skills/swiftui-performance/SKILL.md
- Updated: 2026-07-31
- HTML: https://affpapa.org/en/nevibecode/skills/swiftui-performance

## What it does

This skill takes a SwiftUI performance issue from a repeatable symptom to a measured fix. It starts with code review, labels unconfirmed causes as hypotheses, and asks for a small reproduction, device, OS, and build details when they matter.

It guides profiling with the SwiftUI template in Instruments, preferably on a `Release` build and a real device. The analysis links costly view updates to `Time Profiler` and Hangs/Hitches data. It looks for unstable `ForEach` identity, work inside `body`, broad state reads, costly layout, and oversized images.

Suggested changes stay targeted: narrow state ownership, move expensive work out of `body`, preserve row identity, or downsample images before rendering. The skill then asks for the same capture again and compares CPU, frame drops, and memory peak when supplied. A `Release` run on a device is worth checking, because simulator-only results can mislead the diagnosis.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill swiftui-performance -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/swiftui-performance/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/swiftui-performance/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill swiftui-performance -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/swiftui-performance/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill swiftui-performance -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/swiftui-performance/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install dpearson2699/swift-ios-skills swiftui-performance
```

2. **Manually: put the files in place**
- File: `.github/skills/swiftui-performance/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill swiftui-performance -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/dpearson2699/swift-ios-skills --path skills/swiftui-performance
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/swiftui-performance/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill swiftui-performance -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/dpearson2699/swift-ios-skills/tree/HEAD/skills/swiftui-performance/SKILL.md

## When to use it
- trace scroll hitches in a SwiftUI list
- find excess `body` updates
- stabilize `ForEach` row identity
- move sorting or decoding out of `body`
- connect Instruments evidence to source code

## Example prompts
- Review this SwiftUI screen: list scrolling hitches, and here are the `Row` and `ForEach` implementations.
- Show me how to capture an Instruments profile for this slow animation and what evidence to share.
- Investigate why this view's `body` is recomputed frequently, then suggest measurements before changing code.

## Similar
- [swiftui-performance-audit](https://affpapa.org/en/nevibecode/skills/swiftui-performance-audit.md) — skill · 109 installs
- [axiom-performance](https://affpapa.org/en/nevibecode/skills/axiom-performance.md) — skill · 1300 installs
- [swiftui-specialist](https://affpapa.org/en/nevibecode/skills/swiftui-specialist.md) — skill · 864 installs
- [swiftui-ui-patterns](https://affpapa.org/en/nevibecode/skills/swiftui-ui-patterns.md) — skill · 114 installs
- [swiftui-patterns](https://affpapa.org/en/nevibecode/skills/affaan-m-swiftui-patterns.md) — skill · 4600 installs

From the same set: [dpearson2699/swift-ios-skills](https://affpapa.org/en/nevibecode/by/dpearson2699/swift-ios-skills.md) — 86 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
