Skip to main content
skill Claude Code CX Codex Cursor GitHub Copilot

argent-screenshot-diff — Claude Code skill: what it does

Compares before and after screenshots to catch layout shifts, spacing, color and text rendering changes.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add software-mansion/argent --skill argent-screenshot-diff -a claude-code
Open on GitHub

What argent-screenshot-diff does

Runs pixel-level comparison of two PNG screenshots: a saved baseline and a current capture. The call takes udid, a baseline file path (baselinePath), and either captureCurrent: true for a live snapshot or currentPath for a second saved file. Diff artifacts go to outputDir.

Works with physical iPhones via kind: "device": capture runs through the on-device runner at full resolution, device-wide, with no registered app required. For clean comparison you need stable states without animations, timestamps or random content — otherwise the diff will be noisy. This tool does not find tap coordinates; use describe or debugger-component-tree for that.

Before the call, take a baseline screenshot with the screenshot command using scale: 1.0 and includeImageInContext: false, save the path, apply your change, then call screenshot-diff with the saved baselinePath and captureCurrent: true.

What it helps with

  • test UI regression after component refactoring
  • catch spacing shifts from design system updates
  • compare two saved screenshots of the same screen
  • verify color or typography changes
  • ensure a fix did not break neighboring element layout

Example prompts for the agent

  • Run screenshot diff between `baseline.png` and current state
  • Compare two saved screenshots: `old.png` and `new.png`
  • Check visual regression on the profile screen after changes

How to install argent-screenshot-diff

1Skills CLI (Vercel)

npx skills add software-mansion/argent --skill argent-screenshot-diff -a claude-code

2Manually: put the files in place

~/.claude/skills/argent-screenshot-diff/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/argent-screenshot-diff/

From the same set5

The whole set →

Similar

flutter-expert https://github.com/Jeffallan Skill for building cross-platform apps with Flutter 3+ and Dart. Covers widgets, state management via Riverpod or Bloc, GoRouter navigation, and performance optimization. Claude Code CX Codex Cursor +1 14,300installs shellcheck-configuration Ryan Snodgrass This skill guides ShellCheck setup and use for shell script analysis. Use it when adding CI/CD linting, fixing warnings, or checking script portability. Claude Code CX Codex Cursor 11,533installs doublecheck official github Checks factual claims in AI output, looks for sources, and flags hallucination risk. Use it before relying on analysis, research summaries, or legal content. GitHub Copilot 4,300installs data-quality-frameworks Seth Hobson This skill sets up data checks with Great Expectations, dbt tests, and data contracts. Use it for validation pipelines, CI/CD checks, and schema rules. Claude Code CX Codex Cursor 11,230installs dependency-upgrade Seth Hobson This skill plans major dependency upgrades, checks compatibility, and stages changes with tests. Use it for framework updates or library breaking changes. Claude Code CX Codex Cursor 11,079installs playwright-skill lackeyjb Write and run Playwright scripts directly in your IDE. Auto-detects dev servers, takes screenshots, checks responsive layouts, tests login flows, and validates web functionality. Claude Code CX Codex Cursor +1 6,900installs improve-codebase-architecture Matt Pocock This skill scans a codebase for architectural friction, then builds a visual HTML report with refactoring candidates. Use it before a deeper architecture review. Claude Code 1,163,035installs design-taste-frontend Leonxlnx This skill directs the design of public pages and work screens, then checks the result in a browser through screenshots. Use it when an interface feels generic or unfinished. Claude Code CX Codex Cursor +1 673,100installs

Questions about argent-screenshot-diff

How to install argent-screenshot-diff in Claude Code?

Run npx skills add software-mansion/argent --skill argent-screenshot-diff -a claude-code. The skill will appear at ~/.claude/skills/argent-screenshot-diff/SKILL.md.

What does argent-screenshot-diff do?

Compares two PNG screenshots pixel by pixel and generates diff artifacts. It shows changes in layout, spacing, color, typography and image rendering.

When should I not use argent-screenshot-diff?

