Add browserbase-agents skill: create, run, and integrate Agents via the API#143
Add browserbase-agents skill: create, run, and integrate Agents via the API#143shubh24 wants to merge 1 commit into
Conversation
Teaches an agent the full Browserbase Agents API lifecycle — create reusable agents (systemPrompt + resultSchema), trigger runs with %variable% placeholders and browserSettings, poll to terminal state, stream run messages, and retrieve downloads. Includes a zero-dependency Python CLI (scripts/bb_agents.py), a condensed API reference, and a prompt/schema patterns guide distilled from the docs plus 11 live production runs (outcome enums, appliedFilters echo-back, variable date-drift mitigations, anti-bot settings). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d709bbf. Configure here.
| print(json.dumps(run, indent=2)) | ||
| return run | ||
| time.sleep(interval) | ||
| sys.exit(f"Timed out after {timeout}s waiting for run {run_id}") |
There was a problem hiding this comment.
Poll sleep ignores deadline
Medium Severity
In poll, each loop sleeps for the full --interval without capping sleep to the remaining --timeout. If the interval exceeds the deadline (e.g. --timeout 8 --interval 10), the loop can exit with a timeout after a long sleep even when the run already reached a terminal state during that sleep.
Reviewed by Cursor Bugbot for commit d709bbf. Configure here.
| run = request("POST", "/agents/runs", key, body=body) | ||
| print(json.dumps(run, indent=2)) | ||
| if args.wait: | ||
| poll(run["runId"], key, args.interval, args.timeout) |
There was a problem hiding this comment.
Wait flag emits two JSON blobs
Medium Severity
With run --wait, stdout receives two separate pretty-printed JSON objects: the initial POST response and the final polled run from poll. Pipelines and tools expecting a single JSON document (e.g. jq) fail or only parse the first value.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit d709bbf. Configure here.


What
New skill
skills/browserbase-agents/that teaches an agent (or a customer's coding agent) the full Browserbase Agents API lifecycle:POST /v1/agentswithname,systemPrompt,resultSchema)%variable%placeholders, per-run schema overrides, andbrowserSettings(proxies / verified / contexts)messages, readresult.outputsessionIdContents
SKILL.mdscripts/bb_agents.pyreferences/api_reference.mdreferences/prompt_patterns.mdappliedFiltersecho-back, null-over-invented-data, read-only guardrails, SSR-blob extraction, anti-bot settingsassets/example_agent.jsonevals/evals.jsonWhy
Repeatedly needed during SE demo-building: today we created 11 agents (Amazon/eBay/Walmart search, Resy/OpenTable availability, tee times, Airbnb, Apartments.com, Google Flights, hotel day passes, bakery delivery) and ran 11/11 to completion. The patterns doc encodes what actually went wrong on first runs (filters silently not applied, PerimeterX-thin extraction,
%date%variable drift) and how to catch it via schema design — knowledge that isn't in the docs.Testing
node scripts/validate-skills.mjs --skill browserbase-agents— passes, 0 warningsNote: script is Python stdlib rather than
.mjs— chosen so customers can run it with no Node/npm install at all; happy to port if reviewers prefer.🤖 Generated with Claude Code
Note
Low Risk
Documentation and a local helper CLI only; no changes to auth, core browse CLI, or production runtime code.
Overview
Adds a new
browserbase-agentsskill so coding agents can design, create, run, poll, and iterate on Browserbase Agents without Playwright/Stagehand code. The README skills table gains a row linking toskills/browserbase-agents/SKILL.md.The skill bundles a five-step workflow (design prompt + schema → create → run with
%variables%andbrowserSettings→ poll/messages → verify via echo-back fields and dashboard metrics), a stdlib-onlyscripts/bb_agents.pyCLI (create/update/run/get/poll/messages/list/downloads/delete), condensedreferences/api_reference.md, field-testedreferences/prompt_patterns.md(e.g.appliedFilters, outcome enums, anti-bot),assets/example_agent.json,evals/evals.json, and MITLICENSE.txt.Reviewed by Cursor Bugbot for commit d709bbf. Bugbot is set up for automated code reviews on this repo. Configure here.