Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

optimize-agent-prompt

Skill by browserbase

Optimizes the systemPrompt of a Browserbase Agent through a repeatable run, score, and revise loop. Built for developers creating Agent demos or diagnosing flaky Agent runs.

  • Score 83
  • 3.8k stars
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install optimize-agent-prompt

Built from the published package, never by AI.

git clone --depth 1 https://github.com/browserbase/skills /tmp/skills && mkdir -p ~/.claude/skills && cp -r /tmp/skills/skills/optimize-agent-prompt ~/.claude/skills/optimize-agent-prompt

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install optimize-agent-prompt in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

This skill improves the system prompt of a Browserbase Agent while keeping its task, result schema, variables, and evaluation criteria fixed. It treats the outer agent as a teacher and each Browserbase Agent run as an inner-agent rollout. A Node.js harness that uses only built-in modules creates an isolated workspace, runs the task, and writes messages, session logs, and summary files for each run.

The workflow runs a baseline, finds the earliest wrong turn in the messages and session logs, and makes one attributable prompt change per iteration. Runs are compared in a report and judged on terminal status, required fields, known-fact checks, and message count or duration. A prompt converges only after it passes repeated runs, including an unchanged confirmation run. It is aimed at developers building Browserbase Agents demos or proofs of concept, and reviewers can audit the workspace to see why each instruction exists.

Written from the project's SKILL.md and checked against it.

What it can do

  • initCreates an isolated experiment workspace inside a demo or POC repository.
  • runCreates a reusable Browserbase Agent, sets its systemPrompt, and records the run output.
  • inspectShows a compact trajectory of a labeled run to help diagnose failures.
  • reportGenerates a comparison table of runs in the experiment workspace.
  • Prompt iterationGuides the outer agent to revise one system-prompt heuristic per iteration.
  • Convergence checkDefines when a prompt is confirmed, based on repeated passing runs.

What you need

  • Node.js 18 or later
  • BROWSERBASE_API_KEY environment variable

Try asking

  • Set up a prompt optimization workspace for my Browserbase Agent demo
  • Run the baseline prompt for my Browserbase Agent and inspect the trajectory
  • Compare my Browserbase Agent prompt iterations and show the report

Good to know

  • Runs stop after the configured message budget.
  • Session logs can be empty if the Agent used search or fetch tools and never drove its browser.
  • Reasoning parts may contain no readable text, so the workflow does not rely on them.
  • A winning prompt is the best for the tested task distribution, not globally optimal.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: skills/optimize-agent-prompt/SKILL.md, skills/optimize-agent-prompt/scripts/optimize_agent_prompt.mjs. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

Allowed tools: Bash Read Write Edit Grep Glob

  • LICENSE.txt1 KB
  • SKILL.md5 KB
  • agents/openai.yaml232 B
  • evals/evals.json2 KB
  • references/api.md3 KB
Show all 7 files
  • references/evaluation.md2 KB
  • scripts/optimize_agent_prompt.mjs12 KB

Alternatives to optimize-agent-prompt

All alternatives →

Compare with agent-reproduce-align, google_contacts or m06-error-handling

optimize-agent-prompt: common questions

What does optimize-agent-prompt do?

It optimizes the systemPrompt of a Browserbase Agent while holding the task, result schema, variables, and evaluation criteria fixed. Each change is tested through repeated runs.

When should I use this skill?

The source says to use it when creating a Browserbase Agents demo or POC, optimizing an Agent system prompt, or diagnosing flaky Agent runs. It also applies to auto-research or autobrowse on the Browserbase Agents API.

Does it need anything beyond Node.js?

No. The harness uses only Node.js built-in modules, and it requires the BROWSERBASE_API_KEY environment variable to be set.

How do I install optimize-agent-prompt?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is optimize-agent-prompt free?

The code is public, but no licence file was found, so check the repository before commercial use.

Is optimize-agent-prompt safe to use?

It scores 83 of 100. Grades: maintenance A, licence F, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to optimize-agent-prompt?

Similar skills: agent-reproduce-align, google_contacts, m06-error-handling, caveman.

optimize-agent-prompt Install

Add to stack

Loading.