---
description: "Switch to the active task's branch and prepare it for manual testing in Xcode. Phase 3 user-test step, standalone (the UI Bug Hunter lives at /multi-agent:test). Use when a finished change needs trying by hand on a device or simulator."
description-tr: "Aktif görevin branch'ine geçer ve Xcode'da manuel test için hazırlar. Faz 3 kullanıcı-test adımının bağımsız hali (UI Bug Hunter /multi-agent:test'te)."
argument-hint: "[#id]  -  optional: task ID (e.g. #3); the most recent task when omitted"
parameters: [{"name":"task","kind":"run-id"}]
gui: button
destructive: false
confirm: none
---

# multi-agent manual-test  -  Phase 3 Manual Test Mode

**Input**: $ARGUMENTS

Lets you switch to the task branch for manual testing in Xcode before the PR is opened.

## Steps

1. **Find the task**  -  parse `#N` from the argument or pick the most recent task

2. **Check state**  -  the task must have completed Phase 2 (Dev) or later
   - Phase < 3 → "No code yet, run `resume #N` first"

3. **Remove the worktree and switch to the branch**:
   ```bash
   cd {project-root}
   git worktree remove .worktrees/{JIRA-KEY}-{id} 2>/dev/null
   git checkout {branch-name}
   ```

   Then mark the tracker as waiting (this CONTINUES the task's existing `tracker-state.json`; never `init` here - see `$HOME/.claude/multi-agent-refs/tracker-contract.md` "Continuation runs"). On Claude Code in a fresh session, first rebuild the TaskList from state per the same contract:
   ```bash
   bash $HOME/.claude/scripts/phase-tracker.sh update 3 in_progress
   bash $HOME/.claude/scripts/phase-tracker.sh now 3 "awaiting local test (user)"
   bash $HOME/.claude/scripts/phase-tracker.sh render
   ```

4. **Tell the user how to test**:
   ```
   🧪 Switched to branch: {branch-name}

   To test:
     • SourceTree → review commits and diff
     • Xcode → open .xcworkspace → Cmd+B → Cmd+U
     • Manual test on the simulator

   Reply:
     ✅ "ok" → continue to Phase 4 (commit)
     ❌ "fix: ..." → recreate the worktree and apply the fix
   ```

5. **Wait for the user's reply**

6. **Branch on the answer**:
   - **OK** → first write `$WORKTREE/.pipeline/manual-test.json` (one entry per acceptance criterion from the analysis doc test plan, the plan tasks, or the user's own words):
     ```json
     {"criteria":[{"spec":"<quote>","source":"analysis 15.2 | plan task 3 | user","observed":"<what was seen>","verdict":"pass|fail|not-tested","reason":"<required when not-tested>","screenshot":"<path or null>"}],"verdict":"passed|failed"}
     ```
     then run `node $HOME/.claude/scripts/evidence-gate.mjs --claim manual --status passed --evidence "$WORKTREE/.pipeline/manual-test.json"`, adding `--require-screenshot` when `state.visualEvidence.required` is true (a passing criterion then has to name a screenshot that is actually on disk). Exit 1 means the "ok" is not accepted: name the criterion that is missing evidence and wait for the next reply. Exit 0 → `phase-tracker.sh update 3 completed` + `phase-tracker.sh meta 3 Result "local test passed (user)"`, recreate the worktree, continue to Phase 4. Full contract: `$HOME/.claude/multi-agent-refs/phases/phase-3-review.md` step 5, whose "UI flow video, when Phase 2 produced none" block applies here too: invoked standalone, this command is the only phase that ran, so if `visualEvidence.required` is set and `visualEvidence.video.file` is empty, the recording has to happen here or nowhere.
   - **Fix needed** → `phase-tracker.sh now 3 "applying fix: <summary>"`, recreate the worktree, apply the fix
