Logo : Ui Diff

Ui Diff

Communauté
imuratalpay
ui-diff

Before/after screenshots, highlighted pixel diffs and a short UX summary for pull requests that change UI, posted as one sticky PR comment whose images stay private in the same repository. Use when someone wants reviewers to see a frontend change ("add before/after screenshots to the PR", "what does this PR look like", "visual diff", "UI review", "did this CSS change break anything"), wants to check a hover, focus or open state ("check the mobile menu open state", "diff the checkout flow") or one component on its own ("diff the primary button"), or wants to compare design variants (?hero=1..4), record hover/transition clips, audit design-token usage, check accessibility regressions on changed screens, or capture auth-protected preview deployments.

Présentation

Éditeurimuratalpay
Dépôtui-diff
Nom de la compétenceui-diff
Étoiles
155
Forks
10
Fichiers inclus
134
LicenceMIT
Liens
  • Instructions en Markdown

    Un fichier SKILL.md que le modèle charge à la demande : il ne consomme donc des tokens que lorsqu’une demande correspond réellement à la compétence.

  • Compatible avec tous les LLM

    Les compétences IA sont rédigées en Markdown et non sous forme de code propre à un fournisseur. Elles fonctionnent donc avec GPT, Claude, Gemini, Grok ou un modèle local.

  • Fichiers inclus : 134

    Des scripts, des gabarits et des références que le modèle peut consulter pendant son travail. Les fichiers sont en lecture seule et ne sont jamais exécutés.

  • Open source

    Publiée par imuratalpay sur GitHub. Consultez les sources avant de l’installer.

Installation

Installez la compétence IA Ui Diff dans TypingMind pour l’utiliser avec n’importe quel LLM, ou ajoutez-la à un autre agent capable de lire SKILL.md.

1

Installer dans TypingMind

TypingMind installe une compétence directement depuis son dossier GitHub : l’application lit SKILL.md, regroupe les fichiers de ressources et enregistre le tout localement.

  1. Ouvrez l’application et accédez à Plugins → Compétences.
  2. Choisissez « Installer depuis GitHub ».
  3. Copiez l’URL ci-dessous, qui pointe vers le dossier de la compétence, puis collez-la et confirmez.
    https://github.com/imuratalpay/ui-diff/tree/main/skills/ui-diff
  4. Activez la compétence dans chaque discussion où vous souhaitez pouvoir l’utiliser.
Plugins → Compétences → Ajouter une compétence → Via une URL GitHub, puis collez l’URL du dossier et appuyez sur Continuer.
2

Installer dans un autre agent

Tout agent capable de lire le format Agent Skills peut utiliser cette compétence : copiez le dossier dans le répertoire des compétences de cet agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/imuratalpay/ui-diff.git /tmp/ui-diff
mkdir -p .claude/skills
cp -r /tmp/ui-diff/skills/ui-diff .claude/skills/ui-diff
Redémarrez Claude Code après la copie pour que la nouvelle compétence soit prise en compte.

Utilisez cette compétence dans TypingMind

Activez Ui Diff dans n’importe quelle discussion TypingMind et le modèle s’occupe du reste. Le nom et la description de la compétence figurent dans le prompt système. Dès qu’une demande correspond, le modèle charge lui-même l’intégralité des instructions : vous n’avez jamais à l’invoquer manuellement, et elle ne consomme aucun token tant qu’elle n’est pas utilisée.

Le modèle charge automatiquement Ui Diff dès qu’une demande correspond à cette compétence.

Compatible avec tous les modèles IA

Les compétences IA sont de simples instructions Markdown, et non du code propre à un fournisseur. Ainsi, la compétence Ui Diff n’est pas liée au modèle pour lequel elle a été conçue. Installez-la une seule fois dans TypingMind et utilisez-la avec GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ou un modèle local que vous exécutez vous-même, le tout avec vos propres clés API.

  • Chargée uniquement en cas de besoin

    Le prompt système ne contient que le nom et la description. Les instructions sont récupérées à la première demande correspondante : une compétence inutilisée ne coûte donc rien.

  • Changez de modèle en cours de discussion

    La compétence étant constituée d’instructions et non de code, elle reste fonctionnelle lorsque vous changez de modèle : le nouveau modèle lit le même fichier SKILL.md.

Instructions de la compétence

Voici le contenu de SKILL.md que le modèle charge. Lisez-le avant l’installation : une compétence contient des instructions que votre modèle suivra.

ui-diff

