visual-fidelity
Use when a page emitted by kivo-creator must be proved against its design - rendering the block markup on the local site, screenshotting every section at 390 and 1440 px with the project's Playwright,
SKILL.mdplugins/kivo-creator/skills/visual-fidelity/SKILL.md
GitHubVisual fidelity
Prove fidelity with numbers. verify.mjs produces fidelity.md; you fix what it reports, at most three rounds.
When to use
- After
block-scaffolding-from-design, or after any change to a block used by a/creatorpage. - "Does it match the design?", "verify the page".
- Not for choosing blocks or writing them.
Inputs required
.creator/<run>/withpage.html,emitted.json, specs and references.- The local site URL and runner (session context). Local development only.
- Playwright in the project (same as
html-ingest). - The kivo-creator plugin root (two levels above this skill's folder).
Procedure
Put the page on the local site:
{{runner.wp}} post create .creator/<run>/page.html --post_type=page --post_status=publish --post_title="creator <run>" --post_name=creator-<run> --porcelainKeep the printed id. Get the URL with
{{runner.wp}} post list --post__in=<id> --post_type=page --field=url.Verify:
node <kivo-creator>/scripts/verify.mjs --run=.creator/<run> --url=<page url> --project=.Defaults: widths 390 and 1440, threshold 0.02. The section selector is the one
emit.mjsrecorded inemitted.json(the adapter default,[data-block]for ACF Composer blocks, which scaffolded blocks print). If existing blocks do not print it, pass--selectorwith the wrapper they do print (or pass it toemit.mjsonce), and say so in the report.Read
.creator/<run>/fidelity.mdand the diff images inverify/(red pixels = different).Fix, smallest cause first: a wrong token or utility, a missing field value, spacing from the wrong scale step, an image not imported. Never fix a diff with an arbitrary value, an inline style or a hard-coded string.
Update the page (
{{runner.wp}} post update <id> .creator/<run>/page.html) whenpage.htmlchanged, then run step 2 again. Stop after three rounds.Hand
fidelity.mdto the person with what was fixed and what is left. Delete the page afterwards when the person agrees ({{runner.wp}} post delete <id> --force).
Verification
verify.mjsexits 0 (PASS), or the person accepted the remaining rows after round three.- The lint section of
fidelity.mdsaysNone.
Failure modes
| Symptom | Cause | Fix |
|---|---|---|
found N elements for [data-block] |
Existing blocks do not print data-block, or a block renders twice |
Pass --selector; check nested blocks |
Every row is no reference |
Figma source without FIGMA_TOKEN for references |
Run figma-ref.mjs with a token, or accept a style-and-lint-only report |
| Large diff on image areas only | Media not imported (ids still null) |
Import media (block-scaffolding-from-design step 5) |
size differs on every row |
Fonts not loaded, or a different container width | Load the project's fonts on the page; compare with the right template |
| Style mismatch on font size at 1440 | A token maps to the wrong step | Fix the token mapping or ask for a new token |
Escalation
After three rounds, or when a fix needs a design decision (a new token, a new variant, changing a shared block), stop and hand the report to the person.