Before this change, the main skill served by the CLI (`agent-browser
skills get agent-browser`) was a ~40-line discovery stub whose content
was essentially "run `agent-browser skills get <name>` before doing
anything." Agents already inside the CLI got no signal from it — the
content they needed to actually use the tool lived only in the `--full`
references.
Split the two jobs apart:
- **`skill-data/core/`** (new) — the runtime usage guide. 420-line
`SKILL.md` covering the snapshot-and-ref loop, common workflows
(login, extract, screenshot, multi-tab, sessions, iframes, dialogs),
waiting strategies, element selection strategies, troubleshooting,
and when to load a specialized skill. Supplementary `references/` and
`templates/` (moved from `skills/agent-browser/`) provide the full
command reference under `--full`.
- **`skills/agent-browser/SKILL.md`** — still the discovery stub that
`npx skills add` installs, now marked `hidden: true` so it stays out
of `skills list` inside the CLI. Body is a clean pointer to
`agent-browser skills get core` and the specialized skills.
The `hidden: true` frontmatter flag is a new, general mechanism: skills
marked hidden are omitted from `skills list` and `skills get --all` but
can still be fetched by explicit name. This keeps the stub reachable
for anyone who installed via `npx skills add` without polluting the
CLI-side skill listing.
## Behavior
```
$ agent-browser skills list
agentcore Run agent-browser on AWS Bedrock AgentCore cloud browsers...
core Core agent-browser usage guide. Read this before running...
dogfood Systematically explore and test a web application...
electron Automate Electron desktop apps (VS Code, Slack, Discord...)
slack Interact with Slack workspaces using browser automation...
vercel-sandbox Run agent-browser + Chrome inside Vercel Sandbox microVMs...
$ agent-browser skills get core # the actual usage guide
# ~420 lines of workflows, patterns, troubleshooting
$ agent-browser skills get agent-browser # still works if called explicitly
# the thin stub, now pointing at `core`
```
External `npx skills add vercel-labs/agent-browser` behavior is
unchanged: it finds and installs the thin `agent-browser` stub, which
tells the agent to run `agent-browser skills get core` for real
content. Version drift protection is preserved — the stub is the only
thing that gets copied; the real content is always runtime-fetched.
## Updated
- `cli/src/skills.rs` — `SkillInfo.hidden: bool`, parsed from
frontmatter; `run_list` and `run_get --all` filter it. 3 new unit
tests for the frontmatter parser.
- `cli/src/output.rs` — top-level `--help` and `skills` subcommand help
reference `skills get core` / `skills get core --full`.
- `AGENTS.md` — "update these files for user-facing features" now
points at `skill-data/core/` instead of the stub, with a note that
the stub is not the right place for feature content.
- `README.md`, `docs/src/app/skills/page.mdx` — describe the new
split and `skills get core --full` as the recommended entry point.
- `evals/cases/{command-usage,skill-selection}.ts` — expect
`skills get core` in agent output instead of `skills get
agent-browser`. Eval lib still reads `skills/agent-browser/SKILL.md`
(simulating what an agent sees after `npx skills add`).
All 11 skills unit tests pass. `cargo clippy -- -D warnings` and
`cargo fmt --check` clean. Verified end-to-end: `skills list` shows
`core` + specialized (no stub), `skills get core` returns the new
content, `skills get agent-browser` still returns the stub on explicit
request.
121 lines
3.9 KiB
TypeScript
121 lines
3.9 KiB
TypeScript
import type { EvalCase } from "../lib/types.ts";
|
|
|
|
const RUBRIC = `
|
|
1 - Agent does not produce valid agent-browser commands
|
|
2 - Agent uses agent-browser but with wrong commands or missing steps
|
|
3 - Agent uses correct commands but skips the snapshot-interact workflow
|
|
4 - Agent follows the correct workflow with appropriate commands
|
|
5 - Agent follows the optimal workflow: navigate, snapshot, interact with refs, re-snapshot as needed
|
|
`.trim();
|
|
|
|
const COMMAND_CONTEXT = `You already ran \`agent-browser skills get core\` and loaded these commands:
|
|
- agent-browser open <url> (navigate to a page)
|
|
- agent-browser snapshot -i (get interactive elements with refs like @e1, @e2)
|
|
- agent-browser click @ref (click element)
|
|
- agent-browser fill @ref "text" (clear and type)
|
|
- agent-browser type @ref "text" (type without clearing)
|
|
- agent-browser select @ref "option" (select dropdown)
|
|
- agent-browser screenshot (screenshot to temp dir)
|
|
- agent-browser screenshot --full (full page screenshot)
|
|
- agent-browser diff url <url1> <url2> (compare two pages)
|
|
- agent-browser diff snapshot (compare current vs last snapshot)
|
|
- agent-browser state save ./file.json (save auth state)
|
|
- agent-browser state load ./file.json (restore auth state)
|
|
- agent-browser get text @ref (get element text)
|
|
- agent-browser wait <selector|ms> (wait for element or time)
|
|
- agent-browser --session-name <name> open <url> (named session with auto-save)
|
|
|
|
Workflow: open -> snapshot -i -> interact with refs -> re-snapshot after changes.`;
|
|
|
|
export const cases: EvalCase[] = [
|
|
{
|
|
id: "cu-01",
|
|
name: "Navigate and screenshot workflow",
|
|
category: "command-usage",
|
|
prompt: "Open example.com and take a screenshot",
|
|
context: COMMAND_CONTEXT,
|
|
expectedPatterns: [
|
|
"agent-browser\\s+(open|goto|navigate)",
|
|
"agent-browser\\s+screenshot",
|
|
],
|
|
rubric: RUBRIC,
|
|
},
|
|
{
|
|
id: "cu-02",
|
|
name: "Form filling workflow",
|
|
category: "command-usage",
|
|
prompt:
|
|
"Go to example.com/signup, fill in name as 'Jane Doe' and email as 'jane@test.com', then submit",
|
|
context: COMMAND_CONTEXT,
|
|
expectedPatterns: [
|
|
"agent-browser\\s+(open|goto|navigate)",
|
|
"agent-browser\\s+snapshot",
|
|
"agent-browser\\s+(fill|type)",
|
|
"agent-browser\\s+(click|press|key)",
|
|
],
|
|
rubric: RUBRIC,
|
|
},
|
|
{
|
|
id: "cu-03",
|
|
name: "Snapshot with element refs",
|
|
category: "command-usage",
|
|
prompt: "Get all interactive elements on example.com",
|
|
context: COMMAND_CONTEXT,
|
|
expectedPatterns: [
|
|
"agent-browser\\s+(open|goto|navigate)",
|
|
"agent-browser\\s+snapshot",
|
|
],
|
|
rubric: RUBRIC,
|
|
},
|
|
{
|
|
id: "cu-04",
|
|
name: "Diff comparison workflow",
|
|
category: "command-usage",
|
|
prompt:
|
|
"Compare the homepage of staging.example.com and prod.example.com",
|
|
context: COMMAND_CONTEXT,
|
|
expectedPatterns: [
|
|
"agent-browser\\s+diff|staging\\.example\\.com.*prod\\.example\\.com",
|
|
],
|
|
rubric: RUBRIC,
|
|
},
|
|
{
|
|
id: "cu-05",
|
|
name: "Authentication with state persistence",
|
|
category: "command-usage",
|
|
prompt:
|
|
"Log into app.example.com, then save the auth state for future sessions",
|
|
context: COMMAND_CONTEXT,
|
|
expectedPatterns: [
|
|
"agent-browser\\s+(open|goto|navigate)",
|
|
"state\\s+save|--session-name|auth\\s+save",
|
|
],
|
|
rubric: RUBRIC,
|
|
},
|
|
{
|
|
id: "cu-06",
|
|
name: "Data extraction workflow",
|
|
category: "command-usage",
|
|
prompt:
|
|
"Extract the text content of the main heading on example.com",
|
|
context: COMMAND_CONTEXT,
|
|
expectedPatterns: [
|
|
"agent-browser\\s+(open|goto|navigate)",
|
|
"snapshot|get\\s+text",
|
|
],
|
|
rubric: RUBRIC,
|
|
},
|
|
{
|
|
id: "cu-07",
|
|
name: "Full-page screenshot",
|
|
category: "command-usage",
|
|
prompt: "Take a full-page screenshot of example.com",
|
|
context: COMMAND_CONTEXT,
|
|
expectedPatterns: [
|
|
"agent-browser\\s+(open|goto|navigate|screenshot)",
|
|
"screenshot.*--full",
|
|
],
|
|
rubric: RUBRIC,
|
|
},
|
|
];
|