Skip to content
Agentmart
Submit a tool

playwright

Take screenshots and interact with web pages using a headed Playwright browser.

Skill by espennilsen

IndexedMIT★ 122
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/espennilsen-playwright

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Take screenshots and interact with web pages using a headed Playwright browser. Use when you need to visually inspect a URL, capture a screenshot, interact with a page (click, type, scroll), or verify what a page looks like rendered. **Triggers — use this skill when:** - You need to screenshot a URL (Penpot share link, localhost, public site) - User says "show me", "how does it look", "take a screenshot" - You want to visually verify your own work (e.g. after creating Penpot designs) - User asks to review a live page or prototype - You need to interact with a page (click buttons, fill forms, trigger states)

Use cases: testing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/playwright

What's inside

Skill name
playwright
Description
Take screenshots and interact with web pages using a headed Playwright browser. Use when you need to visually inspect a URL, capture a screenshot, interact with a page (click, type, scroll), or verify what a page looks like rendered. **Triggers — use this skill when:** - You need to screenshot a URL (Penpot share link, localhost, public site) - User says "show me", "how does it look", "take a screenshot" - You want to visually verify your own work (e.g. after creating Penpot designs) - User asks to review a live page or prototype - You need to interact with a page (click buttons, fill forms, trigger states)
License
MIT
Instructions
219 lines in SKILL.md · view on GitHub

Agent Skills spec issues

  • body: contains an absolute path from the author's machine

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Playwright — Browser Screenshots & Interaction

Use Playwright to open a real browser, navigate to URLs, take screenshots, and
interact with pages. This is the go-to approach for visual verification of any
web content — Penpot designs, local dev servers, production sites, etc.

## Setup

Playwright is installed at `/Users/espen/node_modules/playwright`.

When writing scripts, always require from the absolute path:
```javascript
const { chromium } = require('/Users/espen/node_modules/playwright');
```

## Quick Screenshot

Write a `.cjs` script to `/tmp/`, run it with `node`, then `read` the resulting PNG.

```javascript
const { chromium } = require('/Users/espen/node_modules/playwright');

(async () => {
  const browser = await chromium.launch({ headless: false });
  try {
    const page = await browser.newPage();
    await page.goto('https://example.com', { waitUntil: 'domcontentloaded', timeout: 30000 });
    await page.waitForTimeout(3000);
    await page.screenshot({ path: '/tmp/screenshot.png' });
  } finally {
    await browser.close();
  }
})();
```

```bash
node /tmp/screenshot.cjs
```

Then view it:
```
read /tmp/screenshot.png
```

## Key Rules

### Always use `headless: false`

Many SPAs (Penpot, React apps, ClojureScript apps) fail or render blank in
headless mode. Always launch headed:

```javascript
chromium.launch({ headless: false })
```

### Always use CommonJS (`.cjs`)

Write scripts as `.cjs` files with `require()`. ESM imports fail because
Playwright isn't in the local `node_modules`:

```javascript
// ✅ Works
const { chromium } = require('/Users/espen/node_modules/playwright');

// ❌ Fails — "Cannot find package 'playwright'"
import { chromium } from 'playwright';
```

### Wait for SPA rendering

SPAs need time to hydrate after the initial HTML loads. Always add a wait:

| Site type | Wait time |
|-----------|-----------|
| Static HTML | 1-2 seconds |
| Simple SPA (React, Svelte) | 3-4 seconds |
| Complex SPA (Penpot, Figma) | 6-8 seconds |

```javascript
await page.goto(url, { waitUntil: 'domcontentloaded', timeout: 30000 });
await page.waitForTimeout(6000); // adjust per site type
```

Use `waitUntil: 'domcontentloaded'` instead of `'networkidle'` — network-idle
can time out on SPAs that keep WebSocket connections open.

### Write to /tmp

Always save screenshots and scripts to `/tmp/` to avoid polluting the workspace:

```javascript
await page.screenshot({ path: '/tmp/my-screenshot.png' });
```

## Viewport & Device Emulation

### Custom viewport

```javascript
const context = await browser.newContext({ viewport: { width: 1400, height: 1000 } });
const page = await context.newPage();
```

### Mobile device

```javascript
const { devices } = require('/Users/espen/node_modules/playwright');
const iPhone = devices['iPhone 15'];
const context = await browser.newContext({ ...iPhone });
```

### Common viewports

| Use case | Width × Height |
|----------|---------------|
| Desktop (default) | 1400 × 1000 |
| Mobile | 390 × 844 |
| Tablet | 768 × 1024 |
| Wide | 1920 × 1080 |

From espennilsen/pi, MIT.

More from espennilsen/pi

Signals

Stars
122
Forks
13
Open issues
1
Last commit (this folder)
Apr 22, 2026 (6 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from espennilsen

Cite this page

playwright skill. Agent Mart. https://agentmart.dev/skills/espennilsen-playwright (last updated 2026-10-24)