[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M77R87PDKBP83R7SB6RNCJ7H":3,"skill-same:01M77R87PDKBP83R7SB6RNCJ7H":52},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":6,"updatedAt":31,"install":32,"resources":45},"01M77R87PDKBP83R7SB6RNCJ7H","ios-app-test",null,"Run and report the local-first iOS simulator testing workflow for the hawky app. Use when asked to test the iOS app, verify an iOS UI change, run simulator smoke checks, exercise XcodeBuildMCP screenshots\u002Ftaps\u002Faccessibility, run hawky UI tests, or produce an iOS UX\u002Faccessibility audit report for this repo. Works with any MCP-capable agent (Claude Code, Codex).","hao-ai-lab\u002Fhawky","hao-ai-lab","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F149045815?v=4","01M77R84J08EF4S0F8PR8CM7Y3","Hao AI Lab","01M77R84JS1XG4SDF3RMGFB1TG",33,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fhao-ai-lab\u002Fhawky\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fios-app-test\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: ios-app-test\ndescription: Run and report the local-first iOS simulator testing workflow for the hawky app. Use when asked to test the iOS app, verify an iOS UI change, run simulator smoke checks, exercise XcodeBuildMCP screenshots\u002Ftaps\u002Faccessibility, run hawky UI tests, or produce an iOS UX\u002Faccessibility audit report for this repo. Works with any MCP-capable agent (Claude Code, Codex).\n---\n\n# iOS App Test\n\nUse this skill to test `ios\u002Fhawky` locally through deterministic commands plus XcodeBuildMCP simulator automation.\n\nThis skill's source of truth is `.agents\u002Fskills\u002Fios-app-test\u002FSKILL.md`.\nClaude Code loads the same file through the `.claude\u002Fskills\u002Fios-app-test\u002FSKILL.md`\nsymlink.\n\n## Scope\n\nThis skill is simulator-first. It verifies build, launch, navigation, Live\u002FSettings UI, semantic accessibility, deterministic unit\u002FUI tests, screenshots, and obvious UX regressions.\n\nDo not claim physical-device coverage. These still need manual device verification:\n\n- Live Activity \u002F Dynamic Island\n- BLE glasses pairing and HFP audio\n- Camera capture quality\n- AVAudioSession \u002F live mic behaviour\n- Real authenticated gateway sessions over Tailscale\n\n## Prerequisites \u002F First Run\n\n**Before any run, confirm the environment is ready.** The cheap per-run check is `session_show_defaults` (Modes → Step 0). On a fresh checkout, or when Step 0 surfaces a problem, run the full detect + setup below — auto-fix what is safe, surface what needs a human, and never silently change the system (no unsanctioned `brew`).\n\n1. **Detect:** run `bun run ios:mcp:doctor`. It reports Xcode, the simulator, `axe` (UI automation), and `lldb` status.\n\n2. **Safe to auto-fix (do without asking):**\n   - Project missing or stale vs `ios\u002Fproject.yml`: run `bun run ios:check-generated`. If it reports generated drift, keep the generated project updates that match `ios\u002Fproject.yml`; use `bun run ios:generate` when the project file itself must be regenerated outside a check.\n   - Default simulator missing: create the configured `IOS_SIMULATOR_NAME` (defaults to `iPhone 17 Pro`) with the latest available iOS runtime, or fall back to another booted device and note the substitution in the report.\n   - XcodeBuildMCP itself is fetched on demand by `npx` via `.mcp.json` \u002F `.codex\u002Fconfig.toml` — no manual install.\n\n3. **Surface, do not auto-change the system:**\n   - **XcodeBuildMCP tools not available** (e.g. `session_show_defaults` is missing): the server is registered in `.mcp.json` (Claude Code) and `.codex\u002Fconfig.toml` (Codex), but the agent must be **restarted** and the project MCP server **trusted\u002Fapproved** before the tools load. Ask the user to do this, then retry. The deterministic commands (`ios:sim-smoke` \u002F `ios:ui-test` \u002F `ios:test`) still run without the MCP server.\n   - **`axe` not installed:** only the best-effort `snapshot_ui` \u002F `tap` exploratory path needs it (`brew tap cameroncooke\u002Faxe && brew install axe`). The deterministic XCUITest path does not. Recommend it; do not run `brew` without consent.\n   - **Xcode missing or wrong version:** cannot auto-fix — stop and report.\n\n4. **Gateway (optional):** only connected-session flows need it. UI-render, navigation, and audit modes run fine disconnected under `--uitesting`. Start with `bun run gateway` only when a test needs a live session.\n\n## Modes\n\n**Step 0 (always, before any mode):** confirm the environment is ready. Call `session_show_defaults` to verify the project\u002Fscheme\u002Fsimulator and that XcodeBuildMCP tools are loaded. If tools are missing or anything looks off, run `bun run ios:mcp:doctor` and resolve it per **Prerequisites \u002F First Run** above before continuing. Never skip this — a broken environment should surface as a clear pre-flight failure, not a mid-run error.\n\n**Step 1 (backend scope):** choose the smallest backend mode that matches the request and state it in the report.\n\n- **pure-ui**: default for navigation, form, accessibility, screenshot, and report checks. Do not start the gateway.\n- **mock+seed**: default for connected-looking UI states. Use launch configuration \u002F launch environment and in-memory mocks such as `IOS_UI_TESTING_LIVE_MOCK=1`; future seed profiles should use env-backed fixtures instead of a real gateway.\n- **live-integration**: only when the user explicitly asks to verify real gateway behaviour. Check settings and environment first:\n  - Resolve the gateway URL from `IOS_INTEGRATION_GATEWAY_URL`, then `IOS_LIVE_GATEWAY_URL`, else `http:\u002F\u002F127.0.0.1:4242`.\n  - Check `\u002Fhealth` for that URL. If a sandboxed `curl` fails but `lsof` or a user shell shows the port is listening, rerun the health check\u002Ftest outside the sandbox with approval before reporting the gateway as down.\n  - If the gateway is not running and the user wants the harness to start it, set `IOS_LIVE_START_GATEWAY=1`; otherwise ask the user to start `bun run gateway`.\n  - When starting the gateway, confirm provider credentials\u002Fconfig exist (`OPENAI_API_KEY`, Anthropic key, or Vertex config depending on `~\u002F.hawky\u002Fconfig.json`) because gateway startup can fail before `\u002Fhealth` if provider auth is missing.\n  - For simulator-hosted Swift tests, shell env is not enough: the live script sets `IOS_INTEGRATION_GATEWAY_URL` inside simulator launchd before running tests.\n  Run `bun run ios:test:live` for the non-LLM handshake\u002Fsession path, or `bun run ios:test:live:chat` only when API-key-backed chat round-trips are intended. Report that the run depended on a live backend.\n\nThen choose the smallest mode that matches the request.\n\n- **Quick smoke**: use for \"does the iOS app still launch?\" Run `bun run ios:sim-smoke`, then XcodeBuildMCP screenshot if available.\n- **Targeted verification**: use for changed screens or UI flows. Run the relevant deterministic command, then drive that screen with XcodeBuildMCP.\n- **Exploratory audit**: use for UX\u002Faccessibility review. Inspect major screens with screenshots and `snapshot_ui`, interact with visible controls, and report prioritized findings.\n\n## Deterministic Commands\n\nRun from the repo root unless noted.\n\n1. `bun run ios:sim-smoke`\n2. `bun run ios:ui-test`\n3. `bun run ios:test` when the user asks for full test coverage or before high-risk merge decisions.\n4. `bun run ios:test:live` when the user explicitly asks for localhost gateway integration. It checks `IOS_INTEGRATION_GATEWAY_URL` \u002F `IOS_LIVE_GATEWAY_URL` (default `http:\u002F\u002F127.0.0.1:4242`), verifies `\u002Fhealth`, injects the resolved URL into simulator launchd, then runs only the handshake\u002Fsession Swift tests. Set `IOS_LIVE_START_GATEWAY=1` only when the harness should start `bun run gateway` itself. Use `bun run ios:test:live:chat` for the slower LLM-backed chat round-trip.\n5. `bun run ios:test:report` when the user asks for a human-readable report. It runs the UI-test suite with a fixed `.xcresult` path, exports attachments, and writes `ios\u002Freports\u002F\u003Crun>\u002Findex.html`. When a local GUI is available and the user wants to inspect the report, open the generated `index.html`; otherwise report the path and explain why it was not opened.\n6. `bun run ios:check-generated` before PR-ready validation when target membership, schemes, bundle settings, or `ios\u002Fproject.yml` changed.\n\nNotes:\n\n- `ios:ui-test` launches normal UI tests with `--uitesting`, which disables onboarding\u002Fintro, seeds deterministic state, disables Live Activity\u002FLock Screen UI, and avoids external gateway\u002FBLE dependencies.\n- First-run onboarding coverage uses the dedicated `--uitesting-onboarding` launch path while preserving deterministic UI-test defaults.\n- `IOS_UI_TESTING_TABS` can seed alternate tab layouts for UI-test page audits. Keep each iPhone layout to four feature tabs plus Settings for stable tab-bar visibility.\n- `IOS_UI_TESTING_LIVE_MOCK=1` enables an in-memory mock Live provider for connected-session UI tests. It must not persist provider changes to user defaults or require OpenAI credentials, gateway calls, mic capture, camera capture, or recordings.\n- `JC_SEED` selects deterministic app data for mock+seed UI states. Current profiles are `empty`, `chat-populated`, `sessions`, `mixed`, `recordings`, and `error`; use these instead of a live gateway when the test only needs seeded sessions or chat history. Fixture timestamps and IDs should stay fixed so screenshots and assertions do not drift.\n- `ios:test` includes current unit and snapshot tests. If snapshot baselines fail, report them separately as visual-regression work; do not hide them as a simulator-loop failure.\n- Live gateway integration tests are env-gated. Without `IOS_INTEGRATION_GATEWAY_URL` they skip immediately, so normal `ios:test` never waits on a personal Tailscale host or localhost gateway. The live scripts set this env var and point to localhost by default.\n- Do not add test-only gateway bypass tokens or loosen localhost WebSocket auth. The gateway already exposes `\u002Fauth\u002Fdevice` for localhost token issuance; iOS live tests should fetch a real device token through `DeviceAuthClient` and connect with the same WebSocket auth path production uses.\n- `ios:test:report` uses Xcode 16's supported `xcrun xcresulttool get test-results summary\u002Ftests` path. Do not switch it to older `xcresulttool get object` commands or unpinned third-party HTML tools unless they are verified on the team's current Xcode version.\n- The generated HTML should be useful for humans: each TestSpec expands to backend mode, seed profile, action \u002F expected \u002F actual steps, and inline screenshots exported from the `.xcresult`, so reviewers can inspect the actual app screens without opening Xcode.\n- If sandboxing blocks CoreSimulator, rerun with approval rather than treating it as an app failure.\n- If XCUITest reports `unexpected exit`, `test runner unexpected exit`, or `Test crashed with signal kill`, inspect the `.xcresult` to classify the failure, then rerun once before changing app\u002Ftest code. Treat it as a runner\u002FCoreSimulator flake unless the rerun produces a deterministic assertion or crash with the same test location.\n\n### Test Seam Hygiene\n\nKeep app launch preparation at the composition boundary:\n\n- Production views, stores, and containers should read typed `LaunchConfiguration` values such as onboarding mode, gateway mode, Live provider mode, glasses step mode, and camera autostart.\n- Do not add scattered `if UITestingSupport.isEnabled` branches in production views or stores. `UITestingSupport` should only translate DEBUG-gated launch args\u002Fenv vars into `LaunchConfiguration`.\n- Keep app-target UI-test env readers and deterministic seed fixtures DEBUG-only. Release builds should resolve `LaunchConfiguration.current()` directly to `.production` and should not embed mock transcript \u002F recording fixture content.\n- If a seam only exists to reach a screen, prefer an existing app navigation affordance or a production deep link over new test-only state. Use accessibility identifiers for stable selectors; they are production accessibility metadata, not test-only logic.\n- Keep specs granular: data-driven screen catalogs are fine, but each screen\u002Fscenario should emit a named activity or spec-level attachment so the HTML report shows what was covered separately.\n- Keep backend scope explicit in specs: use `pure-ui` for navigation\u002Fform checks, `mock+seed` for deterministic fixture-backed UI states, and reserve `live-integration` for explicit localhost\u002Fgateway runs.\n- Keep screen coverage manifest-backed. `ios\u002FhawkyUITests\u002FScreenManifest.json` is the source of truth for screen ids, deep-link reachability, and expected identifiers; UI tests and the HTML report both read from it. When adding a new screen, add or update its manifest entry and make sure a TestSpec covers that manifest id.\n- Prefer one deep-link target per UI test method. In practice, batching many `app.open(url)` calls in one XCUITest can trigger runner restarts even when each assertion passes. A single-screen deep-link spec gives cleaner report sections and a more stable simulator run.\n- Terminate the app in UI-test teardown. Runtime-heavy screens such as Live2, Pipecat, camera, or sheet routes can continue work after the assertion; explicit termination prevents cross-test contamination and runner restarts.\n- Put `accessibilityIdentifier` on the actual field, button, toggle, picker, or a harmless section title. Avoid assigning an identifier to a `VStack`, `HStack`, `List`, or `Form` that contains controls the tests also need to query; SwiftUI can expose the container identifier in a way that masks child control identifiers in XCUITest.\n- Keep scroll-search assertions fast. For controls that may be below the fold, check `exists` or use a short initial wait before swiping; do not spend the full `waitForExistence` timeout before every swipe, or long forms will accumulate dead wait time.\n- Keep simulator permissions and animation control in the harness where possible: `UIView.setAnimationsEnabled(false)` through launch config, and `xcrun simctl privacy booted grant all \u003Cbundle id>` from the test runner or manual setup when a flow truly needs permissions.\n\n### Team \u002F Local Overrides\n\nThe npm scripts call `ios\u002Fscripts\u002Fxcode-*.sh` wrappers. They infer defaults from `ios\u002Fproject.yml`, but every important Xcode setting is overrideable without editing tracked files:\n\n- `IOS_PROJECT_PATH` or `IOS_WORKSPACE_PATH`\n- `IOS_SCHEME`\n- `IOS_SIMULATOR_NAME`, `IOS_DESTINATION`, `IOS_BUILD_DESTINATION`\n- `IOS_UNIT_TEST_TARGET`, `IOS_UI_TEST_TARGET`, `IOS_TEST_ONLY`\n- `IOS_XCODEGEN_SPEC`\n- `IOS_GENERATED_PROJECT_PATH`\n- `IOS_BUNDLE_ID`, `IOS_APP_TARGET_NAME`, `IOS_APP_PRODUCT_NAME`, `IOS_APP_PROCESS_NAME`\n- `IOS_CONFIGURATION`, `IOS_RELEASE_CONFIGURATION`\n- `IOS_DEVELOPMENT_TEAM`, `IOS_DISTRIBUTION_TEAM`, `IOS_VERSION_PLISTS`\n\nExamples:\n\n```bash\nIOS_SCHEME=MyApp IOS_PROJECT_PATH=MyApp.xcodeproj bun run ios:ui-test\nIOS_WORKSPACE_PATH=MyApp.xcworkspace IOS_SCHEME=MyApp bun run ios:test\nIOS_SIMULATOR_NAME=\"iPhone 16 Pro\" bun run ios:sim-smoke\n```\n\nUse these env vars for teammates with different local Xcode project\u002Fworkspace\u002Fscheme names, bundle ids, signing teams, simulators, or renamed app targets. `ios:install-device` and `ios\u002Fscripts\u002Ftestflight-upload.sh` share the same resolver, and also accept CLI flags such as `--project`, `--workspace`, `--scheme`, `--bundle`, `--team`, and `--simulator`.\n\nDo not hard-code a personal project path, simulator UDID, bundle id, Apple team id, or renamed local project path into the skill, shared npm scripts, or `.xcodebuildmcp\u002Fconfig.yaml`. Shared files should contain repo defaults only; local differences belong in env vars, CLI flags, or XcodeBuildMCP `session_set_defaults`.\n\nWhen validating overrides, set env vars on the wrapper command itself, for example `IOS_SCHEME=MyApp bun run ios:ui-test`. Do not commit shell-local experiments or generated local defaults just because they made one machine pass.\n\n## Known Limitation: Semantic Capture On This App\n\nObserved on this repo: XcodeBuildMCP `snapshot_ui` \u002F `wait_for_ui` can return an **empty accessibility tree** for `hawky` (root only, no targets) even when `screenshot` is correct and deterministic XCUITests pass. In the last validation this happened outside and inside `--uitesting`; AXe could still read other simulator surfaces, so treat it as an app\u002Ftool interaction until investigated further. AXe also requires `Simulator.app` to be frontmost (`open_sim`) before any capture works at all.\n\nConsequences for this skill:\n\n- **Deterministic XCUITest (`bun run ios:ui-test`) is the primary assertion path** — it queries the accessibility tree in-process via the test runner and sees every identifier.\n- Use **`screenshot`** for visual \u002F UX audit evidence.\n- Treat `snapshot_ui` tap-by-elementRef as **best-effort**: attempt it (it may work in an interactive Codex session), but if the tree is empty, do not block — assert via XCUITest and report visually. Never call the app untested solely because the semantic tree is empty.\n\n## XcodeBuildMCP Loop\n\nUse shared defaults from `.xcodebuildmcp\u002Fconfig.yaml` as the first choice. If the current checkout or teammate's local setup uses a different project\u002Fworkspace\u002Fscheme\u002Fsimulator, set the active MCP session defaults with `session_set_defaults` instead of editing shared config.\n\n1. `session_show_defaults`\n   - Confirm project\u002Fworkspace matches the current checkout or local override\n   - Confirm scheme matches the deterministic command being run\n   - Confirm configuration `Debug`\n   - Confirm simulator matches `IOS_SIMULATOR_NAME` or the fallback reported in the test report\n2. `build_run_sim`\n   - Prefer launch arg `--uitesting` for deterministic verification.\n   - Observe bundle id and build duration.\n3. `screenshot`\n   - Confirm the expected first screen.\n4. `snapshot_ui`\n   - Call `open_sim` first, or otherwise ensure Simulator.app is foreground. AXe can fail or return partial results when Simulator is backgrounded.\n   - Use semantic labels\u002Fidentifiers and element refs.\n   - Prefer identifiers like `tab.live`, `tab.settings`, `live.emptyState`, `live.agentPill`, `live.more`, `live.toggleAudio`, `live.toggleVisual`, `live.start`.\n   - If SpringBoard snapshots work but this app's screenshot is normal and `snapshot_ui` returns only the app root with no targets, report this as an MCP semantic capture caveat and fall back to `bun run ios:ui-test` plus screenshots. Do not call the app flow untested solely because the MCP semantic tree is empty.\n5. Interact with `tap`, `type_text`, `swipe`, or `wait_for_ui`.\n   - Use element refs from the latest snapshot.\n   - Avoid raw coordinates unless no semantic element exists.\n6. `screenshot` again.\n   - Confirm navigation or state changed.\n\n## Audit Checklist\n\nCheck at least:\n\n- Live tab renders `Talk to Hawky`\n- Settings tab renders and rows are reachable\n- Live\u002FSettings tab switching works\n- floating Live controls are visible and identified\n- tappable controls have useful labels or accessibility identifiers\n- no onboarding, modal, keyboard, or connection error blocks the target flow\n- text is not clipped or overlapping on iPhone 17 Pro\n\nFlag these explicitly:\n\n- tappable element has no label and no identifier\n- identifier is missing from a key control\n- interaction depends on screen coordinates\n- screenshots show clipped\u002Foverlapping text\n- deterministic command fails\n- simulator-only coverage leaves a device-only gap\n\n## Report Format\n\nReturn a concise report:\n\n- Verdict: pass \u002F pass with caveats \u002F fail\n- Commands run and outcomes\n- HTML report path when `bun run ios:test:report` was run\n- Whether the HTML report includes inline step screenshots, and screenshot count when available\n- Simulator, bundle id, and build duration when observed\n- Screens or flows tested\n- Screenshot\u002Flog paths when available\n- Pass\u002Ffail items\n- Accessibility gaps\n- UX findings, ordered by severity\n- Blockers\u002Fflakes\n- Simulator-only scope note\n\nWhen a failure is environmental, name the layer: sandbox permission, CoreSimulator, XcodeBuildMCP connection, build, app launch, deterministic assertion, snapshot baseline, or UI behaviour.\n","# iOS App Test\n\nUse this skill to test `ios\u002Fhawky` locally through deterministic commands plus XcodeBuildMCP simulator automation.\n\nThis skill's source of truth is `.agents\u002Fskills\u002Fios-app-test\u002FSKILL.md`.\nClaude Code loads the same file through the `.claude\u002Fskills\u002Fios-app-test\u002FSKILL.md`\nsymlink.\n\n## Scope\n\nThis skill is simulator-first. It verifies build, launch, navigation, Live\u002FSettings UI, semantic accessibility, deterministic unit\u002FUI tests, screenshots, and obvious UX regressions.\n\nDo not claim physical-device coverage. These still need manual device verification:\n\n- Live Activity \u002F Dynamic Island\n- BLE glasses pairing and HFP audio\n- Camera capture quality\n- AVAudioSession \u002F live mic behaviour\n- Real authenticated gateway sessions over Tailscale\n\n## Prerequisites \u002F First Run\n\n**Before any run, confirm the environment is ready.** The cheap per-run check is `session_show_defaults` (Modes → Step 0). On a fresh checkout, or when Step 0 surfaces a problem, run the full detect + setup below — auto-fix what is safe, surface what needs a human, and never silently change the system (no unsanctioned `brew`).\n\n1. **Detect:** run `bun run ios:mcp:doctor`. It reports Xcode, the simulator, `axe` (UI automation), and `lldb` status.\n\n2. **Safe to auto-fix (do without asking):**\n   - Project missing or stale vs `ios\u002Fproject.yml`: run `bun run ios:check-generated`. If it reports generated drift, keep the generated project updates that match `ios\u002Fproject.yml`; use `bun run ios:generate` when the project file itself must be regenerated outside a check.\n   - Default simulator missing: create the configured `IOS_SIMULATOR_NAME` (defaults to `iPhone 17 Pro`) with the latest available iOS runtime, or fall back to another booted device and note the substitution in the report.\n   - XcodeBuildMCP itself is fetched on demand by `npx` via `.mcp.json` \u002F `.codex\u002Fconfig.toml` — no manual install.\n\n3. **Surface, do not auto-change the system:**\n   - **XcodeBuildMCP tools not available** (e.g. `session_show_defaults` is missing): the server is registered in `.mcp.json` (Claude Code) and `.codex\u002Fconfig.toml` (Codex), but the agent must be **restarted** and the project MCP server **trusted\u002Fapproved** before the tools load. Ask the user to do this, then retry. The deterministic commands (`ios:sim-smoke` \u002F `ios:ui-test` \u002F `ios:test`) still run without the MCP server.\n   - **`axe` not installed:** only the best-effort `snapshot_ui` \u002F `tap` exploratory path needs it (`brew tap cameroncooke\u002Faxe && brew install axe`). The deterministic XCUITest path does not. Recommend it; do not run `brew` without consent.\n   - **Xcode missing or wrong version:** cannot auto-fix — stop and report.\n\n4. **Gateway (optional):** only connected-session flows need it. UI-render, navigation, and audit modes run fine disconnected under `--uitesting`. Start with `bun run gateway` only when a test needs a live session.\n\n## Modes\n\n**Step 0 (always, before any mode):** confirm the environment is ready. Call `session_show_defaults` to verify the project\u002Fscheme\u002Fsimulator and that XcodeBuildMCP tools are loaded. If tools are missing or anything looks off, run `bun run ios:mcp:doctor` and resolve it per **Prerequisites \u002F First Run** above before continuing. Never skip this — a broken environment should surface as a clear pre-flight failure, not a mid-run error.\n\n**Step 1 (backend scope):** choose the smallest backend mode that matches the request and state it in the report.\n\n- **pure-ui**: default for navigation, form, accessibility, screenshot, and report checks. Do not start the gateway.\n- **mock+seed**: default for connected-looking UI states. Use launch configuration \u002F launch environment and in-memory mocks such as `IOS_UI_TESTING_LIVE_MOCK=1`; future seed profiles should use env-backed fixtures instead of a real gateway.\n- **live-integration**: only when the user explicitly asks to verify real gateway behaviour. Check settings and environment first:\n  - Resolve the gateway URL from `IOS_INTEGRATION_GATEWAY_URL`, then `IOS_LIVE_GATEWAY_URL`, else `http:\u002F\u002F127.0.0.1:4242`.\n  - Check `\u002Fhealth` for that URL. If a sandboxed `curl` fails but `lsof` or a user shell shows the port is listening, rerun the health check\u002Ftest outside the sandbox with approval before reporting the gateway as down.\n  - If the gateway is not running and the user wants the harness to start it, set `IOS_LIVE_START_GATEWAY=1`; otherwise ask the user to start `bun run gateway`.\n  - When starting the gateway, confirm provider credentials\u002Fconfig exist (`OPENAI_API_KEY`, Anthropic key, or Vertex config depending on `~\u002F.hawky\u002Fconfig.json`) because gateway startup can fail before `\u002Fhealth` if provider auth is missing.\n  - For simulator-hosted Swift tests, shell env is not enough: the live script sets `IOS_INTEGRATION_GATEWAY_URL` inside simulator launchd before running tests.\n  Run `bun run ios:test:live` for the non-LLM handshake\u002Fsession path, or `bun run ios:test:live:chat` only when API-key-backed chat round-trips are intended. Report that the run depended on a live backend.\n\nThen choose the smallest mode that matches the request.\n\n- **Quick smoke**: use for \"does the iOS app still launch?\" Run `bun run ios:sim-smoke`, then XcodeBuildMCP screenshot if available.\n- **Targeted verification**: use for changed screens or UI flows. Run the relevant deterministic command, then drive that screen with XcodeBuildMCP.\n- **Exploratory audit**: use for UX\u002Faccessibility review. Inspect major screens with screenshots and `snapshot_ui`, interact with visible controls, and report prioritized findings.\n\n## Deterministic Commands\n\nRun from the repo root unless noted.\n\n1. `bun run ios:sim-smoke`\n2. `bun run ios:ui-test`\n3. `bun run ios:test` when the user asks for full test coverage or before high-risk merge decisions.\n4. `bun run ios:test:live` when the user explicitly asks for localhost gateway integration. It checks `IOS_INTEGRATION_GATEWAY_URL` \u002F `IOS_LIVE_GATEWAY_URL` (default `http:\u002F\u002F127.0.0.1:4242`), verifies `\u002Fhealth`, injects the resolved URL into simulator launchd, then runs only the handshake\u002Fsession Swift tests. Set `IOS_LIVE_START_GATEWAY=1` only when the harness should start `bun run gateway` itself. Use `bun run ios:test:live:chat` for the slower LLM-backed chat round-trip.\n5. `bun run ios:test:report` when the user asks for a human-readable report. It runs the UI-test suite with a fixed `.xcresult` path, exports attachments, and writes `ios\u002Freports\u002F\u003Crun>\u002Findex.html`. When a local GUI is available and the user wants to inspect the report, open the generated `index.html`; otherwise report the path and explain why it was not opened.\n6. `bun run ios:check-generated` before PR-ready validation when target membership, schemes, bundle settings, or `ios\u002Fproject.yml` changed.\n\nNotes:\n\n- `ios:ui-test` launches normal UI tests with `--uitesting`, which disables onboarding\u002Fintro, seeds deterministic state, disables Live Activity\u002FLock Screen UI, and avoids external gateway\u002FBLE dependencies.\n- First-run onboarding coverage uses the dedicated `--uitesting-onboarding` launch path while preserving deterministic UI-test defaults.\n- `IOS_UI_TESTING_TABS` can seed alternate tab layouts for UI-test page audits. Keep each iPhone layout to four feature tabs plus Settings for stable tab-bar visibility.\n- `IOS_UI_TESTING_LIVE_MOCK=1` enables an in-memory mock Live provider for connected-session UI tests. It must not persist provider changes to user defaults or require OpenAI credentials, gateway calls, mic capture, camera capture, or recordings.\n- `JC_SEED` selects deterministic app data for mock+seed UI states. Current profiles are `empty`, `chat-populated`, `sessions`, `mixed`, `recordings`, and `error`; use these instead of a live gateway when the test only needs seeded sessions or chat history. Fixture timestamps and IDs should stay fixed so screenshots and assertions do not drift.\n- `ios:test` includes current unit and snapshot tests. If snapshot baselines fail, report them separately as visual-regression work; do not hide them as a simulator-loop failure.\n- Live gateway integration tests are env-gated. Without `IOS_INTEGRATION_GATEWAY_URL` they skip immediately, so normal `ios:test` never waits on a personal Tailscale host or localhost gateway. The live scripts set this env var and point to localhost by default.\n- Do not add test-only gateway bypass tokens or loosen localhost WebSocket auth. The gateway already exposes `\u002Fauth\u002Fdevice` for localhost token issuance; iOS live tests should fetch a real device token through `DeviceAuthClient` and connect with the same WebSocket auth path production uses.\n- `ios:test:report` uses Xcode 16's supported `xcrun xcresulttool get test-results summary\u002Ftests` path. Do not switch it to older `xcresulttool get object` commands or unpinned third-party HTML tools unless they are verified on the team's current Xcode version.\n- The generated HTML should be useful for humans: each TestSpec expands to backend mode, seed profile, action \u002F expected \u002F actual steps, and inline screenshots exported from the `.xcresult`, so reviewers can inspect the actual app screens without opening Xcode.\n- If sandboxing blocks CoreSimulator, rerun with approval rather than treating it as an app failure.\n- If XCUITest reports `unexpected exit`, `test runner unexpected exit`, or `Test crashed with signal kill`, inspect the `.xcresult` to classify the failure, then rerun once before changing app\u002Ftest code. Treat it as a runner\u002FCoreSimulator flake unless the rerun produces a deterministic assertion or crash with the same test location.\n\n### Test Seam Hygiene\n\nKeep app launch preparation at the composition boundary:\n\n- Production views, stores, and containers should read typed `LaunchConfiguration` values such as onboarding mode, gateway mode, Live provider mode, glasses step mode, and camera autostart.\n- Do not add scattered `if UITestingSupport.isEnabled` branches in production views or stores. `UITestingSupport` should only translate DEBUG-gated launch args\u002Fenv vars into `LaunchConfiguration`.\n- Keep app-target UI-test env readers and deterministic seed fixtures DEBUG-only. Release builds should resolve `LaunchConfiguration.current()` directly to `.production` and should not embed mock transcript \u002F recording fixture content.\n- If a seam only exists to reach a screen, prefer an existing app navigation affordance or a production deep link over new test-only state. Use accessibility identifiers for stable selectors; they are production accessibility metadata, not test-only logic.\n- Keep specs granular: data-driven screen catalogs are fine, but each screen\u002Fscenario should emit a named activity or spec-level attachment so the HTML report shows what was covered separately.\n- Keep backend scope explicit in specs: use `pure-ui` for navigation\u002Fform checks, `mock+seed` for deterministic fixture-backed UI states, and reserve `live-integration` for explicit localhost\u002Fgateway runs.\n- Keep screen coverage manifest-backed. `ios\u002FhawkyUITests\u002FScreenManifest.json` is the source of truth for screen ids, deep-link reachability, and expected identifiers; UI tests and the HTML report both read from it. When adding a new screen, add or update its manifest entry and make sure a TestSpec covers that manifest id.\n- Prefer one deep-link target per UI test method. In practice, batching many `app.open(url)` calls in one XCUITest can trigger runner restarts even when each assertion passes. A single-screen deep-link spec gives cleaner report sections and a more stable simulator run.\n- Terminate the app in UI-test teardown. Runtime-heavy screens such as Live2, Pipecat, camera, or sheet routes can continue work after the assertion; explicit termination prevents cross-test contamination and runner restarts.\n- Put `accessibilityIdentifier` on the actual field, button, toggle, picker, or a harmless section title. Avoid assigning an identifier to a `VStack`, `HStack`, `List`, or `Form` that contains controls the tests also need to query; SwiftUI can expose the container identifier in a way that masks child control identifiers in XCUITest.\n- Keep scroll-search assertions fast. For controls that may be below the fold, check `exists` or use a short initial wait before swiping; do not spend the full `waitForExistence` timeout before every swipe, or long forms will accumulate dead wait time.\n- Keep simulator permissions and animation control in the harness where possible: `UIView.setAnimationsEnabled(false)` through launch config, and `xcrun simctl privacy booted grant all \u003Cbundle id>` from the test runner or manual setup when a flow truly needs permissions.\n\n### Team \u002F Local Overrides\n\nThe npm scripts call `ios\u002Fscripts\u002Fxcode-*.sh` wrappers. They infer defaults from `ios\u002Fproject.yml`, but every important Xcode setting is overrideable without editing tracked files:\n\n- `IOS_PROJECT_PATH` or `IOS_WORKSPACE_PATH`\n- `IOS_SCHEME`\n- `IOS_SIMULATOR_NAME`, `IOS_DESTINATION`, `IOS_BUILD_DESTINATION`\n- `IOS_UNIT_TEST_TARGET`, `IOS_UI_TEST_TARGET`, `IOS_TEST_ONLY`\n- `IOS_XCODEGEN_SPEC`\n- `IOS_GENERATED_PROJECT_PATH`\n- `IOS_BUNDLE_ID`, `IOS_APP_TARGET_NAME`, `IOS_APP_PRODUCT_NAME`, `IOS_APP_PROCESS_NAME`\n- `IOS_CONFIGURATION`, `IOS_RELEASE_CONFIGURATION`\n- `IOS_DEVELOPMENT_TEAM`, `IOS_DISTRIBUTION_TEAM`, `IOS_VERSION_PLISTS`\n\nExamples:\n\n```bash\nIOS_SCHEME=MyApp IOS_PROJECT_PATH=MyApp.xcodeproj bun run ios:ui-test\nIOS_WORKSPACE_PATH=MyApp.xcworkspace IOS_SCHEME=MyApp bun run ios:test\nIOS_SIMULATOR_NAME=\"iPhone 16 Pro\" bun run ios:sim-smoke\n```\n\nUse these env vars for teammates with different local Xcode project\u002Fworkspace\u002Fscheme names, bundle ids, signing teams, simulators, or renamed app targets. `ios:install-device` and `ios\u002Fscripts\u002Ftestflight-upload.sh` share the same resolver, and also accept CLI flags such as `--project`, `--workspace`, `--scheme`, `--bundle`, `--team`, and `--simulator`.\n\nDo not hard-code a personal project path, simulator UDID, bundle id, Apple team id, or renamed local project path into the skill, shared npm scripts, or `.xcodebuildmcp\u002Fconfig.yaml`. Shared files should contain repo defaults only; local differences belong in env vars, CLI flags, or XcodeBuildMCP `session_set_defaults`.\n\nWhen validating overrides, set env vars on the wrapper command itself, for example `IOS_SCHEME=MyApp bun run ios:ui-test`. Do not commit shell-local experiments or generated local defaults just because they made one machine pass.\n\n## Known Limitation: Semantic Capture On This App\n\nObserved on this repo: XcodeBuildMCP `snapshot_ui` \u002F `wait_for_ui` can return an **empty accessibility tree** for `hawky` (root only, no targets) even when `screenshot` is correct and deterministic XCUITests pass. In the last validation this happened outside and inside `--uitesting`; AXe could still read other simulator surfaces, so treat it as an app\u002Ftool interaction until investigated further. AXe also requires `Simulator.app` to be frontmost (`open_sim`) before any capture works at all.\n\nConsequences for this skill:\n\n- **Deterministic XCUITest (`bun run ios:ui-test`) is the primary assertion path** — it queries the accessibility tree in-process via the test runner and sees every identifier.\n- Use **`screenshot`** for visual \u002F UX audit evidence.\n- Treat `snapshot_ui` tap-by-elementRef as **best-effort**: attempt it (it may work in an interactive Codex session), but if the tree is empty, do not block — assert via XCUITest and report visually. Never call the app untested solely because the semantic tree is empty.\n\n## XcodeBuildMCP Loop\n\nUse shared defaults from `.xcodebuildmcp\u002Fconfig.yaml` as the first choice. If the current checkout or teammate's local setup uses a different project\u002Fworkspace\u002Fscheme\u002Fsimulator, set the active MCP session defaults with `session_set_defaults` instead of editing shared config.\n\n1. `session_show_defaults`\n   - Confirm project\u002Fworkspace matches the current checkout or local override\n   - Confirm scheme matches the deterministic command being run\n   - Confirm configuration `Debug`\n   - Confirm simulator matches `IOS_SIMULATOR_NAME` or the fallback reported in the test report\n2. `build_run_sim`\n   - Prefer launch arg `--uitesting` for deterministic verification.\n   - Observe bundle id and build duration.\n3. `screenshot`\n   - Confirm the expected first screen.\n4. `snapshot_ui`\n   - Call `open_sim` first, or otherwise ensure Simulator.app is foreground. AXe can fail or return partial results when Simulator is backgrounded.\n   - Use semantic labels\u002Fidentifiers and element refs.\n   - Prefer identifiers like `tab.live`, `tab.settings`, `live.emptyState`, `live.agentPill`, `live.more`, `live.toggleAudio`, `live.toggleVisual`, `live.start`.\n   - If SpringBoard snapshots work but this app's screenshot is normal and `snapshot_ui` returns only the app root with no targets, report this as an MCP semantic capture caveat and fall back to `bun run ios:ui-test` plus screenshots. Do not call the app flow untested solely because the MCP semantic tree is empty.\n5. Interact with `tap`, `type_text`, `swipe`, or `wait_for_ui`.\n   - Use element refs from the latest snapshot.\n   - Avoid raw coordinates unless no semantic element exists.\n6. `screenshot` again.\n   - Confirm navigation or state changed.\n\n## Audit Checklist\n\nCheck at least:\n\n- Live tab renders `Talk to Hawky`\n- Settings tab renders and rows are reachable\n- Live\u002FSettings tab switching works\n- floating Live controls are visible and identified\n- tappable controls have useful labels or accessibility identifiers\n- no onboarding, modal, keyboard, or connection error blocks the target flow\n- text is not clipped or overlapping on iPhone 17 Pro\n\nFlag these explicitly:\n\n- tappable element has no label and no identifier\n- identifier is missing from a key control\n- interaction depends on screen coordinates\n- screenshots show clipped\u002Foverlapping text\n- deterministic command fails\n- simulator-only coverage leaves a device-only gap\n\n## Report Format\n\nReturn a concise report:\n\n- Verdict: pass \u002F pass with caveats \u002F fail\n- Commands run and outcomes\n- HTML report path when `bun run ios:test:report` was run\n- Whether the HTML report includes inline step screenshots, and screenshot count when available\n- Simulator, bundle id, and build duration when observed\n- Screens or flows tested\n- Screenshot\u002Flog paths when available\n- Pass\u002Ffail items\n- Accessibility gaps\n- UX findings, ordered by severity\n- Blockers\u002Fflakes\n- Simulator-only scope note\n\nWhen a failure is environmental, name the layer: sandbox permission, CoreSimulator, XcodeBuildMCP connection, build, app launch, deterministic assertion, snapshot baseline, or UI behaviour.\n",{"name":5,"description":7},"main","67bb3667be325ce6adacf945aa1234824caeb03b",".agents\u002Fskills\u002Fios-app-test",3,"https:\u002F\u002Fgithub.com\u002Fhao-ai-lab\u002Fhawky","https:\u002F\u002Fgithub.com\u002Fhao-ai-lab","https:\u002F\u002Fhao-ai-lab.github.io","2026-10-01 15:34:56",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add hao-ai-lab\u002Fhawky --skill ios-app-test",{"tool":38,"command":39},"bunx","bunx skills add hao-ai-lab\u002Fhawky --skill ios-app-test",{"tool":41,"command":42},"pnpm","pnpm dlx skills add hao-ai-lab\u002Fhawky --skill ios-app-test","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fhao-ai-lab\u002Fhawky\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fios-app-test\u002FSKILL.md",true,[46],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"agents\u002Fopenai.yaml","REFERENCE","参考文档",396,"https:\u002F\u002Fgithub.com\u002Fhao-ai-lab\u002Fhawky\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fios-app-test\u002Fagents\u002Fopenai.yaml",[53,60,67,74,81,88],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M77R9GJMZGKNXG4GGD8KS8J6","summarize","Summarize or extract text\u002Ftranscripts from URLs, podcasts, and local files (great fallback for “transcribe this YouTube\u002Fvideo”).","https:\u002F\u002Fgithub.com\u002Fhao-ai-lab\u002Fhawky\u002Fblob\u002Fmain\u002Fsrc\u002Fskill-templates\u002Fsummarize\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M77R9C6Y2PE363J3ZQRH2VFM","slack","Use when the user asks you to read, search, send, or react in Slack — including reading channel history, DMs, searching messages, or posting as the user. Covers \"check my Slack\", \"reply to Alice\", \"what's happening in","https:\u002F\u002Fgithub.com\u002Fhao-ai-lab\u002Fhawky\u002Fblob\u002Fmain\u002Fsrc\u002Fskill-templates\u002Fslack\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":19},"01M77R99M7P6MGP6PE2EAZDY5P","peekaboo","Capture and automate macOS UI with the Peekaboo CLI.","https:\u002F\u002Fgithub.com\u002Fhao-ai-lab\u002Fhawky\u002Fblob\u002Fmain\u002Fsrc\u002Fskill-templates\u002Fpeekaboo\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":19},"01M77R96Q4YAZ19ZTHZC2251NQ","paper-search","Search academic papers on arXiv, Semantic Scholar, and DBLP","https:\u002F\u002Fgithub.com\u002Fhao-ai-lab\u002Fhawky\u002Fblob\u002Fmain\u002Fsrc\u002Fskill-templates\u002Fpaper-search\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":19},"01M77R93715SNT4FE2N5WHRNJ3","import-history","Import chat history from ChatGPT, Claude.ai, iMessage, Slack, WeChat, Telegram, Discord, or WhatsApp into Hawky memory","https:\u002F\u002Fgithub.com\u002Fhao-ai-lab\u002Fhawky\u002Fblob\u002Fmain\u002Fsrc\u002Fskill-templates\u002Fimport-history\u002FSKILL.md",[],[],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":19},"01M77R8ZJMA0QY235PVPQY07PE","himalaya","CLI to manage emails via IMAP\u002FSMTP. Use `himalaya` to list, read, write, reply, forward, search, and organize emails from the terminal. Supports multiple accounts and message composition with MML (MIME Meta Language).","https:\u002F\u002Fgithub.com\u002Fhao-ai-lab\u002Fhawky\u002Fblob\u002Fmain\u002Fsrc\u002Fskill-templates\u002Fhimalaya\u002FSKILL.md",[],[]]