Axiom Performance 标志

Axiom Performance

社区热门
CharlesWiltgen
axiom-performance

Use when an Apple-platform app feels slow, memory grows, battery drains, or ANY performance issue needs diagnosing. Covers memory leaks, profiling, Instruments workflows, retain cycles, optimization.

概览

发布者CharlesWiltgen
代码仓库Axiom
技能名称axiom-performance
星标数
1.2K
复刻数
86
附带文件
13
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 13 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 CharlesWiltgen 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Axiom Performance AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/CharlesWiltgen/Axiom/tree/main/axiom-codex/skills/axiom-performance
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

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-performance .claude/skills/axiom-performance
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Axiom Performance,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Axiom Performance。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Axiom Performance 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Performance

You MUST use this skill for ANY performance issue including memory leaks, slow execution, battery drain, or profiling.

Auditors are skills here. Where this router says "Launch some-auditor agent", invoke the matching Codex skill instead — same procedure, no Claude Code agent required.

Available: axiom-analyze-swift-performance, axiom-audit-energy, axiom-audit-memory.

The ones that shell out — builds, tests, simulators, crash symbolication — need shell access to run.

When to Use

Use this router when:

  • App feels slow or laggy
  • Memory usage grows over time
  • Battery drains quickly
  • Device gets hot during use
  • High energy usage in Battery Settings
  • Diagnosing performance with Instruments
  • Memory leaks or retain cycles
  • App crashes with memory warnings

Routing Logic

Memory Issues

Memory leaks (Swift) → See skills/memory-debugging.md

  • Systematic leak diagnosis
  • 5 common leak patterns
  • Instruments workflows
  • deinit not called

Memory leak scan → axiom-audit-memory (5-phase semantic audit: maps resource ownership, detects 6 leak patterns, reasons about missing cleanup, correlates compound risks, scores lifecycle health)

Memory leaks (Objective-C blocks) → See skills/objc-block-retain-cycles.md

  • Block retain cycles
  • Weak-strong pattern
  • Network callback leaks

Performance Profiling

Performance profiling (GUI) → See skills/performance-profiling.md

  • Time Profiler (CPU), incl. Top Functions mode for scattered overhead (OS27)
  • Allocations (memory growth)
  • Core Data profiling (N+1 queries)
  • Decision trees for tool selection
  • Instruments 27 Run Comparisons, Swift executors instrument, Foundation Models instrument; Xcode 27 Organizer (Storage/hitches metrics, Metric Goals, Generate Recommendations)

Automated profiling (CLI) → See skills/xctrace-ref.md

  • Headless xctrace profiling
  • CI/CD integration patterns
  • Command-line trace recording
  • Programmatic trace analysis

Run automated profile → Use performance-profiler agent or axiom-profile-performance

  • Records trace via xctrace
  • Exports and analyzes data
  • Reports findings with severity

Compare two traces / detect regressions → See skills/trace-comparison.md or /axiom:compare-traces (Claude Code only)

  • Did this change slow down a hot path? Function-level CPU-share deltas
  • CI gating with xcprof compare --fail-on-regression (non-zero exit)
  • Regressions vs improvements, severity ranking, exit-code semantics

Hang/Freeze Issues

App hangs or freezes → See skills/hang-diagnostics.md

  • UI unresponsive for >1 second
  • Main thread blocked (busy or waiting)
  • Decision tree: busy vs blocked diagnosis
  • Time Profiler vs System Trace selection
  • 8 common hang patterns with fixes
  • Watchdog terminations

