autoresearch
Autonomous goal-directed iteration loop: modify, verify, keep/discard against a metric or a checkable success predicate, with…
Build and test iOS apps on simulator using XcodeBuildMCP. Use after making iOS code changes, before creating a PR, or when verifying app behavior and checking for crashes on simulator.
$ npx -y skills add leo-kuang-ai/spec-first --skill spec-test-xcode --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/spec-test-xcodeContext preview
The summary Claude sees to decide when to auto-load this skill.
Build and test iOS apps on simulator using XcodeBuildMCP. Use after making iOS code changes, before creating a PR, or when verifying app behavior and checking for crashes on simulator.
name: spec-test-xcode description: "Build and test iOS apps on simulator using XcodeBuildMCP. Use after making iOS code changes, before creating a PR, or when verifying app behavior and checking for crashes on simulator." argument-hint: "[scheme name or 'current' to use default]" disable-model-invocation: true
Build, install, and test iOS apps on the simulator using XcodeBuildMCP. Captures screenshots, logs, and verifies app behavior.
Check that the XcodeBuildMCP MCP server is connected by calling its `list_simulators` tool.
MCP tool names vary by platform:
If the tool is not found or errors, inform the user they need to add the XcodeBuildMCP MCP server:
XcodeBuildMCP not installed Install via Homebrew: brew tap getsentry/xcodebuildmcp && brew install xcodebuildmcp Or via npx (no global install needed): npx -y xcodebuildmcp@latest mcp Then add "XcodeBuildMCP" as an MCP server in your agent configuration and restart your agent.
Do NOT proceed until XcodeBuildMCP is confirmed working.
MCP readiness 只证明 provider 能响应 capability probe;它不证明目标 App 已完成 build、install、launch,或渲染了任何被测 screen。
Call XcodeBuildMCP's `discover_projs` tool to find available projects, then `list_schemes` with the project path to get available schemes.
If an argument was provided, use that scheme name. If "current", use the default/last-used scheme.
第一次 build 前,记录目标 project/workspace path、scheme、所选 simulator identity,以及当前可获得的最佳 source identity。优先记录 Git revision 与 dirty-state/fingerprint context;目标不是 Git worktree 或无法捕获 fingerprint 时,必须将其保留为显式 source-binding limitation,不得让该字段隐式缺失。
Call `list_simulators` to find available simulators. Boot the preferred simulator (iPhone 15 Pro recommended) using `boot_simulator` with the simulator's UUID.
Wait for the simulator to be ready before proceeding.
Call `build_ios_sim_app` with the project path and scheme name.
**On failure:**
**On success:**
1. Call `install_app_on_simulator` with the built app path and simulator UUID 2. Call `launch_app_on_simulator` with the bundle ID and simulator UUID 3. Call `capture_sim_logs` with the simulator UUID and bundle ID to start log capture
For each key screen in the app:
**Take screenshot:** Call `take_screenshot` with the simulator UUID and a descriptive filename (e.g., `screen-home.png`).
**Review screenshot for:**
**Check logs for errors:** Call `get_sim_logs` with the simulator UUID. Look for:
**Known automation limitation — SwiftUI Text links:** Simulated taps (via XcodeBuildMCP or any simulator automation tool) do not trigger gesture recognizers on SwiftUI `Text` views with inline `AttributedString` links. Taps report success but have no effect. This is a platform limitation — inline links are not exposed as separate elements in the accessibility tree. When a tap on a Text link has no visible effect, prompt the user to tap manually in the simulator.
`xcrun simctl openurl <device> <URL>` is an effect-bearing fallback, not an automatic tap substitute. Parse the exact target before execution: reject `file:`, `data:`, and `javascript:` URLs; allow credential-free loopback HTTP(S) only after displaying the resolved URL; and require the run-local fact `url_open_authorization: authorized | missing` for external HTTP(S) or custom app schemes. Show the exact target, scheme, expected network/app-state effect, and device before asking. Missing authority returns `url_open_authorization_missing` with zero `simctl openurl` calls. Permission to build/test, simulator selection, a visible link, or a known URL does not imply this authority.
Pause for human input when testing touches flows that require device interaction.
| Flow Type | What to Ask | |-----------|-------------| | Sign in with Apple | "Please complete Sign in with Apple on the simulator" | | Push notifications | "Send a test push and confirm it appears" | | In-app purchases | "Complete a sandbox purchase" | | Camera/Photos | "Grant permissions and verify camera works" | | Location | "Allow location access and verify map updates" | | SwiftUI Text links | "Please tap on [element description] manually — automated taps cannot trigger inline text links" |
Ask the user using the platform's blocking question tool: `AskUserQuestion` in Claude Code (call `ToolSearch` with `select:AskUserQuestion` first if its schema isn't loaded) or `request_user_input` in Codex. Fall back to numbered options in chat only when no blocking tool exists in the harness or the call errors (e.g., Codex edit modes) — not because a schema load is required. Never silently skip the question:
Human Verification Needed This test requires [flow type]. Please: 1. [Action to take on simulator] 2. [What to verify] Did it work correctly? 1. Yes - continue testing 2. No - describe the issue
When a test fails:
1. **Document the failure:**
2. **Ask the user how to proceed:**
Test Failed: [screen/feature] Issue: [description] Logs: [relevant error messages]
把 AI coding 会话变成可信、由项目拥有的变更。 spec-first 是面向 Claude Code、Codex、Kiro、Qoder、Cursor、OpenCode、ZCode 与 Pi 的仓库原生 AI Coding Harness。它把想法、需求、计划、代码、审查和知识连接成可检查的工程闭环。
Autonomous goal-directed iteration loop: modify, verify, keep/discard against a metric or a checkable success predicate, with…
Audit mobile App PRD/Figma/local-source consistency across page routes, KMP/Clean Architecture, components, analytics, i18n,…
Explore vague or ambitious ideas into a right-sized requirements-only unified plan. Use when the user wants to brainstorm, think…
Structured code review for bugs, regressions, tests, and standards. Report-only by default; apply fixes only when the current…
Internal landing helper for public workflows that already hold explicit commit and landing authorization; commits scoped changes,…
Internal commit helper for public workflows that already hold explicit commit authorization; creates scoped, value-communicating…