/diffy:visual-difffrom diffy
Captures before/after screenshots of a running UI inside Diffy's screenshot-worker Docker container and produces a visual-regression diff with the Diffy CLI. Use when making UI changes to see what changed visually.
Ships in diffy. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Two-phase visual regression for a running UI, built on Diffy's screenshot-worker Docker container +
the diffy CLI:
Pages, breakpoints, and advanced capture settings come from the Diffy project itself — the worker
fetches them (getProject) and re-bases each page onto your local URL. There is no config file to
maintain and no upload.json to build; capture and upload happen in one step and return a screenshot
ID directly, using the same production pipeline that renders Diffy's baselines.
$PLUGIN_DIR below = the diffy plugin root (the folder containing .claude-plugin/ and
scripts/), i.e. two levels up from this SKILL.md. For exact diffy diff syntax and result shapes,
consult reference/diffy-cli.md.
This skill captures the UI on this machine inside Diffy's screenshot-worker container (a running
local dev server). Diffy can also do the whole thing remotely on its servers — that is the
compare-environments skill, used to diff two deployed environments/URLs (prod vs staging, a PR URL,
etc.). If the user's request doesn't make clear which they want — e.g. a bare "compare my UI" with no
local dev server mentioned — ask whether to run local (capture here) or remote (Diffy captures
on app.diffy.website), and if they choose remote, switch to compare-environments. When the user
clearly means their local running app (localhost, "as I edit", "my dev server"), just proceed.
diffywebsite2/screenshot-worker) — the same Chromium/fonts/Playwright runtime Diffy uses in
production. Docker must be installed and running. Check it with
node "$PLUGIN_DIR/scripts/run-worker.mjs" --check. If it reports the setup is incomplete, tell the
user a one-time setup will pull the worker image (~1.1 GB) and fetch the worker code, then run
node "$PLUGIN_DIR/scripts/run-worker.mjs" --provision (it pulls the image, clones the worker code
into ~/.cache/diffy/diffy-worker, and installs its deps inside the container; reused afterward).
Advanced: DIFFY_WORKER_DIR points at a checkout you manage; DIFFY_WORKER_IMAGE pins a tag.command -v diffy — if missing, look for ./vendor/bin/diffy
in the current repo; else ask the user to install it. Suggested install (pick a bin directory the
user can write to — /usr/local/bin may need sudo; Homebrew on Apple Silicon uses
/opt/homebrew/bin):
wget -O /usr/local/bin/diffy https://github.com/diffywebsite/diffy-cli/releases/latest/download/diffy.phar && chmod a+x /usr/local/bin/diffy~/.diffy-cli/diffy-cli.yaml must exist (created by diffy auth:login <API_KEY>,
key from https://app.diffy.website/#/keys). Both the worker and the CLI read from it.baseline or compare, use that. Otherwise infer: if
.diffy-visual/state.json does not exist → Phase A (baseline); if it exists → Phase B
(compare)..diffy-visual/ to the project's .gitignore if it isn't already ignored.Resolve the projectId:
.diffy-visual/state.json.diffy project:list and ask the user
which project to use.appUrl)appUrl is the base URL of the running app to screenshot (your local dev server, e.g.
http://localhost:3000).
appUrl from state.json.diffy project:get <projectId> to suggest a non-empty development/staging/production URL as a
default, but the pages/breakpoints themselves are read by the worker — you do not pass them.Verify it is reachable (accept any HTTP response — a 401/403/404 at / still means the server is up):
curl -s -o /dev/null -w "%{http_code}" "<appUrl>"
If it returns 000, ask the user to start their dev server first.
Capture + upload with the worker engine (pages/breakpoints/settings come from the project):
BEFORE_ID=$(node "$PLUGIN_DIR/scripts/run-worker.mjs" \
--project-id=<projectId> --url="<appUrl>" --name="baseline-$(date +%Y%m%d-%H%M%S)")
Progress streams to stderr; stdout is the numeric screenshot ID.
Persist state — write .diffy-visual/state.json:
{
"baselineScreenshotId": <BEFORE_ID>,
"projectId": <projectId>,
"appUrl": "<appUrl>",
"capturedAt": "<ISO timestamp>"
}
Tell the user the baseline is captured (show BEFORE_ID). They can now make their UI changes and
re-invoke this skill to compare. Stop here — do not proceed to Phase B in the same run.
Read .diffy-visual/state.json for baselineScreenshotId, projectId, and appUrl.
Capture the current UI (same project → same pages/breakpoints as the baseline):
AFTER_ID=$(node "$PLUGIN_DIR/scripts/run-worker.mjs" \
--project-id=<projectId> --url="<appUrl>" --name="after-$(date +%Y%m%d-%H%M%S)")
Create the diff and wait for it:
DIFF_ID=$(diffy diff:create <projectId> <baselineScreenshotId> <AFTER_ID> --wait --name="Claude UI changes $(date +%Y-%m-%d)")
Fetch results as JSON:
diffy diff:get-result "$DIFF_ID" --format=json
Parse the JSON from Phase B and present:
result (% of pages changed). 0 means "No changes found".diffs[url][breakpoint].percentageChanges; list the
pages and breakpoints that changed, sorted by change % descending. Surface non-zero entries
prominently.diffSharedUrl — the shareable visual diff.Offer to open the report so the user can see it visually: open "<diffSharedUrl>" (macOS), or use the
Chrome browser tools to open and screenshot it inline. Give a concise verdict, e.g. "3 of 6
page/breakpoint views changed; largest: /pricing @ 375px (12.4%). Report: ".
.diffy-visual/state.json (and optionally .diffy-visual/).update-project-settings), not this skill.--wait, diff:create returns immediately and Diffy finishes in the
background; poll with diffy diff:get-status <DIFF_ID>. This skill uses --wait by default. If a
diff is slow, confirm completion via the state field of diff:get-result --format=json before
reporting.reference/diffy-cli.md in this skill folder.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub diffywebsite/diffy-cli --plugin diffy9 skills in this plugin
/compare-environmentsCompare two environments of a Diffy project server-side with project:compare — Diffy screenshots both environments on its own servers and produces a visual-regression diff, returning a diff ID. Use when the user wants to compare prod vs staging, prod vs a custom/PR/UAT URL, or two arbitrary URLs remotely, without capturing anything locally. This runs on Diffy's servers; to compare a locally running app on THIS machine instead, use the visual-diff skill. If the user is ambiguous about local vs remote, ask./compare-screenshotsCreate a Diffy visual diff from two existing screenshot set IDs with diff:create. Use when the user asks to compare screenshots, compare two uploaded screenshot sets, create a diff from screenshot IDs, or get a diff ID for before/after screenshots./create-projectCreate a Diffy project with the diffy CLI from user-provided project details. Use when the user asks to create a Diffy project, set up a new project in Diffy, or turn a base URL, pages, and breakpoints into a new Diffy project. Requires the user to provide base_url and returns the created project ID./get-diff-infoFetch and summarize Diffy diff status, result JSON, changed percentage, per-page and per-breakpoint differences, JUnit output, or recent diff lists. Use when the user asks for diff info, diff results, changed pages, percent changed, report link, or whether a Diffy diff is complete./get-project-settingsShow an existing Diffy project's settings as YAML. Use when the user asks for project details, project settings, project config, "details on project <id>", or to view/get/show/export a project's configuration. Displays the exportable YAML (the dashboard "Export" format), never raw JSON./remote-screenshotTrigger Diffy to capture a screenshot set of a project environment on Diffy's own servers (no local browser, no Playwright) with screenshot:create, and return a screenshot ID. Use when the user asks to screenshot production/staging/development or a live custom URL remotely, take Diffy screenshots of an environment, or set a new remote baseline. This runs on Diffy's servers; to capture a locally running app on THIS machine instead, use the upload-screenshot skill. If the user is ambiguous about local vs remote capture, ask.Other plugins' skills for the same job