update-screenshots

Download and commit screenshot baselines from the latest CI run.

189k|41.5k|Updated Sep 3, 2015
One-click install
npx skills add https://github.com/microsoft/vscode --skill update-screenshots
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: update-screenshots
Source: https://github.com/microsoft/vscode/tree/main/.github/skills/update-screenshots
Command: npx skills add https://github.com/microsoft/vscode --skill update-screenshots

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires gh, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automates the process of updating screenshot baselines when they diverge from the CI-generated versions, ensuring consistency and reducing manual effort.

Core Features & Use Cases

  • Automated Baseline Updates: Downloads and commits new screenshot baselines directly from CI runs.
  • CI Integration: Designed to be triggered after screenshot tests fail due to differences.
  • Use Case: After a CI run reports visual regressions in component screenshots, use this Skill to automatically accept the new CI screenshots as the correct baselines for future tests.

Quick Start

Run the update-screenshots skill to refresh the component screenshot baselines from the latest CI run.

Frequently Asked Questions about update-screenshots

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

FAQPage Schema
How do I update screenshot baselines from a CI run?

You need the `gh` CLI installed and authenticated, along with an active `screenshot-test.yml` workflow that generates screenshot artifacts. The Skill uses the `gh` CLI to download these artifacts for the baseline commit.

Why do my local screenshot tests fail but pass in CI?

Local screenshot tests often fail due to discrepancies between local and CI rendering environments. This Skill resolves these visual regression discrepancies by using the CI environment as the source of truth and committing its screenshots as the new baselines.

Can I use this Skill to download workflow artifacts without GitHub CLI?

No, you cannot use this Skill without the GitHub CLI. It explicitly requires the `gh` CLI to interact with GitHub Actions, fetch the `screenshot-test.yml` workflow artifacts, and download the updated component screenshots for committing.

What is the best way to automate visual regression baseline updates?

The best way to automate visual regression baseline updates is to trigger this Skill after CI reports visual discrepancies. It automatically downloads and commits the CI-generated screenshots, eliminating manual effort and ensuring consistent test baselines.

Do I need a specific workflow file to update component screenshots?

Yes, you need the `screenshot-test.yml` workflow file. This Skill depends on the artifacts generated by this specific workflow to download and commit the updated component screenshot baselines from the latest CI run.