setup-browser-cookies
The facts
Its description
Import cookies from your real Chromium browser into the headless browse session. (gstack) Triggers: import browser cookies; login to test site; setup authenticated session
The description the agent reads to decide when to use it. Phrases the author says should start it.
When it starts
The agent picks this when the user wants the headless browse session to be signed in — importing cookies from their real Chromium browser, or setting up an authenticated session so a site that needs login can be tested. It is a setup step, not a browsing step.
Things a person might say (the model's guesses)
- “Import my browser cookies so the headless session is logged in”
- “I need to test a page behind a login, set up an authenticated session”
- “Log the test browser into our staging site”
A model's summary of when it is used.
Tools it may use, or may not
allowed-tools: Bash, Read, AskUserQuestion
Tools it may use while it runs without asking you first.
Runs scripts
bin/gstack-skill-start, bin/gstack-learnings-log, bin/gstack-skill-end
Scripts the text names. Found by matching words, so treat them as pointers.
Stops for a person
3 lines stop to ask a person
Lines that stop and wait for a person before going on. Found by matching words, so treat them as pointers.
What it leads to
Other skills this one hands off to, calls, requires or offers instead, as a model read them.
What leads to it
- gstack hands off to this PROACTIVE all, or user names it gstack, line 231
- benchmark calls this only for authenticated pages benchmark, line 232
- browse calls this on the fallback browser, for an authenticated page browse, line 240
- canary calls this when an authenticated page is needed in the fallback browser canary, line 182
- design-review calls this only when an authenticated page is needed design-review, line 268
- devex-review calls this for an authenticated page devex-review, line 253
- land-and-deploy calls this for an authenticated page without a human sign-in land-and-deploy/canary.md, line 122
- qa calls this standalone /qa, after explicit approval, for NEEDS_SETUP or cookie import qa/browser-setup.md, line 19
- scrape calls this only on the fallback browser path with an authenticated page scrape, line 232
Other skills that hand off to this one, call it, require it or offer it instead, as a model read them.
Licence
MIT, from LICENSE
The terms its author shares it under, which let it be shown here.
The text
Most marks come from matching words in the file, so treat them as pointers.
<!-- AUTO-GENERATED from SKILL.md.tmpl — do not edit directly --> <!-- Regenerate: bun run gen:skill-docs -->
Raw lines 1 to 17Boilerplate, lines 18 to 141. The same text appears in 26 other files here. Close
Plan Status Footer
Skills that run plan reviews (/plan-*-review, /codex review) include the EXIT PLAN MODE GATE blocking checklist at the end of the skill, which verifies the plan file ends with ## GSTACK REVIEW REPORT before ExitPlanMode is called. Skills that don't run plan reviews (operational skills like /ship, /qa, /review) typically don't operate in plan mode and have no review report to verify; this footer is a no-op for them. Writing the plan file is the one edit allowed in plan mode.
Setup Browser Cookies
Raw lines 142 to 1471. Check for Aside
Use this checkout as the gstack root if it contains BROWSER.md and browse/SKILL.md; otherwise use the installed root containing bin/gstack-skill-start, never a generated host stub. Read that root's browse/SKILL.md BROWSER SETUP section and run its Aside probe.
- **Aside probe prints
READY:** no import is needed, because Aside already has the user's signed-in sessions. Tell the user to use Aside, or to sign in there, and end this skill. - Any other result: continue with gstack's own headless browser (
$B).
2. Get every decision from the user first
Ask these together, before running any $B command. Never guess an answer or treat the default Comet browser as consent.
- Source browser and profile.
--profiletakes the profile's directory (Default,Profile 2), not its display name. A profile that cannot be read is unknown, not empty. - Domains to import, and the target: one page on a chosen domain that the session should open, by URL.
- **Sign-in verification (
--verify-auth)? Default no. It reloads the target and reports verified** only after a successful same-origin response with exactly one visible element, found by a CSS selector, whose whitespace-normalized text equals the expected identity. If yes, the user supplies the selector and the expected identity privately. - **Clear stale storage (
--clear-storage)?** Default no; needs explicit approval. Chromium only. It clears localStorage for the target's origin (shared by that origin's tabs) and sessionStorage for the target tab, and nothing else; other browser engines reject the reset but still import. A failed reset may already have cleared some storage and is not rolled back. - **Every cookie in the profile (
--all)?** Default no; needs explicit consent. It cannot be combined with a domain or with clearing storage.
Use the picker when any of answers 1-2 is still open; it asks for them. Use direct import when the user has named the browser, the profile directory and the domains.
Raw lines 155 to 1663. Prepare gstack's browser
- If the user wants verification, have them set
GSTACK_COOKIE_AUTH_SELECTORandGSTACK_COOKIE_AUTH_EXPECTED_IDENTITYprivately in the shell that runs$B. The browser daemon reads them only when it starts, so if a gstack daemon is already running, run$B stopfirst. Never invent the values. - Follow
browse/SKILL.md's Browser fallback section to find$B, building it if the check printsNEEDS_SETUP. - Run
$B status. If it reportsMode: cdp,$Bis attached to the user's real browser and already has its sessions: tell the user no import is needed and end this skill. - Open the target URL from answer 2 and leave that tab alone until the import finishes:
$B goto "<url>"Raw lines 167 to 1774. Import
Picker (the user confirms the browser, profile and domains there, ticks verification if they asked for it, then tells you when done; the link works once, for five minutes, so rerun the command if it expires):
$B cookie-import-browserDirect import: run $B cookie-import-browser with the chosen browser name, one --domain per run and --profile set to the profile directory (not its display name); add --verify-auth or --clear-storage only if the user said yes in step 2.
If the import rejects because verification settings are missing, nothing changed: tell the user which variable is missing and return to step 3. Read that same root's BROWSER.md, Choosing a source and checking sign-in, for other errors and receipt failure reasons; it has the error tables, examples, profile labels, supported sources and platform setup.
5. Report honestly
Report from the import receipt, not from raw $B cookies, as three lines:
Imported: <count> (<imported|partial|empty|failed>, as the receipt says) from <browser> for <domains>Storage reset: <done|failed|not requested>Sign-in: <verified|not verified|not checked>
Not checked means verification was not requested; not verified means it ran and failed; verified needs the identity match. Cookie counts, zero imports and HTTP 200 never prove sign-in. Imported cookies apply to the whole browser context, not one tab.
Never request or publish cookie values, passwords, identity or profile text, session details, or raw errors in public logs.
Raw lines 190 to 201Platform boundaries
Keychain approval is the user's choice. Database retries are bounded; permission denial needs user action, not repeated prompts.
Windows supports DPAPI-compatible cookies, not all App-Bound Encryption; native extraction stays disabled pending qualification. Closing Chrome cannot bypass Chrome 136+ default-directory protection, including numbered profiles. No TCP fallback or real-profile copies. Offer headed manual sign-in only with a display available.
Raw lines 202 to 206From garrytan/gstack at 3f79d81, 2026-11-01. Skills read by DeepSeek V4.1 Flash on 2026-11-04. Summary and techniques by Claude Opus 5.5 on 2026-11-06.