visual-diff

Visual regression testing tool for comparing screenshots before and after changes (pixel or region comparison). Suitable for checking visual regressions, comparing UI changes, or verifying that CSS/layout adjustments did not break page rendering.

Last repository push
GitHub Stars
124
Forks
13
Issues / PRs
1

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "visual-diff" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-04e00345c94545fad543dde80795a597248ae33b9c65e210d8267c7d1f6b4722. Verify the upstream source and version against https://github.com/Houseofmvps/ultraship before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

github.com

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Visual regression testing tool for comparing screenshots before and after changes (pixel or region comparison). Suitable for checking visual regressions, comparing UI changes, or verifying that CSS/layout adjustments did not break page rendering.

0 Downloads

Introduction source: third_party · Houseofmvps · 0.0.1 Reference

SkillPi interpretation

Tasks
Capture and compare visual screenshots between a public reference URL and a local or deployed candidate URL. Use when cloning an existing site pixel-for-pixel, validating responsive similarity, generating screenshot heatmaps, comparing public-vs-local pages, auditing exactness across desktop/mobile/tablet screen sizes, or showing the user visual diff artifacts.
Audience
Not specified in the source documentation.
Inputs and outputs
The comparer writes into this skill by default: When reporting results, include: Reference URL, candidate URL, and all viewport specs checked. The run directory and report path. Inline preview images for side-by-side and heatmap/overlay artifacts. Mismatch percentage, SSIM estimate, screenshot dimensions, and any masks/dismissals used. When masks are used, use `*-unmasked.png` for human-facing screenshots of the real pages and masked `side-by-side`/`heatmap` artifacts for diagnostic comparison. A clear callout for remaining uncertainty, such as third-party iframes, animations, late-loading assets, auth, or network variance.
Software, accounts and paid services
Not specified in the source documentation.
Limits and differences
Not specified in the source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: visual-diff
description: Capture and compare visual screenshots between a public reference URL and a local or deployed candidate URL. Use when cloning an existing site pixel-for-pixel, validating responsive similarity, generating screenshot heatmaps, comparing public-vs-local pages, auditing exactness across desktop/mobile/tablet screen sizes, or showing the user visual diff artifacts.

Visual Diff

Overview

Use this skill when a site or app must look exactly like an existing public URL. It captures matched reference/candidate screenshots, generates heatmaps and overlay diffs, reports mismatch metrics, and saves preview-ready artifacts for user inspection.

Standard Workflow

  1. Define the reference URL and candidate URL.

    • Reference is usually the public site, such as https://vincentdunn.com/.
    • Candidate is usually the local dev server, such as http://127.0.0.1:3000/.
  2. Normalize the capture environment.

    • Use the same browser, viewport, device scale, color scheme, locale, waits, and scroll behavior for both URLs.
    • Dismiss or mask popups, cookie banners, carousels, embedded videos, timestamps, and other unstable regions.
    • Prefer domcontentloaded plus a fixed wait for sites that never reach networkidle.
  3. Run the bundled comparer.

/Users/Henry/.codex/skills/visual-diff/scripts/compare-page.sh \
  --reference "https://example.com/" \
  --candidate "http://127.0.0.1:3000/" \
  --viewport "desktop:1280x720" \
  --viewport "mobile:390x844" \
  --dismiss-text "ACCEPT" \
  --dismiss 'svg[id$="-close-icon"]'
  1. Inspect the artifacts directly.

    • Open side-by-side.png, heatmap.png, and overlay.png with view_image.
    • Show the user the most useful images inline with Markdown image tags using absolute paths.
    • Do not claim exactness from metrics alone; visually inspect the screenshots.
  2. Iterate the candidate implementation until the unmasked differences are intentionally small.

    • For an exact clone, treat layout, typography, image assets, spacing, scroll height, colors, and responsive breakpoints as first-class requirements.
    • If the local app differs because of missing assets or fonts, fetch or recreate those assets before tuning CSS.

Output Contract

The comparer writes into this skill by default:

visual-diff/repos/<repo-key>/runs/<timestamp>/
  report.html
  report.md
  report.json
  <viewport>-reference.png
  <viewport>-candidate.png
  <viewport>-reference-unmasked.png
  <viewport>-candidate-unmasked.png
  <viewport>-heatmap.png
  <viewport>-overlay.png
  <viewport>-side-by-side.png
  <viewport>-reference-dom.json
  <viewport>-candidate-dom.json
  <viewport>-reference-content.json
  <viewport>-candidate-content.json
  <viewport>-reference-text.txt
  <viewport>-candidate-text.txt
  <viewport>-reference.html
  <viewport>-candidate.html

