pr-evidence-screenshots

Capture before/after Playwright screenshot pairs and embed them inline on private GitHub PRs.

Updated Mar 6, 2026
One-click install
npx skills add https://github.com/timi-ty/agent-forge --skill pr-evidence-screenshots-timi-ty
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pr-evidence-screenshots
Source: https://github.com/timi-ty/agent-forge/tree/main/skills/pr-evidence-screenshots
Command: npx skills add https://github.com/timi-ty/agent-forge --skill pr-evidence-screenshots-timi-ty

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @playwright/test, and includes scripts (resource) components.

What problem does it solve? UI fixes are hard to review without visual proof, and on private GitHub repos most image-hosting routes silently 404 for human reviewers even when they pass a curl check. This Skill produces a controlled before/after screenshot pair where the only difference is the code, then publishes the images so they actually render inline for a signed-in reviewer. ## Core Features & Use Cases - Controlled pair capture: Builds both the base branch and the fix branch as production builds in separate git worktrees, then drives one Playwright script against both with identical viewport, input, and waits. - Falsifiable evidence: Prints the same facts read from the DOM into the run log so the log corroborates the pixels, avoiding false-positive assertions like body textContent checks. - Private-repo publishing: Pushes PNGs to a slash-free orphan branch in the same repo and links them via /raw/ URLs authenticated by the viewer's GitHub session cookie, then verifies the rendered HTML for camo proxy breakage. - Use Case: After fixing a bug where an edited field silently fails to persist, capture the broken behavior on the base branch and the corrected behavior on the fix branch, then post both frames side by side in the PR so a reviewer can confirm the fix without running anything. ## Quick Start Ask the agent to add before and after screenshots proving this UI fix to the pull request.

Frequently Asked Questions about pr-evidence-screenshots

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

FAQPage Schema
How do I add before and after screenshots to a GitHub PR?

Build the base branch and fix branch as production builds in separate git worktrees, then run one Playwright script against both with identical viewport and inputs. Push the PNGs to an orphan branch in the same repo and reference them with /raw/ URLs in a two-column table.

Why do my images 404 on a private GitHub repo?

raw.githubusercontent.com URLs need a token a browser never sends, so they return 200 under curl with an Authorization header but 404 for human reviewers. Use github.com/OWNER/REPO/raw/BRANCH/file.png instead, which authenticates via the viewer's github.com session cookie.

How do I make sure both screenshots differ only by the code change?

Run the identical capture script against both builds with the same viewport, same typed input, and same waits, and use production builds rather than dev servers. Confirm which worktree serves each port before capturing, since a stale server from another session produces wrong-code screenshots.

Why does my Playwright screenshot script hang in headless mode?

A dead DISPLAY environment variable, common under WSL, makes headless screenshots hang rather than fail. Run the script with unset DISPLAY. Also place the script inside a worktree, since running from a scratch directory cannot resolve @playwright/test.

Why does document.body.textContent.includes give false positives in tests?

The search box you typed into contributes its value to body textContent, so a lost value still reads as present. Read the specific cells instead, such as querySelectorAll('table tbody tr')[0].querySelectorAll('td'), and log the result to corroborate the screenshot.

Can I symlink node_modules between git worktrees for faster setup?

No for Next.js builds: Turbopack rejects a symlinked node_modules with a fatal error pointing outside the filesystem root. Symlinking works for vitest but not next build, so run a real package install in the before-worktree.