Reflex Browser Skill
Purpose
Use this skill when the task involves a website or browser: navigating pages, clicking elements, reading content, filling forms, scraping data, or automating a web flow.
This skill covers interactive browser work via reflex browser ... CLI commands. Each command is a single stateless action — run one, inspect the JSON response, then decide the next step.
When the end goal is a reusable Lua or Python browser automation script, still start here first: use reflex browser ... to inspect the site, verify the flow, and stabilize selectors before writing script code. Then switch to the reflex-scripting skill for the script itself.
When To Use This Skill
- User asks to interact with a website (navigate, click, fill, read, scrape)
- User asks to inspect or explore a page
- User asks for browser-based data collection
- User asks for a browser automation script (start here for discovery, then
reflex-scriptingfor the script)
When NOT To Use This Skill
- One-off file manipulation (xlsx, csv, json) without a browser → use
reflex-scripting - REST API calls → use
reflex-scripting - Data transforms or batch processing without a browser → use
reflex-scripting - Writing a script after browser discovery is done → use
reflex-scripting
Quick Start
- Install globally from Gitea npm:
npm config set @reflexautomation:registry "https://git.bqa-solutions.nl/api/packages/reflex/npm/" --location=usernpm config set "//git.bqa-solutions.nl/api/packages/reflex/npm/:_authToken" "YOUR_DEPLOY_TOKEN" --location=usernpm install -g @reflexautomation/reflex-cli- Start or reuse a session:
reflex browser start- Default to auto-session mode for normal agent runs:
- do not pass
--sessionon follow-up commands - example:
reflex browser open https://example.com - Use explicit
--sessiononly for deterministic override: - example:
reflex browser open https://example.com --session <sessionId> - End with
reflex browser session-killin auto-session mode. - if you used an explicit session id, use
reflex browser session-kill --session <sessionId>(orreflex browser session-kill <sessionId>)
Use the CLI itself as the command/protocol source of truth:
reflex browser --helpreflex browser help --json
Agent Defaults
- Do not pass
--sessionby habit afterstart; normal flows should stay in scoped auto-session mode. - Start on the target page, not on broad capability audits; do not inventory libraries or call repeated help commands unless a concrete next step needs exact syntax.
- Prefer
summaryfirst and fine-tune it (-i -c, then-s,-C,-d) for selector discovery and recovery before tryingevalorhtml; treathtmlas last-resort evidence, not normal recovery. Start with count 20; increase only when the page has many repeated items. - Use
reflex browser help --jsonfor exact command/response/schema details instead of duplicating those rules here.
Discovery Before Capability Audits (Required)
- For normal tasks, start with the target page:
start->open->summary. - Do not begin with broad audits such as
reflex lua libs, repeatedhelpcalls, external doc hunts, or speculative output-format work. - Check exact command/library help only when you have a concrete next step that requires it.
- Once a browser command succeeds, continue the task instead of re-checking availability.
Agent Availability And Recovery (Required)
- Before assuming browser commands are broken, verify the local agent is available.
- If a browser command fails with a transport/connect error, use this recovery order:
reflex agent status- if not running,
reflex agent start - if the agent jar is missing,
reflex agent download - if Java is missing or incompatible,
reflex agent runtime install - retry the original browser command after recovery
- Prefer the CLI's own guidance text when it suggests
reflex agent startorreflex agent download. - For local development tasks, the AI agent may run
reflex agent ...commands directly instead of only telling the human what to do. - If the environment is clearly non-local, remote, or permission-sensitive, explain the exact
reflex agent ...command the human should run. - Do not start multiple background agents on different ports unless the task explicitly requires it.
Recommended recovery flow:
reflex agent status
reflex agent start
reflex agent download
reflex agent runtime install
Command Lifecycle (Required)
- Send actions as separate CLI invocations.
- Do not chain browser commands with
&&, long shell pipelines, or opaque wrappers. - Keep one logical session context for the task (auto-session by default).
- Default rule: omit
--sessionon commands unless explicit override is required. - Execute sequentially: run one command, inspect response, then run the next.
- On transport failure, recover the local agent first, then rerun the command as a new invocation.
- Cleanup with
reflex browser session-killwhen done unless the user explicitly asks to keep the session open.
Response Handling (Required)
- Always capture the full JSON response first, then parse fields from that captured payload.
- Do not pipe command output directly into filtering (
jq | head) as the only observable output; this hides critical context. - Prefer in-memory capture over temp files; if temp files are needed, use ephemeral files and clean them up.
- Treat envelope fields (
ok,action,session) as source-of-truth; mirrored duplicates may be compacted out ofresponse. - For exact field names such as
summary.targets[], usereflex browser help --jsonas the contract reference.
Parser-First Summary Contract (Required)
- For selector discovery that feeds agent logic, use
summaryfirst. - Parse
response.data.summary.targets[]as the primary selector feed: selectorselectorTypeconfidencereason- optional steering:
statushintfallbackref— short-lived element ref (@r1,@r2, …); prefer overselectorwhen present- Treat
summary.version+summary.targets[]as the stable parser contract; avoid parsing deep fields from full summary output by default. - Do not parse
elements/actions/candidates-style fields from summary output. - Keep extraction flow deterministic:
- summary for candidate selection
- targeted action (
click/text/attribute/etc.) - re-run summary only after DOM-changing actions when needed
Summary Count And Flags (Required)
The positional count argument controls how many targets (ranked actionable elements) and snapshot lines are returned. It does not control how much of the DOM is scanned — the agent always scans up to 2000 nodes regardless.
- Default: 20. Hard max: 100.
- Start with
summary 20 -i -c. This is enough for most pages. - If you need more coverage, refine with flags first (
-s,-C,-d), not by increasing the count. - Only increase the count when the page has many similar actionable items (e.g., a product listing with 50+ links) and you need targets for more of them.
- Do not use high counts like
summary 80as a general "show me everything" — it adds low-confidence targets and more snapshot noise without improving discovery quality.
Summary Refinement Ladder (Required)
When the first summary pass is weak, noisy, or incomplete, stay in summary mode and refine it before escalating:
- Start with
summary 20 -i -cfor normal interactive discovery. - If the results are too broad, add
-s "<container>"to scope discovery to the relevant region. - If the page relies on non-semantic clickable UI, add
-C. - If the output is still noisy, tune depth (
-d <n>) and scope (-s) instead of increasing count or switching tools. - Only increase count beyond 20 when you