← ClaudeAtlas

capture-pr-screenshotslisted

Use when opening or updating a PR that changes a UI route file (`page.tsx`, `+page.svelte`, a `routes/` entry) without adding a matching screenshot. Also fire when the user says "missing screenshot" / "no screenshot for the UI" / "capture the screenshot" / "screenshot for this PR" / "you forgot the screenshot". Skip on a backend-only PR, or one that already includes screenshots for the surfaces it changes. Where the repo documents its own capture command, run that instead — this skill is the fallback for repos that document nothing.
damson/hard-won-skills · ★ 1 · AI & Automation · score 67
Install: claude install-skill damson/hard-won-skills
# Capture PR screenshots end-to-end From "the diff touched a UI page" to "the PR body shows a SHA-pinned image". ## Procedure ### 0. Defer to the repo's own command ```bash { find . -maxdepth 4 -iname '*screenshot*' -name '*.md' find . -maxdepth 4 -ipath '*screenshot*' -iname 'README*'; } 2>/dev/null | sort -u ``` If one exists and documents a regenerate/capture command, **run that and skip to step 7.** It knows the project's viewport, auth story and naming. The steps below are defaults for a repo that documents none of it. ### 1. Find the changed surfaces ```bash BASE=$(gh pr view --json baseRefName -q .baseRefName 2>/dev/null \ || git symbolic-ref --short refs/remotes/origin/HEAD | sed 's|origin/||') git diff "origin/$BASE"... --name-only | grep -E '(page|index)\.(tsx|jsx|vue)$|\+page\.svelte$|routes/.*\.(tsx|jsx)$' SHOTS=$(find . -type d -iname 'screenshot*' -not -path './node_modules/*' | head -1) echo "base=$BASE shots=${SHOTS:-<none>}" ``` Zero route matches, or no screenshot directory, means this repo is not shaped the way this skill assumes — **stop and ask** rather than proceeding on empty results. Map each route to a filename in `$SHOTS`, following the naming already used by the files there. ### 2. Pre-flight - Ensure env files exist. In a secondary worktree they are gitignored and absent — link the primary's: ```bash MAIN=$(git worktree list --porcelain | awk '/^worktree /{print $2; exit}') ln -sfn "$MAIN/.env" .env.local # adjust to