agentleFS
mazreanmazrean/agent-skills/skills/checking-wsh-vrt/SKILL.md

checking-wsh-vrt

Skill2 starsChanged 8 months agoMITView on GitHub

Runs Visual Regression Testing (VRT) locally to prevent disqualification in Web Speed Hackathon. Captures screenshots, compares against baselines, updates snapshots, and validates visual integrity after performance optimizations. Use when optimizing WSH apps, running VRT checks, updating VRT baselines, or investigating VRT failures.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run the full VRT check cycle:

    line 41
  2. Distinctive:

    If VRT passes: Commit immediately. This is your new safe checkpoint.

    line 52
  3. Distinctive:

    Never batch more than 3 changes: before running VRT — Bisecting visual bugs across many changes wastes hours

    line 93
  4. Very specific:

    Check docs/regulation.md and the VRT config (usually playwright.config.ts) for project-specific settings.

    line 106
  5. Distinctive:

    Before running VRT, verify the Playwright config has correct VRT settings:

    line 122
  6. Very specific:

    If the project doesn't have VRT configured, check docs/regulation.md for the competition's expected VRT setup before creating your own.

    line 140

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Checking WSH VRT

Prevents disqualification in Web Speed Hackathon by running Visual Regression Testing locally. VRT failures mean your optimizations broke the visual appearance — and that means disqualification, no matter how fast your app is.

Use this skill when you need to run VRT checks during WSH optimization, investigate VRT failures, or update baselines after intentional visual changes.

Supporting files:

  • VRT-TROUBLESHOOTING.md — Common VRT failures and fixes

Quick Start

# 1. Install dependencies (first time only)
npx playwright install --with-deps chromium

# 2. Start the app (portless assigns http://wsh.localhost:1355)
npm run build && portless wsh npm run start &

# 3. Run VRT
npx playwright test --project=vrt

# 4. If tests fail, review diffs
npx playwright show-report

Core Workflow

Before Any Optimization

  1. Read docs/regulation.md — Understand what visual elements must be preserved
  2. Verify VRT passes on unmodified code — If baseline is broken, fix it first
  3. Commit the clean state — You need a known-good point to revert to

After Every 2-3 Optimizations

Run the full VRT check cycle:

# Build and start (portless assigns http://wsh.localhost:1355)
npm run build && portless wsh npm run start &

# Wait for server to be ready, then run VRT
timeout 30 bash -c 'until curl -s http://wsh.localhost:1355 > /dev/null 2>&1; do sleep 1; done'
npx playwright test --project=vrt

If VRT passes: Commit immediately. This is your new safe checkpoint.

If VRT fails: See the failure resolution workflow below.

VRT Failure Resolution

  1. Open the HTML report to see visual diffs:
    npx playwright show-report
  2. Classify the failure:
    • Unintentional breakage — Your optimization broke something. Revert or fix.
    • Intentional change — Layout improved (e.g., CLS fix added explicit dimensions). Update baseline.
    • Flaky test — Animation timing, lazy-load race condition. Needs stabilization.
  3. For unintentional breakage:
    # Revert to last known-good commit
    git stash   # or git checkout -- .
    Then re-apply optimizations one by one to isolate the culprit.
  4. For intentional changes (only if regulation allows):
    # Update baseline snapshots
    npx playwright test --project=vrt --update-snapshots
    
    # Verify the new baselines look correct
    npx playwright show-report
    
    # Commit updated baselines
    git add -A '*.png'
    git commit -m "update VRT baselines: <reason>"
  5. For flaky tests: See VRT-TROUBLESHOOTING.md

Critical Rules

  • Never skip VRT — "I'll check later" leads to compounding visual regressions that are impossible to debug
  • Never batch more than 3 changes before running VRT — Bisecting visual bugs across many changes wastes hours
  • Never blindly update baselines — Every --update-snapshots must be reviewed. Blindly updating hides regulation violations
  • Always read the regulation first — Some competitions have specific VRT configurations or custom comparison thresholds
  • Commit after every green VRT run — Your commit history is your safety net

Regulation Awareness

WSH regulations typically specify:

  • Which pages are tested — VRT may only cover scored pages
  • Comparison thresholds — Pixel diff tolerance (e.g., 0.1% threshold)
  • Required viewport sizes — Desktop and/or mobile
  • Animation handling — Whether animations must be disabled during capture

Check docs/regulation.md and the VRT config (usually playwright.config.ts) for project-specific settings.

WSH-Specific VRT Pitfalls

OptimizationVRT RiskMitigation
Image format conversion (AVIF/WebP)Color shift, quality lossCompare carefully, adjust quality parameter
Font subsettingMissing glyphsVerify all characters used on scored pages
CSS-in-JS removalStyle differencesPixel-level comparison in report
Lazy loading imagesImages not loaded in screenshotEnsure scroll/wait in test or disable lazy for VRT
CLS fixes (dimensions)Layout shift (intentional)Update baselines after confirming improvement
SSR implementationHydration mismatch visibleCheck for flicker or unstyled content
Library replacementRendering differencesCarefully compare component output

Playwright Config Check

Before running VRT, verify the Playwright config has correct VRT settings:

// Expected in playwright.config.ts
{
  project: {
    name: 'vrt',
    testMatch: /.*\.vrt\.ts/,  // or similar pattern
    use: {
      // Consistent viewport for reproducible screenshots
      viewport: { width: 1440, height: 900 },
      // Animations disabled for deterministic captures
      // Check regulation for required settings
    }
  }
}

If the project doesn't have VRT configured, check docs/regulation.md for the competition's expected VRT setup before creating your own.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.