Skip it for dynamic content, animations, timestamps, ads or random data — the comparison will be noisy. For state, navigation or accessibility tree checks, structural tests work better.

Source text

SKILL.md · Apache-2.0
---
name: argent-screenshot-diff
description: Compare saved or live app screenshots with the argent screenshot-diff tool. Use when testing visual regressions, before/after UI comparisons, screenshot diff checks, visible layout, spacing, color, typography, clipping, overflow, text rendering, or image/icon rendering changes.
---

## 1. Role

Use `screenshot-diff` as supporting visual evidence for UI QA and visual regression checks. It highlights pixel-visible change or stability; it does not replace visual inspection, accessibility/component-tree state, frame/attribute checks, logs, network evidence, or app behavior.

Do not use screenshot diffing for tap-coordinate discovery. Use `describe`, `debugger-component-tree`, or `native-describe-screen` to find targets first.

`screenshot-diff` supports physical iPhones (kind `"device"`) for both saved-file diffs and live captures. A live capture on hardware goes through the on-device runner at full resolution, is device-wide, and needs no registered app. Keep baselines per device model and resolution, and note that the `rotation` parameter is ignored on hardware: the capture follows the device's real orientation.

## 2. When To Use

Use `screenshot-diff` when pixel comparison can answer the verification question:

- Required for explicit "UI regression test", "visual regression test", "screenshot diff", "compare screenshots", or "before/after visual comparison" requests, unless stable comparable screenshots cannot be produced.
- Good fit when the affected screen has stable before/after states and the expected result is pixel-visible: layout, position, size, spacing, color, typography, image/icon rendering, clipping, overflow, or text rendering.
- Good fit when the risk is unintended visual regression outside the exact element changed.
- Poor fit when the result is better verified structurally: state changes, navigation existence, accessibility tree contents, console/network behavior, or unit tests.
- Poor fit when dynamic content, unpausable animation, timestamps, ads, random data, or missing baseline/current screenshots would make the comparison noisy or meaningless.

## 3. Capture Rules

Use normal downscaled `screenshot` calls for UI context and state checks. Use full-resolution screenshots only when saving baseline/current PNG files for visual regression comparison. Suppress the image block so the full-size PNG is not loaded into context:

```json
{ "udid": "<UDID>", "scale": 1.0, "includeImageInContext": false }
```

Capture the stable baseline before the relevant interaction or before editing whenever feasible. Compare it to the post-change or post-interaction screen after the app reloads, rebuilds, or reaches the state under test.

## 4. Parameters

Provide `udid` and exactly one input for the baseline side and exactly one input for the current side:

- Common UI regression flow: saved baseline plus live current -> `baselinePath`, `captureCurrent: true`, `udid`, `outputDir`.
- Both screenshots already saved -> `baselinePath`, `currentPath`, `udid`, `outputDir`.
- Rare fixture flow: live baseline plus saved current -> `captureBaseline: true`, `currentPath`, `udid`, `outputDir`.
- Do not combine `captureBaseline: true` with `captureCurrent: true`, or provide both a path and live capture flag for the same side.

## 5. Deterministic Flow

1. Navigate to the known-good state.
2. Capture a baseline PNG with `screenshot` using `scale: 1.0` and `includeImageInContext: false`; keep the returned `path`.
3. Perform the interaction, apply the code change and navigate to the state under test.
4. Call `screenshot-diff` with the saved `baselinePath`, `captureCurrent: true`, `udid`, and `outputDir`.
5. Inspect the summary and artifact paths, then combine the diff with normal visual inspection and any structural/runtime evidence needed for the assertion.

```json
{
  "baselinePath": "/tmp/baseline.png",
  "captureCurrent": true,
  "udid": "<UDID>",
  "outputDir": "/tmp/argent-diff"
}
```

If both images are already saved, use file paths for both sides:

```json
{
  "baselinePath": "/tmp/baseline.png",
  "currentPath": "/tmp/current.png",
  "udid": "<UDID>",
  "outputDir": "/tmp/argent-diff"
}
```

© software-mansion · Apache-2.0 · software-mansion/argent

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor