[01] LOOP
TestingmanualHardened

Screenshot Regression Loop

Capture UI screenshots, diff against baselines, fix visual drift, and repeat until pixel diffs are within tolerance.

by Trooper

Kickoff prompt
Start the "Screenshot Regression Loop" loop.

Goal: visual regression diff is within approved tolerance
Max iterations: 8
Between iterations run: npx playwright test --grep @visual || npm run test:visual
Exit when: no unapproved visual diffs remain

Step 1: Capture UI screenshots, diff against baselines, fix drift or get approval to update baselines.

Self-pace this loop. After each iteration, run the check command, read the output, and only continue if the exit condition is not met. Stop when the exit condition passes or max iterations is reached. Give a short status update each pass.

Paste the kickoff prompt into Cursor, Claude Code, or Codex. Deeplinks do not install hook files.

Steps

1. Capture UI

Screenshot key pages and components at target breakpoints.

2. Diff baselines

Compare against stored baselines and highlight drift regions.

3. Fix or approve

Fix unintended drift or get approval to update baselines.

Flow diagram

Guardrails

Rules the agent must follow so it cannot cheat the exit condition.

  • Do not update baselines without reviewing each diff
  • Flag intentional design changes for human approval before accepting
  • Capture full-page and component-level shots for context

More Testing loops