Skip to content
cccskills
FreePublished on GitHub

pr-screenshots

Capture interface or documentation pages with Playwright and embed the screenshots in a GitHub pull request description. Reviewers can inspect visual changes without checking out the branch, using images hosted on a temporary branch.

OriginalShow the original description

Capture Playwright screenshots and embed them in GitHub PR descriptions

See how to install

Good for

  • Show documentation page changes in a pull request
  • Share screenshots of new or updated UI components
  • Present generated API references or diagrams for review
  • Reuse screenshots from existing Playwright tests

Files included (1)

  • SKILL.md4.5 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Context

When a PR includes visual changes (docs sites, UI components, generated pages), reviewers need to see what the PR delivers without checking out the branch. Screenshots belong in the PR description body, not as committed files and not as text descriptions.

Use this skill whenever:

  • A PR touches docs site pages (Astro, Starlight, etc.)
  • A PR adds or changes UI components
  • A PR generates visual artifacts (TypeDoc, Storybook, diagrams)
  • Playwright tests already capture screenshots as part of testing

Patterns

1. Capture screenshots with Playwright

If Playwright tests already exist and produce screenshots, reuse those. Otherwise, write a minimal capture script:

// scripts/capture-pr-screenshots.mjs
import { chromium } from 'playwright';

const browser = await chromium.launch();
const page = await browser.newPage({ viewport: { width: 1280, height: 720 } });

const screenshots = [
  { url: 'http://localhost:4321/path/to/page', name: 'feature-landing' },
  { url: 'http://localhost:4321/path/to/detail', name: 'feature-detail' },
];

for (const { url, name } of screenshots) {
  await page.goto(url, { waitUntil: 'networkidle' });
  await page.screenshot({ path: `screenshots/${name}.png`, fullPage: false });
}

await browser.close();

2. Host screenshots on a temporary branch

GitHub PR descriptions render images via URLs. The gh CLI cannot upload binary images directly. Use a temporary orphan branch to host the images:

# Save current branch
$currentBranch = git branch --show-current

# Create orphan branch with only screenshot files
git checkout --orphan screenshots-temp
git reset
git add screenshots/*.png
git commit -m "screenshots for PR review"
git push origin screenshots-temp --force

# Build raw URLs
$base = "https://raw.githubusercontent.com/{owner}/{repo}/screenshots-temp/screenshots"
# Each image: $base/{name}.png

# Return to working branch
git checkout -f $currentBranch

3. Embed in PR description

Use gh pr edit with the raw URLs embedded as markdown images:

$base = "https://raw.githubusercontent.com/{owner}/{repo}/screenshots-temp/screenshots"

gh pr edit {PR_NUMBER} --repo {owner}/{repo} --body @"
## {PR Title}

### What this PR delivers
- {bullet points of changes}

---

### Screenshots

#### {Page/Feature Name}
![{alt text}]($base/{name}.png)

#### {Another Page}
![{alt text}]($base/{another-name}.png)

---

### To verify locally
```bash
{commands to run locally}

"@


### 4. Cleanup after merge

After the PR is merged, delete the temporary branch:

```bash
git push origin --delete screenshots-temp

5. Gitignore screenshots locally

Screenshots are build artifacts — never commit them to feature branches:

# PR screenshots (hosted on temp branch, not committed to features)
screenshots/
docs/tests/screenshots/

Examples

Example: Docs site PR with 3 pages

  1. Start dev server: cd docs && npm run dev
  2. Run Playwright tests (they capture screenshots as a side effect)
  3. Push screenshots to screenshots-temp branch
  4. Update PR body with embedded ![...]() image references
  5. Reviewer sees the pages inline without checking out the branch

Example: Reusing existing Playwright test screenshots

If tests at docs/tests/*.spec.mjs already save to docs/tests/screenshots/:

cd docs && npx playwright test tests/api-reference.spec.mjs
# Screenshots now at docs/tests/screenshots/*.png
# Push those to screenshots-temp and embed in PR

Anti-Patterns

  • ❌ Committing screenshots to feature branches — they bloat the repo and go stale
  • ❌ Posting text descriptions instead of actual images — reviewers can't see what they're getting
  • ❌ Using gh CLI to "upload" images — gh issue comment and gh pr edit don't support binary uploads
  • ❌ Asking the user to manually drag-drop images — automate it with the temp branch pattern
  • ❌ Skipping screenshots for visual PRs — if the PR changes what users see, show what users see
  • ❌ Leaving the screenshots-temp branch around forever — clean up after merge

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Coordinate work across AI agents with shared rules for locating team files, recording decisions and their reasons, and requesting help. It also defines who owns revisions after a reviewer rejects an artifact.

  • Locate team files across separate working directories
  • Record decisions that affect other agents
  • Request input from another specialist
github/gh-aw5.4KUpdated Oct 19, 2026

agent-conduct

FreeSummary

Set shared development rules for an agent team: keep specific agent names out of product code, tests, and CI configuration, verify affected tests before finishing, and record lessons learned from mistakes.

  • Share development rules across multiple agents
  • Keep team-specific agent names out of code and tests
  • Check affected tests before declaring work complete
github/gh-aw5.4KUpdated Oct 19, 2026

Routes requests to design, create, update, debug, or upgrade GitHub Agentic Workflows to the appropriate instructions. It helps the agent select a workflow-specific procedure and apply any additional rules defined for the repository.

  • Designing a new workflow through questions
  • Investigating failed runs and recurring errors
  • Upgrading workflows and addressing deprecations
github/gh-aw5.4KUpdated Oct 19, 2026

Prepare architecture proposals before implementation so the team can agree on a direction. Organize evidence, technical choices, effects on existing work, risks, and the first release’s scope into a document with clear recommendations and decision owners.

  • Proposing a major architecture change
  • Replanning milestones after a foundation change
  • Comparing technical options before seeking approval
github/gh-aw5.4KUpdated Oct 19, 2026

Update the gh-aw-firewall version used by gh-aw, rebuild generated files, and review release notes and configuration schemas, which define valid settings. It guides related code and test updates while identifying follow-up work that remains.

  • Updating the firewall version used by gh-aw
  • Reviewing release notes for integration changes
  • Checking configuration schema differences
github/gh-aw5.4KUpdated Oct 19, 2026

Review git and gh operations in gh-aw workflows to check credential availability for each repository. Identify missing token handoffs, risky expansions of limited checkouts, and error handling needed where credentials are intentionally unavailable.

  • Reviewing git operations after repository checkout
  • Checking tokens for private cross-repository access
  • Reviewing sparse and shallow checkout changes
github/gh-aw5.4KUpdated Oct 19, 2026

See all skills by github

Report a problem with this skill