SKILL.md quick-start does not run on [email protected] (5 API mismatches)
The quick-start snippet in skills/dev-browser/SKILL.md does not run on the published CLI. Every
call in this line fails:
dev-browser -e 'const p = await browser.getPage("main"); await p.click("ref/e6"); await p.waitForLoad(); p.url()'Since agents follow the skill literally, the first real task errors out. Five separate mismatches,
all verified against [email protected] on Linux x86_64 (glibc), Chrome for Testing 145.
1. -e is not a flag
$ dev-browser -e 'console.log(1)'
error: unexpected argument '-e' found
Usage: dev-browser [OPTIONS] [COMMAND]--help documents stdin and run <file> only.
2. The last expression is not printed
SKILL.md line 21 says "last expression is printed". It is not — a script whose final line is a bare
expression produces no output. My first run against the documented snippet returned an empty string
and looked like a hang. console.log is required.
3. page.snapshot() does not exist; the method is page.snapshotForAI()
typeof page.snapshot // "undefined"
typeof page.snapshotForAI // "function"It also returns an object, not a string:
const snap = await page.snapshotForAI();
Object.keys(snap); // ["full"]
snap.full; // '- generic [ref=e2]:\n - heading "Example Domain" [level=1] [ref=e3]…'Worth calling out in the docs, because snap.length and snap.slice() on the returned object give
undefined rather than throwing — which reads as "the API is broken" instead of "wrong shape". That
cost me a while.
4. page.click("ref/e6") is parsed as CSS
Error: Unexpected token "/" while parsing css selector "ref/e6"The refs from snapshotForAI() are fine — they just need getByRef:
await page.getByRef("e6").click(); // works5. page.waitForLoad() does not exist
TypeError: not a functionpage.waitForLoadState("domcontentloaded") is the Playwright method. Relevant because the gotchas
section correctly warns that click never waits, and then names a helper that isn't there.
Suggested replacement snippet
dev-browser <<'EOF'
const page = await browser.getPage("main");
await page.goto("https://example.com", { waitUntil: "domcontentloaded" });
const snap = await page.snapshotForAI();
console.log(snap.full);
await page.getByRef("e6").click();
await page.waitForLoadState("domcontentloaded");
console.log(page.url());
EOFVerified end to end: prints the ARIA tree, clicks the link, prints
https://www.iana.org/help/example-domains.
Guess at the cause
main looks ahead of the published package — -e and page.snapshot() read like a newer surface.
If so, the skill is correct for an unreleased build and wrong for everything on npm today. A note
about the minimum version would help as much as the fixes.
Happy to send a PR for the SKILL.md if useful.
Source: SawyerHood/dev-browser