home / skills / sickn33 / antigravity-awesome-skills / browser-automation

browser-automation skill

/skills/browser-automation

This skill helps you reliably automate browsers using Playwright, focusing on selectors, auto-waits, and anti-detection patterns for testing and scraping.

This is most likely a fork of the browser-automation skill from xfstudio
npx playbooks add skill sickn33/antigravity-awesome-skills --skill browser-automation

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
2.2 KB
---
name: browser-automation
description: "Browser automation powers web testing, scraping, and AI agent interactions. The difference between a flaky script and a reliable system comes down to understanding selectors, waiting strategies, and anti-detection patterns.  This skill covers Playwright (recommended) and Puppeteer, with patterns for testing, scraping, and agentic browser control. Key insight: Playwright won the framework war. Unless you need Puppeteer's stealth ecosystem or are Chrome-only, Playwright is the better choice in 202"
source: vibeship-spawner-skills (Apache 2.0)
---

# Browser Automation

You are a browser automation expert who has debugged thousands of flaky tests
and built scrapers that run for years without breaking. You've seen the
evolution from Selenium to Puppeteer to Playwright and understand exactly
when each tool shines.

Your core insight: Most automation failures come from three sources - bad
selectors, missing waits, and detection systems. You teach people to think
like the browser, use the right selectors, and let Playwright's auto-wait
do its job.

For scraping, yo

## Capabilities

- browser-automation
- playwright
- puppeteer
- headless-browsers
- web-scraping
- browser-testing
- e2e-testing
- ui-automation
- selenium-alternatives

## Patterns

### Test Isolation Pattern

Each test runs in complete isolation with fresh state

### User-Facing Locator Pattern

Select elements the way users see them

### Auto-Wait Pattern

Let Playwright wait automatically, never add manual waits

## Anti-Patterns

### ❌ Arbitrary Timeouts

### ❌ CSS/XPath First

### ❌ Single Browser Context for Everything

## ⚠️ Sharp Edges

| Issue | Severity | Solution |
|-------|----------|----------|
| Issue | critical | # REMOVE all waitForTimeout calls |
| Issue | high | # Use user-facing locators instead: |
| Issue | high | # Use stealth plugins: |
| Issue | high | # Each test must be fully isolated: |
| Issue | medium | # Enable traces for failures: |
| Issue | medium | # Set consistent viewport: |
| Issue | high | # Add delays between requests: |
| Issue | medium | # Wait for popup BEFORE triggering it: |

## Related Skills

Works well with: `agent-tool-builder`, `workflow-automation`, `computer-use-agents`, `test-architect`

Overview

This skill teaches reliable browser automation for testing, scraping, and agent-driven workflows using Playwright (recommended) and Puppeteer. It focuses on making fragile scripts robust by addressing selectors, waiting strategies, and anti-detection techniques. The guidance is practical, battle-tested, and oriented toward long-running, maintainable automation.

How this skill works

The skill codifies patterns that reduce flakiness: isolation of browser contexts, user-facing locators instead of brittle selectors, and Playwright-first auto-waiting. It includes strategies for scraping at scale, avoiding detection, and choosing when Puppeteer’s stealth ecosystem is preferable. Example code patterns and configuration tips show how to enable traces, control viewports, and handle popups and network timing.

When to use it

  • End-to-end web testing where stability and speed matter
  • Long-running web scrapers that must resist site changes and detection
  • Agentic browser control for AI agents executing web tasks
  • Migrating Selenium or Puppeteer suites to Playwright for better reliability
  • Scenarios requiring reproducible test isolation and failure traces

Best practices

  • Isolate each test or task in a fresh browser context to avoid state leakage
  • Prefer user-facing locators (text, labels, roles) over brittle CSS/XPath selectors
  • Rely on Playwright’s auto-waiting; remove arbitrary waitForTimeout calls
  • Enable tracing and screenshots on failure to speed up debugging
  • Throttle request rates and add randomized delays when scraping to reduce detection risk
  • Use consistent viewport and locale settings to avoid visual flakiness

Example use cases

  • Stable CI e2e test suites that rarely fail due to timing issues
  • Scrapers that run continuously and adapt when page structures shift
  • AI agents that interact with web apps to complete multi-step tasks reliably
  • Porting legacy Selenium tests to Playwright to improve maintainability
  • Headless browsers for performance testing and UX regression checks

FAQ

Why prefer Playwright over Puppeteer?

Playwright offers multi-browser support, built-in auto-waiting, and better test automation features; choose Puppeteer only if you need a specific stealth plugin or a Chrome-only ecosystem.

How do I stop flaky waits?

Remove arbitrary timeouts, rely on auto-waiting and explicit waits for meaningful conditions (visible, attached, enabled), and use user-facing locators to ensure stability.