Skip to content

Add browserbase-agents skill: create, run, and integrate Agents via the API#143

Open
shubh24 wants to merge 1 commit into
mainfrom
browserbase-agents-skill
Open

Add browserbase-agents skill: create, run, and integrate Agents via the API#143
shubh24 wants to merge 1 commit into
mainfrom
browserbase-agents-skill

Conversation

@shubh24

@shubh24 shubh24 commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

What

New skill skills/browserbase-agents/ that teaches an agent (or a customer's coding agent) the full Browserbase Agents API lifecycle:

  • Create reusable agents (POST /v1/agents with name, systemPrompt, resultSchema)
  • Run them with %variable% placeholders, per-run schema overrides, and browserSettings (proxies / verified / contexts)
  • Poll runs to a terminal state, stream messages, read result.output
  • Retrieve downloads via the run's sessionId

Contents

File Purpose
SKILL.md Lean 5-step workflow (design → create → run → poll → verify/iterate)
scripts/bb_agents.py Zero-dependency (Python stdlib) CLI: create, update, run, get, poll, messages, list-agents, list-runs, downloads, delete
references/api_reference.md Condensed endpoint/payload/lifecycle reference from docs.browserbase.com
references/prompt_patterns.md System-prompt + schema design patterns: outcome enums, appliedFilters echo-back, null-over-invented-data, read-only guardrails, SSR-blob extraction, anti-bot settings
assets/example_agent.json Complete working agent payload (e-commerce search, full filter surface)
evals/evals.json 4 realistic prompts with expected behaviors

Why

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 warnings
  • CLI live-tested against the real API (list-agents, get-run against a completed run with structured output)
  • Every documented command was executed today against api.browserbase.com

Note: 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-agents skill 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 to skills/browserbase-agents/SKILL.md.

The skill bundles a five-step workflow (design prompt + schema → create → run with %variables% and browserSettings → poll/messages → verify via echo-back fields and dashboard metrics), a stdlib-only scripts/bb_agents.py CLI (create/update/run/get/poll/messages/list/downloads/delete), condensed references/api_reference.md, field-tested references/prompt_patterns.md (e.g. appliedFilters, outcome enums, anti-bot), assets/example_agent.json, evals/evals.json, and MIT LICENSE.txt.

Reviewed by Cursor Bugbot for commit d709bbf. Bugbot is set up for automated code reviews on this repo. Configure here.

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>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ 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}")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d709bbf. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant