axiom-ios-build
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseiOS Build & Environment Router
iOS构建与环境问题路由指南
You MUST use this skill for ANY build, environment, or Xcode-related issue before debugging application code.
在调试应用代码之前,任何构建、环境或Xcode相关问题都必须使用此技能。
When to Use
使用场景
Use this router when you encounter:
- Build failures (, compilation errors, linker errors)
BUILD FAILED - Test crashes or hangs
- Simulator issues (won't boot, device errors)
- Xcode misbehavior (stale builds, zombie processes)
- Dependency conflicts (CocoaPods, SPM)
- Build performance issues (slow compilation)
- Environment issues before debugging code
遇到以下情况时使用此路由工具:
- 构建失败(、编译错误、链接器错误)
BUILD FAILED - 测试崩溃或挂起
- 模拟器问题(无法启动、设备错误)
- Xcode运行异常(构建缓存残留、僵尸进程)
- 依赖冲突(CocoaPods、SPM)
- 构建性能问题(编译耗时过长)
- 调试代码前出现的环境问题
Routing Logic
路由逻辑
This router invokes specialized skills based on the specific issue:
本工具会根据具体问题调用对应的专业技能:
1. Environment-First Issues → xcode-debugging
1. 优先环境类问题 → xcode-debugging
Triggers:
- without obvious code cause
BUILD FAILED - Tests crash in clean project
- Simulator hangs or won't boot
- "No such module" after SPM changes
- Zombie processes
xcodebuild - Stale builds (old code still running)
- Clean build differs from incremental build
Why xcode-debugging first: 90% of mysterious issues are environment, not code. Check this BEFORE debugging code.
Invoke:
/skill axiom-xcode-debugging触发条件:
- 无明显代码原因的
BUILD FAILED - 干净项目中测试崩溃
- 模拟器挂起或无法启动
- SPM变更后出现"No such module"错误
- Xcode构建僵尸进程
- 构建缓存残留(仍运行旧代码)
- 干净构建与增量构建结果不同
优先选择xcode-debugging的原因:90%的疑难问题源于环境而非代码,请在调试代码前先检查环境。
调用方式:
/skill axiom-xcode-debugging2. Slow Builds → build-performance
2. 构建缓慢问题 → build-performance
Triggers:
- Compilation takes too long
- Type checking bottlenecks
- Want to optimize build time
- Build Timeline shows slow phases
Invoke:
/skill axiom-build-performance触发条件:
- 编译耗时过长
- 类型检查瓶颈
- 希望优化构建时间
- 构建时间线显示阶段耗时过长
调用方式:
/skill axiom-build-performance3. SPM Dependency Conflicts → spm-conflict-resolver (Agent)
3. SPM依赖冲突 → spm-conflict-resolver(Agent)
Triggers:
- SPM resolution failures
- "No such module" after adding package
- Duplicate symbol linker errors
- Version conflicts between packages
- Swift 6 package compatibility issues
- Package.swift / Package.resolved conflicts
Why spm-conflict-resolver: Specialized agent that analyzes Package.swift and Package.resolved to diagnose and resolve Swift Package Manager conflicts.
Invoke: Launch agent
spm-conflict-resolver触发条件:
- SPM解析失败
- 添加包后出现"No such module"错误
- 重复符号链接器错误
- 包之间的版本冲突
- Swift 6包兼容性问题
- Package.swift / Package.resolved冲突
选择spm-conflict-resolver的原因:这是专门分析Package.swift和Package.resolved以诊断并解决Swift Package Manager冲突的智能代理。
调用方式:启动代理
spm-conflict-resolver4. Security & Privacy Audit → security-privacy-scanner (Agent)
4. 安全与隐私审计 → security-privacy-scanner(Agent)
Triggers:
- App Store submission prep
- Privacy Manifest requirements (iOS 17+)
- Hardcoded credentials in code
- Sensitive data storage concerns
- ATS violations
- Required Reason API declarations
Why security-privacy-scanner: Specialized agent that scans for security vulnerabilities and privacy compliance issues.
Invoke: Launch agent or
security-privacy-scanner/axiom:audit security触发条件:
- App Store提交准备
- 隐私清单要求(iOS 17+)
- 代码中存在硬编码凭证
- 敏感数据存储隐患
- ATS违规
- Required Reason API声明
选择security-privacy-scanner的原因:这是专门扫描安全漏洞和隐私合规问题的智能代理。
调用方式:启动代理或
security-privacy-scanner/axiom:audit security5. iOS 17→18 Modernization → modernization-helper (Agent)
5. iOS 17→18版本适配 → modernization-helper(Agent)
Triggers:
- Migrate ObservableObject to @Observable
- Update @StateObject to @State
- Adopt modern SwiftUI patterns
- Deprecated API cleanup
- iOS 17+ migration
Why modernization-helper: Specialized agent that scans for legacy patterns and provides migration paths with code examples.
Invoke: Launch agent or
modernization-helper/axiom:audit modernization触发条件:
- 从ObservableObject迁移到@Observable
- 将@StateObject更新为@State
- 采用现代SwiftUI模式
- 清理废弃API
- iOS 17+版本迁移
选择modernization-helper的原因:这是专门扫描旧有模式并提供含代码示例的迁移方案的智能代理。
调用方式:启动代理或
modernization-helper/axiom:audit modernization6. General Dependency Issues → build-debugging
6. 通用依赖问题 → build-debugging
Triggers:
- CocoaPods resolution failures
- "Multiple commands produce" errors
- Framework version mismatches
- Non-SPM dependency graph conflicts
Invoke:
/skill axiom-build-debugging触发条件:
- CocoaPods解析失败
- "Multiple commands produce"错误
- 框架版本不匹配
- 非SPM依赖图冲突
调用方式:
/skill axiom-build-debugging7. TestFlight Crash Triage → testflight-triage
7. TestFlight崩溃分类排查 → testflight-triage
Triggers:
- Beta tester reported a crash
- Crash reports in Xcode Organizer
- Crash logs aren't symbolicated
- TestFlight feedback with screenshots
- App was killed but no crash report
Why testflight-triage: Systematic workflow for investigating TestFlight crashes and reviewing beta feedback. Covers symbolication, crash interpretation, common patterns, and Claude-assisted analysis.
Invoke:
/skill axiom-testflight-triage触发条件:
- 测试人员反馈崩溃
- Xcode Organizer中的崩溃报告
- 崩溃日志未符号化
- 带截图的TestFlight反馈
- 应用被终止但无崩溃报告
选择testflight-triage的原因:提供系统化的TestFlight崩溃调查和Beta反馈审查流程,涵盖符号化、崩溃解读、常见模式及Claude辅助分析。
调用方式:
/skill axiom-testflight-triage8. App Store Connect Navigation → app-store-connect-ref
8. App Store Connect导航指引 → app-store-connect-ref
Triggers:
- How to find crashes in App Store Connect
- ASC metrics dashboard navigation
- Understanding crash-free users percentage
- Comparing crash rates between versions
- Exporting crash data from ASC
- App Store Connect API for crash data
Why app-store-connect-ref: Reference for navigating ASC crash analysis, metrics dashboards, and data export workflows.
Invoke:
/skill axiom-app-store-connect-ref触发条件:
- 如何在App Store Connect中查找崩溃信息
- ASC指标仪表板导航
- 理解无崩溃用户占比
- 对比版本间的崩溃率
- 从ASC导出崩溃数据
- 用于崩溃数据的App Store Connect API
选择app-store-connect-ref的原因:提供ASC崩溃分析、指标仪表板及数据导出流程的导航参考。
调用方式:
/skill axiom-app-store-connect-ref9. Crash Log Analysis → crash-analyzer (Agent)
9. 崩溃日志分析 → crash-analyzer(Agent)
Triggers:
- User has .ips or .crash file to analyze
- User pasted crash report text
- Need to parse crash log programmatically
- Identify crash pattern from exception type
- Check symbolication status
Why crash-analyzer: Autonomous agent that parses crash reports, identifies patterns (null pointer, Swift runtime, watchdog, jetsam), and generates actionable analysis.
Invoke: Launch agent or
crash-analyzer/axiom:analyze-crash触发条件:
- 用户需要分析.ips或.crash文件
- 用户粘贴了崩溃报告文本
- 需要以编程方式解析崩溃日志
- 根据异常类型识别崩溃模式
- 检查符号化状态
选择crash-analyzer的原因:自主代理,可解析崩溃报告、识别模式(空指针、Swift运行时、看门狗、jetsam)并生成可执行的分析结果。
调用方式:启动代理或
crash-analyzer/axiom:analyze-crash10. MetricKit API Reference → metrickit-ref
10. MetricKit API参考 → metrickit-ref
Triggers:
- MetricKit setup and subscription
- MXMetricPayload parsing (CPU, memory, launches, hitches)
- MXDiagnosticPayload parsing (crashes, hangs, disk writes)
- MXCallStackTree decoding and symbolication
- Field crash/hang collection
- Background exit metrics
Why metrickit-ref: Complete MetricKit API reference with setup patterns, payload parsing, and integration with crash reporting systems.
Invoke:
/skill axiom-metrickit-ref触发条件:
- MetricKit设置与订阅
- MXMetricPayload解析(CPU、内存、启动次数、卡顿)
- MXDiagnosticPayload解析(崩溃、挂起、磁盘写入)
- MXCallStackTree解码与符号化
- 线上崩溃/挂起收集
- 后台退出指标
选择metrickit-ref的原因:完整的MetricKit API参考,包含设置模式、负载解析及与崩溃报告系统的集成。
调用方式:
/skill axiom-metrickit-ref11. Hang Diagnostics → hang-diagnostics
11. 应用挂起诊断 → hang-diagnostics
Triggers:
- App hangs or freezes
- Main thread blocked for >1 second
- UI unresponsive to touches
- Xcode Organizer shows hang diagnostics
- MXHangDiagnostic from MetricKit
- Watchdog terminations (app killed during launch/background transition)
Why hang-diagnostics: Systematic diagnosis of hangs with decision tree for busy vs blocked main thread, tool selection (Time Profiler, System Trace), and 8 common hang patterns with fixes.
Invoke:
/skill axiom-hang-diagnostics触发条件:
- 应用挂起或冻结
- 主线程阻塞超过1秒
- UI无法响应触摸
- Xcode Organizer显示挂起诊断
- MetricKit的MXHangDiagnostic
- 看门狗终止(应用在启动/后台切换时被杀死)
选择hang-diagnostics的原因:提供系统化的挂起诊断流程,包含主线程繁忙/阻塞的决策树、工具选择(Time Profiler、System Trace),以及8种常见挂起模式及修复方案。
调用方式:
/skill axiom-hang-diagnosticsDecision Tree
决策树
- Mysterious/intermittent/clean build fails? → xcode-debugging (environment-first)
- SPM dependency conflict? → spm-conflict-resolver (Agent)
- CocoaPods/other dependency conflict? → build-debugging
- Slow build time? → build-performance
- Security/privacy/App Store prep? → security-privacy-scanner (Agent)
- Modernization/deprecated APIs? → modernization-helper (Agent)
- TestFlight crash/feedback? → testflight-triage
- Navigating App Store Connect? → app-store-connect-ref
- Have a crash log (.ips/.crash)? → crash-analyzer (Agent)
- MetricKit setup/parsing? → metrickit-ref
- App hang/freeze/watchdog? → hang-diagnostics
- 出现疑难/间歇性/干净构建失败?→ xcode-debugging(优先环境检查)
- SPM依赖冲突?→ spm-conflict-resolver(智能代理)
- CocoaPods/其他依赖冲突?→ build-debugging
- 构建耗时过长?→ build-performance
- 安全/隐私/App Store提交准备?→ security-privacy-scanner(智能代理)
- 版本适配/废弃API清理?→ modernization-helper(智能代理)
- TestFlight崩溃/反馈?→ testflight-triage
- App Store Connect导航?→ app-store-connect-ref
- 有崩溃日志(.ips/.crash)?→ crash-analyzer(智能代理)
- MetricKit设置/解析?→ metrickit-ref
- 应用挂起/冻结/看门狗终止?→ hang-diagnostics
Anti-Rationalization
常见误区纠正
| Thought | Reality |
|---|---|
| "I know how to fix this linker error" | Linker errors have 4+ root causes. xcode-debugging diagnoses all in 2 min. |
| "Let me just clean the build folder" | Clean builds mask the real issue. xcode-debugging finds the root cause. |
| "It's just an SPM issue, I'll fix Package.swift" | SPM conflicts cascade. spm-conflict-resolver analyzes the full dependency graph. |
| "The simulator is just slow today" | Simulator issues indicate environment corruption. xcode-debugging checks systematically. |
| "I'll skip environment checks, it compiles locally" | Environment-first saves 30+ min. Every time. |
| 错误想法 | 实际情况 |
|---|---|
| "我知道怎么修复这个链接器错误" | 链接器错误有4种以上根本原因,xcode-debugging可在2分钟内完成全面诊断。 |
| "我先清理构建文件夹试试" | 清理构建会掩盖真实问题,xcode-debugging能找到根本原因。 |
| "这只是SPM问题,我修改Package.swift就行" | SPM冲突会连锁反应,spm-conflict-resolver会分析完整的依赖图。 |
| "今天模拟器只是变慢了" | 模拟器问题通常表明环境已损坏,xcode-debugging会进行系统化检查。 |
| "我跳过环境检查,本地能编译就行" | 优先检查环境每次能节省30分钟以上的时间。 |
When NOT to Use (Conflict Resolution)
禁用场景(冲突解决)
Do NOT use ios-build for these — use the correct router instead:
| Error Type | Correct Router | Why NOT ios-build |
|---|---|---|
| Swift 6 concurrency errors | ios-concurrency | Code error, not environment |
| SwiftData migration errors | ios-data | Schema issue, not build environment |
| "Sending 'self' risks data race" | ios-concurrency | Language error, not Xcode issue |
| Type mismatch / compilation errors | Fix the code | These are code bugs |
ios-build is for environment mysteries, not code errors:
- ✅ "No such module" when code is correct
- ✅ Simulator won't boot
- ✅ Clean build fails, incremental works
- ✅ Zombie xcodebuild processes
- ❌ Swift concurrency warnings/errors
- ❌ Database migration failures
- ❌ Type checking errors in valid code
以下情况请勿使用ios-build,请使用对应的正确路由工具:
| 错误类型 | 正确路由工具 | 禁用原因 |
|---|---|---|
| Swift 6并发错误 | ios-concurrency | 代码错误,非环境问题 |
| SwiftData迁移错误 | ios-data | 架构问题,非构建环境问题 |
| "Sending 'self' risks data race" | ios-concurrency | 语言特性错误,非Xcode问题 |
| 类型不匹配/编译错误 | 直接修复代码 | 这些是代码bug |
ios-build仅用于环境类疑难问题,而非代码错误:
- ✅ 代码正确但出现"No such module"错误
- ✅ 模拟器无法启动
- ✅ 干净构建失败,增量构建正常
- ✅ Xcode构建僵尸进程
- ❌ Swift并发警告/错误
- ❌ 数据库迁移失败
- ❌ 有效代码中的类型检查错误
Example Invocations
调用示例
User: "My build failed with a linker error"
→ Invoke: (environment-first diagnostic)
/skill axiom-xcode-debuggingUser: "Builds are taking 10 minutes"
→ Invoke:
/skill axiom-build-performanceUser: "SPM won't resolve dependencies"
→ Invoke: agent
spm-conflict-resolverUser: "Two packages require different versions of the same dependency"
→ Invoke: agent
spm-conflict-resolverUser: "Duplicate symbol linker error"
→ Invoke: agent
spm-conflict-resolverUser: "I need to prepare for App Store security review"
→ Invoke: agent
security-privacy-scannerUser: "Do I need a Privacy Manifest?"
→ Invoke: agent
security-privacy-scannerUser: "Are there hardcoded credentials in my code?"
→ Invoke: agent
security-privacy-scannerUser: "How do I migrate from ObservableObject to @Observable?"
→ Invoke: agent
modernization-helperUser: "Update my code to use modern SwiftUI patterns"
→ Invoke: agent
modernization-helperUser: "Should I still use @StateObject?"
→ Invoke: agent
modernization-helperUser: "A beta tester said my app crashed"
→ Invoke:
/skill axiom-testflight-triageUser: "I see crashes in App Store Connect but don't know how to investigate"
→ Invoke:
/skill axiom-testflight-triageUser: "My crash logs aren't symbolicated"
→ Invoke:
/skill axiom-testflight-triageUser: "I need to review TestFlight feedback"
→ Invoke:
/skill axiom-testflight-triageUser: "How do I find crashes in App Store Connect?"
→ Invoke:
/skill axiom-app-store-connect-refUser: "Where's the crash-free users metric in ASC?"
→ Invoke:
/skill axiom-app-store-connect-refUser: "How do I export crash data from App Store Connect?"
→ Invoke:
/skill axiom-app-store-connect-refUser: "Analyze this crash log" [pastes .ips content]
→ Invoke: agent or
crash-analyzer/axiom:analyze-crashUser: "Parse this .ips file: ~/Library/Logs/DiagnosticReports/MyApp.ips"
→ Invoke: agent or
crash-analyzer/axiom:analyze-crashUser: "Why did my app crash? Here's the report..."
→ Invoke: agent or
crash-analyzer/axiom:analyze-crashUser: "How do I set up MetricKit to collect crash data?"
→ Invoke:
/skill axiom-metrickit-refUser: "How do I parse MXDiagnosticPayload?"
→ Invoke:
/skill axiom-metrickit-refUser: "What's in MXCallStackTree and how do I decode it?"
→ Invoke:
/skill axiom-metrickit-refUser: "My app hangs sometimes"
→ Invoke:
/skill axiom-hang-diagnosticsUser: "The main thread is blocked and UI is unresponsive"
→ Invoke:
/skill axiom-hang-diagnosticsUser: "Xcode Organizer shows hang diagnostics for my app"
→ Invoke:
/skill axiom-hang-diagnosticsUser: "My app was killed by watchdog during launch"
→ Invoke:
/skill axiom-hang-diagnostics用户:"我的构建因链接器错误失败"
→ 调用:(优先环境诊断)
/skill axiom-xcode-debugging用户:"构建需要10分钟"
→ 调用:
/skill axiom-build-performance用户:"SPM无法解析依赖"
→ 调用:智能代理
spm-conflict-resolver用户:"两个包需要同一依赖的不同版本"
→ 调用:智能代理
spm-conflict-resolver用户:"出现重复符号链接器错误"
→ 调用:智能代理
spm-conflict-resolver用户:"我需要为App Store安全审查做准备"
→ 调用:智能代理
security-privacy-scanner用户:"我需要隐私清单吗?"
→ 调用:智能代理
security-privacy-scanner用户:"我的代码里有硬编码凭证吗?"
→ 调用:智能代理
security-privacy-scanner用户:"如何从ObservableObject迁移到@Observable?"
→ 调用:智能代理
modernization-helper用户:"更新我的代码以使用现代SwiftUI模式"
→ 调用:智能代理
modernization-helper用户:"我还应该使用@StateObject吗?"
→ 调用:智能代理
modernization-helper用户:"测试人员反馈我的应用崩溃了"
→ 调用:
/skill axiom-testflight-triage用户:"我在App Store Connect中看到崩溃,但不知道如何排查"
→ 调用:
/skill axiom-testflight-triage用户:"我的崩溃日志未符号化"
→ 调用:
/skill axiom-testflight-triage用户:"我需要审查TestFlight反馈"
→ 调用:
/skill axiom-testflight-triage用户:"如何在App Store Connect中查找崩溃信息?"
→ 调用:
/skill axiom-app-store-connect-ref用户:"ASC中的无崩溃用户指标在哪里?"
→ 调用:
/skill axiom-app-store-connect-ref用户:"如何从App Store Connect导出崩溃数据?"
→ 调用:
/skill axiom-app-store-connect-ref用户:"分析这个崩溃日志" [粘贴.ips内容]
→ 调用:智能代理或
crash-analyzer/axiom:analyze-crash用户:"解析这个.ips文件:~/Library/Logs/DiagnosticReports/MyApp.ips"
→ 调用:智能代理或
crash-analyzer/axiom:analyze-crash用户:"我的应用为什么崩溃?这是报告..."
→ 调用:智能代理或
crash-analyzer/axiom:analyze-crash用户:"如何设置MetricKit以收集崩溃数据?"
→ 调用:
/skill axiom-metrickit-ref用户:"如何解析MXDiagnosticPayload?"
→ 调用:
/skill axiom-metrickit-ref用户:"MXCallStackTree包含什么内容,如何解码?"
→ 调用:
/skill axiom-metrickit-ref用户:"我的应用有时会挂起"
→ 调用:
/skill axiom-hang-diagnostics用户:"主线程被阻塞,UI无响应"
→ 调用:
/skill axiom-hang-diagnostics用户:"Xcode Organizer显示我的应用有挂起诊断"
→ 调用:
/skill axiom-hang-diagnostics用户:"我的应用在启动时被看门狗杀死"
→ 调用:
/skill axiom-hang-diagnostics