Corpus/aggregate hang triage (Sentry, ASC) → axiom-shipping (skills/production-triage.md) + triage-analyzer agent

  • Multiple grouped hang reports from an aggregator, not a single .ips file
  • Classify anr_idle_runloop vs anr_main_thread_block across the corpus
  • Flag suspension/idle-runloop false-positives (the #1 hang by user count is often noise)
  • Cluster into root-cause families and rank by impact

App Launch

Slow app launch → See skills/app-launch.md

  • Slow first frame, frozen first screen, launch regression in Organizer
  • Launch-phase model (pre-main / main→first frame / extended launch)
  • Cold vs warm vs hot/resume vs notification launch — how to reproduce each
  • App Launch instrument workflow, dyld Activity, measurement hygiene
  • Pre-main fixes: linkage strategy (static vs dynamic vs mergeable, MERGED_BINARY_TYPE/MERGEABLE_LIBRARY), +load, main-thread deferral, priority inversion
  • XCTApplicationLaunchMetric regression test, MXAppLaunchMetric field histograms, custom "app is interactive" signpost
  • Push-notification launch path (tap→first pixel / tap→interactive targets)

Energy Issues

Battery drain, high energy → See skills/energy.md

  • Power Profiler workflow
  • Subsystem diagnosis (CPU/GPU/Network/Location/Display)
  • Anti-pattern fixes
  • Background execution optimization

Symptom-based diagnosis → See skills/energy-diag.md

  • "App at top of Battery Settings"
  • "Device gets hot"
  • "Background battery drain"
  • Time-cost analysis for each path

API reference with code → See skills/energy-ref.md

  • Complete WWDC code examples
  • Timer, network, location efficiency
  • BGContinuedProcessingTask (iOS 26)
  • MetricKit setup

Energy scan → axiom-audit-energy (8 anti-patterns: timer abuse, polling, continuous location, animation leaks, background mode misuse, network inefficiency, GPU waste, disk I/O)

Timer Safety

Timer crash patterns (DispatchSourceTimer) → See axiom-integration (skills/timer-patterns.md)

  • 4 crash scenarios trapping with BUG IN CLIENT OF LIBDISPATCH — EXC_BREAKPOINT (SIGTRAP) on arm64, EXC_BAD_INSTRUCTION on Intel
  • RunLoop mode gotcha (Timer stops during scroll)
  • SafeDispatchTimer wrapper
  • Timer vs DispatchSourceTimer decision

Timer API reference → See axiom-integration (skills/timer-patterns-ref.md)

  • Timer, DispatchSourceTimer, Combine, AsyncTimerSequence APIs
  • Lifecycle diagrams
  • Platform availability

Swift Performance

Swift performance optimization → See skills/swift-performance.md

  • Value vs reference types, copy-on-write
  • ARC overhead, generic specialization
  • Collection performance

Swift performance scan → axiom-analyze-swift-performance (unnecessary copies, ARC overhead, unspecialized generics, collection inefficiencies, actor isolation costs, memory layout)

Modern Swift idioms → See axiom-swift (skills/swift-modern.md)

  • Outdated API patterns (Date(), CGFloat, DateFormatter)
  • Foundation modernization (URL.documentsDirectory, FormatStyle)
  • Claude-specific hallucination corrections

MetricKit Integration

MetricKit API reference → See skills/metrickit-ref.md

  • New Swift-first API (OS27): MetricManager AsyncSequence streams, typed MetricResult metrics (incl. Metal frame rate, storage), typed diagnostics with termination categories, launch-task tracking
  • Per-state metrics (StateReporting framework, OS27): split hitch/hang/memory metrics by tab, mode, or experiment
  • Crash reporter extensions (CrashReportExtension framework, OS27): process crashes at crash time with in-extension symbolication (Part 10)
  • MXMetricPayload / MXDiagnosticPayload parsing (legacy, iOS 13–26)
  • Field performance data collection
  • Integration with crash reporting

Runtime Console Capture

Capture simulator console output → /axiom:console (Claude Code only)

  • Capture print(), os_log(), Logger output from simulator
  • Structured JSON with level, subsystem, category
  • Bounded collection with --timeout and --max-lines
  • Filter by subsystem or regex

Runtime State Inspection

LLDB interactive debugging → See axiom-build (skills/lldb.md)

  • Set breakpoints, inspect variables at runtime
  • Crash reproduction from crash logs
  • Thread state analysis for hangs
  • Swift value inspection (po vs v)

LLDB command reference → See axiom-build (skills/lldb-ref.md)

  • Complete command syntax
  • Breakpoint recipes
  • Expression evaluation patterns

Decision Tree

  1. Memory climbing + UI stutter/jank? → memory-debugging FIRST (memory pressure causes GC pauses that drop frames), then performance-profiling if memory is fixed but stutter remains
  2. Memory leak (Swift)? → memory-debugging
  3. Memory leak (Objective-C blocks)? → objc-block-retain-cycles
  4. App hang/freeze — is UI completely unresponsive (can't tap, no feedback)?
    • YES → hang-diagnostics (busy vs blocked diagnosis)
    • NO, just slow → performance-profiling (Time Profiler)
    • First launch only? → Also check for synchronous I/O or lazy initialization in hang-diagnostics
    • Multiple grouped hang reports from Sentry/ASC (corpus, not single file)? → axiom-shipping (skills/production-triage.md) + triage-analyzer
  5. Slowdown when multiple async operations complete at once? → Cross-route to axiom-concurrency (callback contention, not profiling)
  6. Slow app launch / slow first frame / launch regression / slow after push tap? → app-launch
  7. Battery drain (know the symptom)? → energy-diag
  8. Battery drain (need API reference)? → energy-ref
  9. Battery drain (general)? → energy
  10. MetricKit setup/parsing? → metrickit-ref 10a. Metrics split by app state (per-tab hitch rate, experiment arms) or StateReporting? → metrickit-ref (Part 1) 10b. Profiling agentic/LLM features (Foundation Models instrument, token metrics)? → performance-profiling, then axiom-ai 10c. Building a crash reporter extension (process crashes at crash time)? → metrickit-ref (Part 10)
  11. Profile with GUI (Instruments)? → performance-profiling
  12. Profile with CLI (xctrace)? → xctrace-ref
  13. Run automated profile now? → performance-profiler agent
  14. General slow/lag? → performance-profiling 14a. Slow GRDB/SQLite queries (EXPLAIN QUERY PLAN, index design, cursors)? → See axiom-data (skills/grdb-performance.md)
  15. Want proactive memory leak scan? → memory-auditor (Agent)
  16. Want energy anti-pattern scan? → energy-auditor (Agent)
  17. Want Swift performance audit (ARC, generics, collections)? → swift-performance-analyzer (Agent)
  18. Need to inspect variable/thread state at runtime? → See axiom-build (skills/lldb.md)
  19. Need exact LLDB command syntax? → See axiom-build (skills/lldb-ref.md)
  20. Timer stops during scrolling? → timer-patterns (RunLoop mode)
  21. EXC_BREAKPOINT (SIGTRAP) crash with DispatchSourceTimer — BUG IN CLIENT OF LIBDISPATCH? → timer-patterns (4 crash patterns)
  22. Choosing between Timer, DispatchSourceTimer, Combine timer, async timer? → timer-patterns
  23. Need timer API syntax/lifecycle? → timer-patterns-ref
  24. Code review for outdated Swift patterns? → swift-modern
  25. Claude generating legacy APIs (DateFormatter, CGFloat, DispatchQueue)? → swift-modern
  26. Need to see runtime console output before profiling? → axiom-tools (skills/xclog-ref.md) or /axiom:console (Claude Code only)
  27. Have an .ips, MetricKit, or legacy .crash text file to symbolicate/triage? → axiom-tools (skills/xcsym-ref.md) or axiom-analyze-crash

Anti-Rationalization

ThoughtReality
"I know it's a memory leak, let me find it"Memory leaks have 6 patterns. memory-debugging diagnoses the right one in 15 min vs 2 hours.
"I'll just run Time Profiler"Wrong Instruments template wastes time. performance-profiling selects the right tool first.
"Battery drain is probably the network layer"Energy issues span 8 subsystems. energy skill diagnoses the actual cause.
"App feels slow, I'll optimize later"Performance issues compound. Profiling now saves exponentially more time later.
"It's just a UI freeze, probably a slow API call"Freezes have busy vs blocked causes. hang-diagnostics has a decision tree for both.
"Memory is climbing AND scrolling stutters — two separate bugs"Memory pressure causes GC pauses that drop frames. Fix the leak first, then re-check scroll performance.
"It only freezes on first launch, must be loading something"First-launch hangs have 3 patterns: synchronous I/O, lazy initialization, main thread contention. hang-diagnostics diagnoses which.
"Launch feels slow — I'll trim some startup code"Launch has 3 phases (pre-main / main→first frame / extended) and a watchdog. app-launch tells you which phase to profile, with measurement hygiene so the number means something.
"Launch is fine, it's fast on my phone"Measure on your oldest supported device with a Release build. app-launch has the full hygiene checklist — newest-device numbers hide the regression.
"Resume from the app switcher is slow too"Resume isn't a launch — never measure it as one. app-launch distinguishes cold/warm/hot/notification and how to reproduce each.
"Too many frameworks — I'll just statically link everything"Static copies the library into every binary that links it (app + each extension), duplicates its global state, and breaks on Obj-C categories without -ObjC. app-launch has the static/dynamic/mergeable tradeoff and the DYLD_PRINT_STATISTICS check that tells you whether pre-main is even your problem.
"UI locks up when network requests finish — that's slow"Multiple callbacks completing at once = main thread contention = concurrency issue. Cross-route to axiom-concurrency.
"I'll just add print statements to debug this"Print-debug cycles cost 3-5 min each (build + run + reproduce). An LLDB breakpoint costs 30 seconds. axiom-build (skills/lldb.md) has the commands.
"I can't see what the app is logging"xclog captures print() + os_log from the simulator with structured JSON. /axiom:console (Claude Code only).
"I'll hand-parse this .ips JSON to see the top frame"xcsym parses, discovers dSYMs, symbolicates, and categorizes in one call — structured JSON with pattern_tag. axiom-analyze-crash.
"I'll just use Timer.scheduledTimer, it's simpler"Timer stops during scrolling (.default mode), retains its target (leak). timer-patterns has the decision tree.
"DispatchSourceTimer crashed but it's intermittent, let's ship"DispatchSourceTimer has 4 crash patterns that are ALL deterministic. timer-patterns diagnoses which one.
"Claude already knows modern Swift"Claude defaults to pre-5.5 patterns (Date(), CGFloat, filter().count). swift-modern has the correction table.
"MetricKit is that old MX delegate API"The 27 cycle rebuilt it: MetricManager AsyncSequence streams, typed metrics, per-state aggregation. metrickit-ref Part 1 has the new surface.
"My field metrics are one blended average, can't tell which screen is slow"StateReporting splits every metric by app state you define (per-tab, per-experiment). metrickit-ref Part 1.
"No single function is hot, so the profile is useless"Scattered overhead (dynamic dispatch, retain/release, existentials) hides in flame graphs. Top Functions mode merges it. performance-profiling.

Critical Patterns

Memory Debugging (memory-debugging):

  • 6 leak patterns: timers, observers, closures, delegates, view callbacks, PhotoKit
  • Instruments workflows
  • Leak vs caching distinction

Performance Profiling (performance-profiling):

  • Time Profiler for CPU bottlenecks
  • Allocations for memory growth
  • Core Data SQL logging for N+1 queries
  • Self Time vs Total Time

Energy Optimization (energy):

  • Power Profiler subsystem diagnosis
  • 8 anti-patterns: timers, polling, location, animations, background, network, GPU, disk
  • Audit checklists by subsystem
  • Pressure scenarios for deadline resistance

Example Invocations

User: "My app's memory usage keeps growing" → See skills/memory-debugging.md

User: "I have a memory leak but deinit isn't being called" → See skills/memory-debugging.md

User: "My app feels slow, where do I start?" → See skills/performance-profiling.md

User: "My Objective-C block callback is leaking" → See skills/objc-block-retain-cycles.md

User: "My app drains battery quickly" → See skills/energy.md

User: "Users say the device gets hot when using my app" → See skills/energy-diag.md

User: "What's the best way to implement location tracking efficiently?" → See skills/energy-ref.md

User: "Profile my app's CPU usage" → Use: performance-profiler agent (or axiom-profile-performance)

User: "How do I run xctrace from the command line?" → See skills/xctrace-ref.md

User: "I need headless profiling for CI/CD" → See skills/xctrace-ref.md

User: "My app hangs sometimes" → See skills/hang-diagnostics.md

User: "The UI freezes and becomes unresponsive" → See skills/hang-diagnostics.md

User: "Main thread is blocked, how do I diagnose?" → See skills/hang-diagnostics.md

User: "Triage my Sentry hangs" / "Which ANR reports are real blocks?" → See axiom-shipping (skills/production-triage.md) + triage-analyzer agent (or axiom-analyze-triage)

User: "My app takes 3 seconds to launch" → See skills/app-launch.md

User: "Xcode Organizer says my launch time regressed" → See skills/app-launch.md

User: "How do I reduce pre-main / dyld time?" → See skills/app-launch.md

User: "Should I use mergeable libraries / statically link my frameworks?" → See skills/app-launch.md

User: "App is slow to come up after tapping a push notification" → See skills/app-launch.md

User: "How do I write a launch performance test?" → See skills/app-launch.md

User: "How do I set up MetricKit?" → See skills/metrickit-ref.md

User: "How do I parse MXMetricPayload?" → See skills/metrickit-ref.md

User: "How do I use the new MetricManager / migrate off MXMetricManager?" → See skills/metrickit-ref.md (Part 1)

User: "Can I get hitch metrics per tab or per experiment?" → See skills/metrickit-ref.md (Part 1, StateReporting)

User: "How do I profile my Foundation Models / agentic feature?" → See skills/performance-profiling.md (Foundation Models instrument), then axiom-ai

User: "How do I compare two Instruments runs to verify a fix?" → See skills/performance-profiling.md (Run Comparisons) or skills/trace-comparison.md (CLI/CI)

User: "Scan my code for memory leaks" → Invoke: memory-auditor agent

User: "Check my app for battery drain issues" → Invoke: energy-auditor agent

User: "Audit my Swift code for performance anti-patterns" → Invoke: swift-performance-analyzer agent

User: "How do I inspect this variable in the debugger?" → Invoke: See axiom-build (skills/lldb.md)

User: "What's the LLDB command for conditional breakpoints?" → Invoke: See axiom-build (skills/lldb-ref.md)

User: "I need to reproduce this crash in the debugger" → Invoke: See axiom-build (skills/lldb.md)

User: "My list scrolls slowly and memory keeps growing" → See skills/memory-debugging.md first, then skills/performance-profiling.md if stutter remains

User: "App freezes for a few seconds on first launch then works fine" → See skills/hang-diagnostics.md

User: "UI locks up when multiple API calls return at the same time" → Cross-route: /skill axiom-concurrency (callback contention)

User: "My timer stops when the user scrolls" → Read: axiom-integration (skills/timer-patterns.md)

User: "EXC_BREAKPOINT (SIGTRAP) crash in my timer code — BUG IN CLIENT OF LIBDISPATCH" → Read: axiom-integration (skills/timer-patterns.md)

User: "Should I use Timer or DispatchSourceTimer?" → Read: axiom-integration (skills/timer-patterns.md)

User: "How do I create an AsyncTimerSequence?" → Read: axiom-integration (skills/timer-patterns-ref.md)

User: "Review my Swift code for outdated patterns" → Invoke: See axiom-swift (skills/swift-modern.md)

User: "Is there a more modern way to do this?" → Invoke: See axiom-swift (skills/swift-modern.md)

User: "What is the app logging? I need to see console output" → Invoke: /axiom:console (Claude Code only)

User: "Capture the simulator logs while I reproduce this bug" → Invoke: /axiom:console (Claude Code only)

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Axiom Performance AI 技能有什么作用?

Use when an Apple-platform app feels slow, memory grows, battery drains, or ANY performance issue needs diagnosing. Covers memory leaks, profiling, Instruments workflows, retain cycles, optimization.

为什么在 TypingMind 中使用 Axiom Performance?

因为您只需安装一次,就能搭配任何模型使用。Axiom Performance 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Axiom Performance?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/CharlesWiltgen/Axiom/tree/main/axiom-codex/skills/axiom-performance。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Axiom Performance?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Axiom Performance 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Axiom Performance 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Axiom Performance AI 技能免费吗?

是的。CharlesWiltgen 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