argent-screenshot-diff
software-mansion/argent
Compare app screenshots to detect visual regressions and UI changes pixel-by-pixel.
What is argent-screenshot-diff?
The argent screenshot-diff tool compares saved or live app screenshots to identify visual changes in layout, spacing, color, typography, and rendering. Use it for visual regression testing and before/after UI comparisons when pixel-level differences can answer your verification question.
- Compare baseline and current screenshots to highlight pixel-visible changes
- Detect layout, spacing, color, typography, and rendering differences
- Support both saved PNG files and live device captures for comparison
- Generate diff artifacts showing changed regions
- Suppress large images from context to keep token usage efficient
How to install argent-screenshot-diff
npx skills add https://github.com/software-mansion/argent --skill argent-screenshot-diff- Node.js and npm installed
- Access to a running app or simulator/device with a UDID
- Baseline screenshot saved as PNG file (or ability to capture live)
How to use argent-screenshot-diff
- 1.Navigate your app to the known-good baseline state
- 2.Capture a baseline screenshot using `screenshot` with `scale: 1.0` and `includeImageInContext: false`, and save the returned path
- 3.Perform the interaction or code change you want to test
- 4.Call `screenshot-diff` with `baselinePath`, `captureCurrent: true`, your device `udid`, and an `outputDir` for results
- 5.Review the diff summary and artifact images to identify visual changes
- 6.Combine diff results with visual inspection and structural checks to verify the change is correct
Use cases
- Verify UI regression after code changes by comparing baseline to post-change screenshots
- Test before/after visual comparisons when UI is intentionally modified
- Check for unintended visual side effects outside the directly changed element
- Validate correct rendering of images, icons, text, and spacing after updates
- Compare screenshots from different app states or device configurations
- QA engineers performing visual regression testing
- Frontend developers verifying UI changes before commit
- Product teams comparing design implementations
- Test automation engineers building screenshot-based test suites
argent-screenshot-diff FAQ
Use screenshot-diff for pixel-visible changes like layout, spacing, color, and typography. Use structural checks (describe, debugger-component-tree) for state changes, navigation, accessibility, and behavior verification.
Yes. Provide both `baselinePath` and `currentPath` instead of using `captureCurrent: true`. Do not combine file paths with live capture flags.
Full-resolution screenshots are large and consume significant token budget. Suppressing the image block keeps context efficient while still saving the PNG file for comparison.
Screenshot-diff works best with stable, deterministic UI states. Avoid comparing screens with timestamps, ads, random data, or unpausable animations, as these will create noisy diffs.
No. Use it as supporting evidence alongside visual inspection, accessibility checks, logs, and behavior verification. It highlights pixel changes but does not verify user experience or accessibility.
Full instructions (SKILL.md)
Source of truth, from software-mansion/argent.
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.
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:
{ "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: truewithcaptureCurrent: true, or provide both a path and live capture flag for the same side.
5. Deterministic Flow
- Navigate to the known-good state.
- Capture a baseline PNG with
screenshotusingscale: 1.0andincludeImageInContext: false; keep the returnedpath. - Perform the interaction, apply the code change and navigate to the state under test.
- Call
screenshot-diffwith the savedbaselinePath,captureCurrent: true,udid, andoutputDir. - Inspect the summary and artifact paths, then combine the diff with normal visual inspection and any structural/runtime evidence needed for the assertion.
{
"baselinePath": "/tmp/baseline.png",
"captureCurrent": true,
"udid": "<UDID>",
"outputDir": "/tmp/argent-diff"
}
If both images are already saved, use file paths for both sides:
{
"baselinePath": "/tmp/baseline.png",
"currentPath": "/tmp/current.png",
"udid": "<UDID>",
"outputDir": "/tmp/argent-diff"
}
Related skills
More from software-mansion/argent and the wider catalog.

argent-test-ui-flow
Autonomously test iOS/Android app UI flows with interact-screenshot-verify loops using argent MCP tools.

argent-android-emulator-setup
Set up and boot Android emulators, connect via adb, and prepare for UI automation.

argent-create-flow
Record and replay scripted sequences of device actions as reusable flows.

argent-device-interact
Interact with iOS simulators, Android emulators, and Chromium apps using unified gesture and UI automation tools.

solana-dev
End-to-end Solana dApp development: wallet connection, Anchor programs, client generation, testing, and on-chain lookups.

browser-automation
Browser automation with Playwright—navigate, click, fill forms, and screenshot web pages.