skills/pr-screenshot/SKILL.md
Add before/after comparison screenshots to a PR using browser automation. Captures UI on the base branch and the PR branch, saves to docs/screenshot/, and updates the PR body with a side-by-side comparison table using GitHub CDN URLs.
npx skillsauth add madeyexz/ian-skills-agents pr-screenshotInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Add before/after comparison screenshots to a pull request using browser automation and GitHub CDN. This captures the UI on the base branch (before) and the PR branch (after), then presents them in a side-by-side comparison table.
$ARGUMENTS - PR number and optional description of what to screenshot (e.g. pages/routes to capture)# Get current repo info
REPO=$(gh repo view --json nameWithOwner -q .nameWithOwner)
# Get PR info (base branch, head branch, title, body)
gh pr view <PR_NUMBER> --json baseRefName,headRefName,title,body
# Save branch names
BASE_BRANCH=<baseRefName> # e.g. main
HEAD_BRANCH=<headRefName> # e.g. feature/new-ui
# Stash any uncommitted changes, then checkout the base branch
git stash
git checkout $BASE_BRANCH
# Install dependencies (in case they differ)
pnpm install
# Start dev server
pnpm dev &
DEV_PID=$!
sleep 5
# Create screenshot directories
mkdir -p docs/screenshot/before docs/screenshot/after
# Open the page(s) to screenshot
agent-browser open "http://localhost:3000/path/to/feature"
sleep 2
# Login if needed (check CLAUDE.md for credentials)
agent-browser snapshot -i
agent-browser fill @e1 "email"
agent-browser fill @e2 "password"
agent-browser click @e3
# Navigate to the relevant page and take screenshot(s)
agent-browser screenshot docs/screenshot/before/feature-overview.png
agent-browser screenshot docs/screenshot/before/feature-detail.png
# Stop dev server and close browser
agent-browser close
kill $DEV_PID 2>/dev/null || true
pkill -f "next dev" || true
# Checkout the PR branch
git checkout $HEAD_BRANCH
git stash pop || true
# Install dependencies
pnpm install
# Start dev server
pnpm dev &
DEV_PID=$!
sleep 5
# Open the same page(s)
agent-browser open "http://localhost:3000/path/to/feature"
sleep 2
# Login if needed (same steps as before)
agent-browser snapshot -i
agent-browser fill @e1 "email"
agent-browser fill @e2 "password"
agent-browser click @e3
# Navigate to the same page and take screenshot(s)
agent-browser screenshot docs/screenshot/after/feature-overview.png
agent-browser screenshot docs/screenshot/after/feature-detail.png
# Stop dev server and close browser
agent-browser close
kill $DEV_PID 2>/dev/null || true
pkill -f "next dev" || true
Use matching filenames in before/ and after/ so the comparison table is easy to construct:
docs/screenshot/
├── before/
│ ├── feature-overview.png
│ ├── feature-detail.png
│ └── feature-empty.png
└── after/
├── feature-overview.png
├── feature-detail.png
└── feature-empty.png
Naming ideas:
feature-overview.png — main viewfeature-detail.png — expanded/detailed viewfeature-empty.png — empty statefeature-loading.png — loading statefeature-mobile.png — mobile viewportgit add docs/screenshot/
git commit -m "$(cat <<'EOF'
docs: add before/after screenshots for [feature]
Co-Authored-By: Claude Opus 4.5 <[email protected]>
EOF
)"
git push
IMPORTANT: Use GitHub CDN URL format with ?raw=true:
https://github.com/<REPO>/blob/<BRANCH>/docs/screenshot/<before|after>/<filename>.png?raw=true
Where <REPO> is the nameWithOwner from step 1 and <BRANCH> is the PR head branch.
Update PR body with a comparison table:
gh pr edit <PR_NUMBER> --body "$(cat <<'EOF'
# PR Title
## Summary
[existing summary]
## Screenshots
### Feature Overview
| Before | After |
|--------|-------|
|  |  |
### Detail View
| Before | After |
|--------|-------|
|  |  |
[rest of PR body]
EOF
)"
Add one table per page/state you screenshot. Each table has a single row with the before image on the left and the after image on the right.
agent-browser close
pkill -f "next dev" || true
git checkout $HEAD_BRANCH
Always use this exact format for images to render in GitHub:
https://github.com/OWNER/REPO/blob/BRANCH/path/to/image.png?raw=true
gh repo view --json nameWithOwner -q .nameWithOwnergh pr view)If the app requires login, check the project's CLAUDE.md for test credentials.
agent-browser tab list to see all open tabsagent-browser tab N to switch tabsagent-browser click "button.submit"agent-browser scroll down 500agent-browser eval "window.resizeTo(375, 812)"development
Design principles from Bret Victor's "Magic Ink" for building information software. Use when designing dashboards, search results, calendars, finance apps, or any interface where users seek answers rather than manipulate objects. Ask "what can the user learn?" not "what can the user do?"
testing
Workflow for translating entire books using AI agents. Split markdown books into chapters, batch translate 5 at a time, and verify completeness. Works with any language pair.
tools
Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layers like Lobster, ACPX, plugins, or plain code. Keep conditional logic in the caller; use TaskFlow for flow identity, child-task linkage, waiting state, revision-checked mutations, and user-facing emergence.
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------