When reporting results, include:

  • Reference URL, candidate URL, and all viewport specs checked.
  • The run directory and report path.
  • Inline preview images for side-by-side and heatmap/overlay artifacts.
  • Mismatch percentage, SSIM estimate, screenshot dimensions, and any masks/dismissals used.
  • When masks are used, use *-unmasked.png for human-facing screenshots of the real pages and masked side-by-side/heatmap artifacts for diagnostic comparison.
  • A clear callout for remaining uncertainty, such as third-party iframes, animations, late-loading assets, auth, or network variance.

CLI Notes

scripts/compare-page.sh passes arguments to scripts/compare_page.py.

Useful options:

  • --viewport "name:WIDTHxHEIGHT" or --viewport "name:WIDTHxHEIGHT@DPR".
  • --device "iPhone 13" for a Playwright device profile.
  • --viewport-only to compare only the first viewport instead of full-page screenshots.
  • --reference-image-dir path/to/run to use pre-captured <viewport>-reference.png screenshots instead of navigating the reference URL.
  • --candidate-image-dir path/to/run to use pre-captured <viewport>-candidate.png screenshots instead of navigating the candidate URL.
  • --dismiss SELECTOR to click a selector on both pages before capture.
  • --dismiss-text TEXT to click visible text on both pages before capture.
  • --dismiss-cycles 5 and --dismiss-wait-ms 700 to repeat dismissals when closing one overlay reveals another, such as a promo modal followed by a cookie banner.
  • --wait-for SELECTOR and --wait-for-text TEXT to require route-specific hydrated content before capture, such as a product title inside a late-loading store widget.
  • Use --reference-wait-for-text TEXT or --reference-wait-for SELECTOR when only the public reference needs a hydration wait, especially when the candidate is a screenshot-backed static clone whose text is inside an image rather than DOM.
  • Add --fail-on-wait-timeout for exact clone checks so missing hydration targets abort the run instead of producing screenshots of loading states.
  • --hover SELECTOR, --reference-hover SELECTOR, or --candidate-hover SELECTOR to move the cursor over a matching element before capture; use --hover-wait-ms when hover animations need extra settle time.
  • --hover-stability-probe SELECTOR --hover-stability-ms 700 to record whether a hovered animated element kept the same position and transform before the screenshot.
  • --scroll-y 160, --reference-scroll-y 160, or --candidate-scroll-y 160 to compare a page after scrolling; use --scroll-wait-ms to let sticky headers or scroll-triggered transitions settle.
  • --lazy-scroll to scroll through a full page before screenshot capture, trigger lazy-loaded images/iframes, wait for image completion/decode, and return to the top. Use this for exact clone checks unless the page is intentionally viewport-only.
  • --mask SELECTOR to fill selector bounding boxes with a neutral color before comparison.
  • --mask-rect x,y,w,h to mask a fixed screenshot rectangle.
  • --zoom-rect label:x,y,w,h to write magnified reference/candidate/heatmap/overlay crop artifacts for a specific screenshot rectangle; repeatable. Pair with --zoom-scale 6 or similar when inspecting small details such as icons, star ratings, and text anti-aliasing.
  • --color-pick label:x,y[,radius] to sample exact reference/candidate colors at a screenshot point, optionally averaging a square radius around it. Repeatable.
  • --color-pick-rect label:x,y,w,h to sample a screenshot rectangle and report sorted dominant color bins, mean/median RGB/hex values, and a swatch artifact. Tune --color-pick-top and --color-pick-quantum when matching small assets.
  • --clip-selector SELECTOR to compare only one component region after all waits, dismissals, hovers, and lazy-load preparation; use role-specific --reference-clip-selector or --candidate-clip-selector when selectors differ.
  • --freeze-animations to pause CSS animations/transitions and make marquees, tickers, and other animated surfaces deterministic.
  • --storage-state state.json to reuse one Playwright storage state for both pages.
  • --reference-storage-state state.json and --candidate-storage-state state.json when the two sides need different sessions.
  • --wait-until domcontentloaded --wait-ms 2000 for deterministic public-site captures.
  • --navigation-retries 2 to retry transient public-site timeouts before failing.
  • Navigation failures are fatal by default; use --allow-navigation-error only when intentionally inspecting an error state.
  • Use --capture-retries N with --fail-on-wait-timeout when a public widget intermittently hydrates into a loading state before eventually rendering the required content.
  • --max-mismatch 0.5 to return a non-zero exit code when mismatch exceeds the threshold.

