diff --git a/TODOS.md b/TODOS.md index bb85a56d..e77b8f47 100644 --- a/TODOS.md +++ b/TODOS.md @@ -52,7 +52,9 @@ **Why:** Enables "resume where I left off" for QA sessions and repeatable auth states. -**Effort:** M +**Context:** The `saveState()`/`restoreState()` helpers from the handoff feature (browser-manager.ts) already capture cookies + localStorage + sessionStorage + URLs. Adding file I/O on top is ~20 lines. + +**Effort:** S **Priority:** P3 **Depends on:** Sessions diff --git a/browse/SKILL.md.tmpl b/browse/SKILL.md.tmpl index 7030eac2..9c722f50 100644 --- a/browse/SKILL.md.tmpl +++ b/browse/SKILL.md.tmpl @@ -106,6 +106,32 @@ $B diff https://staging.app.com https://prod.app.com ### 11. Show screenshots to the user After `$B screenshot`, `$B snapshot -a -o`, or `$B responsive`, always use the Read tool on the output PNG(s) so the user can see them. Without this, screenshots are invisible. +## User Handoff + +When you hit something you can't handle in headless mode (CAPTCHA, complex auth, multi-factor +login), hand off to the user: + +```bash +# 1. Open a visible Chrome at the current page +$B handoff "Stuck on CAPTCHA at login page" + +# 2. Tell the user what happened (via AskUserQuestion) +# "I've opened Chrome at the login page. Please solve the CAPTCHA +# and let me know when you're done." + +# 3. When user says "done", re-snapshot and continue +$B resume +``` + +**When to use handoff:** +- CAPTCHAs or bot detection +- Multi-factor authentication (SMS, authenticator app) +- OAuth flows that require user interaction +- Complex interactions the AI can't handle after 3 attempts + +The browser preserves all state (cookies, localStorage, tabs) across the handoff. +After `resume`, you get a fresh snapshot of wherever the user left off. + ## Snapshot Flags {{SNAPSHOT_FLAGS}}