A collection of skills for AI coding agents working with Bun.WebView — the native headless browser automation API built into Bun.
Guide for browser automation using Bun.WebView. Covers web scraping, screenshot capture, form automation, and programmatic page control.
Use when:
- "Take a screenshot of a website"
- "Automate filling this form"
- "Scrape data from a webpage"
- "Test my web application"
- "Click buttons and interact with elements"
Topics covered:
- Creating WebView instances with
new Bun.WebView() - Navigation (navigate, goBack, goForward, reload)
- Element interaction (click, type, press keys)
- Form automation workflows
- Data extraction with
evaluate() - Screenshot capture (PNG, JPEG, WebP)
- Scrolling (scroll, scrollTo)
- Chrome backend configuration
- Console capture and debugging
- Best practices and complete examples
cp -r skills/browser-automation ~/.claude/skills/Add the skill to project knowledge or paste the contents of skills/browser-automation/SKILL.md into your conversation.
Skills are automatically available once installed. The agent will use them when relevant tasks are detected.
Examples:
Take a screenshot of example.com
Scrape the top 10 stories from Hacker News
Automate logging into this website
Each skill contains:
SKILL.md- Instructions for the agentscripts/- Helper scripts for automation (optional)references/- Supporting documentation (optional)evals/- Evaluation test cases (optional)
await using view = new Bun.WebView({ width: 1280, height: 720 });
await view.navigate("https://example.com");
// Take a screenshot
const screenshot = await view.screenshot();
await Bun.write("example.png", screenshot);
// Extract data
const title = await view.evaluate("document.title");
console.log(title);
// Interact with elements
await view.click("button#submit");
await view.type("Hello World");Bun.WebView is a native headless browser automation API built into Bun. It provides programmatic control over web browsers for testing, scraping, screenshot capture, and automation tasks.
Key Features:
- Two Backends: WebKit (macOS default, zero deps) or Chrome (cross-platform)
- Native Events: All interactions dispatch OS-level events with
isTrusted: true - Auto-waiting: Selector-based methods wait for elements to be actionable
- Disposable Pattern: Use
await usingfor automatic cleanup
Learn more at bun.com/reference/bun/WebView
To create a new skill:
- Create a new folder in
skills/{skill-name}/ - Add a
SKILL.mdwith instructions for the agent - Optionally add scripts, references, and evaluations
- Test the skill thoroughly
See AGENTS.md for detailed guidelines.
MIT