browser-automation

Browser automation via HTTP server. Supports multiple concurrent sessions for multi-user testing, saved flows, and profile-based auth persistence.

7,060 stars

Best use case

browser-automation is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Browser automation via HTTP server. Supports multiple concurrent sessions for multi-user testing, saved flows, and profile-based auth persistence.

Teams using browser-automation should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/browser-automation/SKILL.md --create-dirs "https://raw.githubusercontent.com/civitai/civitai/main/.claude/skills/browser-automation/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/browser-automation/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How browser-automation Compares

Feature / Agentbrowser-automationStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Browser automation via HTTP server. Supports multiple concurrent sessions for multi-user testing, saved flows, and profile-based auth persistence.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Browser Automation Skill

Explore pages interactively, build reusable flows, and test multi-user scenarios.

## Quick Start

```bash
# Start server
node .claude/skills/browser-automation/server.mjs &

# Check available profiles
curl http://localhost:9222/profiles

# Create a session
curl -X POST http://localhost:9222/sessions \
  -d '{"name": "test", "url": "http://localhost:3000", "profile": "member"}'

# Inspect the page
curl http://localhost:9222/inspect

# Execute code
curl -X POST http://localhost:9222/chunk \
  -d '{"label": "Click button", "code": "await page.click(\"button.submit\");"}'

# Shutdown
curl -X POST http://localhost:9222/exit
```

## Endpoints

| Endpoint | Method | Description |
|----------|--------|-------------|
| `/profiles` | GET | List auth profiles with descriptions |
| `/sessions` | GET | List active sessions |
| `/sessions` | POST | Create session `{ name, url, profile?, headless? }` |
| `/sessions/:name` | DELETE | Close session |
| `/flows` | GET | List saved flows |
| `/flows/:name/run` | POST | Run flow `{ profile?, startUrl?, headless? }` |
| `/status` | GET | Session status |
| `/inspect` | GET | Page state + screenshot. Add `?fullPage=true` for full-page screenshot |
| `/chunk` | POST | Execute code `{ label, code }` |
| `/navigate` | POST | Navigate `{ url, fullPage? }`. Set `fullPage: true` for full-page screenshot |
| `/save-auth` | POST | Save auth `{ profile, description }` |
| `/review` | GET | Review recorded chunks |
| `/exit` | POST | Shutdown server |

Use `?session=name` when multiple sessions are active.

## Multi-User Testing

```bash
# Create two sessions with different profiles
curl -X POST http://localhost:9222/sessions \
  -d '{"name": "creator", "url": "http://localhost:3000", "profile": "creator"}'
curl -X POST http://localhost:9222/sessions \
  -d '{"name": "viewer", "url": "http://localhost:3000", "profile": "member"}'

# Creator does something
curl -X POST "http://localhost:9222/chunk?session=creator" \
  -d '{"label": "Publish", "code": "await page.click(\"button.publish\");"}'

# Viewer sees it
curl -X POST "http://localhost:9222/navigate?session=viewer" \
  -d '{"url": "http://localhost:3000/models"}'
```

## Profiles

```bash
# List profiles
curl http://localhost:9222/profiles

# Create new profile (description required)
curl -X POST http://localhost:9222/save-auth \
  -d '{"profile": "moderator", "description": "User with mod permissions"}'

# Refresh existing profile
curl -X POST http://localhost:9222/save-auth \
  -d '{"profile": "moderator"}'
```

| Profile | Description |
|---------|-------------|
| `moderator` | Mod permissions for content review |
| `creator` | Established user with published content |
| `member` | Standard logged-in user |
| `new-user` | Fresh account for onboarding flows |

## Flows

Saved flows are reusable Playwright scripts.

```bash
# List flows
curl http://localhost:9222/flows

# Run a flow
curl -X POST http://localhost:9222/flows/my-flow/run \
  -d '{"profile": "member"}'

# Run with custom start URL
curl -X POST http://localhost:9222/flows/my-flow/run \
  -d '{"profile": "member", "startUrl": "http://localhost:3000"}'
```

