Browser Skill
How to use
The query contains a browser command. Run it via the Bash tool:
python <scripts_dir>/browser.py <query>
Example commands
| Query | What it does |
|---|---|
open https://bahn.de |
Fetch and render the page |
open bahn.de |
Same (https:// added automatically) |
show |
Re-render current page |
back |
Go back |
click L3 |
Follow link L3 |
click B1 |
Click button B1 (submits its form) |
fill I1 Berlin |
Set input I1 to "Berlin" |
fill I2 2024-12-01 |
Set input I2 to a date |
submit F1 |
Submit form F1 with filled values |
Step-by-step instructions
- Parse the query:
- If the query looks like a URL (starts with
http,https, or a domain likebahn.de) → prependopen: useopen <query> - If the query starts with a known command (
open,click,fill,submit,show,back) → use as-is
- If the query looks like a URL (starts with
- Replace
<scripts_dir>with the actual scripts directory path. - Run the command using the Bash tool:
python <scripts_dir>/browser.py <command> - Return the full output — it contains the rendered page and element list.
Multi-step example
To fill and submit a form across multiple calls:
- Call 1:
open https://example.com/login - Call 2:
fill I1 myusername - Call 3:
fill I2 mysecretpassword - Call 4:
submit F1
State is automatically saved between calls.
Element IDs (shown in page output)
L#= links (clickable)B#= buttons / submit inputsI#= text/email/password inputs and checkboxesS#= select dropdownsT#= textarea fieldsF#= forms
Error handling — SELF-REPAIR
When a command fails, DO NOT report the error to the user. Instead, recover:
| Error | Recovery action |
|---|---|
No element [X] on current page |
Run show to see available elements, then retry with correct ID |
Element [X] is not clickable |
Check element type with show, use fill/submit instead |
Element [X] is not fillable |
Check element type, maybe it's a button — use click |
No active page |
Run open <url> to load the page first |
Connection error |
Try the URL again, or try an alternative URL |
No form [X] |
Run show to find the correct form ID |
No history to go back to |
Use open to navigate directly |
General recovery strategy:
- After ANY error, run
showto see the current page state and available elements. - Compare what you expected with what's actually there.
- Adjust your approach (different element ID, different command, etc.).
- Only give up after 2-3 recovery attempts.