playwright

Captures browser screenshots of local HTML files using Playwright and Chromium.

Updated May 23, 2026
One-click install
npx skills add https://github.com/kiranimmadi2/promptforge-ai --skill playwright-kiranimmadi2
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: playwright
Source: https://github.com/kiranimmadi2/promptforge-ai/tree/main/openai-agents-python/examples/sandbox/tutorials/vision_website_clone/skills/playwright
Command: npx skills add https://github.com/kiranimmadi2/promptforge-ai --skill playwright-kiranimmadi2

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires playwright.

What problem does it solve? Capturing a rendered preview of a locally built static website normally requires starting a server and manually opening a browser. This Skill automates headless Chromium screenshots of local HTML files directly from the terminal, without running a server. ## Core Features & Use Cases - Headless Browser Screenshots: Renders a local HTML file in Chromium and saves a full-viewport PNG screenshot. - Controlled Environment: Sets a local temporary directory and installs a pinned Playwright version (1.50.0) for reproducible captures. - Iterative Visual Review: Supports multiple capture passes (draft-1.png, draft-2.png) so rendered output can be compared across revisions. - Use Case: After generating a static site clone in output/site/index.html, capture a 2048x1152 screenshot to visually verify the layout against the original design. ## Quick Start Use the playwright skill to take a Chromium screenshot of output/site/index.html and save it to output/screenshots/draft-1.png.

Frequently Asked Questions about playwright

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I take a screenshot of a local HTML file with Playwright?

Run npx playwright screenshot with a file:// URL pointing to your HTML file and an output path. Use --browser=chromium and --viewport-size to control the rendering, for example --viewport-size=2048,1152 for a large desktop capture.

How to install Playwright Chromium from the command line?

Run npx --yes --package [email protected] playwright install chromium to download the Chromium browser binary. This installs only the Chromium browser needed for headless screenshots without installing other browsers.

Can Playwright screenshot a local file without starting a server?

Yes, Playwright can render local files directly using the file:// protocol, such as file://$PWD/output/site/index.html. This avoids the overhead of running a local HTTP server for simple static page captures.

Why does Playwright fail with temporary directory errors?

Playwright may fail when the system temp directory is restricted or full. Set TMPDIR, TEMP, and TMP environment variables to a writable local directory before running the screenshot command to resolve this.

What are the limitations of Playwright CLI screenshots?

The CLI screenshot command offers limited control compared to the Playwright scripting API, such as no custom wait conditions or element-level captures. For complex interactions like scrolling or clicking before capture, write a Playwright script instead.