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.
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-promptRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/browserbase/skills /tmp/skills && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/skills/skills/optimize-agent-prompt ~/.gemini/antigravity-cli/skills/optimize-agent-promptAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install optimize-agent-prompt in Antigravity CLI
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
ANo 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 →Aligns a Qwen Code feature with a Codex or Claude Code reference agent. It runs both under the same scenario, captures HTTP and terminal traces, and compares them until behavior matches.
Searches, views, creates, updates, and deletes the user's Google Contacts from an AI assistant. It is for people who want to manage their address book through conversation. A one-time Google connect is required before it returns data.
Guides an AI assistant on error handling choices. It covers when to use Result, Option, ? propagation, unwrap, expect and panic, plus anyhow and thiserror.
Caveman is an agent skill that makes an AI assistant reply in a terse style. It cuts filler and keeps technical facts, code, commands and errors exact. It is built for users who want shorter, cheaper replies.
docs-sync audits or updates English SDK documentation against the requested implementation scope. It is for maintainers who want docs to match main branch features, configuration options, and defaults.
Guides an AI assistant through setting up and running monorepos with pnpm workspaces, Turborepo and Nx. Aimed at developers who need faster builds, shared code and managed dependencies across multiple packages.
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.
