Skip to content
Back to skills

Screenshot

ASecurity

Use when a rendered visual would help — verifying a change renders, checking code output by eye instead of a test run, capturing a bug repro or a visual for a PR. Drives a real running web app in headless Chromium via a reusable Playwright runner and writes a PNG.

  • 32 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 8, 2026
testinggobashnode

Works with

  • cli

Security analysis

A100/100

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

Scanned December 1, 2026

npx -y skills add joshmanders/dotfiles --skill screenshot --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Screenshot?

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

Security grade badge for Screenshot
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/joshmanders-screenshot/badge)](https://www.skillsdirectory.com/skills/joshmanders-screenshot)

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
---
name: screenshot
description: Use when a rendered visual would help — verifying a change renders, checking code output by eye instead of a test run, capturing a bug repro or a visual for a PR. Drives a real running web app in headless Chromium via a reusable Playwright runner and writes a PNG.
user-invocable: false
---

# Screenshot

Generic engine: the runner `screenshot.mjs` (next to this file) plus a throwaway driver you write. Project specifics (auth, seeding, dev URL, framework state tricks) belong in that project's own `taking-screenshots` skill, not here.

**Prerequisite:** `playwright` in the project's `node_modules`; the runner resolves it from the cwd. Assume it's there if the project documents screenshots. Any reachable URL works, including localhost with self-signed certs.

## Runner behavior

- Headless Chromium, default viewport 1400x1100.
- `ignoreHTTPSErrors` is set at context creation and can't be changed.
- Page errors and console errors are echoed to stdout.
- One driver → one PNG. Don't edit the runner.

## Driver

A throwaway `*.mjs` in the project root that default-exports `async (page) => {}`. It hardcodes its URL, navigates, waits, and may call `page.setViewportSize()`. Return value is ignored.

```js
export default async (page) => {
  await page.goto('https://example.com/dashboard', { waitUntil: 'networkidle' });
  await page.waitForTimeout(500);
};
```

Without `page.capture()` you get a viewport shot. The runner injects `page.capture()` as a setter to customize:

```js
page.capture({ selector: '#panel' });                              // element
page.capture({ clip: { x: 0, y: 0, width: 800, height: 600 } });  // region
page.capture({ fullPage: true });                                  // whole page
```

## Run

From the project root:

```bash
node ~/.claude/skills/screenshot/screenshot.mjs ./shot.mjs [outPath]
```

`outPath` defaults to a timestamped file under `/tmp`.

## Clipboard

`pbcopy` copies only the path. For the image:

```bash
osascript -e 'set the clipboard to (read (POSIX file "/tmp/out.png") as «class PNGf»)'
osascript -e 'clipboard info'   # verify: output leads with «class PNGf» and a byte count
```

Delete the driver when done.

Files in this skill

  • SKILL.md3.9 KB
  • screenshot.mjs1.4 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 testing →

Comments

Loading comments…

Newsletter

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