regenerating-screenshots

Creates a labeled PR that triggers the GitHub Action to regenerate Playwright screenshot expectations.

Updated Jul 28, 2026
One-click install
npx skills add https://github.com/christian-byrne/comfy-skills --skill regenerating-screenshots-christian-byrne
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: regenerating-screenshots
Source: https://github.com/christian-byrne/comfy-skills/tree/main/skills/regenerating-screenshots
Command: npx skills add https://github.com/christian-byrne/comfy-skills --skill regenerating-screenshots-christian-byrne

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Screenshot tests fail on main or pull requests when golden images become stale, and manually regenerating Playwright expectations locally is slow and environment-dependent. This Skill automates the entire process by creating a properly labeled PR that triggers the repository's update workflow. ## Core Features & Use Cases - Automated PR Creation: Fetches latest main, creates a timestamped branch, pushes an empty commit, and opens a PR via the GitHub CLI. - Workflow Triggering: Adds the "New Browser Test Expectations" label through the GitHub API so the pr-update-playwright-expectations workflow runs Playwright with --update-snapshots and commits results back. - Use Case: Your CI is red because screenshot tests fail after a UI change. Ask the agent to regenerate screenshots, and it opens a PR whose branch receives freshly updated golden images automatically. ## Quick Start Regenerate the Playwright screenshot expectations by creating a labeled PR from the latest main branch.

Frequently Asked Questions about regenerating-screenshots

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

FAQPage Schema
How do I regenerate Playwright screenshot expectations in CI?▼

Create an empty-commit branch from origin/main, open a PR, and add the label that triggers the update workflow. The GitHub Action runs Playwright with --update-snapshots and commits the new golden images back to the PR branch.

How to fix failing screenshot tests caused by stale golden images?▼

Open a regeneration PR from the latest main and apply the New Browser Test Expectations label. The workflow updates the snapshots automatically, so you do not need to run Playwright locally.

Why doesn't the GitHub Action trigger when the label is added during PR creation?▼

The labeled event only fires when a label is added after the PR already exists, not when applied during creation with --label. Add the label as a separate step using the GitHub API issues labels endpoint.

Why does gh pr edit --add-label fail for adding labels?▼

gh pr edit --add-label can fail due to deprecated Projects Classic GraphQL errors. Use gh api to POST to repos/{owner}/{repo}/issues/<pr-number>/labels with the labels array instead.

Do I need to monitor the screenshot regeneration workflow after creating the PR?▼

No, the process is fire-and-forget. The workflow runs Playwright with --update-snapshots, commits results to the PR branch, and removes the label on its own.