visual-view-diff
БесплатноБез исполняемых скриптовНе проверенRender the VS Code extension's webview panels headlessly and detect which ones changed visually, producing before/after/diff screenshots for review. Use when…
от rajbos★ 127 звёзд на GitHubОб этом скилле
Visual View Diff Skill
Renders the extension's webview panels headlessly, screenshots them, and reports which views changed compared to a baseline commit.
The screenshots are the deliverable. Posting them anywhere — a PR comment, a
job summary, an artifact upload — is deliberately not part of this skill. It
answers exactly one question: what changed visually, and what does it look
like? Whoever wants to publish that answer reads report.md and the PNGs.
The publisher for pull requests is the ui-checks job in
.github/workflows/ci.yml: it runs this diff against the PR's merge base and
posts the before/after/diff images as one comment on the PR (replaced on every
push) through gh pr comment --attach, rendered by
.github/workflows/scripts/visual-diff-comment.js. Other surfaces merge their
screenshots into the same report with lib/report.js's mergeReportSection
under a view prefix: the badge emulator (badge-*,
badge-app/tools/emulator/badge-diff.js) and the desktop app's panels
(desktop-*, scripts/desktop-visual-diff.js). An agent opening a UI PR
does not have to attach screenshots by hand — it has to make sure the change is
visible to this harness (see "States" below) and say in the PR body which
views it expects to change.
When to use it
- A change touches
vscode-extension/src/webview/**, the shared webview CSS, or aget*Htmlmethod inextension.ts. - A refactor is supposed to be visually neutral and you want proof.
- You want before/after images of a UI change for a human to look at.
Why this exists (and why it does not open VS Code)
The repo forbids agents from launching a real editor window — see
"Never Launch a Real Editor/IDE Instance" in AGENTS.md.
That rules out the Extension Development Host, and with it the existing
aiEngineeringFluency.runLocalViewRegression command, which only a human can
run and which checks DOM metrics (node counts, text length) rather than
appearance.
This skill covers the gap: it renders the real webview bundles outside VS
Code. Every panel's HTML shell in extension.ts is the same four ingredients —
a <div id="root">, a window.__INITIAL_<VIEW>__ payload, the shared JSON
config globals, and <script src="dist/webview/<view>.js">. The harness
reproduces that shell around a committed fixture and supplies the --vscode-*
theme tokens VS Code would normally inject, then lets the real bundle render.
Nothing about the views is re-implemented, which is what makes the screenshots trustworthy: if rendering code changes, the screenshot changes with it.
Usage
Everything runs from the repo root. Bundles must be built first
(cd vscode-extension && pnpm install && node esbuild.js).
Compare against the baseline commit (the usual case)
node .github/skills/visual-view-diff/visual-diff.js
# or, from vscode-extension/: pnpm run visual:diff
This builds the webviews at the merge base with origin/main in a temporary
git worktree, builds the working tree, renders both, and compares. Your
checkout is never touched — no stashing, no branch switching.
Both sides render at the same time, each with --concurrency pages open at
once (default 4). Every target still gets its own page and browser context, and
file names and reports are ordered by view, state and theme, not by which page
finished first. The run ends by printing how long each phase took (checkout,
builds, renders, compare) and writes the same table to
visual-output/timings.md, which CI appends to the job summary.
# Compare against something else, or render both themes
node .github/skills/visual-view-diff/visual-diff.js --base origin/main --theme both
node .github/skills/visual-view-diff/visual-diff.js --view details,chart
# Include the high-contrast variants (opt-in; CI stays on dark + light)
node .github/skills/visual-view-diff/visual-diff.js --theme all
# Fewer pages at once, e.g. on a small machine or to rule out load-related noise
node .github/skills/visual-view-diff/visual-diff.js --concurrency 1
Output lands in visual-output/ (git-ignored):
visual-output/
├── baseline/ <view>.<theme>.png — before
├── current/ <view>.<theme>.png — after
├── diff/ <view>.<theme>.diff.png, report.md, report.json
└── timings.md — how long each phase took
Themes: dark (default), light, hc (Dark High Contrast), hc-light
(Light High Contrast); both = dark + light, all = all four. Each theme sets
body[data-vscode-theme-kind] / class and the --vscode-* tokens, so
shared/theme.css's light and high-contrast rules apply exactly as in VS Code.
High contrast is opt-in because it doubles the render count again; use it
after touching theme.css or any colour in a stylesheet. The PR comment
publisher only knows dark and light, so CI keeps --theme both.
A view rendered in one of its declared states (a tab, a mode) is named
<view>--<state>.<theme>.png, e.g. usage--tools.dark.png.
Just sc
Установить visual-view-diff в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл visual-view-diff?
Render the VS Code extension's webview panels headlessly and detect which ones changed visually, producing before/after/diff screenshots for review. Use when a change touches webview UI (src/webview/**, view HTML in extension.ts, shared CSS) and you want to see and show what it looks like, or to check that a refactor changed nothing visually.
Как установить скилл visual-view-diff?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл visual-view-diff запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic