debugging
iOS/macOS 运行时调试与问题排查 Skill。用于 crash、异常、运行时错误、对象未释放、内存泄漏、Watchdog、卡死、行为异常等有运行时症状的问题;不要把编译验证、静态代码审查、性能 profiling、benchmark 或构建配置误判到本 Skill。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
iOS/macOS 运行时调试与问题排查 Skill。用于 crash、异常、运行时错误、对象未释放、内存泄漏、Watchdog、卡死、行为异常等有运行时症状的问题;不要把编译验证、静态代码审查、性能 profiling、benchmark 或构建配置误判到本 Skill。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
默认优先使用的 iOS 主 Skill 入口;先按任务复杂度选择 lite / standard / full 档位,再协调 coder / reviewer / tester / reporter / main agent 分工;所有 iOS 生产代码与测试代码实施统一路由到 ios-feature-implementation 的内部模式,验证统一路由到 ios-verification,正式 HTML 文档生成统一路由到 html-docs,调试、性能、审查与构建配置仍路由到专项模块;除实现后的 code-review 必须由独立 reviewer subAgent 执行外,其它 subAgent 使用不做仓库级限制。
iOS Design Context Compiler Skill。用于把明确的 Figma / Sketch / 人工设计证据归一化为 Canonical UI IR,校验设计真源、布局意图、token、状态、交互和 unknowns,解析 UIKit / SwiftUI 组件绑定,并按 screen / region / component 生成低 Token Agent Packet;也用于执行 screenshot-only、UI IR、UI IR+Binding 的收益基准。不要用于视觉方向探索、直接编写产品 UI、截图执行或最终视觉验收。
统一 iOS 实施 Skill。作为所有 iOS 代码实施、测试代码编写、页面落地、SDK/Framework 架构契约和结构重构的单一实现入口;根据本地项目事实自动选择 business、swiftui、uikit、mixed-ui、advanced-swift、refactor、sdk-contract、liquid-glass 或 test-implementation 模式,覆盖 service/repository/use case/view model/coordinator/router、SwiftUI/UIKit 页面与组件、XCTest/XCUITest/Mock/Stub/Spy/Fake/fixture/Page Object、iOS 26+ SwiftUI Liquid Glass、复杂 Swift 并发/Sendable/泛型/类型擦除、行为保持型重构、跨模块 Public API、SDK 模块边界、Configuration、分发与版本演进;不要再把普通 SwiftUI/UIKit/Swift 进阶/SDK 架构/Liquid Glass 或测试代码编写拆到独立实现 Skill,构建配置、运行时调试、性能取证、Apple 官方事实检索和验证执行/证据裁决仍路由到对应专项 Skill。
UI/UX 设计系统与开放式设计探索 Skill。用于视觉方向、设计系统、交互规则、色板、字体、无障碍、设计评审、原型方向、HTML review 优先的设计交付建议;也用于读取 Sketch 源文件 / SketchMCP / 蓝湖标注并整理可追溯 Design-to-Code source packet,iOS 高保真链路随后交给 design-context-compiler 生成 Canonical UI IR / Agent Packet;若需要正式 HTML 文档交给 html-docs。不要用于 SwiftUI/UIKit API 级实现、设计上下文编译、构建配置或性能取证。
iOS / Apple Xcode 项目统一验证 Skill。用于验证前路由、优先通过官方 Xcode MCP 执行最窄交互式 build/test、按风险升级到 codex_verify wrapper + shared build-queue 的项目环境证据、读取 MCP 结果或结构化 artifact 做低 token 失败归因,以及在定向验证和独立 code-review 后裁决最终证据是否足够;替代原先分散的验证路由、受影响测试选择、定向验证执行、构建日志摘要、最终证据裁决与项目环境构建验证入口。
App Store 机会研究技能。用于在指定赛道中识别可商业化机会,完成竞品缺口分析、Top-3 机会排序与 MVP PRD 源素材整理;若需要正式 HTML 研究报告或 PRD,最终文档生成交给 html-docs;可按需补充 Rork 原型提示词。
| name | debugging |
| description | iOS/macOS 运行时调试与问题排查 Skill。用于 crash、异常、运行时错误、对象未释放、内存泄漏、Watchdog、卡死、行为异常等有运行时症状的问题;不要把编译验证、静态代码审查、性能 profiling、benchmark 或构建配置误判到本 Skill。 |
Diagnose iOS/macOS runtime failures using symptoms, logs, stack traces, reproduction steps, and runtime evidence, then provide root-cause analysis, focused fixes, and verification guidance.
该 Skill 是运行时排障专项 Skill。
负责:
不负责:
Use this Skill when at least one runtime signal exists:
Do not use this Skill when:
code-review.ios-verification / ios-verification.xctrace, or Instruments workflow; use ios-performance.xcode-build.ios-feature-implementation(test-implementation).ios-verification.code-review.ios-verification / ios-verification are optional strengthening steps only when explicitly requested or risk requires it.ios-verification.| Symptom | Common Causes | First Checks |
|---|---|---|
EXC_BAD_ACCESS | Use-after-free, unsafe pointer, invalid memory access, data race | Zombie objects, memory graph, thread access, first app frame |
EXC_BAD_INSTRUCTION | fatalError, preconditionFailure, forced unwrap, invalid cast | Assertion site, optional chain, type assumptions |
SIGABRT | NSException, unrecognized selector, Auto Layout exception, KVC issue | Exception reason, ObjC selector, view hierarchy |
Watchdog | Main thread blocked, deadlock, long launch/background task | Main thread stack, synchronous I/O, locks, launch work |
| Object not deallocated | Retain cycle, timer, delegate, subscription, notification | Memory Graph, closure captures, dispose/cancel lifecycle |
| UI freeze | Main thread work, layout loop, lock contention | main thread backtrace, runloop, layout invalidation |
| Async wrong state | Race, cancellation, callback order, actor boundary | task lifetime, state machine, main actor, cancellation path |
Expected input contract:
{
"symptom": "crash | exception | leak | hang | wrong_behavior | unknown",
"logs": [],
"stack_trace": "optional",
"exception_reason": "optional",
"reproduction_steps": [],
"device": "optional",
"os_version": "optional",
"app_version": "optional",
"changed_files": [],
"recent_changes": [],
"constraints": []
}
Minimal useful input:
{
"symptom": "crash",
"stack_trace": "...",
"reproduction_steps": ["..."]
}
Return compact structured output:
{
"status": "diagnosed | probable | needs-more-evidence | fixed | blocked",
"symptom_type": "crash | exception | leak | hang | wrong_behavior | unknown",
"location": "File.swift:method:line | unknown",
"first_app_frame": "optional",
"root_cause": "...",
"confidence": "high | medium | low",
"evidence": [],
"fix_plan": [],
"defensive_changes": [],
"validation_plan": [],
"residual_risk": [],
"next_action": "fix | collect-evidence | run-targeted-validation | code-review | blocked"
}
Return diagnosed when:
Return probable when:
Return needs-more-evidence when:
Return fixed when:
Return blocked when:
Escalate to code-review when:
Escalate to ios-performance when:
xctrace, or Instruments evidence.Escalate to ios-feature-implementation(test-implementation) when test code is needed; escalate to ios-verification when targeted validation is needed:
Escalate to ios-verification when:
Escalate to ios-verification only when:
ios-verification determines the debugging fix needs full build evidence.Escalate to unified implementation when:
🔍 问题类型: crash | exception | leak | hang | wrong_behavior
📍 位置: File.swift:method:line | unknown
🧩 首个 App 栈帧: ...
💡 根因分析: ...
📎 证据: ...
🔧 修复方案: ...
🛡️ 防御建议: ...
✅ 验证计划: ...
⚠️ 残余风险: ...
If evidence is insufficient:
当前无法确认根因。
缺少证据:
- symbolicated crash stack
- reproduction steps
- device / OS version
下一步: collect-evidence
LLDB:
bt
bt all
po <variable>
expr <expression>
thread backtrace all
image lookup -a <address>
Memory / lifecycle:
Memory Graph
Zombies
Malloc Stack Logging
Leaks instrument
Allocations instrument
references/memory-leak.md: common leak patterns and Memory Graph usage.code-review.ios-performance.ios-verification.ios-verification.ios-feature-implementation(test-implementation); targeted validation: use ios-verification.xcode-build.ios-feature-implementation with the matching internal mode (business, swiftui, uikit, mixed-ui, advanced-swift, or refactor).