pr-screenshots
Skill0 starsChanged 23 days agoMITView on GitHub
Capture matched before/after screenshots of a UI change in the running web app and attach them to the branch's GitHub PR. The "before" comes from swapping the changed files back to the base branch while the dev server hot-reloads, so both shots share the same data, URL, login and viewport. Use when a PR changes what a screen shows, or when asked for screenshots, before/after shots or visuals for a PR.
- Commits and pushes
14 other projects use a version of this.
Adopted by
Most recently taken up by
- github/squadtheir own version, first seen Nov 8, 2026
- Venkateshvenki404224/shipcraft-skillstheir own version, first seen Nov 1, 2026
- github/awesome-copilottheir own version, first seen Oct 25, 2026
- nabondance/stratatheir own version, first seen Oct 25, 2026
- microsoft/github-vteam-industry-demostheir own version, first seen Oct 25, 2026
- getsentry/skillstheir own version, first seen Oct 20, 2026
Used with
Projects with it also use security-review.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
SentrySkillsecurity-review
Finds exploitable application security vulnerabilities in code changes. Use for Warden security scans, appsec review, OWASP-style checks, authentication or authorization bugs, injection, XSS, SSRF, path traversal, secrets, unsafe crypto, webhook verification, open redirects, or sensitive data exposure.
Also in 3 projects that use this
Other versions14 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 14
- github/awesome-copilot★ 41ksame name
- github/gh-aw★ 5.6ksame name
- lukevella/rallly★ 5.4ksame name
- github/squad★ 3.4ksame name
- levy-street/world-of-claudecraft★ 2.3ksame name
- getsentry/skills★ 1.1ksame name
- BrOrlandi/my-claude-skills★ 22same name
- nanosite-ai/nanoflow★ 15same name
- bwhtech/skills★ 3same name
- krimvp/xpl★ 2same name
4 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository2 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- pr-demo-videoSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
17 rules. 0 are common, 8 are distinctive, and 9 are very specific to this project.
0
Common
Most of the 13 edited versions we read keep these.
8
Distinctive
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Before/after pairs that differ only by the code in the diff.
- Very specific: line 14
Read .pr-visuals/config.md at the repo root.
- Very specific: line 26
Write .pr-visuals/config.md from config-template.md, and .pr-visuals/.gitignore containing out/.
- Distinctive: line 39
Create the data the screens need the normal way (the UI or the real backend), logged in as the demo account.
- Very specific: line 69
Check with git diff --quiet HEAD -- <files>.
- Very specific: line 73
Wait for the hot reload, then reload the page and repeat the exact steps from section 2.
- Distinctive: line 81
If the change is in the API, the database or generated data, a frontend swap can't show the old state.
- Very specific: line 84
Config says how: use the "Backend changes" section of .pr-visuals/config.md, e.g.
- Very specific: line 86
Throwaway state script: write a script under .pr-visuals/out/<branch>/ that puts the same record into its old and new shape (node state.mjs …
- Distinctive: line 98
Write the section into the PR body file, using the layout from the config:
- Very specific: line 108
Use stacked pairs (Before / image / After / image) instead of a table when the shots are wider than about 1200 px or when there's only one …
- Distinctive: line 110
If the repo has a PR template, keep its section names and put the shots in its screenshots section.
- Distinctive: line 113
Run gh from the folder that holds the PNGs, so the relative paths resolve:
- Very specific: line 128
If the user said not to touch the PR, or there's no GitHub remote or a new enough gh, keep the files in .pr-visuals/out/<branch>/ and hand …
- Distinctive: line 133
Only the diff differs between a pair: same data, account, URL, viewport, theme and language.
- Distinctive: line 136
No real personal data in a shot.
- Very specific: line 137
Never commit anything under .pr-visuals/out/.
“Common” is measured: kept by at least 6 in 10 of the 13 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
PR screenshots
Before/after pairs that differ only by the code in the diff. The trick: take the "after" shot, put the changed files back to their base-branch version, let the dev server hot-reload, take the "before" shot of the same page, then restore the files.
0. Config
Read .pr-visuals/config.md at the repo root. If it's missing, set it up once:
- Detect what's available instead of asking:
which playwright-cli, the browser tools you have (Claude in Chrome, Chrome DevTools MCP, others), the dev command inpackage.json, the dev server port, and any seed script or seeded accounts in the repo. - Propose a config in one message and let the user correct it, e.g. "playwright-cli is installed, so I'll use it at 1440x900 against http://localhost:5173, logging in as the seeded demo@example.com. OK?" Any tool that saves a PNG works; playwright-cli is the default because scripted shots repeat exactly.
- Explain the demo account: screenshots end up in a PR, so log in only with a local or seeded account whose data can be public. If there isn't one, ask the user to create it (or offer to add it to the seed) rather than using their own account.
- Write
.pr-visuals/config.mdfrom config-template.md, and.pr-visuals/.gitignorecontainingout/. Commit the config with the rest of the work.
Artifacts go to .pr-visuals/out/<branch>/ (gitignored by the file above). Run browser commands
from the repo root: playwright-cli only reads scripts from under the directory it was opened in.
1. Plan the shots
From the diff and the task, list the screens and states the change affects: a page, an open dialog, a hover state, an error state. One pair per state. New screens get only an "after".
2. Prepare the state
Create the data the screens need the normal way (the UI or the real backend), logged in as the demo account. Note the exact URL and the steps that reach each state.
3. After
With the branch code running, capture each state at the config viewport. Name files
after-<state>.png. Look at each one before moving on: a dev-server error overlay, a spinner or
a half-finished animation means a retake.
# Keeps playwright-cli logs in .pr-visuals/out/ instead of a .playwright-cli/ folder in the repo.
P() { PLAYWRIGHT_MCP_OUTPUT_DIR="$PWD/.pr-visuals/out/.cli" playwright-cli -s=shots "$@"; }
# Twice the pixel density, so shots stay sharp in a PR and in a README. Viewport from the config.
mkdir -p .pr-visuals/out && printf %s '{"browser":{"contextOptions":{"viewport":{"width":1440,"height":900},"deviceScaleFactor":2}}}' > .pr-visuals/out/shots.json
P open --config=.pr-visuals/out/shots.json "<url>"
P goto "<url of the state>"
P screenshot --filename=.pr-visuals/out/<branch>/after-<state>.pngFor a crop of one component, run-code with page.screenshot({ path, clip }) around its
boundingBox() plus about 16 px of padding.
4. Before: swap, reload, capture
- Find the base:
gh pr view --json baseRefName -q .baseRefName, or the remote default branch (git symbolic-ref --short refs/remotes/origin/HEAD). Rungit fetch origin <base>. - Pick the files to swap: the changed frontend files that render this state, from
git diff --name-only origin/<base>...HEAD. Swap the smallest set that brings back the old UI. Swapping unrelated files (new imports, changed types) can break the build. - Each file you swap must have no uncommitted changes, or restoring it would wipe them.
Check with
git diff --quiet HEAD -- <files>. If it fails, commit first (a WIP commit is fine) or stop and ask. - Swap:
git show origin/<base>:<file> > <file>for each file. A file that is new on the branch has no base version; leave it, and swap the file that imports it instead. - Wait for the hot reload, then reload the page and repeat the exact steps from section 2.
Capture
before-<state>.pngat the same viewport, scroll position and zoom as the "after". - Restore, always, even if a capture failed:
git checkout -- <files>. Thengit statusmust show the working tree as it was before the swap. Reload once more and check the page shows the "after" UI again.
When swapping files isn't enough
If the change is in the API, the database or generated data, a frontend swap can't show the old state. In order of preference:
- Config says how: use the "Backend changes" section of
.pr-visuals/config.md, e.g. a command that runs the base branch on another port. - Throwaway state script: write a script under
.pr-visuals/out/<branch>/that puts the same record into its old and new shape (node state.mjs before/after) against the local dev database only, capture each, then delete the script. Never point it at a shared or remote database. - Can't reproduce: say so in the PR ("before: not reproducible locally, see the issue") and attach only the "after".
5. Attach to the PR
GitHub only, and gh 2.99 or later (gh --version). --attach uploads each file and rewrites
 references in the body to the uploaded URL.
Write the section into the PR body file, using the layout from the config:
## Screenshots
| State | Before | After |
| --- | --- | --- |
| Settings, saved |  |  |Use stacked pairs (**Before** / image / **After** / image) instead of a table when the shots
are wider than about 1200 px or when there's only one pair, so GitHub doesn't shrink them.
If the repo has a PR template, keep its section names and put the shots in its screenshots
section.
Run gh from the folder that holds the PNGs, so the relative paths resolve:
cd .pr-visuals/out/<branch>
gh pr view --json number -q .number # is there a PR already?
gh pr create --title "..." --body-file pr.md --attach ./before-saved.png --attach ./after-saved.png
gh pr edit <n> --body-file pr.md --attach ./before-saved.png --attach ./after-saved.pngIn a fork, pass -R <owner>/<repo> (and --base) to every gh command, or gh targets the
upstream repository.
Then check the result: gh pr view <n> --json body -q .body must contain
github.com/user-attachments/ URLs and no ./ paths left.
If the user said not to touch the PR, or there's no GitHub remote or a new enough gh, keep the
files in .pr-visuals/out/<branch>/ and hand over their paths plus the markdown above.
Rules
- Only the diff differs between a pair: same data, account, URL, viewport, theme and language.
- Crop or zoom to the area that changed when the page is large; the reader should see the difference without hunting for it. Use the same crop for both shots of a pair.
- No real personal data in a shot. If it appears, retake with demo data.
- Never commit anything under
.pr-visuals/out/.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

