ui-screenshots
Helps your agent take screenshots of web apps. It captures full pages or specific parts. Useful for documenting or showing interface visuals during development.
What it does
This tool takes 'pictures' of websites or apps while you are developing them. It helps you see how things are changing visually.
When to use it
- ✓To record how a website looks before making changes.
- ✓To show specific states, like a menu that appears on hover.
- ✓To capture just a part of a screen without re-taking a picture of everything.
Example of what to ask your AI
“Take a screenshot of my website at http://mysite.com”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
The tool uses a program called Playwright to 'see' the website and take a full picture. Then, it uses another tool (PIL) to crop the picture and show only the part you want.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add github/awesome-copilot --skill ui-screenshotsOr download just the file:
curl -L https://raw.githubusercontent.com/github/awesome-copilot/main/skills/ui-screenshots/SKILL.md -o SKILL.mdTechnical content (original SKILL.md)
Original text by the author, straight from GitHub.
UI Screenshots
Capture screenshots of web apps and graphical UIs during development to document visual changes.
When to Use This Skill
Use this skill when you need to:
- Capture the current state of a running web app
- Document a UI before and after a code change
- Screenshot interactive states (tooltips, hovers, selected elements)
- Capture specific sections of a page without re-screenshotting
Prerequisites
pip install playwright Pillow -q
playwright install chromium
Core Workflow
1. Take a raw full-page screenshot
from playwright.async_api import async_playwright
async def capture(url="http://localhost:3000", out="screenshot-raw.png", width=1400, height=5000):
async with async_playwright() as p:
browser = await p.chromium.launch()
page = await browser.new_page(viewport={"width": width, "height": height})
await page.goto(url, wait_until="networkidle")
await page.wait_for_timeout(4000) # let charts/animations render
await page.screenshot(path=out, full_page=True)
await browser.close()
- Use a tall viewport (height=5000) so the page renders everything without scrolling
wait_until="networkidle"+wait_for_timeout(4000)ensures async charts loadfull_page=Truecaptures the entire scrollable content
2. View the raw image, then crop with PIL
Do NOT try to get perfect crops via Playwright's clip parameter. It's unreliable with full-page captures.
from PIL import Image
img = Image.open("screenshot-raw.png")
cropped = img.crop((left, top, right, bottom)) # adjust based on what you see
cropped.save("screenshot-final.png")
- Take the raw screenshot
- View it to see actual pixel positions
- Crop with PIL based on what you see
- View the result — if not right, re-crop (instant, no re-screenshot needed)
3. Iterate on crop, not on capture
- Re-screenshotting is slow (browser launch + page load + render wait)
- Re-cropping is instant (just PIL)
- Get one good raw capture, then slice it as many ways as needed
4. Interactive states
element = page.locator("selector").first
await element.hover()
await page.wait_for_timeout(1000) # let tooltip appear
await page.screenshot(path="screenshot-hover.png", full_page=True)
For "selected" state without hover effect, move the mouse away after clicking:
await element.click()
await page.mouse.move(300, 300) # move away so hover doesn't show
await page.wait_for_timeout(500)
await page.screenshot(path="screenshot-selected.png", full_page=True)
5. Section-specific captures
Crop different sections from a single full-page screenshot:
img.crop((0, 200, 920, 900)).save("screenshot-header.png")
img.crop((0, 900, 920, 1600)).save("screenshot-main.png")
Guidelines
- Always capture before state BEFORE making any changes — if you forget, you have to revert code to get a before shot
- Before/after pairs must use the same viewport width and crop — otherwise the comparison is useless
- To get a "before" after you already changed code: use
git checkout HEAD~1 -- <files>to revert, screenshot, thengit checkout HEAD -- <files>to restore - For interactive states: capture before AND after for each state — don't assume the "normal" before covers all cases
- Use
device_scale_factor=1in Playwright to force 1x pixels so screenshots match what users see at 100% zoom - Charts need extra wait time — Plotly, D3, etc. render asynchronously; 4s minimum after networkidle
- Narrow viewport reveals rendering bugs — some border/alignment issues only appear at specific widths
Non-Web App Screenshots
For desktop apps (VS, WPF, WinForms, console apps, terminals) where Playwright can't reach.
mss + ctypes (recommended for desktop windows)
Find a window by title via Win32 API, capture its region with mss. Tested at ~33ms per capture.
import ctypes
from ctypes import c_int, Structure, byref, windll
import mss
from PIL import Image
user32 = windll.user32
def find_window(title_contains):
"""Find visible windows matching a title substring."""
results = []
WNDENUMPROC = ctypes.WINFUNCTYPE(ctypes.c_bool, ctypes.c_void_p, ctypes.c_void_p)
def cb(hwnd, _):
if user32.IsWindowVisible(hwnd):
buf = ctypes.create_unicode_buffer(256)
user32.GetWindowTextW(hwnd, buf, 256)
…
FAQ
Do I need to install anything?
Yes, you need to install the 'playwright' and 'Pillow' tools and then download Playwright components for the Chromium browser.
Why can't I just crop the screenshot directly in Playwright?
Cropping directly in Playwright can be inaccurate, especially with full pages. It's easier to take a full screenshot and then use the PIL tool for precise cropping.
What if I want to screenshot a non-web app, like VS Code?
For desktop apps, you can use a different approach with the 'mss' and 'ctypes' libraries to find the window and take a picture of it, as long as it's visible on screen.
Details
Original description by the author
Capture screenshots of web apps during development using Playwright and PIL. Supports full-page captures, interactive states, and an iterate-on-crop workflow that avoids slow re-screenshots.
repo: github/awesome-copilot
Popularity
- GitHub stars
- 40k
- Ranking position
- #5403
- License
- MIT
- Updated
- 10/15/2026
Comments
- …
More skills from this repository
acquire-codebase-knowledge
Helps your agent understand and document an existing code project. It's useful for onboarding new people or getting an overview of the architecture.
github/awesome-copilot
acreadiness-assess
Enables your agent to assess a project's readiness for AI and generate a report. It's useful for understanding how well a project is prepared to use AI tools.
github/awesome-copilot
acreadiness-generate-instructions
Helps your agent create instructions for AI tools based on an assessment. It's useful for improving how AI interacts with code and closing identified gaps.
github/awesome-copilot
acreadiness-policy
Enables your agent to help define or apply policies for AI project assessment. It's useful for standardizing how projects are evaluated and ensuring compliance.
github/awesome-copilot
Similar skills
accessibility
Helps your agent create interfaces that everyone can use. Ensures websites and apps work well for people with disabilities, like those who are blind or have reduced mobility.
affaan-m/ECC
design-system
Helps your agent create a design system from existing code. It extracts visual information and checks for consistency, generating a report and an interactive preview.
affaan-m/ECC
liquid-glass-design
Helps your agent create iOS user interfaces with a 'Liquid Glass' effect. Allows adding dynamic and interactive visual effects in SwiftUI and UIKit.
affaan-m/ECC