axiom-ios-performance by charleswiltgen/axiom
npx skills add https://github.com/charleswiltgen/axiom --skill axiom-ios-performance对于任何性能问题,包括内存泄漏、执行缓慢、电池耗电或性能分析,您必须使用此技能。
在以下情况时使用此路由器:
内存泄漏 (Swift) → /skill axiom-memory-debugging
内存泄漏扫描 → 启动 memory-auditor 代理或 /axiom:audit memory (6 种常见模式:计时器、观察者、闭包、委托、视图回调、PhotoKit)
内存泄漏 (Objective-C 块) → /skill axiom-objc-block-retain-cycles
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
性能分析 (GUI) → /skill axiom-performance-profiling
自动化分析 (CLI) → /skill axiom-xctrace-ref
运行自动化分析 → 使用 performance-profiler 代理或 /axiom:profile
应用卡顿或冻结 → /skill axiom-hang-diagnostics
电池耗电快、高能耗 → /skill axiom-energy
基于症状的诊断 → /skill axiom-energy-diag
带代码的 API 参考 → /skill axiom-energy-ref
能耗扫描 → 启动 energy-auditor 代理或 /axiom:audit energy (8 种反模式:计时器滥用、轮询、持续定位、动画泄漏、后台模式误用、网络效率低下、GPU 浪费、磁盘 I/O)
计时器崩溃模式 (DispatchSourceTimer) → /skill axiom-timer-patterns
计时器 API 参考 → /skill axiom-timer-patterns-ref
Swift 性能优化 → /skill axiom-swift-performance
Swift 性能扫描 → 启动 swift-performance-analyzer 代理或 /axiom:audit swift-performance (不必要的拷贝、ARC 开销、未特化的泛型、集合效率低下、Actor 隔离成本、内存布局)
现代 Swift 惯用法 → /skill axiom-swift-modern
MetricKit API 参考 → /skill axiom-metrickit-ref
LLDB 交互式调试 → /skill axiom-lldb
LLDB 命令参考 → /skill axiom-lldb-ref
axiom-ios-concurrency (回调争用,非性能分析)| 想法 | 现实 |
|---|---|
| "我知道是内存泄漏,让我找找看" | 内存泄漏有 6 种模式。memory-debugging 在 15 分钟内诊断出正确的模式,而不是 2 小时。 |
| "我直接运行时间分析器" | 错误的 Instruments 模板会浪费时间。performance-profiling 首先选择正确的工具。 |
| "电池耗电可能是网络层的问题" | 能耗问题涉及 8 个子系统。energy 技能诊断出实际原因。 |
| "应用感觉慢,我稍后再优化" | 性能问题会累积。现在进行分析可以节省指数级的时间。 |
| "只是 UI 冻结了,可能是一个慢的 API 调用" | 冻结有繁忙和阻塞两种原因。hang-diagnostics 有针对两者的决策树。 |
| "内存攀升且滚动卡顿 — 两个独立的 Bug" | 内存压力导致 GC 暂停,从而掉帧。先修复泄漏,然后重新检查滚动性能。 |
| "只在首次启动时冻结,肯定是在加载什么" | 首次启动卡顿有 3 种模式:同步 I/O、延迟初始化、主线程争用。hang-diagnostics 诊断是哪一种。 |
| "网络请求完成时 UI 锁死 — 那是慢" | 多个回调同时完成 = 主线程争用 = 并发问题。交叉路由到 ios-concurrency。 |
| "我直接加打印语句来调试这个" | 打印调试循环每次花费 3-5 分钟 (构建 + 运行 + 重现)。一个 LLDB 断点花费 30 秒。axiom-lldb 有这些命令。 |
| "我直接用 Timer.scheduledTimer,它更简单" | 滚动时计时器停止 (.default 模式),保留其目标 (泄漏)。timer-patterns 有决策树。 |
| "DispatchSourceTimer 崩溃了,但它是间歇性的,我们发布吧" | DispatchSourceTimer 有 4 种崩溃模式,它们都是确定性的。timer-patterns 诊断是哪一种。 |
| "Claude 已经知道现代 Swift" | Claude 默认使用 5.5 之前的模式 (Date(), CGFloat, filter().count)。swift-modern 有纠正表。 |
内存调试 (memory-debugging):
性能分析 (performance-profiling):
能耗优化 (energy):
用户:"我的应用内存使用量不断增长" → 调用:/skill axiom-memory-debugging
用户:"我有一个内存泄漏,但 deinit 没有被调用" → 调用:/skill axiom-memory-debugging
用户:"我的应用感觉慢,从哪里开始?" → 调用:/skill axiom-performance-profiling
用户:"我的 Objective-C 块回调正在泄漏" → 调用:/skill axiom-objc-block-retain-cycles
用户:"我的应用电池耗电很快" → 调用:/skill axiom-energy
用户:"用户说使用我的应用时设备发热" → 调用:/skill axiom-energy-diag
用户:"高效实现位置跟踪的最佳方式是什么?" → 调用:/skill axiom-energy-ref
用户:"分析我的应用的 CPU 使用情况" → 使用:performance-profiler 代理 (或 /axiom:profile)
用户:"如何从命令行运行 xctrace?" → 调用:/skill axiom-xctrace-ref
用户:"我需要用于 CI/CD 的无头分析" → 调用:/skill axiom-xctrace-ref
用户:"我的应用有时会卡住" → 调用:/skill axiom-hang-diagnostics
用户:"UI 冻结并且变得无响应" → 调用:/skill axiom-hang-diagnostics
用户:"主线程被阻塞,如何诊断?" → 调用:/skill axiom-hang-diagnostics
用户:"如何设置 MetricKit?" → 调用:/skill axiom-metrickit-ref
用户:"如何解析 MXMetricPayload?" → 调用:/skill axiom-metrickit-ref
用户:"扫描我的代码查找内存泄漏" → 调用:memory-auditor 代理
用户:"检查我的应用是否存在电池耗电问题" → 调用:energy-auditor 代理
用户:"审计我的 Swift 代码是否存在性能反模式" → 调用:swift-performance-analyzer 代理
用户:"如何在调试器中检查这个变量?" → 调用:/skill axiom-lldb
用户:"条件断点的 LLDB 命令是什么?" → 调用:/skill axiom-lldb-ref
用户:"我需要在调试器中重现这个崩溃" → 调用:/skill axiom-lldb
用户:"我的列表滚动缓慢且内存不断增长" → 首先调用:/skill axiom-memory-debugging,如果卡顿仍然存在,则调用 /skill axiom-performance-profiling
用户:"应用在首次启动时冻结几秒钟,然后正常工作" → 调用:/skill axiom-hang-diagnostics
用户:"当多个 API 调用同时返回时 UI 锁死" → 交叉路由:/skill axiom-ios-concurrency (回调争用)
用户:"我的计时器在用户滚动时停止" → 调用:/skill axiom-timer-patterns
用户:"我的计时器代码中出现 EXC_BAD_INSTRUCTION 崩溃" → 调用:/skill axiom-timer-patterns
用户:"我应该使用 Timer 还是 DispatchSourceTimer?" → 调用:/skill axiom-timer-patterns
用户:"如何创建 AsyncTimerSequence?" → 调用:/skill axiom-timer-patterns-ref
用户:"审查我的 Swift 代码是否存在过时的模式" → 调用:/skill axiom-swift-modern
用户:"有没有更现代的方法来做这个?" → 调用:/skill axiom-swift-modern
每周安装量
125
仓库
GitHub 星标数
610
首次出现
Jan 21, 2026
安全审计
安装于
opencode106
codex103
claude-code98
gemini-cli97
github-copilot91
cursor90
You MUST use this skill for ANY performance issue including memory leaks, slow execution, battery drain, or profiling.
Use this router when:
Memory leaks (Swift) → /skill axiom-memory-debugging
Memory leak scan → Launch memory-auditor agent or /axiom:audit memory (6 common patterns: timers, observers, closures, delegates, view callbacks, PhotoKit)
Memory leaks (Objective-C blocks) → /skill axiom-objc-block-retain-cycles
Performance profiling (GUI) → /skill axiom-performance-profiling
Automated profiling (CLI) → /skill axiom-xctrace-ref
Run automated profile → Use performance-profiler agent or /axiom:profile
App hangs or freezes → /skill axiom-hang-diagnostics
Battery drain, high energy → /skill axiom-energy
Symptom-based diagnosis → /skill axiom-energy-diag
API reference with code → /skill axiom-energy-ref
Energy scan → Launch energy-auditor agent or /axiom:audit energy (8 anti-patterns: timer abuse, polling, continuous location, animation leaks, background mode misuse, network inefficiency, GPU waste, disk I/O)
Timer crash patterns (DispatchSourceTimer) → /skill axiom-timer-patterns
Timer API reference → /skill axiom-timer-patterns-ref
Swift performance optimization → /skill axiom-swift-performance
Swift performance scan → Launch swift-performance-analyzer agent or /axiom:audit swift-performance (unnecessary copies, ARC overhead, unspecialized generics, collection inefficiencies, actor isolation costs, memory layout)
Modern Swift idioms → /skill axiom-swift-modern
MetricKit API reference → /skill axiom-metrickit-ref
LLDB interactive debugging → /skill axiom-lldb
LLDB command reference → /skill axiom-lldb-ref
axiom-ios-concurrency (callback contention, not profiling)| Thought | Reality |
|---|---|
| "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. |
| "UI locks up when network requests finish — that's slow" | Multiple callbacks completing at once = main thread contention = concurrency issue. Cross-route to ios-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-lldb has the commands. |
Memory Debugging (memory-debugging):
Performance Profiling (performance-profiling):
Energy Optimization (energy):
User: "My app's memory usage keeps growing" → Invoke: /skill axiom-memory-debugging
User: "I have a memory leak but deinit isn't being called" → Invoke: /skill axiom-memory-debugging
User: "My app feels slow, where do I start?" → Invoke: /skill axiom-performance-profiling
User: "My Objective-C block callback is leaking" → Invoke: /skill axiom-objc-block-retain-cycles
User: "My app drains battery quickly" → Invoke: /skill axiom-energy
User: "Users say the device gets hot when using my app" → Invoke: /skill axiom-energy-diag
User: "What's the best way to implement location tracking efficiently?" → Invoke: /skill axiom-energy-ref
User: "Profile my app's CPU usage" → Use: performance-profiler agent (or /axiom:profile)
User: "How do I run xctrace from the command line?" → Invoke: /skill axiom-xctrace-ref
User: "I need headless profiling for CI/CD" → Invoke: /skill axiom-xctrace-ref
User: "My app hangs sometimes" → Invoke: /skill axiom-hang-diagnostics
User: "The UI freezes and becomes unresponsive" → Invoke: /skill axiom-hang-diagnostics
User: "Main thread is blocked, how do I diagnose?" → Invoke: /skill axiom-hang-diagnostics
User: "How do I set up MetricKit?" → Invoke: /skill axiom-metrickit-ref
User: "How do I parse MXMetricPayload?" → Invoke: /skill axiom-metrickit-ref
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: /skill axiom-lldb
User: "What's the LLDB command for conditional breakpoints?" → Invoke: /skill axiom-lldb-ref
User: "I need to reproduce this crash in the debugger" → Invoke: /skill axiom-lldb
User: "My list scrolls slowly and memory keeps growing" → Invoke: /skill axiom-memory-debugging first, then /skill axiom-performance-profiling if stutter remains
User: "App freezes for a few seconds on first launch then works fine" → Invoke: /skill axiom-hang-diagnostics
User: "UI locks up when multiple API calls return at the same time" → Cross-route: /skill axiom-ios-concurrency (callback contention)
User: "My timer stops when the user scrolls" → Invoke: /skill axiom-timer-patterns
User: "EXC_BAD_INSTRUCTION crash in my timer code" → Invoke: /skill axiom-timer-patterns
User: "Should I use Timer or DispatchSourceTimer?" → Invoke: /skill axiom-timer-patterns
User: "How do I create an AsyncTimerSequence?" → Invoke: /skill axiom-timer-patterns-ref
User: "Review my Swift code for outdated patterns" → Invoke: /skill axiom-swift-modern
User: "Is there a more modern way to do this?" → Invoke: /skill axiom-swift-modern
Weekly Installs
125
Repository
GitHub Stars
610
First Seen
Jan 21, 2026
Security Audits
Gen Agent Trust HubPassSocketFailSnykPass
Installed on
opencode106
codex103
claude-code98
gemini-cli97
github-copilot91
cursor90
Vue.js开发指南:最佳实践、组件设计与响应式编程核心原则
1,500 周安装
| "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. |