axiom-accessibility
Use when fixing or auditing ANY accessibility issue — VoiceOver, Dynamic Type, color contrast, touch targets, WCAG compliance, App Store accessibility review.
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.
$ npx -y skills add charleswiltgen/axiom --skill axiom-analyze-swiftui-performance --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/axiom-analyze-swiftui-performanceContext preview
The summary Claude sees to decide when to auto-load this skill.
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.
name: axiom-analyze-swiftui-performance 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. license: MIT
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.
Run every Glob, Grep, and Read this prompt lists. Do not reason from training data instead of scanning.
Skip: `*Tests.swift`, `*Previews.swift`, `*/Pods/*`, `*/Carthage/*`, `*/.build/*`, `*/DerivedData/*`, `*/scratch/*`, `*/docs/*`, `*/.claude/*`, `*/.claude-plugin/*`
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
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
Read 3-5 key view files (especially those in scrolling contexts) to understand:
Write a brief **Performance Context Map** (8-10 lines) summarizing:
Present this map in the output before proceeding.
Run all 11 existing detection patterns. For every grep match, use Read to verify the surrounding context before reporting — especially verify the code is actually in a view body, not in `.task` or a background context.
**Pattern**: Synchronous file reads in view body **Search**: `Data(contentsOf:` or `String(contentsOf:` — verify near `var body` **Issue**: Blocks the main thread for the duration of the read — can miss the commit deadline (a commit hitch) or, if it runs long enough, register as a hang. Not guaranteed: measure it **Fix**: Use `.task` with async loading, store in @State
**Pattern**: DateFormatter(), NumberFormatter() created in view body **Search**: `DateFormatter()` or `NumberFormatter()` in files with `var body` — verify not `static let` **Issue**: Recomputed on every body pass — measured ~135 µs per call for the create-and-format shape (macOS 27, `-O`), so 100 rows ≈ 14 ms per update. Creating a bare formatter is sub-microsecond; the formatting call dominates **Fix**: Move the formatter to the model and cache the formatted strings there — reuse alone still pays the `string(from:)` call on every pass. `static let` is concurrency-safe for `DateFormatter`/`NumberFormatter`; `MeasurementFormatter` is non-Sendable under Swift 6 and belongs on the model
**Pattern**: Image resizing, filtering, transformation in view body **Search**: `preparingThumbnail`, `byPreparingThumbnail`, `UIGraphicsBeginImageContext`, `CIFilter` — verify near `var body`, not in `.task`. Neither SwiftUI nor UIKit has a `.resized` or `.thumbnail` member: a helper with those names is the app's own code, so grep for its definition too. `.resizable()` is not a signal — it is how every correctly written image view scales its bitmap **Issue**: CPU-intensive work causes stuttering during scrolling **Fix**: `preparingThumbnail(of:)` (sync) or `byPreparingThumbnail(ofSize:)` (async) in `.task`, then cache the result
**Pattern**: Collection operations that depend on entire collection in view body **Search**: `.contains(`, `.first(where:`, `.filter(` — verify near `var body` **Issue**: View updates when ANY item changes, not just relevant items **Fix**: Narrow the dependency — per-item view models or a finer-grained source (rule 1). A `Set` changes the lookup cost only: the read still registers a dependency on the whole property **Note**: Small collections (<10 items) are cheap to scan; a `Set` lowers the scan cost, not the dependency
**Pattern**: Non-lazy containers with many items **Search**: `VStack` or `HStack` followed by `ForEach` — verify not already `LazyVStack`/`LazyHStack` **Issue**: All views created immediately, high memory, slow initial load **Fix**: Use LazyVStack/LazyHStack for long lists **Note**: VStack with <20 items is fine
**Pattern**: Environment values that change every frame passed to deep hierarchies **Search**: `.environment(` with scroll offset, gesture state, or timer-driven values **Issue**: Every view that reads the environment is notified and re-checks its value; only the views whose own value changed run their body again. The cost is that check, multiplied by the number of readers **Fix**: Pass values directly to views that need them, not via e
Battle-tested skills, agents, and tools for modern Apple OS development — Swift 6, SwiftUI, Liquid Glass, Apple Intelligence, and more. Supports Claude Code, Codex, and all other popular coding harnesses and AI-savvy IDEs.
Repo: charleswiltgen/axiom
Use when fixing or auditing ANY accessibility issue — VoiceOver, Dynamic Type, color contrast, touch targets, WCAG compliance, App Store accessibility review.
Use when implementing, testing, or evaluating ANY Apple Intelligence, on-device AI, or speech-to-text feature. Covers Foundation Models, @Generable,…
Use when the user has a crash log (.ips, MetricKit JSON, legacy .crash text, .xccrashpoint bundle, or pasted text) that needs analysis.
Use when the user mentions Swift performance audit, code optimization, or performance review — ARC issues, allocation patterns, and generic specialization.
Use when the user mentions flaky tests, tests that pass locally but fail in CI, race conditions in tests, or needs to diagnose WHY a specific test fails.
Use when the user wants to triage a CORPUS of production crashes/hangs from an aggregator (Sentry, App Store Connect) — grouped, counted issues — rather than a…