Use --reference-image-dir after a successful live reference capture when a public site starts throttling or timing out during iterative clone work. Refresh the live reference again before making final claims whenever the public URL is reachable.

Repo-local helpers may exist under visual-diff/repos/<repo-key>/ for repeated capture work. For the Vincent Dunn clone repo, capture-reference-pages.sh captures named public pages once per viewport, and compare-vincentdunn-route.sh ROUTE RUN_NAME --viewport desktop:1440x900 compares a route with the right popup dismissal, lazy-load, route-specific waits, and iframe masks.

Relationship To Check

Keep $check and $visual-diff separate but symbiotic.

  • Use $check to prove a page is reachable from the correct account/session, seed or refresh auth, and capture a single visual proof.
  • Use $visual-diff to compare two page renders, retrieve clone content, generate heatmaps, and iterate toward pixel exactness.
  • When a diff requires authentication, let $check produce or verify the Playwright storage-state JSON, then pass it to $visual-diff with --storage-state, --reference-storage-state, or --candidate-storage-state.
  • Do not copy $check account-selection, Henry-account safety, or auth-refresh logic into this skill. Visual diff may consume browser state, but $check should own how that state is created safely.

Page Content Retrieval

Every capture writes page content artifacts for clone work:

  • *-content.json: title, URL, canonical URL, language, meta tags, headings, links, images, media/iframes, stylesheets, scripts, and body text.
  • *-text.txt: rendered body text for quick reading or copy reconstruction.
  • *.html: post-load HTML snapshot from Playwright.

Use these artifacts to reconstruct copy, image inventories, link targets, embedded media, and stylesheet/script dependencies. Treat screenshots as the visual truth and content snapshots as the inventory that helps build the clone.

Similarity Standards

For clone work, use metrics as gates and screenshots as proof:

  • Pixel mismatch: useful for exactness, but sensitive to fonts, anti-aliasing, video, animations, and browser differences.
  • SSIM estimate: useful for broad perceptual similarity, but it can hide small layout errors.
  • Screenshot size: different width/height or scroll height is a serious clone mismatch unless intentionally masked.
  • DOM audit: use generated *-dom.json files to compare visible text, fonts, colors, and element boxes.

Read references/clone-quality.md when setting pass/fail thresholds or diagnosing difficult mismatches.

Self-Healing Rule

Treat this skill like $check: every real use is a chance to improve it.

If a run requires repeated manual setup, a missing normalization option, a fragile dismissal pattern, a better report format, a new dependency fallback, or a repo-specific workflow, patch this skill or add a minimal helper under visual-diff/repos/<repo-key>/. Prefer improving the global scripts when the lesson is reusable.

After using the skill, state whether you changed the skill or repo-local helpers so future visual-diff runs are faster and more exact.

