Run a batch of visual comparisons defined in a uiMatch suite JSON file using @uimatch/cli, then read each report to summarize which components passed or failed their quality gates...
Run a batch of visual comparisons defined in a JSON suite file and summarize overall results.
Use this skill to:
@uimatch/cli is installed as a devDependency.npx playwright install chromium has been run previously.The uiMatch CLI does not load .env files automatically.
Before running any uimatch suite command:
export FIGMA_ACCESS_TOKEN="figd_..."
Suite items that rely on Figma API will fail if this is missing.
Inside the suite JSON:
Prefer FILE_KEY:NODE_ID format for figma fields:
{
"figma": "AbCdEf123:1-2"
}
If a full Figma URL is used, it is stored in JSON and not parsed by the shell directly, so shell escaping is less of a problem. Still, keep URLs valid and unbroken.
For more shared environment notes, see:
../_shared/uimatch-common-env.mdFor advanced tuning (viewport, size, contentBasis, dpr) on suite items, see:
../_shared/uimatch-advanced-settings.mdnpx uimatch suite \
path=<PATH_TO_SUITE_JSON> \
outDir=<OUTPUT_DIR> \
concurrency=<NUMBER>
Recommended:
outDir=.uimatch-suiteconcurrency=4Example:
npx uimatch suite \
path=.github/uimatch-suite.json \
outDir=.uimatch-suite \
concurrency=4
A typical suite JSON looks like:
{
"name": "Component Suite",
"defaults": {
"profile": "component/dev",
"story": "http://localhost:6006"
},
"items": [
{
"name": "Button Primary",
"figma": "AbCdEf123:1-2",
"story": "http://localhost:6006/iframe.html?id=button--primary",
"selector": "#storybook-root button"
},
{
"name": "Card Component",
"figma": "AbCdEf123:3-4",
"story": "http://localhost:6006/iframe.html?id=card--default",
"selector": "#storybook-root .card"
}
]
}
For full schema details, see docs/docs/cli-reference.md (suite section).
For each item, uiMatch will create a subdirectory under outDir:
<outDir>/<item-slug>/figma.png<outDir>/<item-slug>/impl.png<outDir>/<item-slug>/diff.png<outDir>/<item-slug>/report.jsonClaude Code should:
Enumerate all item directories under outDir.
For each report.json, read:
metrics.dfsqualityGate.passqualityGate.reasonsBuild a summary:
If CI-like behavior is desired, note that:
uimatch suite will exit with:0 when all items pass1 when one or more items fail2 for configuration errorsUse this skill when:
For one-off comparisons, prefer the uimatch-compare skill.
For text-only checks, prefer the uimatch-text-diff skill.
