Skip to content
/greyscale
Skills

/ui-diff

UI diff

On every pull request it compares the UI against its base and posts one comment saying what changed visually.

Compares every route a pull request touches at base and head, names the style changes it measured and posts one sticky PR comment that starts with the verdict. Only people who can read the repo can see the images.

Updated

Install

Or all three skills: npx skills add imuratalpay/skills

Installs every skill here, for coding agents. ui-diff needs git and Node.js 20.10+, and the GitHub CLI only to post. For the standalone CLI, clone imuratalpay/ui-diff and run ./install.sh.

Point at the screenshot, or drag it, to compare

What’s new in 2.1

  • Hover and focus states. Links, buttons and form fields in the first viewport are also checked hovered and reached with Tab, so a PR that only changes a hover color or drops a focus ring reads button 'Save' · hover: background #1d4ed8 → #1e3a8a, with a before and after crop.
  • Recorded flows. List a few steps in flows, such as a click, typing or a wait, and ui-diff replays them on base and head and compares the page at each checkpoint, under flow 'menu' · after open. A flow that no longer gets through is reported: flow 'checkout' stops at step 3 on head: button 'Pay' not found.
  • Component mode. Point components at one selector, on a route or after a flow, to get the same tight crop on both sides and only the changes inside it, under component 'primary button' with how its box changed. A component the selector no longer finds is reported as removed.

Example

The repo’s verified example: one page committed at 6737326 and cc13cab. The primary button got more padding and rounder corners, the gap beside it grew by 1px and the email label turned blue. This is the top of the comment ui-diff wrote for it, trimmed.

### UI diff · 5 measured changes on 1 route **Base** `6737326` → **Head** `cc13cab` · 1 route · desktop, mobile · light, dark #### Measured changes **`/`** - `label 'Work email'` (`label`): color #0f172a → #2563eb · desktop, mobile · light- `label 'Work email'` (`label`): color #f8fafc → #2563eb · desktop, mobile · dark- `link 'Start free trial'` (`a.cta`): padding 8px 14px → 10px 18px · desktop, mobile · light, dark  - size 134.5×40px → 142.5×44px (from the padding change)  <details><summary>10 effects on other elements</summary>  …- `link 'Start free trial'` (`a.cta`): border-radius 4px → 8px · desktop, mobile · light, dark- `div.hero-actions`: gap 16px → 17px · desktop, mobile · light, dark
Before and after of the mobile page, side by side: the Start free trial button is a few pixels larger with rounder corners, and the link beside it sits further right. The changed row is outlined in pink.
The still pair for / on mobile, light, and the line ui-diff puts under it: link 'Start free trial': padding 8px 14px → 10px 18px · border-radius 4px → 8px

What it does

  • Works out which routes your changed files affect, using ui-diff.config.json, the framework’s routing and the import graph.
  • Runs the PR’s base and head in temporary git worktrees, or uses preview URLs, and captures each route with Playwright. Clock, randomness, animations and fonts are frozen on both sides, so the same page gives the same pixels.
  • Matches base and head elements, measures their style changes and checks each one against the changed pixels. A change that fails the check is listed as unverified, never dropped.
  • Creates or updates one sticky PR comment. The images go to an orphan branch of the same repository, so only people who can read the repo can see them.

The story behind it is in Issue 02: The camera was never the hard part.

When to use it

When a pull request changes components, styles or pages and reviewers would otherwise approve it from the code. Run ui-diff check on your branch first. Nothing gets posted until you publish.

It also checks a menu, form or dialog after it is used and a single component on its own, puts design variants side by side (?hero=1..4), records hover and transition clips, reports new accessibility issues, and flags colors and spacing that match no design token.

When it runs

You ask for the taskThe agent picks the skill from its description
You type /ui-diffThe skill runs with what you wrote after it
On its own when a PR or branch changes UI, or when you type /ui-diff.

What the skill changed

The full-page image from the 2.0 comment for the repo’s verified example, at commits 6737326 and cc13cab.

Run the ui-diff skill on PR #123 and update the sticky PR comment.
Landing page at the base commit: the Start free trial button with 8px 14px padding and 4px corners.
Base 6737326. The Start free trial button at 8px 14px padding, with 4px corners.

Example prompts

Plain English works.

Pairs with

The full skill

The instructions your agent reads, from SKILL.md, and 4 reference files.

  1. 01Privacy rules (always)
  2. 021. Context
  3. 032. Detect changed UI and choose routes
  4. 043. Capture and diff
  5. 054. Review and write the UX summary
  6. 065. Publish one sticky comment
  7. 076. Wrap up
  8. 08Extras
  9. references/config.md · ui-diff.config.json
  10. references/extras.md · Extras
  11. references/privacy.md · Privacy, image hosting and protected previews
  12. references/troubleshooting.md · Troubleshooting

The full skill is for members

$80 a yearTwo months free

Membership opens soon. Leave your email and you will hear first.

Free with an email: all of Issue 01 and the first chapter of Issues 02, 04, 05 and 06. Start free

Read every issue · Subscribe