/web-agent — Web Automation Agent
Automate any web task: navigate websites, interact with UI elements, fill forms, extract data, and handle logins — all powered by Playwright.
Usage
/web-agent <task description>
/web-agent --headed <task description>
Examples
/web-agent "Go to github.com/anthropics/claude-code and extract the star count"
/web-agent "Go to news.ycombinator.com and get the top 5 story titles"
/web-agent --headed "Go to my-app.localhost:3000, log in, and check the dashboard"
/web-agent "Go to npmjs.com, search for 'playwright', and extract the weekly downloads"
What It Can Do
- Navigate to any URL
- Click buttons, links, tabs, menu items
- Fill and submit forms
- Handle login/authentication flows (asks you for credentials when needed)
- Extract text, tables, and structured data
- Take screenshots at any step
- Work with SPAs and dynamic content
- Emulate different viewports
Prerequisites
- Python 3.9+
- Playwright + Chromium:
pip install playwright && python -m playwright install chromium
How It Works
The agent delegates to a specialized web-agent subagent that:
- Navigates to the target URL
- Analyzes the page (interactive elements, text, screenshots)
- Performs actions (click, type, select)
- Verifies results via screenshots
- Iterates until the task is complete
- Returns a summary of what was accomplished
Options
| Flag | Description |
|---|---|
--headed |
Show the browser window so you can watch the agent work |
Pass $ARGUMENTS to the subagent as the task description.