argent-screenshot-diff — скилл для Claude Code: что делает
Сравнивает скриншоты до и после изменений в UI: ловит сдвиги в раскладке, отступах, цвете и рендере текста.
npx skills add software-mansion/argent --skill argent-screenshot-diff -a claude-codeЧто делает argent-screenshot-diff
Делает попиксельное сравнение двух PNG-снимков экрана — сохранённого базового и текущего. Вызов принимает udid, путь к базовому файлу (baselinePath) и либо флаг captureCurrent: true для живого захвата, либо currentPath для второго сохранённого файла. Пишет артефакты диффа в outputDir.
Поддерживает физические iPhone через kind: "device": захват идёт через раннер на устройстве в полном разрешении, без привязки к зарегистрированному приложению. Для корректного сравнения нужны стабильные состояния без анимаций, таймстемпов или случайного контента — иначе дифф будет шумным. Координаты тапов этот инструмент не находит: для этого есть describe или debugger-component-tree.
Перед вызовом сделай базовый скриншот командой screenshot с параметрами scale: 1.0 и includeImageInContext: false, сохрани путь, примени изменение, потом вызови screenshot-diff с сохранённым baselinePath и captureCurrent: true.
Какие задачи решает
- проверить UI-регрессию после рефакторинга компонента
- поймать сдвиг отступов при обновлении дизайн-системы
- сравнить два сохранённых скриншота одного экрана
- зафиксировать изменения цвета или типографики
- убедиться, что правка не сломала раскладку соседних элементов
Примеры запросов агенту
- Сделай скриншот-дифф текущего состояния с `baseline.png`
- Сравни два сохранённых скриншота: `old.png` и `new.png`
- Проверь визуальную регрессию на экране профиля после изменений
Как установить argent-screenshot-diff
1Через Skills CLI (Vercel)
npx skills add software-mansion/argent --skill argent-screenshot-diff -a claude-code2Вручную: положить файлы
~/.claude/skills/argent-screenshot-diff/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/argent-screenshot-diff/
1Через Skills CLI (Vercel)
npx skills add software-mansion/argent --skill argent-screenshot-diff -a codex2Вручную: положить файлы
.agents/skills/argent-screenshot-diff/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add software-mansion/argent --skill argent-screenshot-diff -a cursor2Вручную: положить файлы
.cursor/skills/argent-screenshot-diff/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install software-mansion/argent argent-screenshot-diff2Вручную: положить файлы
.github/skills/argent-screenshot-diff/SKILL.md1Через Skills CLI (Vercel)
npx skills add software-mansion/argent --skill argent-screenshot-diff -a gemini-cli2Командой платформы
gemini skills install https://github.com/software-mansion/argent --path packages/skills/skills/argent-screenshot-diffВручную: положить файлы
.devin/skills/argent-screenshot-diff/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add software-mansion/argent --skill argent-screenshot-diff -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
Из того же набора15
Весь набор →Похожие
Вопросы о argent-screenshot-diff
Как установить argent-screenshot-diff в Claude Code?
Выполни команду npx skills add software-mansion/argent --skill argent-screenshot-diff -a claude-code. Скилл появится в ~/.claude/skills/argent-screenshot-diff/SKILL.md.
Что делает argent-screenshot-diff?
Сравнивает два PNG-скриншота попиксельно и создаёт артефакты диффа. Показывает изменения в раскладке, отступах, цвете, типографике и рендере изображений.
Когда argent-screenshot-diff не подходит?
Не используй его для динамического контента, анимаций, таймстемпов, рекламы или случайных данных — сравнение будет шумным. Для проверки состояния, навигации или accessibility-дерева лучше структурные тесты.
Исходный текст
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