| name | browser |
| description | Automate browser actions using Puppeteer with a simple DSL for web testing and automation |
Browser Automation Skill
This skill uses pkgx to run tools without global installation:
- Node scripts:
pkgx pnpm exec tsx script.ts
- Python scripts:
pkgx uv run script.py
This skill provides browser automation using Puppeteer through a simple DSL. You can use it to:
- Test web applications
- Scrape web content
- Automate repetitive browser tasks
- Take screenshots of pages
Installation
First, install dependencies in the skill directory:
cd ~/.claude/skills/browser
pkgx pnpm install
This will install Puppeteer, TypeScript, and tsx.
Then install Chrome for Puppeteer:
npx puppeteer browsers install chrome
This downloads a compatible Chrome version to ~/.cache/puppeteer/.
Usage
Running from Command Line
cd ~/.claude/skills/browser && pkgx pnpm exec tsx scripts/browser.ts "
load https://www.google.com
waitForElement textarea[name=q]
click textarea[name=q]
type hello world
sleep 500
waitForElement input[value=\"Google Search\"]
click input[value=\"Google Search\"]
waitForNewPage google.com/search
screenshot result.png
"
Available Commands
DSL Syntax
- One command per line (except
eval blocks)
- Commands use the format:
commandName arg1 arg2 ...
- No quotes or parentheses needed - arguments are separated by whitespace
- Multi-line code blocks supported with
eval / endeval
- Lines starting with
# are treated as comments
- Empty lines are ignored
Examples
Simple commands:
load https://example.com
click button.submit
type Hello World
waitForNewPage example.com/results # Waits for navigation, then checks URL contains "example.com/results"
Multi-line eval block:
eval
const title = document.querySelector('h1').textContent;
console.log('Title:', title);
return title;
endeval