Skill Tracer
Skills › Compound Engineering › ce-dogfood › agent-browser-driver.md

agent-browser-driver.md

40 lines · skills/ce-dogfood/references/agent-browser-driver.md at 3449230

Open on GitHub
1# `agent-browser` Driver
2
3Read this file only after the run has selected `agent-browser`. That happens when the host has no built-in browser that can cover this run's matrix.
4

agent-browser Driver

Read this file only after the run has selected agent-browser. That happens when the host has no built-in browser that can cover this run's matrix.

Raw lines 1 to 4
5## Bootstrap
6
7Verify the direct CLI is installed. Use the direct binary, never `npx agent-browser`.
8
9```bash
10command -v agent-browser >/dev/null 2>&1 && echo "Ready" || echo "NOT INSTALLED"
11```
13If it is missing, stop as the skill's Prerequisites section says. Otherwise load the workflow and troubleshooting guide that matches the installed CLI before the first browser action:
15```bash
16agent-browser skills get core
17```
19If the CLI exists but cannot launch its browser, follow that guide's troubleshooting and report the exact launch failure. Do not report a launch error as a missing CLI.

Bootstrap

Verify the direct CLI is installed. Use the direct binary, never npx agent-browser.

command -v agent-browser >/dev/null 2>&1 && echo "Ready" || echo "NOT INSTALLED"

If it is missing, stop as the skill's Prerequisites section says. Otherwise load the workflow and troubleshooting guide that matches the installed CLI before the first browser action:

agent-browser skills get core

If the CLI exists but cannot launch its browser, follow that guide's troubleshooting and report the exact launch failure. Do not report a launch error as a missing CLI.

Raw lines 5 to 20
21## Commands this skill relies on
23Pass `--headed` so the user can watch the run, unless the machine has no display to show it on. Give each test user its own `--session <name>` so logins never leak between users.
25```bash
26SHOTS="$(mktemp -d "${TMPDIR:-/tmp}/ce-dogfood-XXXXXX")" # once per run; reuse for every screenshot
28agent-browser --headed open "http://localhost:${PORT}/<route>"
29agent-browser snapshot -i # interactive elements with refs
30agent-browser click @e1
31agent-browser fill @e2 "value"
32agent-browser screenshot "$SHOTS/<scenario>.png"
33agent-browser errors # page errors
34agent-browser console # console log
35agent-browser set viewport 390 844 # phone width
36agent-browser network route "<url>" --abort # simulate a failed request
37agent-browser --session viewer open "http://localhost:${PORT}/<route>"
38```
40Refs from `snapshot -i` go stale after navigation; snapshot again before the next interaction. Use the core guide for any command not shown here.

Commands this skill relies on

Pass --headed so the user can watch the run, unless the machine has no display to show it on. Give each test user its own --session <name> so logins never leak between users.

SHOTS="$(mktemp -d "${TMPDIR:-/tmp}/ce-dogfood-XXXXXX")"   # once per run; reuse for every screenshot

agent-browser --headed open "http://localhost:${PORT}/<route>"
agent-browser snapshot -i            # interactive elements with refs
agent-browser click @e1
agent-browser fill @e2 "value"
agent-browser screenshot "$SHOTS/<scenario>.png"
agent-browser errors                 # page errors
agent-browser console                # console log
agent-browser set viewport 390 844   # phone width
agent-browser network route "<url>" --abort   # simulate a failed request
agent-browser --session viewer open "http://localhost:${PORT}/<route>"

Refs from snapshot -i go stale after navigation; snapshot again before the next interaction. Use the core guide for any command not shown here.

Raw lines 21 to 40