Skip to content
Back to skills

Playwright Skill

ASecurity

Complete browser automation with Playwright. Auto-detects dev servers, writes clean test scripts to /tmp. Test pages, fill forms, take screenshots, check responsive design, validate UX, test login flows, check links, automate any browser task. Use when user wants to test websites, automate browser interactions, validate web functionality, or perform any browser-based testing.

  • 508 stars
  • 0 votes
  • 0 copies
  • 13 views
  • Added September 7, 2026
developmentjavascriptgojavabashnodetestingdebugging

Security analysis

A100/100

Pro scans all 13 files and shows the line behind each finding

Scanned September 7, 2026

npx -y skills add Dokhacgiakhoa/antigravity-ide --skill playwright-skill --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Playwright Skill?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Playwright Skill
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/dokhacgiakhoa-playwright-skill/badge)](https://www.skillsdirectory.com/skills/dokhacgiakhoa-playwright-skill)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
version: 4.1.0-fractal
name: playwright-skill
description: Complete browser automation with Playwright. Auto-detects dev servers, writes clean test scripts to /tmp. Test pages, fill forms, take screenshots, check responsive design, validate UX, test login flows, check links, automate any browser task. Use when user wants to test websites, automate browser interactions, validate web functionality, or perform any browser-based testing.
---

**IMPORTANT - Path Resolution:**
This skill can be installed in different locations (plugin system, manual installation, global, or project-specific). Before executing any commands, determine the skill directory based on where you loaded this SKILL.md file, and use that path in all commands below. Replace `$SKILL_DIR` with the actual discovered path.

Common installation paths:

- Plugin system: `~/.claude/plugins/marketplaces/playwright-skill/skills/playwright-skill`
- Manual global: `~/.claude/skills/playwright-skill`
- Project-specific: `<project>/.claude/skills/playwright-skill`

# Playwright Browser Automation

General-purpose browser automation skill. I'll write custom Playwright code for any automation task you request and execute it via the universal executor.

**CRITICAL WORKFLOW - Follow these steps in order:**

1. **Auto-detect dev servers** - For localhost testing, ALWAYS run server detection FIRST:

   ```bash
   cd $SKILL_DIR && node -e "require('./lib/helpers').detectDevServers().then(servers => console.log(JSON.stringify(servers)))"
   ```

   - If **1 server found**: Use it automatically, inform user
   - If **multiple servers found**: Ask user which one to test
   - If **no servers found**: Ask for URL or offer to help start dev server

2. **Write scripts to /tmp** - NEVER write test files to skill directory; always use `/tmp/playwright-test-*.js`

3. **Use visible browser by default** - Always use `headless: false` unless user specifically requests headless mode

4. **Parameterize URLs** - Always make URLs configurable via environment variable or constant at top of script

## How It Works

1. You describe what you want to test/automate
2. I auto-detect running dev servers (or ask for URL if testing external site)
3. I write custom Playwright code in `/tmp/playwright-test-*.js` (won't clutter your project)
4. I execute it via: `cd $SKILL_DIR && node run.js /tmp/playwright-test-*.js`
5. Results displayed in real-time, browser window visible for debugging
6. Test files auto-cleaned from /tmp by your OS

## Setup (First Time)

```bash
cd $SKILL_DIR
npm run setup
```

This installs Playwright and Chromium browser. Only needed once.

## Execution Pattern

**Step 1: Detect dev servers (for localhost testing)**

```bash
cd $SKILL_DIR && node -e "require('./lib/helpers').detectDevServers().then(s => console.log(JSON.stringify(s)))"
```

**Step 2: Write test script to /tmp with URL parameter**

```javascript
// /tmp/playwright-test-page.js
const { chromium } = require('playwright');

// Parameterized URL (detected or user-provided)
const TARGET_URL = 'http://localhost:3001'; // <-- Auto-detected or from user

(async () => {
  const browser = await chromium.launch({ headless: false });
  const page = await browser.newPage();

  await page.goto(TARGET_URL);
  console.log('Page loaded:', await page.title());

  await page.screenshot({ path: '/tmp/screenshot.png', fullPage: true });
  console.log('📸 Screenshot saved to /tmp/screenshot.png');

  await browser.close();
})();
```

**Step 3: Execute from skill directory**

```bash
cd $SKILL_DIR && node run.js /tmp/playwright-test-page.js
```

## Common Patterns

## 🧠 Knowledge Modules (Fractal Skills)

### 1. [Test a Page (Multiple Viewports)](./sub-skills/test-a-page-multiple-viewports.md)
### 2. [Test Login Flow](./sub-skills/test-login-flow.md)
### 3. [Fill and Submit Form](./sub-skills/fill-and-submit-form.md)
### 4. [Check for Broken Links](./sub-skills/check-for-broken-links.md)
### 5. [Take Screenshot with Error Handling](./sub-skills/take-screenshot-with-error-handling.md)
### 6. [Test Responsive Design](./sub-skills/test-responsive-design.md)
### 7. [Configuration](./sub-skills/configuration.md)
### 8. [How It Works](./sub-skills/how-it-works.md)

Files in this skill

  • API_REFERENCE.md16 KB
  • SKILL.md4.1 KB
  • lib/helpers.js12.3 KB
  • package.json652 B
  • run.js5.7 KB
  • sub-skills/check-for-broken-links.md880 B
  • sub-skills/configuration.md351 B
  • sub-skills/fill-and-submit-form.md734 B
  • sub-skills/how-it-works.md3.6 KB
  • sub-skills/take-screenshot-with-error-handling.md615 B
  • sub-skills/test-a-page-multiple-viewports.md744 B
  • sub-skills/test-login-flow.md665 B
  • sub-skills/test-responsive-design.md2.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.