A skill for AI coding agents. It finds and fixes slow parts of a SwiftUI iOS app: slow screens, slow launch, freezes, laggy scrolling and slow data loading.
- Claude Code
- OpenAI Codex
- Cursor
- Gemini CLI
- Any agent that supports Agent Skills (
SKILL.md)
- Views that redraw too often, for example because one big view model updates many screens at once.
- A parent screen that redraws every time its child screen changes.
- Timers that redraw a whole screen every second.
AnyView, unstable list IDs and.id()tricks that make SwiftUI rebuild views.- Long lists built all at once instead of lazily.
- Heavy work in a view's
initorbody: formatters, sorting, JSON decoding, image decoding. - Work on the main thread that freezes the UI.
- Expensive effects on many rows: shadows, blur, masks.
- Network requests that run one after another when they could run together.
- The same request sent twice for one screen.
- Slow app launch: SDKs and setup work before the first frame.
- Debug tools (for example network inspectors) that slow the app.
- Setup. The agent asks you a few questions about your project (scheme, bundle ID, simulator) and saves the answers in
.swiftui-perf.json. You do this once. - Ask. You tell the agent what is slow. It asks you to log in to the app on the simulator.
- Scan. It reads your code and lists patterns that often make SwiftUI slow.
- Measure. It adds temporary timers to your app and measures how long the screen takes to open. It also records which network requests the screen waits for.
- Trace. It records the app with Instruments to see where the time goes, and counts how often each view redraws.
- Fix. It makes one change, then measures again the same way. It keeps the change only if the numbers get better.
- Clean up. It removes all the temporary code.
- Remember. It saves how to reach each screen and every problem it hit (and how it solved it) in
.swiftui-perf-memory.json. The next session starts with that knowledge. Commit the file to share it with your team. - Report. It writes a short report: what was slow, what it fixed, how much faster it is, and what is left.
Claude Code:
/plugin marketplace add repfly/swiftui-perf-skill
/plugin install swiftui-perf@swiftui-perf-tools
Codex:
codex plugin marketplace add repfly/swiftui-perf-skillGemini CLI:
gemini skills install https://github.com/repfly/swiftui-perf-skill.git --path plugins/swiftui-perf/skills/swiftui-perf --consentCursor or any other agent:
npx skills add repfly/swiftui-perf-skillTell your agent what is slow. For example:
The home screen opens slowly. Fix it.
The first time, the agent runs the setup for you. To run it yourself:
node <skill folder>/scripts/setup.mjs init- macOS with Xcode
- Node.js 22 or later
- An iOS Simulator
MIT