Version history

  1. v2.5.0 GitHub ↗
    Original release notes

    ## Elite SEO Intelligence — Top 1% Operator Patterns Based on real top 1% SEO operator methodology. Every feature is designed to provide technical foundation to ruthlessly help rank sites and get cited in AI search (ChatGPT, Perplexity, Copilot, Gemini, AI Overviews). ### New Commands **keyword-intelligence.mjs** (12 commands, was 10) - `anomalies` — Detects low-position high-CTR keywords (Google flags these as strongest opportunities) + high-position low-CTR underperformers - `cross-reference` — Joins GSC page data with GA4 conversions to find 4 critical buckets: converting-but-underexposed (highest ROI), ranking-but-not-converting (funnel problem), scalable pages (double down), CTR problems - `--brand=term1,term2` — Separates brand vs non-brand queries across ALL commands. Non-brand is all that matters for SEO growth. - Position band % distribution (1-3, 4-10, 11-20, 21+) in analyze output **ga4-client.mjs** (12 commands, was 10) - `ai-traffic` — Tracks ChatGPT (utm_source=chatgpt.com), Perplexity, Microsoft Copilot, Gemini, Claude, and You.com referral traffic with conversion rates - `organic` — Organic-only overview with key event rates per landing page - `--organic` flag — Filters top-pages and landing-pages to organic search only - Key event rate per session + average engagement time per page **bing-webmaster.mjs** (11 commands, was 6) - `indexnow` — Instant IndexNow push for changed URLs (Bing + Yandex + partners) - `keyword-research` — Keyword suggestions from Bing - `backlinks` — Backlink counts and sample link data - `site-scan` — Bing's technical SEO scan - `url-inspection` — Crawl/index status from Bing **seo-scanner.mjs** - Snippet restriction detection: `nosnippet`, `max-snippet`, `data-nosnippet` — Google says restrictive preview controls limit AI feature eligibility ### Updated SEO Strategy SKILL - AI Traffic Measurement phase - CTR Anomaly Analysis framework - Non-Brand Position Band Tracking (weekly KPIs) - GSC ↔ GA4 Cross-Reference (the "money move") - IndexNow for instant Bing/Copilot discovery - AI Slop Prevention guardrails - Ruthless weekly KPI stack (14 metrics, not 50) ### Install ``` npm install -g ultraship ```

  2. v2.3.2 GitHub ↗
    Original release notes

    ## Security Fixes ### CRITICAL — IPv6-Mapped IPv4 SSRF Bypass `validateUrl()` in `tools/lib/security.mjs` only matched IPv4 dotted-decimal patterns. Addresses like `::ffff:127.0.0.1` and `::ffff:169.254.169.254` bypassed all SSRF protection. Now detects and blocks IPv6-mapped IPv4 addresses in both dotted and hex formats. ### HIGH — Redirect-Based SSRF in health-check.mjs `health-check.mjs` followed HTTP redirects without re-validating the target URL. A public URL redirecting to an internal IP would bypass SSRF protection. Now validates every redirect hop. ### MEDIUM — Guard Hook Bypass Hardening `guard-bash.sh` now blocks additional evasion techniques: - Base64-encoded commands piped to shell (`base64 -d | bash`) - Remote scripts piped to shell (`curl ... | sh`, `wget ... | sh`) - Python/Perl destructive one-liners (`python3 -c "shutil.rmtree(...)"`) - xargs chaining destructive commands (`xargs rm -rf`, `xargs git push --force`) ### LOW — MCP Server Version Pinning Pinned `@upstash/[email protected]` and `@playwright/[email protected]` (previously `@latest`), eliminating supply chain risk from automatic upgrades. ## Stats - 180 tests passing - 0 dependencies with known vulnerabilities - All IPv6 SSRF bypass vectors verified blocked (9/9 test cases) **Full install:** `npm install -g [email protected]`

  3. v2.3.0 GitHub ↗
    Original release notes

    ## What's New 6 new features inspired by analyzing [gstack](https://github.com/garrytan/gstack) and adapting the best patterns for indie SaaS builders. ### New Skills (6) | Skill | Command | Description | |---|---|---| | **Sprint Workflow** | `/sprint` | Structured pipeline: plan → build → test → review → ship → verify. Skills chain into each other with artifacts. | | **Safety Guardrails** | `/guard` | PreToolUse hooks block destructive commands (`rm -rf`, `DROP TABLE`, `git push --force`, `git reset --hard`). Optional directory freeze restricts edits. | | **Investigation** | `/investigate` | Root cause debugging with module freeze. Iron law: no fixes without investigation. Scoped analysis, evidence-based hypotheses. | | **Project Learnings** | `/learn` | Save, search, prune, export structured knowledge that compounds across sessions. Debugging insights, deployment gotchas, architecture decisions. | | **Sprint Retrospective** | `/retro` | Analyzes git velocity, commit patterns (features vs fixes), test health, hot files, shipping cadence. Generates insights and recommendations. | | **Canary Monitoring** | `/canary` | Post-deploy health verification. Checks HTTP status, response time, error patterns. Compares against baseline for regression detection. | ### New Tools (3) - `learnings-manager.mjs` — CRUD for project learnings (save/search/list/prune/export) - `canary-monitor.mjs` — Post-deploy canary with baseline regression detection - `retro-analyzer.mjs` — Sprint retrospective analyzer (git velocity, patterns, test health) ### New Agent (1) - `canary-monitor` — Dispatched by `/canary` for post-deploy verification ### New Hooks (2) - `guard-bash.sh` — PreToolUse hook for blocking destructive Bash commands - `guard-edit.sh` — PreToolUse hook for directory freeze enforcement ### Numbers | | Before | After | |---|---|---| | Skills | 33 | **39** | | Tools | 30 | **33** | | Agents | 10 | **11** | | Commands | 28 | **34** | | Tests | 155 | **180** | All 180 tests passing. 1 dependency. Node.js ESM. MIT. ```bash claude plugin install ultraship # or npm install -g ultraship ```

  4. v2.1.2 GitHub ↗
    Original release notes

    README rewritten as standard developer tool documentation. Removed: narrative "your week without Ultraship" section, marketing taglines, pitch framing, dramatic copy. Added: structured tool reference tables (29 tools in 7 categories), full command reference (27), skill categorization (32), architecture section with directory layout, inline security summary. Motivated by PR feedback on awesome-claude-code-toolkit: "comes across as marketing-heavy rather than a grounded technical tool." The README now reads like ESLint or Turborepo documentation — what it is, how to install, what every tool/command/skill does, how it's built, how to contribute.

  5. v2.1.1 GitHub ↗
    Original release notes

    ## Frontend Design Skill Upgraded to Product Designer + UI/UX Expert Level The `frontend-design` skill now combines three disciplines: ### Product Design Thinking (new) - User intent analysis (what is the ONE primary action?) - Information hierarchy (5-second test) - Conversion design (CTA placement, social proof, value proposition above fold) - User psychology (cognitive load, loss aversion, anchoring, social proof, progress indication) ### UX Discipline (new) - Interaction design (4 states for every element: default, hover, active, disabled) - Form design (single column, labels above fields, inline validation on blur, descriptive submit buttons) - Accessibility (WCAG AA contrast, keyboard nav, screen readers, 44px touch targets, prefers-reduced-motion) - Responsive design (mobile-first, 4 breakpoints, touch vs hover, fluid typography) - Performance as UX (1s = instant, 3s = slow, skeleton screens, lazy loading) - Navigation patterns (breadcrumbs, max 7 items, mobile thumb zone) ### Industry-Specific Design Rules (new) 10 product types with specific tone guidance and anti-patterns: - SaaS/DevTools, Fintech/Banking, Healthcare, E-commerce, Education, Creative/Portfolio, Enterprise/B2B, Social/Community, Legal/Government, Kids/Gaming - Example: banking apps get "trust, stability, clarity" — NEVER playful design or AI purple gradients ### Design System Specifics (new) - Complete 14-token color architecture (primary through destructive, with on-* contrast pairs) - Animation timing: 200-300ms enter, 120-200ms exit, 30-50ms stagger, spring physics over cubic-bezier - GPU-composited properties only (opacity + transform — never animate width/height/margin) - 8px spacing grid for all margins, padding, and gaps - Line height rules: 1.5 body, 1.2-1.3 headings ### Expanded Quality Checklist 25 items across 5 categories (Functionality, Accessibility, Responsiveness, Visual Consistency, Production Readiness) — up from 10 items. ### Page-Specific UX Patterns Landing pages, dashboards, settings pages, onboarding flows, pricing pages — each with specific design rules a top product designer would apply. All knowledge is inline in the skill file. No Python scripts. No CSV databases. No new dependencies. Pure design expertise, zero bloat.

Only the five most recent versions are shown. View full version history at the source ↗

Current listing version

0.0.1

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value92/100

Highlights

  • 高价值/高频刚需,直接解决用户明确的核心任务痛点
  • 显著提升日常高频场景的效率,如自动化任务、信息聚合、内容生成等
Trigger Precision95/100

Highlights

  • 触发词精准完整,覆盖多种变体,边界清晰
Structure and Standards90/100

Highlights

  • Phase/步骤清晰,有出口条件,含端到端示例
  • frontmatter完整,单文件≤500行
Execution Reliability88/100

Highlights

  • 工具来源明确,参数正确,覆盖主要异常
  • 不可逆操作有确认机制,可靠性良好
Evidence Verifiability (mean of the first four)91/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

Domains or addresses referenced in the document

These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.

  • 127.0.0.1
  • example.com
  • vincentdunn.com

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Not specified in the source documentation.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.