visual-regression-triage
Compare reference mockups against rendered screenshots at matching viewport dimensions, calculate quantitative pixel difference metrics, isolate bounding boxes, filter rendering noise, and triage discrepancies by severity.
- License 许可
- MIT
- 最近更新
- 2026-10-21
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- visual-regression-triage
- description
- Compare reference mockups against rendered screenshots at matching viewport dimensions, calculate quantitative pixel difference metrics, isolate bounding boxes, filter rendering noise, and triage discrepancies by severity.
02 资源文件 2
- 参考文档references/triage-taxonomy.md2.2 KB
- 脚本scripts/diff.js1.9 KB
03 SKILL.md 正文
Visual Regression Triage Skill
Use this skill to perform automated visual comparison between a reference image and a rendered implementation, isolate the discrepancy regions, filter out rendering noise, and produce prioritized remediation guidance.
Core Responsibilities
- Dimension Verification: Assert identical viewport dimensions using
bin/ves-dimension.jsbefore diffing. - Quantitative Metrics: Run diff.js to compute mismatched pixel count, diff percentage, and coordinate bounding boxes.
- Noise Filtering: Distinguish subpixel antialiasing and font smoothing noise from layout, color, and structural defects using Triage Taxonomy.
- Severity Prioritization: Rank findings (Critical, Major, Minor) and recommend specific code corrections.
Step-by-Step Procedure
1. Verify Image Dimensions
Ensure both images share identical dimensions:
node bin/ves-dimension.js <reference-png> <rendered-png>
If dimensions differ, do not proceed with pixel diffing. Resize the browser viewport or crop the candidate image to match the reference.
2. Execute Visual Diff
Run the regression comparison with visual diff output:
node skills/visual-regression-triage/scripts/diff.js <reference-png> <rendered-png> --diff ./output/diff.png --json
3. Analyze Findings & Discrepancy Bounding Boxes
Inspect the resulting bounding box and metrics:
boundingBox: Coordinate region[minX..maxX, minY..maxY]identifying exactly where the mismatch occurred.diffPercentage: Quantitative mismatch ratio.- Cross-reference with the Triage Taxonomy to classify:
- Is it a layout shift? (e.g. element moved 20px down)
- Is it a color mismatch? (e.g. wrong hex code on CTA)
- Is it missing elements or truncated text?
- Is it harmless antialiasing noise?
4. Produce Structured Triage Report
Format the report with concrete code fixes:
### Visual Regression Triage Report
- **Reference Image**: `fixtures/landing-hero-ref.png` (1280x800px)
- **Rendered Image**: `output/rendered-desktop.png` (1280x800px)
- **Status**: FAILED (Diff: 1,420 pixels, 0.138%)
- **Discrepancy Region**: Bounding Box `x: 96..280, y: 340..396` (Primary CTA Button)
#### Triaged Issues:
1. **[Major] CTA Button Background Color Mismatch**:
- *Observation*: Button rendered in `#2563EB` (Tailwind blue-600) instead of reference `#1D4ED8` (blue-700).
- *Remediation*: Update `className="bg-blue-600"` to `className="bg-blue-700"` in `src/components/Hero.tsx`.
2. **[Minor] Heading Margin-Bottom**:
- *Observation*: Spacing between headline and subtitle is 16px instead of 24px.
- *Remediation*: Update `mb-4` to `mb-6`.
5. Loop Back to Frontend Implementation
Apply the corrections, re-render, and repeat diffing until the visual test passes cleanly.
04 同仓库更多 Skills
valid-skill
A valid sample skill used for automated manifest testing and verification.
missing-name
Missing name field
missing-desc
暂无简介
broken-link
Skill containing a broken relative link.
visual-refinement-loop
Coordinate the end-to-end visual refinement loop across reconstruction, implementation, browser capture, regression triage, and accessibility auditing, with configurable iteration caps, stagnation detection, and verified run artifacts.
visual-reconstruction
Inspect supplied screenshots, mockups, or web pages, extract visual hierarchy, layout structure, typography, and visible components, and produce a structured UI specification separating facts from assumptions.