daybreak-visual-parity

Validates Flutter screens against external Daybreak reference PNGs using a three-tier exact-tolerance-differs standard.

Updated Aug 22, 2026
One-click install
npx skills add https://github.com/zakariaf/NearlyStop --skill daybreak-visual-parity-zakariaf
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: daybreak-visual-parity
Source: https://github.com/zakariaf/NearlyStop/tree/main/.claude/skills/daybreak-visual-parity
Command: npx skills add https://github.com/zakariaf/NearlyStop --skill daybreak-visual-parity-zakariaf

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Comparing a Flutter implementation against a design mockup by pixel identity always fails because Chrome and Skia rasterise text, shadows, and gradients differently, so teams either disable visual checks or argue endlessly over what counts as a defect. This Skill defines a measurable parity standard: everything a human decided (tokens, layout order, copy, RTL mirroring) must match exactly, everything a rasteriser decided is compared within stated tolerances (±2 logical px, ΔE00 ≤ 2), and renderer artifacts are declared legitimate differences. ## Core Features & Use Cases - Three-tier parity standard: exact-tier assertions on token values, element order, state signals, copy, and RTL geometry; tolerance-tier measurements via getRect and pixel sampling; a differs tier that is never a finding. - Reproducible capture pipeline: headless-Chrome regeneration of the four 2600x4760 reference sheets, a crop-rect dump via --dump-dom, zero-dependency cropping, and Flutter captures at 390x844 logical / DPR 2 with loadAppFonts, pinned clocks, and seeded fixtures. - Full comparison matrix: 24 paired captures across six screens x {light, dark} x {en/LTR, fa/RTL}, plus no-reference passes for German longest-string overflow, Sorani script rendering, and 200% text scale. - Use Case: Before merging a UI epic, capture the four parity cells per screen, build the side-by-side sheet with a difference column, paste it into the PR description, and back it with widget-test assertions on resolved token values and measured rects. ## Quick Start Use the daybreak-visual-parity skill to capture the Today screen at 390x844 DPR 2 in light and dark for en and fa, crop the matching reference frames, and produce the side-by-side parity sheet for my PR.

Frequently Asked Questions about daybreak-visual-parity

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I compare a Flutter screen against a design mockup?

Capture the Flutter screen at the mockup's exact geometry (390x844 logical, DPR 2) with loadAppFonts and a pinned clock, crop the reference frame from the contact sheet, and build a side-by-side sheet. Back the visual check with widget-test assertions on token values and getRect measurements.

Why does pixel-perfect comparison between Chrome and Flutter always fail?

Chrome and Flutter's Skia/Impeller rasterisers permanently disagree on text shaping, hinting, antialiasing, gradient dithering, and shadow blur maths. A pixel-identity gate fails on font rendering alone and gets disabled, so parity must be defined structurally with stated tolerances instead.

What is the difference between golden tests and visual parity checks?

Golden tests via matchesGoldenFile compare a screen against its own blessed past, so they are self-referential and cannot detect a screen that never matched the design. Parity compares the implementation against an external reference, and goldens only hold parity once it is achieved.

How do I capture Flutter screenshots for visual comparison in widget tests?

Set tester.view devicePixelRatio to 2.0 and physicalSize to 780x1688, call loadAppFonts in setUpAll so glyphs are not Ahem boxes, and set debugDisableShadows to false since the test binding disables shadows by default. Seed fixtures and pin the clock so captures are deterministic.

How do I verify RTL layout mirroring in Flutter?

Pump the widget tree with a RTL locale such as fa and assert directional geometry, for example that a chevron's center sits on the expected side of the screen midpoint. A screenshot alone is insufficient because mirroring bugs hide in gradient origins, chevrons, and directional insets.

When should the design reference be regenerated instead of fixing the app?

Only when the reference itself is wrong, which is a design change: edit the source HTML, regenerate all four PNGs with the documented headless-Chrome command, and commit that separately with rationale. Never re-shoot the reference to match a shipped bug, as that destroys the external check.