Flows are stored in `.browser/flows/*.js`.

## Playwright Code

Chunks execute with `page` available:

```javascript
await page.click('button.submit');
await page.fill('input[name="email"]', 'test@example.com');
await page.waitForSelector('h1');
await page.goto('https://example.com');
const title = await page.textContent('h1');
```

## Mockup Comparison

Open local HTML mockups with `file://` URLs, then compare to live pages:

```bash
# 1. Open mockup and take full-page screenshot
curl -X POST http://localhost:9222/sessions \
  -d '{"name": "compare", "url": "file:///C:/path/to/mockup.html"}'
curl "http://localhost:9222/inspect?session=compare&fullPage=true"

# 2. Navigate to live page and screenshot
curl -X POST "http://localhost:9222/navigate?session=compare" \
  -d '{"url": "http://localhost:3000/page", "fullPage": true}'

# 3. Compare screenshots in session folder
```

## File Locations

- **Flows**: `.browser/flows/*.js`
- **Profile metadata**: `.browser/profiles/profiles.meta.json`
- **Auth state**: `.browser/profiles/*.json` (gitignored)
- **Screenshots**: `.browser/sessions/{id}/screenshots/`

Related Skills

worktree

7060
from civitai/civitai

Create and manage git worktrees with automatic environment setup. Creates worktrees at ../model-share-<branch>, copies .env, and runs pnpm install.

ux-design

7060
from civitai/civitai

UX design methodology and external consultation. Use when creating user flows, wireframes, interaction patterns, or getting UX feedback. Provides structured frameworks for user-centered design.

retool-query

7060
from civitai/civitai

Run queries against the Retool PostgreSQL database for moderation notes, user notes, and other Retool-managed data. Read-only by default. Use when you need to query the Retool database directly.

redis-inspect

7060
from civitai/civitai

Inspect Redis cache keys, values, and TTLs for debugging. Supports both main cache and system cache. Use for debugging cache issues, checking cached values, and monitoring cache state. Read-only by default.

ralph

7060
from civitai/civitai

Autonomous agent for tackling big projects. Create PRDs with user stories, then run them via the CLI. Sessions persist across restarts with pause/resume and real-time monitoring.

quick-mockups

7060
from civitai/civitai

Create multiple UI design mockups in parallel. Use when asked to create mockups, wireframes, or design variations for a feature. Creates HTML files using Mantine v7 + Tailwind following Civitai's design system.

postgres-query

7060
from civitai/civitai

Run PostgreSQL queries for testing, debugging, and performance analysis. Use when you need to query the database directly, run EXPLAIN ANALYZE, compare query results, or test SQL optimizations. Always uses read-only connections unless explicitly directed otherwise.

opensearch-admin

7060
from civitai/civitai

Inspect and debug OpenSearch clusters — health, index stats, search performance, query profiling, mappings, shards, and thread pools. Read-only admin operations for monitoring and troubleshooting.

mod-actions

7060
from civitai/civitai

Take moderator actions on users - ban, mute, remove content, manage leaderboard eligibility, send DMs. Use when you need to ban a user, mute them, send direct messages, or take other moderation actions.

metabase

7060
from civitai/civitai

Create and manage Metabase questions, dashboards, and public links. Use when the user wants to build metrics dashboards, create saved questions with SQL queries, or share analytics publicly.

meilisearch-admin

7060
from civitai/civitai

Check Meilisearch index status, tasks, health, and settings. Use for debugging search issues, monitoring indexing tasks, and inspecting index configuration. Read-only admin operations.

freshdesk

7060
from civitai/civitai

Interact with Freshdesk support platform - search/view/update tickets, reply to customers, add notes, look up contacts, and manage Knowledge Base articles. Use when you need to manage support tickets, look up customer information, or work with KB content.