Renders the affected routes of a web app at the PR's base and head, diffs the screenshots, and posts one PR comment that starts with the verdict, then the measured element changes, still base | head pairs of each changed area and your UX summary. The mechanics are scripted; your job is the judgment: which routes matter, what the changes mean for users, and whether it is OK to post.

$SKILL is the directory containing this file. Run the CLI as:

bash
node "$SKILL/bin/ui-diff.mjs" <command> [options]

The first run installs dependencies and builds (about a minute); the first capture downloads Playwright's Chromium. Every command prints JSON on stdout and progress on stderr. Output goes to .ui-diff/ at the repo root, which is added to .git/info/exclude automatically.

Privacy rules (always)

  • Screenshots never go to public or third-party hosts (no imgur, gists, Slack, CDNs, pastebins). The only upload target is the repository's own ui-diff-assets branch.
  • publish refuses public repositories unless the user explicitly passes --allow-public-repo. If it says the repo is public or its visibility is unknown, stop and ask the user.
  • Never create Vercel share links, bypass URLs or URLs with tokens. Protected previews are reached with headers/cookies whose values come from environment variables (see references/privacy.md).
  • Never print secret values or paste them into comments or summaries.

1. Context

bash
gh pr view <n> --json number,url,baseRefName,headRefName,headRefOid   # or: gh pr view (current branch)
git status --short
  • Look for ui-diff.config.json (repo root or the app's directory). If there is none, run node "$SKILL/bin/ui-diff.mjs" init, check the suggested startCommand and routes, and offer to commit the file. doctor checks git, gh, the browser, the config and repo visibility: FAIL blocks a run; WARN (no gh login, no remote) only matters for publishing or --pr.
  • Posting to a PR: pass --pr <n> so head is the pushed commit. Mention uncommitted or unpushed work, because it will not appear.
  • Checking work in progress: node "$SKILL/bin/ui-diff.mjs" check diffs the working tree (uncommitted changes included) against the merge base with the default branch (--base <ref> to change it), prints a short summary with the measured changes, writes .ui-diff/out/ and posts nothing; exit 0 no visual changes, 1 changes, 2 errors (--json for JSON). run without --head does the same into .ui-diff/ for a later publish.
  • Deployed previews: pass --base-url / --head-url (or preview in the config). For protected previews configure auth once; see references/privacy.md.

2. Detect changed UI and choose routes

bash
node "$SKILL/bin/ui-diff.mjs" detect --pr <n>

Its JSON starts with status: capture (routes to capture), nothing-mapped (UI files that match no route) or no-ui-changes. It maps changed files to routes through routes[].files and globalFiles in the config, then framework conventions (Next.js, SvelteKit, Nuxt, Astro, Remix, TanStack Router, plain HTML) and an import graph (relative imports, tsconfig aliases, package.json # imports, workspace packages, CSS @import/url(), HTML href/src). The JSON lists each route with reasons and confidence, plus:

  • unmatched: UI files it could not place. Find their pages yourself (grep for imports) and pass them with --routes.
  • If the user only cares about part of a page, or a part is noise (ads, live feeds), set focus or ignore selectors in the config; a selector that matches nothing is reported as a warning.
  • needsExample: dynamic routes (/blog/[slug]). Find a real id and pass --routes /blog/hello.
  • notes: e.g. routes beyond detect.maxRoutes.
  • dependencies: changed packages from package.json and lockfiles. A ui: true one (React, Tailwind, a component library; detect.uiPackages) makes every route affected; mention the others as not checked visually.

If no UI file changed, say so and stop; do not produce an empty report. If UI files changed but none maps to a route (run prints "status": "nothing-mapped" and a notChecked reason), nothing was checked: resolve the routes yourself or tell the user; never report that as "no visual changes". Tell the user in one or two lines which routes you will capture and why. Remember routes that are affected but not captured (login walls, modals, limits): they go in the summary so "no change" is not read as an all-clear.

3. Capture and diff

bash
node "$SKILL/bin/ui-diff.mjs" run --pr <n> [--routes "/,/pricing"] [--viewports desktop,mobile] [--themes light,dark] \
  [--variants hero=1..4] [--motion | --motion-all] [--tokens path/to/tokens.json | auto] [--a11y]

In one go it creates git worktrees for base (the merge base) and head, links or installs dependencies, starts each app on a free port in its own process group, captures every route × viewport × theme, diffs with pixelmatch, writes per changed area a still base | head pair with the changed boxes outlined, a blink GIF and a before | after | diff crop (plus the full page), runs the enabled extras, and cleans up. Captures are deterministic (freeze, on by default): Date frozen at run start, Math.random and crypto seeded, animations, transitions and the caret stopped, web fonts and images awaited; plus hidden scrollbars, scroll reset and masked selectors (capture.mask, for carousels and live counters), and each screenshot is retaken until consecutive shots match (if something keeps moving, the page's JavaScript timers are paused for the final shots).

The JSON result has stats, changed (with image paths), flows, components, variants, motion, a11y, tokens, timing (one measured line: detect, prepare per side, capture, diff, extras; timings in report.json has the numbers), warnings, notCaptured and unmatchedFiles. Add --themes light,dark when colors or tokens changed. If it fails, the error names the step and the log in .ui-diff/logs/ (common causes and fixes: references/troubleshooting.md); fix the cause (missing env var, wrong startCommand, auth) and rerun. Never post a one-sided result. A capture whose page returns HTTP 4xx/5xx is reported as failed, not as "unchanged". A failed run keeps the previous report in .ui-diff/ (render and publish warn that it is from an earlier run): do not publish until a rerun succeeds.

Flows: changes that need someone to use the page

Still captures show pages as they load. When the change sits behind an interaction (a menu, a dialog, a filled form, a tab), add a flow to flows in ui-diff.config.json: it is replayed on base and head with the same frozen inputs, and at each checkpoint the first viewport is captured, mapped and diffed like a still capture. To write one from a sentence such as "check the mobile menu open state":

  1. Route and viewport: the page the sentence names (/ when none), plus viewports when it names one ("mobile" → ["mobile"], a name from the config's viewports).
  2. Steps: read the component to find the trigger and what appears. Prefer stable selectors: data-testid, id, aria-label (button[aria-label='Open menu']), then a class; never a generated class. Steps are click, hover, focus, type (+ text), press (a key), select (+ value), scroll (px or selector) and wait (ms or selector).
  3. Checkpoint: put "checkpoint": "<state>" on the step that reaches the state the user means; when that state appears asynchronously, end with a wait for it carrying the checkpoint. Without one, the end of the flow is captured as end.
json
{ "flows": [{ "name": "mobile menu", "route": "/", "viewports": ["mobile"],
  "steps": [{ "click": "button[aria-label='Open menu']" }, { "wait": "nav#menu", "checkpoint": "open" }] }] }

Keep flows short (at most flowLimits.maxSteps, 15 steps; flowLimits.maxFlows, 5 flows, run). A flow runs only when its route is captured; pass --routes to force it. Offer to commit the flow. Changes at a checkpoint are listed under "/ · flow 'mobile menu' · open" (what the still capture already lists is not repeated), with images compare/<capture>__flow-<name>-<checkpoint>.png (and its __pair-* crops) and flows in report.json. "flow 'checkout' stops at step 3 on head: button 'Pay' not found" means users can no longer get through it: lead "worth a look" with it. A flow that stops at the same step on both sides is a warning about the flow, not the PR: fix its selector and rerun.

Components: one part of a page on its own

When the user cares about one component ("check the primary button", "diff the pricing card"), add it to components in ui-diff.config.json: it gets a tight crop on both sides, only the measured changes inside it, and its own row in the comment. To write one:

  1. Route: the page the component is on (find where it renders; / when it is on the home page). When it only shows after an interaction (a menu, a dialog), point at a flow and its checkpoint instead: "flow": "mobile menu", "checkpoint": "open" (write the flow first).
  2. Selector: one that matches exactly one element, the component's root: data-testid, id or aria-label first ([data-testid=hero-cta], section[aria-label='Pro plan']), else a class unique on the page; never a generated class. If the name is ambiguous ("the button"), pick the one the PR touches and say which.
  3. States: add "hover" and "focus" when the sentence or the change is about interaction (a button, a link, a field); otherwise leave the default.
json
{ "components": [{ "name": "primary button", "route": "/", "selector": "[data-testid=hero-cta]", "states": ["default", "hover", "focus"] },
                 { "name": "pricing card", "route": "/pricing", "selector": ".plan-card--pro" }] }

At most componentLimits.maxComponents (10) run. Offer to commit the entry. The comment groups changes under "component 'primary button'" with how its box changed ("size 320×48 → 320×52px"), with images compare/<capture>__component-<name>*.png, and components in report.json. "component 'primary button' removed on head: nothing matches …" means the selector found it on base only: check whether the component was removed or only renamed, and say which. A component missing on both sides is a warning about the selector: fix it and rerun.

4. Review and write the UX summary

Start from the measured changes: captures[].styleDiff.changes in report.json names each changed element with exact before → after values (padding, color, radius, text, added, removed, reordered), and styleDiff.regions says which element each changed area belongs to; quote those values instead of estimating from pixels. A change with verified: false did not pass the check (weak match, or no changed pixels under it): its unverified reasons say why; do not state it as fact without the images. Open the images before writing (the still pairs compare/*__pair-*.png first, then the compare/*__focus-*.png diff crops, the full composites, variants/*__strip.png and motion/*.gif). Read .ui-diff/report.json for the measured data, and start from .ui-diff/summary.auto.md. The comment's first line is the verdict and the measured changes follow it, so the summary need not repeat them: say what they mean for users. Write .ui-diff/summary.md for a designer or PM who will not read the code:

A change with a state (hover or focus) happened only while the element was hovered or had keyboard focus; its crops are under states/ and its pair in compare/*__state-hover-*.png or compare/*__state-focus-*.png. A removed focus ring is an accessibility problem: name it in "worth a look".

markdown
**What changed**
- **Primary button**: padding 8×14 → 10×18px, corner radius 4 → 8px. The link beside it shifts right, and the page below moves down 4px.
- **Newsletter label**: "Work email" is now brand blue.

**Worth a look**
- The label is 3.45:1 in dark mode (`#2563eb` on `#0f172a`).
- Button padding `10px` / `18px` and the 17px action gap are not spacing tokens.

**Not checked:** `/settings` (needs login).

A capture whose base and head environments differed (fonts, device pixel ratio, browser; see fingerprint.differences in report.json) gets a warning in the comment, and notComparable in the report makes the verdict say the captures were not comparable: name it in "worth a look" and do not describe that diff as a product change without checking the images.

Guidelines: lead "worth a look" with likely-unintended changes (a page changed without its files changing, breakage at one viewport, new a11y issues, off-token values). Content that only moved (a taller hero pushing sections down) is matched row by row and reported as "shifted down Npx" (diff.shifted in report.json); it is not in the changed percentage, so mention the shift without calling the moved sections changed. A "page did not settle" warning names an element that kept moving by itself (carousel, ticker); when a capture says every difference is inside such an area, do not describe it as a change: suggest the capture.mask the warning gives. Say "changed", not "intentionally changed". Keep it proportional: a one-color tweak gets one bullet. If you cannot view images, write from report.json and say the screenshots were not reviewed.

Preview the final comment locally:

bash
node "$SKILL/bin/ui-diff.mjs" render     # writes .ui-diff/comment.preview.md

5. Publish one sticky comment

Posting writes to a shared PR and pushes a branch: show the user the summary and get a yes first, unless the request already said to post.

bash
node "$SKILL/bin/ui-diff.mjs" publish --pr <n> --dry-run   # lists uploads, writes .ui-diff/comment.md, pushes and posts nothing
node "$SKILL/bin/ui-diff.mjs" publish --pr <n>
  • Read the dry run's publishable and problems: if it says the repository is public, its visibility is unknown or there is no GitHub remote, the real publish will stop there. Tell the user; do not add --allow-public-repo or --assume-private on your own.
  • Images go to the orphan branch ui-diff-assets of the same repository (single commit, other PRs' files kept) and are linked as https://github.com/<owner>/<repo>/raw/ui-diff-assets/…, which renders only for people who can read the repo.
  • The comment is found by a hidden marker (<!-- ui-diff:sticky id=default -->) and edited in place; reruns never stack comments, unchanged bodies are not re-sent, and ticked variant picks survive.
  • Exit code 3 means git could not read or push the repository (no push access, e.g. a fork, or missing git credentials; the error says which): use --no-upload for a text-only comment, or --no-comment to upload and print the markdown without posting.
  • When the report has no changed UI file, publish uploads nothing and creates no comment; an existing sticky comment gets "no UI files changed in " as its top line, with the last result that had UI changes kept below it, collapsed.
  • No PR yet: use render (or publish --dry-run) to produce the comment and offer to post once the PR exists.

6. Wrap up

Report the comment link, the counts, the "worth a look" items and anything not captured. If you worked out routes, masks or dynamic ids yourself, offer to save them in ui-diff.config.json. After a PR closes, node "$SKILL/bin/ui-diff.mjs" prune --closed removes its images.

Extras

FeatureEnableWhat you get
Variant compare--variants hero=1..4 or routes[].variantsHead captured once per ?hero= value, shown side by side in one table with tick boxes reviewers use to pick.
Motion clips--motion or motion.enabled + routes[].motion.stepsShort before/after GIF (and optional WebM) of a scripted hover/click/scroll, for transitions screenshots miss. Only routes whose changed files touch motion (transitions, keyframes, :hover, the elements the steps target; transition-only changes included) unless --motion-all; a single-frame clip is flagged "no motion detected".
Token audit--tokens tokens.json or tokens.enabledComputed colors, spacing, radii and type in changed areas that match no token (JSON, CSS variables or StyleX *.stylex.ts; --tokens auto finds them), with selectors and the nearest token.
Protected previews--base-url/--head-url + authCaptures behind Vercel Authentication and similar, with credentials from env vars sent only to the preview origin.
Accessibility delta--a11y or a11y.enabledaxe-core on both sides; only new and fixed issues (contrast, labels, focus), plus tab-order changes.

Details and examples: references/extras.md. All config options: references/config.md. Hosting trade-offs and protected previews: references/privacy.md. Failures and flaky captures: references/troubleshooting.md.

Fichiers inclus

Le modèle lit ces fichiers à la demande lorsque la compétence est chargée. Ils sont accessibles en lecture et ne sont jamais exécutés.

Nombre de fichiers supplémentaires : 74.

Foire aux questions

À quoi sert la compétence IA Ui Diff ?

Before/after screenshots, highlighted pixel diffs and a short UX summary for pull requests that change UI, posted as one sticky PR comment whose images stay private in the same repository. Use when someone wants reviewers to see a frontend change ("add before/after screenshots to the PR", "what does this PR look like", "visual diff", "UI review", "did this CSS change break anything"), wants to check a hover, focus or open state ("check the mobile menu open state", "diff the checkout flow") or one component on its own ("diff the primary button"), or wants to compare design variants (?hero=1....

Pourquoi utiliser Ui Diff sur TypingMind ?

Parce que vous l’installez une seule fois pour l’utiliser avec n’importe quel modèle. Ui Diff se compose de simples instructions en Markdown plutôt que de code propre à un fournisseur. La même compétence fonctionne donc avec GPT-5, Claude, Gemini, Grok ou un modèle local, et vous pouvez changer de modèle en cours de discussion sans perturber son fonctionnement. TypingMind utilise vos propres clés API : vous payez donc directement les fournisseurs plutôt qu’un abonnement par siège, et vos compétences et discussions restent dans votre propre espace de stockage.

Comment installer Ui Diff dans TypingMind ?

Dans TypingMind, ouvrez Plugins → Compétences → Installer depuis GitHub et collez https://github.com/imuratalpay/ui-diff/tree/main/skills/ui-diff. TypingMind lit le fichier SKILL.md, regroupe les fichiers associés et installe le tout sous forme de compétence que vous pouvez activer pour chaque discussion.

Quels modèles d’IA peuvent utiliser Ui Diff ?

N’importe quel modèle que vous connectez dans TypingMind. Les compétences IA sont de simples instructions en Markdown, et non du code propre à un fournisseur. GPT, Claude, Gemini, Grok et les modèles locaux peuvent donc tous charger cette compétence lorsqu’une demande lui correspond.

Combien de modèles d’IA puis-je utiliser avec Ui Diff ?

Autant que vous le souhaitez. Vous pouvez utiliser Ui Diff avec tout modèle qui prend en charge les compétences : GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama et bien d’autres, le tout dans TypingMind avec vos propres clés API.

La compétence IA Ui Diff est-elle gratuite ?

Oui. Cette compétence est publiée sur GitHub par imuratalpay sous licence MIT. Vous ne payez que votre propre fournisseur d’IA pour les tokens utilisés.

Que sont les compétences IA ?

Une compétence IA est un ensemble d’instructions réutilisables qui apprend à un modèle d’IA à accomplir une tâche précise. Elle suit le format ouvert Agent Skills : un fichier SKILL.md contenant un nom et une description, ainsi que les éventuels scripts, gabarits ou fichiers de référence dont le modèle peut avoir besoin. Le modèle ne lit les instructions que lorsque votre demande correspond à la compétence. Une compétence installée ne coûte donc rien tant qu’elle n’est pas utilisée.

En quoi les compétences IA diffèrent-elles des plugins ou des serveurs MCP ?

Un plugin ou un serveur MCP fournit au modèle de nouveaux outils à appeler : du code qui s’exécute quelque part et renvoie un résultat. Une compétence IA lui apporte plutôt des connaissances et une méthode : comment aborder une tâche, quelles étapes suivre et à quoi ressemble un bon résultat. Les compétences sont de simples instructions en Markdown. Elles ne nécessitent donc ni serveur, ni clé API, ni environnement d’exécution, et fonctionnent avec n’importe quel modèle.

Tout voir

Créez votre propre espace de travail IA dès maintenant

Abonnez-vous à notre newsletter pour être informé des nouvelles fonctionnalités et des prochains cadeaux à gagner 👇