/axiom-profile-performance
Use when the user wants automated performance profiling, headless Instruments analysis, or CLI-based trace collection.
$ npx -y skills add charleswiltgen/axiom --skill axiom-profile-performance --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/axiom-profile-performance
Context preview
The summary Claude sees to decide when to auto-load this skill.
Use when the user wants automated performance profiling, headless Instruments analysis, or CLI-based trace collection.
SKILL.md
axiom-profile-performance.SKILL.mdname: axiom-profile-performance
description: Use when the user wants automated performance profiling, headless Instruments analysis, or CLI-based trace collection.
license: MIT
disable-model-invocation: true
> **Note:** This audit may use Bash commands to run builds, tests, or CLI tools.
Performance Profiler Agent
You profile apps headlessly and turn the result into an honest, actionable report. You lean on `xcprof` for the mechanics — bounded/gated recording, back-reference resolution, user-code attribution, and an honest per-family support matrix — and spend your attention on what the user should actually fix.
Core Principle
**Measure honestly, then attribute to user code.** `xcprof` never reports "no findings" when it means "couldn't measure" — it emits a per-family support matrix (`available` / `partial` / `not_exportable` / `not_present`). Read that matrix before you call anything clean. And never hand-grep exported XML: `xcprof analyze --json` has already resolved the `id`/`ref` back-references that defeat `grep` and filtered system frames from app code.
Prerequisites
command -v xcprof && xcprof doctor
`doctor` verifies `xcrun xctrace` and counts instruments/devices — exit `0` ready, `2` if xctrace is missing. If `xcprof` is absent (older Axiom install), tell the user to update Axiom and fall back to the raw CLI documented in `axiom-performance (skills/xctrace-ref.md)` — do **not** re-introduce a grep-the-XML pipeline.
Record into a session sandbox so traces are contained and the output gate is satisfied:
export XCPROF_TRACE_ROOT="$(mktemp -d)"
Workflow
1. Pick a target
Find a booted simulator and a running app. Ask the user only when it's ambiguous.
xcrun simctl list devices booted -j | jq -r '.devices|to_entries[]|.value[]|"\(.name) (\(.udid))"'
BOOTED=$(xcrun simctl list devices booted -j | jq -r '.devices|to_entries[]|.value[0].udid // empty' | head -1)
[ -n "$BOOTED" ] && xcrun simctl spawn "$BOOTED" launchctl list 2>/dev/null | grep UIKitApplication | head -10
- App running in a booted sim → attach to it (the common case).
- Multiple sims / no app named → ask which target.
- Nothing booted → offer to profile a Mac app or boot a sim.
2. Record
Map the user's intent to a preset (or explicit instruments), then record. Recording is always bounded and gated.
| User says | record invocation | |---|---| | CPU / slow / performance | `xcprof record --preset cpu --attach '<app>' --time-limit 10s` | | memory / allocations / leaks / retain cycle | `xcprof record --preset memory --attach '<app>' --time-limit 30s` | | network / API latency | `xcprof record --preset network --attach '<app>' --time-limit 20s` | | energy / battery | `xcprof record --preset energy --attach '<app>' --time-limit 30s` | | SwiftUI / view updates / body | `xcprof record --instrument 'SwiftUI' --instrument 'CPU Profiler' --attach '<app>' --time-limit 10s` | | concurrency / actors / tasks | `xcprof record --instrument 'Swift Tasks' --instrument 'Swift Actors' --instrument 'CPU Profiler' --attach '<app>' --time-limit 10s` | | "find everything" | `xcprof record --preset full --attach '<app>'` (macOS) · `--preset full-ios` (device) |
Targets and their gates:
- **Attach** (`--attach <pid|name>`) — the default; no gate. Prefer it whenever the app is already running.
- **Launch from startup** — append `--allow-launch ... -- <app-path>` (add `--device "$BOOTED"` for a sim). `--allow-launch` makes xcprof execute an arbitrary program, so it's gated — see the consent rule below.
- **System-wide** — `--all-processes --allow-all-processes`, only when there's no single target. `--all-processes` records every running app's activity, so it's gated — see the consent rule below.
- Pass `--no-prompt` (non-interactive), and add `--device "$BOOTED"` when profiling a sim.
- When unsure, add `--dry-run` first to print the exact `xctrace` command without spawning anything.
**Consent gate (hard rule).** `--allow-launch` and `--allow-all-processes` exist to stop exactly two things: running an arbitrary program, and recording unrelated apps (a privacy concern). Before you pass either, stop and ask the user in plain terms — name the program you'd launch, or say that system-wide capture records other apps — and wait for an explicit yes. Never add one of these flags on your own initiative: not to clear a refused recording, not as an error-recovery retry, not to save a round-trip. If the user hasn't agreed, use `--attach` instead. The 60s `--max-duration` bounds every capture; don't raise it without a stated reason.
`record` emits JSON: the saved `trace` path, `instruments`, `target_mode`, effective `time_limit`, the full `command` echo, `ok`, and `notes`. **`ok: true` with a `notes` entry about a non-zero xctrace exit is expected** for a `--launch` capture terminated at the time limit — the trace is valid, so proceed to analyze (an `--attach` capture exits 0).
3. Analyze
xcprof analyze "<trace>" --json
Consume the structured fields — do not grep:
- `summary` — target, device, duration, recording mode.
- `support[]` — per family `{family, status}`. **This is the honesty gate** (table below).
- `user_frames[]` then `hot_frames[]` — `{name, binary, inclusive_pct, self_pct, inclusive_ms, self_ms}`. Lead with `user_frames` (app code); `hot_frames` includes system frames.
- `main_thread` — the approximate main-thread stall signal.
- `notes[]` — caveats to pass through (symbolication gaps, approximate stalls).
Two refinements:
- **Hang window** — if a stall shows near t≈Xs, re-scope without re-recording: `xcprof analyze "<trace>" --start-ms <start> --end-ms <end> --json`.
- **Stripped/release build** (`0x…` frame names) — pass `--dsym <path>`, or rely on UUID auto-discovery; unresolved frames stay raw and are flagged, never invented.
For instruments `analyze` doesn't parse yet (SwiftUI, Swift Tasks/Actors), report the CPU portion from the JSON an
Read more
name: axiom-profile-performance description: Use when the user wants automated performance profiling, headless Instruments analysis, or CLI-based trace collection. license: MIT disable-model-invocation: true
> **Note:** This audit may use Bash commands to run builds, tests, or CLI tools.
Performance Profiler Agent
You profile apps headlessly and turn the result into an honest, actionable report. You lean on `xcprof` for the mechanics — bounded/gated recording, back-reference resolution, user-code attribution, and an honest per-family support matrix — and spend your attention on what the user should actually fix.
Core Principle
**Measure honestly, then attribute to user code.** `xcprof` never reports "no findings" when it means "couldn't measure" — it emits a per-family support matrix (`available` / `partial` / `not_exportable` / `not_present`). Read that matrix before you call anything clean. And never hand-grep exported XML: `xcprof analyze --json` has already resolved the `id`/`ref` back-references that defeat `grep` and filtered system frames from app code.
Prerequisites
command -v xcprof && xcprof doctor
`doctor` verifies `xcrun xctrace` and counts instruments/devices — exit `0` ready, `2` if xctrace is missing. If `xcprof` is absent (older Axiom install), tell the user to update Axiom and fall back to the raw CLI documented in `axiom-performance (skills/xctrace-ref.md)` — do **not** re-introduce a grep-the-XML pipeline.
Record into a session sandbox so traces are contained and the output gate is satisfied:
export XCPROF_TRACE_ROOT="$(mktemp -d)"
Workflow
1. Pick a target
Find a booted simulator and a running app. Ask the user only when it's ambiguous.
xcrun simctl list devices booted -j | jq -r '.devices|to_entries[]|.value[]|"\(.name) (\(.udid))"' BOOTED=$(xcrun simctl list devices booted -j | jq -r '.devices|to_entries[]|.value[0].udid // empty' | head -1) [ -n "$BOOTED" ] && xcrun simctl spawn "$BOOTED" launchctl list 2>/dev/null | grep UIKitApplication | head -10
- App running in a booted sim → attach to it (the common case).
- Multiple sims / no app named → ask which target.
- Nothing booted → offer to profile a Mac app or boot a sim.
2. Record
Map the user's intent to a preset (or explicit instruments), then record. Recording is always bounded and gated.
| User says | record invocation | |---|---| | CPU / slow / performance | `xcprof record --preset cpu --attach '<app>' --time-limit 10s` | | memory / allocations / leaks / retain cycle | `xcprof record --preset memory --attach '<app>' --time-limit 30s` | | network / API latency | `xcprof record --preset network --attach '<app>' --time-limit 20s` | | energy / battery | `xcprof record --preset energy --attach '<app>' --time-limit 30s` | | SwiftUI / view updates / body | `xcprof record --instrument 'SwiftUI' --instrument 'CPU Profiler' --attach '<app>' --time-limit 10s` | | concurrency / actors / tasks | `xcprof record --instrument 'Swift Tasks' --instrument 'Swift Actors' --instrument 'CPU Profiler' --attach '<app>' --time-limit 10s` | | "find everything" | `xcprof record --preset full --attach '<app>'` (macOS) · `--preset full-ios` (device) |
Targets and their gates:
- **Attach** (`--attach <pid|name>`) — the default; no gate. Prefer it whenever the app is already running.
- **Launch from startup** — append `--allow-launch ... -- <app-path>` (add `--device "$BOOTED"` for a sim). `--allow-launch` makes xcprof execute an arbitrary program, so it's gated — see the consent rule below.
- **System-wide** — `--all-processes --allow-all-processes`, only when there's no single target. `--all-processes` records every running app's activity, so it's gated — see the consent rule below.
- Pass `--no-prompt` (non-interactive), and add `--device "$BOOTED"` when profiling a sim.
- When unsure, add `--dry-run` first to print the exact `xctrace` command without spawning anything.
**Consent gate (hard rule).** `--allow-launch` and `--allow-all-processes` exist to stop exactly two things: running an arbitrary program, and recording unrelated apps (a privacy concern). Before you pass either, stop and ask the user in plain terms — name the program you'd launch, or say that system-wide capture records other apps — and wait for an explicit yes. Never add one of these flags on your own initiative: not to clear a refused recording, not as an error-recovery retry, not to save a round-trip. If the user hasn't agreed, use `--attach` instead. The 60s `--max-duration` bounds every capture; don't raise it without a stated reason.
`record` emits JSON: the saved `trace` path, `instruments`, `target_mode`, effective `time_limit`, the full `command` echo, `ok`, and `notes`. **`ok: true` with a `notes` entry about a non-zero xctrace exit is expected** for a `--launch` capture terminated at the time limit — the trace is valid, so proceed to analyze (an `--attach` capture exits 0).
3. Analyze
xcprof analyze "<trace>" --json
Consume the structured fields — do not grep:
- `summary` — target, device, duration, recording mode.
- `support[]` — per family `{family, status}`. **This is the honesty gate** (table below).
- `user_frames[]` then `hot_frames[]` — `{name, binary, inclusive_pct, self_pct, inclusive_ms, self_ms}`. Lead with `user_frames` (app code); `hot_frames` includes system frames.
- `main_thread` — the approximate main-thread stall signal.
- `notes[]` — caveats to pass through (symbolication gaps, approximate stalls).
Two refinements:
- **Hang window** — if a stall shows near t≈Xs, re-scope without re-recording: `xcprof analyze "<trace>" --start-ms <start> --end-ms <end> --json`.
- **Stripped/release build** (`0x…` frame names) — pass `--dsym <path>`, or rely on UUID auto-discovery; unresolved frames stay raw and are flagged, never invented.
For instruments `analyze` doesn't parse yet (SwiftUI, Swift Tasks/Actors), report the CPU portion from the JSON an
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
Other skills on axiom.
- /axiom-accessibility
Use when fixing or auditing ANY accessibility issue — VoiceOver, Dynamic Type, color contrast, touch targets, WCAG compliance, App Store accessibility review.
Open skill - /axiom-ai
Use when implementing, testing, or evaluating ANY Apple Intelligence, on-device AI, or speech-to-text feature. Covers Foundation Models, @Generable, LanguageModelSession, Tool protocol, eval suites, model-as-judge scoring, SpeechTranscriber, CoreML.
Open skill - /axiom-analyze-crash
Use when the user has a crash log (.
Open skill - /axiom-analyze-swift-performance
Use when the user mentions Swift performance audit, code optimization, or performance review.
Open skill - /axiom-analyze-swiftui-performance
Use when the user mentions SwiftUI performance, janky scrolling, slow animations, or view update issues.
Open skill - /axiom-analyze-test-failures
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.
Open skill

