Skip to main content
skill CX Codex

browser-screenshot-diff — Claude Code skill: diff and install

Compares two recorded browser sessions by matching steps, screenshots, and accessibility snapshots. Use it for visual regression and replay checks.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add ruvnet/ruflo --skill browser-screenshot-diff -a claude-code
Open on GitHub

What browser-screenshot-diff does

The skill pairs matching step-id values across two RVF sessions. It compares the PNG screenshot and accessibility snapshot for each step, flags steps that exist on only one side, reports the first divergence, and calculates an aggregate similarity score. Pixel mode reports mse, psnr, and the bounding box of the largest diff cluster; DOM mode lists added, removed, and changed nodes.

It first checks both containers with npx -y [email protected] rvf status, then reads trajectory.ndjson and maps each step to its saved artifacts. The verdict is written to findings.md inside a new RVF container, while browser-sessions receives comparison tags for both source sessions. browser_eval is used for live verification.

The default pixel threshold is 0.02, and the available modes are pixel, dom, and both. Pixel comparison reacts to font hinting, antialiasing, and scrollbar position, so the viewport must stay pinned across both sessions. Dynamic content such as clocks and ads needs ignore regions or snapshot preprocessing.

What it helps with

  • compare screenshots from two browser sessions step by step
  • spot the first divergence after a UI change
  • verify a replay against its parent session
  • diff accessibility trees for two form variants
  • save the comparison verdict in replayable RVF artifacts

Example prompts for the agent

  • Compare <session-id-a> and <session-id-b> in both mode with threshold 0.02.
  • Check whether the replay session matches the parent at every step-id, then report the first divergence.
  • Compare the two form variants in dom mode and list changed nodes with their accessible names.

How to install browser-screenshot-diff

1Skills CLI (Vercel)

npx skills add ruvnet/ruflo --skill browser-screenshot-diff -a claude-code

2Manually: put the files in place

~/.claude/skills/browser-screenshot-diff/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/browser-screenshot-diff/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about browser-screenshot-diff

How do I install browser-screenshot-diff in Claude Code?

Run npx skills add ruvnet/ruflo --skill browser-screenshot-diff -a claude-code, then run npx skills add ruvnet/ruflo --skill browser-screenshot-diff -a claude-code again. The skill file is at ~/.claude/skills/browser-screenshot-diff/SKILL.md.

What does browser-screenshot-diff do?

It compares two recorded sessions at matching step-id values, checks screenshots and accessibility snapshots, then produces a first-divergence report and an aggregate similarity score.

Why can pixel diff report a difference when the UI looks the same?

Pixel diff is affected by font hinting, antialiasing, and scrollbar position. Keep the viewport pinned in both sessions, and handle dynamic content with ignore regions or snapshot preprocessing.

Source text

SKILL.md · MIT
---
name: browser-screenshot-diff
description: Visual + DOM diff between two recorded sessions at matching trajectory step ids; used for visual regression and replay verification
argument-hint: "<session-id-a> <session-id-b> [--threshold <0..1>] [--mode pixel|dom|both]"
allowed-tools: mcp__plugin_ruflo-core_ruflo__browser_eval Bash Read Write
---

# Browser Screenshot Diff

Compare two recorded sessions step-by-step. Pairs each step in session A to the same `step-id` in session B, diffs the captured screenshot and accessibility snapshot, reports the first divergence and an aggregate similarity score.

## When to use

- Visual regression after a UI change (record before, record after, diff).
- Verifying a `browser-replay` run matches the parent session within tolerance.
- Comparing two A/B variants of the same form flow.

## Steps

1. **Locate both RVF containers**:
   ```bash
   npx -y [email protected] rvf status <session-id-a>.rvf
   npx -y [email protected] rvf status <session-id-b>.rvf
   ```
2. **Load both trajectories** from `trajectory.ndjson`. Build a `step-id → (screenshot_path, snapshot_path)` map for each.
3. **Pair steps** by `step-id`. Steps that exist on only one side are flagged as `unmatched` and contribute to the divergence score.
4. **Pixel diff** (`--mode pixel|both`): compare the two PNGs at each step. Report `mse`, `psnr`, and the bounding box of the largest diff cluster. Threshold default `0.02` (2% of pixels).
5. **DOM diff** (`--mode dom|both`): compare the accessibility snapshots node-by-node. Report added / removed / changed nodes with their accessible names.
6. **Aggregate similarity**: weighted average across matched steps, weighted by step duration. Verdict goes into a new `findings.md` under a fresh RVF container so the diff itself is replayable.
7. **Persist** the diff verdict in `browser-sessions` under both source ids' tags so future searches surface "ran a diff against session X".

## Caveats

- Pixel diff is sensitive to font hinting, antialiasing, and scrollbar position. Keep viewport pinned across both sessions.
- DOM diff over Playwright's accessibility tree is more stable than HTML diff. Prefer it.
- This skill does not handle dynamic content (clocks, ads); add ignore regions to the field map or pre-process snapshots before diffing.
- The `browser_screenshot_diff` MCP tool is **not** planned (ADR-0001 §7); the skill operates against locally-saved RVF artifacts and uses `browser_eval` only for live verification.

© ruvnet · MIT · ruvnet/ruflo

Similar skills

Everything for Testing and QA →

From the same set146

browser-record Opens a named browser session, allocates an RVF container for it and records every action as a ruvector trajectory step. Useful when a browsing run has to be replayed or analysed later. CX Codex +1 718installs browser-form-fill Fills web forms using a structured JSON field map and saved selector templates. It automates data entry and form submission directly in browser sessions. CX Codex +1 717installs dossier-collect Builds a graph-based dossier from a user, file, symbol, ADR, URL, or concept. Use it to trace connected entities instead of answering one narrow question. CX Codex +1 701installs browser-extract Pulls text, tables and attribute values off a rendered page as structured JSON, with PII and prompt-injection checks running before anything reaches the model. CX Codex +1 697installs cost-budget-check Adds up what the project has spent, compares it with the budget limit and names the alert level. Worth running before you spawn another round of agents. CX Codex +1 692installs browser-auth-flow Drives your login flow once, then probes it for redirect leaks, missing CSRF tokens, weak session cookies and OAuth mistakes. Writes a findings.md with a verdict. CX Codex +1 689installs adr-verify Reads the stored ADR graph back and flags dangling references, supersede cycles and status mismatches. Useful right after adr-index or as a CI gate. CX Codex +1 688installs cost-track Reads the session jsonl of a Claude Code run, adds up token usage per model, prices it and stores a record in the cost-tracking namespace. CX Codex +1 684installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor