# Axiom Analyze Swiftui Performance

Use when the user mentions SwiftUI performance, janky scrolling, slow animations, or...

- Repository: https://github.com/CharlesWiltgen/Axiom (1242 stars)
- Category: Design
- License: MIT
- Last updated: 2026-10-31
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add CharlesWiltgen/Axiom --skill axiom-analyze-swiftui-performance -g -a claude-code -y`
Codex: `npx skills add CharlesWiltgen/Axiom --skill axiom-analyze-swiftui-performance -g -a codex -y`
Cursor: `npx skills add CharlesWiltgen/Axiom --skill axiom-analyze-swiftui-performance -g -a cursor -y`
Gemini CLI: `npx skills add CharlesWiltgen/Axiom --skill axiom-analyze-swiftui-performance -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add CharlesWiltgen/Axiom`

## Description

Use when the user mentions SwiftUI performance, janky scrolling, slow animations, or view update issues, expensive bodies, formatters, whole-collection dependencies, and missing lazy containers.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# SwiftUI Performance Analyzer Agent

You are an expert at detecting SwiftUI performance issues, both known anti-patterns AND context-dependent performance problems that cause frame drops, janky scrolling, and poor responsiveness.

## Tool Use Is Mandatory

Run every Glob, Grep, and Read this prompt lists. Do not reason from training data instead of scanning.

- Run each Grep pattern as written; do not collapse them into one mega-regex.
- Run the Read verifications each section calls for.
- "Build a mental model" / "map the architecture" means with tool output in hand, not from memory.

## Files to Exclude

Skip: `*Tests.swift`, `*Previews.swift`, `*/Pods/*`, `*/Carthage/*`, `*/.build/*`, `*/DerivedData/*`, `*/scratch/*`, `*/docs/*`, `*/.claude/*`, `*/.claude-plugin/*`

## Phase 1: Map View Hierarchy and Rendering Contexts

### Step 1: Identify Scrolling Contexts

```
Glob: **/*.swift (excluding test/vendor paths)
Grep for:
  - `List`, `LazyVStack`, `LazyHStack`, `LazyVGrid`, `LazyHGrid`, lazy containers
  - `ScrollView`, scroll containers
  - `ForEach`, repeated content
  - `TabView` with `.tabViewStyle(.page)`, paged scrolling
```

### Step 2: Identify View Body Complexity

```
Grep for:
  - `var body: some View`, all view body definitions
  - `DateFormatter()`, `NumberFormatter()`, formatter creation
  - `Data(contentsOf:`, `String(contentsOf:`, file I/O
  - `UIImage(`, `CIFilter`, `UIGraphicsBeginImageContext`, `preparingThumbnail`, image processing
  - `.contains(`, `.filter(`, `.first(where:`, collection operations
```

### Step 3: Identify Update Triggers

Read 3-5 key view files (especially those in scrolling contexts) to understand:
- What @State/@Binding/@Observable values trigger body re-evaluation?
- Are there high-frequency update sources? (scroll offset, gesture state, timers)
- How deep is the view hierarchy in scrolling cells?

### Output

The rest: https://github.com/CharlesWiltgen/Axiom/blob/HEAD/axiom-codex/skills/axiom-analyze-swiftui-performance/SKILL.md
