Logo Axiom Profile Performance

Axiom Profile Performance

Cộng đồngPhổ biến
CharlesWiltgen
axiom-profile-performance

Use when the user wants automated performance profiling, headless Instruments analysis, or CLI-based trace collection.

Tổng quan

Nhà phát hànhCharlesWiltgen
Kho mãAxiom
Tên kỹ năngaxiom-profile-performance
Sao
1.2K
Bản fork
86
Tệp đi kèm
1
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 1 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được CharlesWiltgen công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Axiom Profile Performance trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/CharlesWiltgen/Axiom/tree/main/axiom-codex/skills/axiom-profile-performance
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/CharlesWiltgen/Axiom.git /tmp/Axiom
mkdir -p .claude/skills
cp -r /tmp/Axiom/axiom-codex/skills/axiom-profile-performance .claude/skills/axiom-profile-performance
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Axiom Profile Performance trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Axiom Profile Performance ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Axiom Profile Performance với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

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

bash
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:

bash
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.

bash
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 saysrecord invocation
CPU / slow / performancexcprof record --preset cpu --attach '<app>' --time-limit 10s
memory / allocations / leaks / retain cyclexcprof record --preset memory --attach '<app>' --time-limit 30s
network / API latencyxcprof record --preset network --attach '<app>' --time-limit 20s
energy / batteryxcprof record --preset energy --attach '<app>' --time-limit 30s
SwiftUI / view updates / bodyxcprof record --instrument 'SwiftUI' --instrument 'CPU Profiler' --attach '<app>' --time-limit 10s
concurrency / actors / tasksxcprof 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

bash
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 and tell the user to open the trace in Instruments for the instrument-specific view: open "<trace>".

Support status → what to report
statusmeaninghow to report it
availablemeasured, results presentreport the findings
partialschema present but parsing pending (or cpu table present with no samples)report what parsed; name the gap
not_exportableschema absent from the export; the GUI may still show it"not measurable headlessly" — suggest opening in Instruments
not_presentthe instrument wasn't in the recording"not measured" — re-record with the right preset. Never call this clean

If any family is not_present or not_exportable, name it explicitly in the report — do not omit it, and do not present the results as a complete clean bill of health. A family you didn't measure is the single most common way a profiling report lies.

4. Report

markdown
## Performance Profile Results

### Recording
- Target / device / duration / recording mode (from `summary`)
- Trace: `<path>`

### Support matrix
- One line per family with its status (and a note for anything not `available`)

### Top user-code frames
| Function | Binary | Inclusive % | Self % | ~ms |
|----------|--------|-------------|--------|-----|
| … | … | … | … | … |

### Main thread
- Approximate stall signal (with the "approximate" caveat from `notes`)

### Recommendations
1. Highest-impact fix, tied to a specific frame/family
2. Next investigation step (e.g. re-scope a hang window, add `--dsym`)

### Next steps
- Open in Instruments for deeper / unparsed views: `open "<trace>"`

Cleanup

Do not rm -rf trace directories (CLAUDE.md S-3). Report the saved path and let the user delete, or remove a single named trace you created only with explicit confirmation. Recording into XCPROF_TRACE_ROOT keeps traces contained. (A safe, preview-first xcprof cleanup is a later xcprof phase.)

Comparison (before / after)

Use xcprof compare <baseline> <current> --json to diff two traces. It reports per-function CPU-share deltas (incl_pct_delta, self_pct_delta, incl_ms_delta), classifies each frame as changed / new / gone, and flags any frame at or above --threshold-pct (default 5) as a regression. Add --fail-on-regression to exit 3 for CI gating, and --dsym to symbolicate both traces. Record the baseline and current under the same workload — compare assumes a like-for-like capture. See /axiom:compare-traces (Claude Code only) and axiom-performance (skills/trace-comparison.md).

Error handling

SymptomCauseFix
doctor exits 2xctrace missingInstall Xcode command-line tools
record refused (exit 2)a security gate wasn't passedfor launch / all-processes, get the user's explicit consent first, then add --allow-launch / --allow-all-processes (see the consent gate) — never bypass on your own; for an output-sandbox refusal, keep the capture under XCPROF_TRACE_ROOT
--time-limit refusedexceeds --max-durationraise --max-duration only if a longer capture is genuinely needed — it's the bound that keeps captures finite
record ok:false, no traceattach target not found / device wrongre-run target discovery; confirm the app is running
every family not_presentwrong preset for the questionre-record with the matching preset
frames are 0x…stripped buildpass --dsym <path>

Tips for better profiles

  1. Warm up the slow path once before recording (avoid cold-cache noise).
  2. Isolate the operation — profile the slow action, not the whole app.
  3. Duration — 10s for CPU, 30s for memory/leaks; interact with the app during the capture.
  4. Repeat 2–3 times to confirm a pattern is consistent.

Related

  • axiom-tools (skills/xcprof-ref.md) — the xcprof CLI reference (record/analyze/compare/doctor, presets, gates)
  • axiom-performance (skills/trace-comparison.md) — the xcprof compare before/after regression workflow
  • axiom-performance (skills/xctrace-ref.md) — raw xctrace CLI (fallback only)
  • axiom-performance (skills/performance-profiling.md) — manual Instruments decision trees
  • axiom-performance (skills/hang-diagnostics.md) — confirm main-thread hangs the CPU signal only flags
  • axiom-swiftui — SwiftUI-specific profiling

Invocation Examples

Prompts that should launch this agent:

Explicit command: Users can also invoke this agent directly with axiom-profile-performance

Scope

Records traces with xcprof and turns them into structured, honest performance reports — no Instruments GUI required.

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Axiom Profile Performance làm được gì?

Use when the user wants automated performance profiling, headless Instruments analysis, or CLI-based trace collection.

Vì sao nên dùng Axiom Profile Performance trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Axiom Profile Performance là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Axiom Profile Performance trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/CharlesWiltgen/Axiom/tree/main/axiom-codex/skills/axiom-profile-performance. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Axiom Profile Performance?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Axiom Profile Performance với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Axiom Profile Performance với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Axiom Profile Performance có miễn phí không?

Có. Kỹ năng này được CharlesWiltgen phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