From f896a586dbe6697f95322576fccd8e31a283ea72 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Sat, 21 Mar 2026 10:23:39 -0700 Subject: [PATCH] =?UTF-8?q?feat:=20CDP-aware=20skill=20templates=20?= =?UTF-8?q?=E2=80=94=20skip=20cookie=20import=20in=20real=20browser=20mode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Skills now check `$B status` for CDP mode and skip: - /qa: cookie import prompt, user-agent override, headless workarounds - /design-review: cookie import for authenticated pages - /setup-browser-cookies: returns "not needed" in CDP mode Regenerated SKILL.md files from updated templates. Co-Authored-By: Claude Opus 4.6 (1M context) --- .agents/skills/gstack-browse/SKILL.md | 3 +++ .agents/skills/gstack-design-review/SKILL.md | 6 ++++++ .agents/skills/gstack-qa/SKILL.md | 6 ++++++ .agents/skills/gstack-setup-browser-cookies/SKILL.md | 8 ++++++++ .agents/skills/gstack/SKILL.md | 3 +++ SKILL.md | 3 +++ browse/SKILL.md | 3 +++ design-review/SKILL.md | 6 ++++++ design-review/SKILL.md.tmpl | 6 ++++++ qa/SKILL.md | 6 ++++++ qa/SKILL.md.tmpl | 6 ++++++ setup-browser-cookies/SKILL.md | 8 ++++++++ setup-browser-cookies/SKILL.md.tmpl | 8 ++++++++ 13 files changed, 72 insertions(+) diff --git a/.agents/skills/gstack-browse/SKILL.md b/.agents/skills/gstack-browse/SKILL.md index db405e47..8649aef9 100644 --- a/.agents/skills/gstack-browse/SKILL.md +++ b/.agents/skills/gstack-browse/SKILL.md @@ -469,6 +469,9 @@ Refs are invalidated on navigation — run `snapshot` again after `goto`. ### Server | Command | Description | |---------|-------------| +| `connect [browser] [--port N]` | Connect to real Chrome/Comet browser via CDP | +| `disconnect` | Disconnect from real browser, return to headless mode | +| `focus [@ref]` | Bring connected browser window to foreground (macOS) | | `handoff [message]` | Open visible Chrome at current page for user takeover | | `restart` | Restart server | | `resume` | Re-snapshot after user takeover, return control to AI | diff --git a/.agents/skills/gstack-design-review/SKILL.md b/.agents/skills/gstack-design-review/SKILL.md index 2a7d26b2..affdc216 100644 --- a/.agents/skills/gstack-design-review/SKILL.md +++ b/.agents/skills/gstack-design-review/SKILL.md @@ -235,6 +235,12 @@ You are a senior product designer AND a frontend engineer. Review live sites wit **If no URL is given and you're on main/master:** Ask the user for a URL. +**CDP mode detection:** Check if browse is connected to the user's real browser: +```bash +$B status 2>/dev/null | grep -q "Mode: cdp" && echo "CDP_MODE=true" || echo "CDP_MODE=false" +``` +If `CDP_MODE=true`: skip cookie import steps — the real browser already has cookies and auth sessions. Skip headless detection workarounds. + **Check for DESIGN.md:** Look for `DESIGN.md`, `design-system.md`, or similar in the repo root. If found, read it — all design decisions must be calibrated against it. Deviations from the project's stated design system are higher severity. If not found, use universal design principles and offer to create one from the inferred system. diff --git a/.agents/skills/gstack-qa/SKILL.md b/.agents/skills/gstack-qa/SKILL.md index 0617c447..205acc6a 100644 --- a/.agents/skills/gstack-qa/SKILL.md +++ b/.agents/skills/gstack-qa/SKILL.md @@ -260,6 +260,12 @@ You are a QA engineer AND a bug-fix engineer. Test web applications like a real **If no URL is given and you're on a feature branch:** Automatically enter **diff-aware mode** (see Modes below). This is the most common case — the user just shipped code on a branch and wants to verify it works. +**CDP mode detection:** Before starting, check if the browse server is connected to the user's real browser: +```bash +$B status 2>/dev/null | grep -q "Mode: cdp" && echo "CDP_MODE=true" || echo "CDP_MODE=false" +``` +If `CDP_MODE=true`: skip cookie import prompts (the real browser already has cookies), skip user-agent overrides (real browser has real user-agent), and skip headless detection workarounds. The user's real auth sessions are already available. + **Check for clean working tree:** ```bash diff --git a/.agents/skills/gstack-setup-browser-cookies/SKILL.md b/.agents/skills/gstack-setup-browser-cookies/SKILL.md index 34f95391..f0531235 100644 --- a/.agents/skills/gstack-setup-browser-cookies/SKILL.md +++ b/.agents/skills/gstack-setup-browser-cookies/SKILL.md @@ -217,6 +217,14 @@ never blocks the user. Import logged-in sessions from your real Chromium browser into the headless browse session. +## CDP mode check + +First, check if browse is already connected to the user's real browser: +```bash +$B status 2>/dev/null | grep -q "Mode: cdp" && echo "CDP_MODE=true" || echo "CDP_MODE=false" +``` +If `CDP_MODE=true`: tell the user "Not needed — you're connected to your real browser via CDP. Your cookies and sessions are already available." and stop. No cookie import needed. + ## How it works 1. Find the browse binary diff --git a/.agents/skills/gstack/SKILL.md b/.agents/skills/gstack/SKILL.md index 4bb9ba17..414fa2f3 100644 --- a/.agents/skills/gstack/SKILL.md +++ b/.agents/skills/gstack/SKILL.md @@ -597,6 +597,9 @@ Refs are invalidated on navigation — run `snapshot` again after `goto`. ### Server | Command | Description | |---------|-------------| +| `connect [browser] [--port N]` | Connect to real Chrome/Comet browser via CDP | +| `disconnect` | Disconnect from real browser, return to headless mode | +| `focus [@ref]` | Bring connected browser window to foreground (macOS) | | `handoff [message]` | Open visible Chrome at current page for user takeover | | `restart` | Restart server | | `resume` | Re-snapshot after user takeover, return control to AI | diff --git a/SKILL.md b/SKILL.md index 46b7a558..97bc51dd 100644 --- a/SKILL.md +++ b/SKILL.md @@ -603,6 +603,9 @@ Refs are invalidated on navigation — run `snapshot` again after `goto`. ### Server | Command | Description | |---------|-------------| +| `connect [browser] [--port N]` | Connect to real Chrome/Comet browser via CDP | +| `disconnect` | Disconnect from real browser, return to headless mode | +| `focus [@ref]` | Bring connected browser window to foreground (macOS) | | `handoff [message]` | Open visible Chrome at current page for user takeover | | `restart` | Restart server | | `resume` | Re-snapshot after user takeover, return control to AI | diff --git a/browse/SKILL.md b/browse/SKILL.md index 2acf60b0..ca0a0d43 100644 --- a/browse/SKILL.md +++ b/browse/SKILL.md @@ -475,6 +475,9 @@ Refs are invalidated on navigation — run `snapshot` again after `goto`. ### Server | Command | Description | |---------|-------------| +| `connect [browser] [--port N]` | Connect to real Chrome/Comet browser via CDP | +| `disconnect` | Disconnect from real browser, return to headless mode | +| `focus [@ref]` | Bring connected browser window to foreground (macOS) | | `handoff [message]` | Open visible Chrome at current page for user takeover | | `restart` | Restart server | | `resume` | Re-snapshot after user takeover, return control to AI | diff --git a/design-review/SKILL.md b/design-review/SKILL.md index cbc0d5e8..5dc474fe 100644 --- a/design-review/SKILL.md +++ b/design-review/SKILL.md @@ -245,6 +245,12 @@ You are a senior product designer AND a frontend engineer. Review live sites wit **If no URL is given and you're on main/master:** Ask the user for a URL. +**CDP mode detection:** Check if browse is connected to the user's real browser: +```bash +$B status 2>/dev/null | grep -q "Mode: cdp" && echo "CDP_MODE=true" || echo "CDP_MODE=false" +``` +If `CDP_MODE=true`: skip cookie import steps — the real browser already has cookies and auth sessions. Skip headless detection workarounds. + **Check for DESIGN.md:** Look for `DESIGN.md`, `design-system.md`, or similar in the repo root. If found, read it — all design decisions must be calibrated against it. Deviations from the project's stated design system are higher severity. If not found, use universal design principles and offer to create one from the inferred system. diff --git a/design-review/SKILL.md.tmpl b/design-review/SKILL.md.tmpl index 84119c26..3188df31 100644 --- a/design-review/SKILL.md.tmpl +++ b/design-review/SKILL.md.tmpl @@ -41,6 +41,12 @@ You are a senior product designer AND a frontend engineer. Review live sites wit **If no URL is given and you're on main/master:** Ask the user for a URL. +**CDP mode detection:** Check if browse is connected to the user's real browser: +```bash +$B status 2>/dev/null | grep -q "Mode: cdp" && echo "CDP_MODE=true" || echo "CDP_MODE=false" +``` +If `CDP_MODE=true`: skip cookie import steps — the real browser already has cookies and auth sessions. Skip headless detection workarounds. + **Check for DESIGN.md:** Look for `DESIGN.md`, `design-system.md`, or similar in the repo root. If found, read it — all design decisions must be calibrated against it. Deviations from the project's stated design system are higher severity. If not found, use universal design principles and offer to create one from the inferred system. diff --git a/qa/SKILL.md b/qa/SKILL.md index 92799a0d..342c3d3e 100644 --- a/qa/SKILL.md +++ b/qa/SKILL.md @@ -270,6 +270,12 @@ You are a QA engineer AND a bug-fix engineer. Test web applications like a real **If no URL is given and you're on a feature branch:** Automatically enter **diff-aware mode** (see Modes below). This is the most common case — the user just shipped code on a branch and wants to verify it works. +**CDP mode detection:** Before starting, check if the browse server is connected to the user's real browser: +```bash +$B status 2>/dev/null | grep -q "Mode: cdp" && echo "CDP_MODE=true" || echo "CDP_MODE=false" +``` +If `CDP_MODE=true`: skip cookie import prompts (the real browser already has cookies), skip user-agent overrides (real browser has real user-agent), and skip headless detection workarounds. The user's real auth sessions are already available. + **Check for clean working tree:** ```bash diff --git a/qa/SKILL.md.tmpl b/qa/SKILL.md.tmpl index a3d02abc..ac8d0a9e 100644 --- a/qa/SKILL.md.tmpl +++ b/qa/SKILL.md.tmpl @@ -49,6 +49,12 @@ You are a QA engineer AND a bug-fix engineer. Test web applications like a real **If no URL is given and you're on a feature branch:** Automatically enter **diff-aware mode** (see Modes below). This is the most common case — the user just shipped code on a branch and wants to verify it works. +**CDP mode detection:** Before starting, check if the browse server is connected to the user's real browser: +```bash +$B status 2>/dev/null | grep -q "Mode: cdp" && echo "CDP_MODE=true" || echo "CDP_MODE=false" +``` +If `CDP_MODE=true`: skip cookie import prompts (the real browser already has cookies), skip user-agent overrides (real browser has real user-agent), and skip headless detection workarounds. The user's real auth sessions are already available. + **Check for clean working tree:** ```bash diff --git a/setup-browser-cookies/SKILL.md b/setup-browser-cookies/SKILL.md index ac2d873c..facbefeb 100644 --- a/setup-browser-cookies/SKILL.md +++ b/setup-browser-cookies/SKILL.md @@ -222,6 +222,14 @@ never blocks the user. Import logged-in sessions from your real Chromium browser into the headless browse session. +## CDP mode check + +First, check if browse is already connected to the user's real browser: +```bash +$B status 2>/dev/null | grep -q "Mode: cdp" && echo "CDP_MODE=true" || echo "CDP_MODE=false" +``` +If `CDP_MODE=true`: tell the user "Not needed — you're connected to your real browser via CDP. Your cookies and sessions are already available." and stop. No cookie import needed. + ## How it works 1. Find the browse binary diff --git a/setup-browser-cookies/SKILL.md.tmpl b/setup-browser-cookies/SKILL.md.tmpl index 4496d11c..78cae80b 100644 --- a/setup-browser-cookies/SKILL.md.tmpl +++ b/setup-browser-cookies/SKILL.md.tmpl @@ -18,6 +18,14 @@ allowed-tools: Import logged-in sessions from your real Chromium browser into the headless browse session. +## CDP mode check + +First, check if browse is already connected to the user's real browser: +```bash +$B status 2>/dev/null | grep -q "Mode: cdp" && echo "CDP_MODE=true" || echo "CDP_MODE=false" +``` +If `CDP_MODE=true`: tell the user "Not needed — you're connected to your real browser via CDP. Your cookies and sessions are already available." and stop. No cookie import needed. + ## How it works 1. Find the browse binary