All skills
Skillintermediate
/capture-baseline - Capture Visual Baseline
Capture baseline screenshots for visual regression testing.
Claude Code Knowledge Pack7/10/2026
Overview
/capture-baseline - Capture Visual Baseline
Capture baseline screenshots for visual regression testing.
Steps
- Identify the pages or components to capture baselines for
- Check if a visual testing tool is configured (Percy, Chromatic, reg-suit, or Playwright)
- Determine viewport sizes for captures: mobile (375px), tablet (768px), desktop (1280px)
- Start the application or Storybook server if needed
- Navigate to each target page and wait for all assets to load
- Remove dynamic content (timestamps, ads, animations) using CSS injection or masking
- Capture full-page screenshots at each viewport size
- Save screenshots to the baselines directory with descriptive naming:
{page}-{viewport}-baseline.png - Generate a manifest file listing all captured baselines with timestamps
- Report total baselines captured, file sizes, and storage location
- Commit baseline images to the repository or upload to cloud storage
Rules
- Always capture at minimum three viewport sizes (mobile, tablet, desktop)
- Wait for network idle before capturing to avoid incomplete renders
- Mask or hide dynamic content that changes between runs
- Use consistent browser and device emulation settings
- Name baselines clearly with page name and viewport size
- Store baselines in a dedicated directory separate from test code
- Compress images to keep repository size manageable