verify_html_parity
Verifies HTML parity with Figma design by running content, structural, and visual gate comparisons, outputting a JSON report with diff images.
Instructions
The acceptance gate. Compares rendered HTML against a Figma replica spec: content gate (copy/font/color tolerances: font size ±1px, letter-spacing ±0.5px, line-height ±2px, color ±2/255), structural gate (position/size ±4px), visual gate (pixelmatch diff ratio ≤ 1%, 2px crop tolerance). Emits a JSON report + diff images.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | Remote URL of the HTML page. | |
| html | No | Raw HTML string. | |
| spec | No | Inline spec JSON (string or object). | |
| outDir | No | Directory for report.json + diff images (default ./figmingo-parity-out). | |
| htmlPath | No | Local HTML file path. | |
| sections | No | HTML section selectors (default: auto-detect semantic elements). | |
| specPath | No | Path to a spec JSON from get_html_replica_spec. | |
| hideFixed | No | ||
| sectionMap | No | spec section id → html section id overrides. | |
| skipVisual | No | Run only content+structural gates. | |
| skipSections | No | Spec section ids/names to skip (e.g. floating widgets). | |
| viewportWidth | No | ||
| expectedCounts | No | ||
| looseRectHints | No | Extra rect slack per assetHint, e.g. {"product": 20}. | |
| viewportHeight | No | ||
| visualMaxRatio | No | default 0.01 | |
| positionTolerance | No | default 4 | |
| figmaScreenshotPath | No | Existing PNG of the Figma design (skips REST render). |