Agent skill

UI Screenshots Skill: Before and After Captures with Playwright

The ui-screenshots skill gives an AI coding agent a Playwright and Pillow recipe for one tall page capture, tidy crops and matching before and after images.

Install
git clone https://github.com/github/awesome-copilot.git
View on GitHub

Stars, license and last push from GitHub. Install count as reported by the open skills directory.

What is the ui-screenshots skill?

The ui-screenshots skill is a SKILL.md in awesome-copilot for capturing UI screenshots. Your agent takes one full-page Playwright capture at a tall viewport, then crops it with Pillow, grabs hover or click states, and builds consistent before and after pairs.

The ui-screenshots skill is a folder in the awesome-copilot repository. It is a capture recipe, not a set of design rules. Its job is to make an agent produce clean screenshots of a UI it built or changed.

The method is simple. Take one raw full-page capture, then iterate on crops in Python with Pillow. That avoids retaking the page for every crop and keeps the framing identical between runs.

The core flow

  1. Install Playwright and Pillow, then run playwright install chromium.
  2. Capture the page once with a tall viewport, 1400 wide by 5000 high, waiting for the network to go idle and an extra 4000ms.
  3. Crop regions from that raw image in Pillow.
  4. For interactive states, hover or click, then move the mouse away before the next shot.

Before and after pairs

The guidelines say to capture the before state first, and to use the same viewport and crop for both images. device_scale_factor stays at 1. If you forgot the before shot, git checkout HEAD~1 -- followed by the files recovers it.

Beyond the browser

The skill also covers non-web capture. On Windows, mss with ctypes takes screenshots in about 33ms for a window and about 68ms for the full screen. Electron apps use Node.js Playwright and need a --user-data-dir.

Who the ui-screenshots skill is for

Best for

  • Pull request evidence, where an agent should show what a UI change looked like.
  • Feeding captures into a review so critique rests on real pixels. Related: web design guidelines.
  • Anyone documenting a build, including Electron or Windows desktop apps.

Not for

  • Apps that are not running. The skill needs a live app or page to capture.
  • Hidden or minimized windows, since the window must be visible.
  • Design judgment. It records the screen and does not assess it. Related: improve UI.

Use it with UiChemy

A WordPress page produced with UiChemy is a normal running site, so Playwright can capture it for a before and after record of an edit. Composer makes the edit inside Elementor or Gutenberg. Click Get Started on uichemy.com.