AGENT SKILL

bubbles-external-browser-auth-capture

暂无简介

License 许可
MIT
最近更新
2026-11-07
Stars
★ 1
Forks
0

03 SKILL.md 正文

External Browser Auth Capture (Human-in-the-Loop)

Core Principle

When you must read web content behind interactive human auth (SSO/OAuth, cookie/consent walls, bot checks) or content a headless fetch cannot retrieve (client-rendered, gated), drive a real external browser via the configured browser-automation MCP tools and hand the login step to the human. This is a human-in-the-loop technique: the agent opens and steers the browser, then pauses and waits for the user to sign in, then resumes and extracts. The agent never handles the user's credentials.

Why NOT the internal VS Code browser

Do not use the internal VS Code browser (Simple Browser / simpleBrowser.show / any webview) for auth-gated capture:

  • The agent has no automation handle into the VS Code webview — it cannot click, snapshot the accessibility tree, or extract the DOM.
  • OAuth/SSO popups and third-party cookies frequently break inside the embedded webview.
  • There is no persistent real user profile, so a login does not stick and bot detection is more aggressive.
  • A plain fetch_webpage / headless fetch fails on login-gated or client-rendered pages (e.g. the YouTube transcript panel is rendered client-side and is often gated).

Why an external automated browser

  • A headed, real Chromium/Chrome window the human can see and interact with.
  • A persistent user-data-dir — the human logs in once and the session survives subsequent navigations.
  • The agent steers it with the configured browser tool family: navigate, accessibility snapshot, click, DOM evaluation, wait, and close. Refer to the tool family generically because the MCP server alias/prefix varies per environment.

Triage first (decision tree)

Does the target need interactive auth OR is it JS/bot-gated?
├── No  → a plain fetch_webpage on the public/static page works
│         → use THAT (cheaper, no browser). STOP.
└── Yes → escalate to the external automated browser (below).

Workflow

  1. Triage. If fetch_webpage on a public/static page returns the content, use it — do not open a browser. Only escalate when the target needs interactive auth or is JS/bot-gated.
  2. Open the external browser and browser_navigate to the target. Confirm it is the real external window, NOT the internal VS Code browser.
  3. Dismiss consent/cookie dialogs — browser_snapshot to find the control, then browser_click.
  4. Hand off to the human for login. Tell the user plainly, e.g. "A browser window has opened — please sign in to your account in that window, then tell me when you're done." Pause with a user-question/wait tool (e.g. vscode_askQuestions, or a wait) until the user confirms. NEVER ask the user to paste credentials into chat; NEVER type the user's password yourself. The human authenticates directly in the browser.
  5. Resume after the user confirms, then navigate to the specific content.
  6. Extract:
    • YouTube transcript (primary worked example): open the video, then open the transcript panel — expand the description and click the "Show transcript" control, or use the "⋯" (more actions) menu → "Show transcript". Then collect the segments with browser_evaluate:
      () => Array.from(document.querySelectorAll('ytd-transcript-segment-renderer')).map(s => s.innerText.replace(/\s+/g,' ').trim()).join('\n')
      
      Segments carry timestamps + text — capture both if the caller needs timing.
    • General pages: prefer browser_snapshot (accessibility tree) for structured reading; use browser_evaluate for specific DOM text.
  7. Persist to a file (if needed) with IDE file tools — never shell redirection (terminal-discipline).
  8. Close with browser_close when done — unless the human wants the session kept for follow-ups.

Rules / non-negotiables

  • NEVER use the internal VS Code Simple Browser / webview for auth-gated capture — always the configured external automated browser.
  • NEVER request, type, echo, or handle the user's credentials/secrets — the human authenticates in the browser (mirrors terminal-discipline's "never ask the user to paste secrets").
  • Only capture content the authenticated human is entitled to access; respect site ToS/robots; do not defeat paywalls the user has no right to; do not scrape at abusive rates.
  • Prefer the accessibility browser_snapshot over screenshots for reading content.
  • This is human-in-the-loop: the agent waits for the human login and does not fabricate having read content it could not actually access (anti-fabrication).

When NOT to use

  • Public / static / un-gated pages → use fetch_webpage (no browser needed).
  • Content available via an official API/export the user already has → prefer the API.
  • Any path that would require the user to paste secrets into chat → never; use in-browser login instead.
  • Previewing a localhost dev page you only need to LOOK at (not extract from, not auth) → the internal Simple Browser is fine there; this skill is specifically for automated extraction behind interactive auth.

Works well with

  • bubbles-long-running-commands — how to wait without polling while the human logs in.
  • bubbles-evidence-capture — record what was actually extracted as evidence.
  • terminal-discipline instruction — file writes via IDE tools; never echo/handle secrets.

04 同仓库更多 Skills

pkirsanov
pkirsanov/smackerel

smackerel-trace-capture

Wire Smackerel's concrete validate-plane stack into the framework trace-driven defect-discovery method. Use when running live-category tests (integration/e2e/e2e-ui/stress) against the ephemeral test stack; capturing SLO or trace evidence; hunting latency/error/perf bugs from spans; querying the test-stack Jaeger or Prometheus; or touching `.specify/runtime/observability`. Concrete smackerel endpoints + the exact `capture-slo.sh` command; do NOT duplicate `bubbles-observability-adapter` — this only adds the wiring.

★ 1
pkirsanov
pkirsanov/smackerel

smackerel-no-defaults

Enforce Smackerel's NO-DEFAULTS / fail-loud SST policy. Use when editing config, Docker Compose, deploy adapters, docs, instructions, skills, env handling, host bind addresses, or any runtime value that could be hidden by fallback syntax.

★ 1
pkirsanov
pkirsanov/smackerel

bubbles-workflow-mode-resolution

Resolve a Bubbles workflow mode against `bubbles/workflows.yaml`, including template inheritance, status ceilings, gate wiring, and decision policy. Use when picking a mode for a request, when a guard reports a mode-related failure, or when extending workflows.yaml with a new mode or template. Covers natural-language intent routing and the workflow registry consistency rules.

★ 1
pkirsanov
pkirsanov/smackerel

bubbles-workflow-execution-loops

Run per-round synchronous workflow execution loops correctly. Use when orchestrating a multi-round workflow, dispatching specialist subagents, handling round-based remediation, or interpreting a workflow mode's execution policy. Covers authorized direct execution, dispatch-and-wait, batch-then-summarize prohibition, and mapped-mode execution.

★ 1
pkirsanov
pkirsanov/smackerel

bubbles-vscode-agent-constraints

Design agents that fit the VS Code Copilot Chat runtime instead of fighting it. Use when authoring or editing any `*.agent.md`; when adding `tools:`, `agents:`, `handoffs:`, `model:`, `user-invocable:`, or `disable-model-invocation:` frontmatter; when designing an orchestrator that dispatches specialists; when a design implies agent-calls-agent-calls-agent chaining; when a subagent dispatch silently no-ops or an agent cannot be selected in the dropdown; or when writing a governance rule about delegation that the runtime cannot actually enforce. Prevents multi-level-subagent designs, prose-only dispatch laws, and frontmatter/body contradictions.

★ 1
pkirsanov
pkirsanov/smackerel

bubbles-upkeep-cadence

How to schedule, dispatch, and record recurring operational upkeep tasks (backup, restore-drill, BCDR-drill, patch-cycle, secret-rotation, flag-cleanup, compliance-sweep). Use when authoring or modifying `config/upkeep-calendar.yaml`, when investigating a missed task, when reading the upkeep ledger, or when adding a new task type.

★ 1