From 9fbda768e6415f56b07f2d9a2a86c42d9a4a8ff8 Mon Sep 17 00:00:00 2001 From: Abdul Wahab Date: Thu, 13 Aug 2026 18:18:15 +0500 Subject: [PATCH] Launch the picker in the harness browser first. Name Cursor browser_navigate as the in-IDE viewport, then other in-app tools, then the system opener. Same ladder in serve-question stdout so agents stop using macOS open while the IDE browser works. AI-assisted. Co-authored-by: Cursor --- skill/reference/visual-cues.md | 8 ++++++-- skill/scripts/serve-question.mjs | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/skill/reference/visual-cues.md b/skill/reference/visual-cues.md index 8baf0824c..29365308d 100644 --- a/skill/reference/visual-cues.md +++ b/skill/reference/visual-cues.md @@ -512,8 +512,12 @@ When more than one surface comes back, DESIGN.md says what each of them does wit Tell the user in one line that the visual cues are ready at `.impeccable/visual-cues/` (name the count), then run `node {{scripts_path}}/picker-server.mjs` from the project root as a foreground command and parse its `PICKER_URL` line. -- **The harness has a browser tool**: open the URL with it and let the user drive. The tool is a viewport only; never drive the questionnaire yourself, because the answers are the user's. -- **No browser tool**: tell the user *"The design picker is running at [URL]; open it in your browser and finish there."* Then wait on the foreground process. +- **Cursor**: `browser_navigate` to the `PICKER_URL`; that is the in-IDE browser, where the questionnaire belongs. Do not skip this, and do not use the system opener while the tool works. The tab is the user's viewport only; never drive the questionnaire yourself, because the answers are the user's. +- **Another harness with a browser tool**: open the URL with that tool, on the same viewport-only rule. +- **No browser tool, or the tool call failed**: open the URL with the system opener (macOS `open`, Linux `xdg-open`), then tell the user in one line to finish in the opened tab. +- **Even the opener failed**: tell the user *"The design picker is running at [URL]; open it in your browser and finish there."* + +Whichever branch ran, wait on the foreground process. The server process exiting is the completion signal; never poll or watch the answers file while it runs. diff --git a/skill/scripts/serve-question.mjs b/skill/scripts/serve-question.mjs index 689c9559a..06e4a3854 100644 --- a/skill/scripts/serve-question.mjs +++ b/skill/scripts/serve-question.mjs @@ -375,7 +375,7 @@ if (hasFlag('start')) { const state = JSON.parse(fs.readFileSync(stateFile(key), 'utf8')); console.log(`QUESTION URL: ${state.url}`); console.log(`QUESTION KEY: ${key}`); - console.log('Open the URL for the user now: in-app browser when the harness has one, otherwise the system opener (macOS `open`, Linux `xdg-open`), otherwise show the URL.'); + console.log('Open the URL for the user now: on Cursor with browser_navigate (the in-IDE browser), on another harness with its in-app browser tool, otherwise the system opener (macOS `open`, Linux `xdg-open`), otherwise show the URL.'); console.log(`Then collect the answer with: node ${fileURLToPath(import.meta.url)} --wait --key ${key}`); process.exit(0); }