Audit and polish a frontend — static HTML/CSS/JS or a built SPA — towards verifiable perfection. The skill exists because production web perf tooling commonly breaks when it pokes at private APIs (Playwright internals, old Lighthouse signatures, unisolated global deps). This skill runs on STABLE apis only, computes exactly (luminance, not eyeballs), and demands a before/after report bound to audit ids.
python3 -m http.server 8377 (or the
project’s dev server). Static files are fine over http://localhost.node scripts/audit.js --url http://localhost:8377/ --mobile --out lh-mobile.json
node scripts/audit.js --url http://localhost:8377/ --desktop --out lh-desktop.json
Default threshold is 100; exit 0 only when every measured category is
at or above it. Add --only <category> to iterate on one category.
python3 scripts/meta_audit.py --html index.html --css main.css css/demo.css --out meta.json
Exit 0 = no violations; exit 1 = violations found.
audit.js color-contrast, meta_audit.py meta:description).--no-headless to watch). No Playwright dependency, no private fields,
no _ws_url transport hacks. CDP port comes from chrome.port (public).require("lighthouse").default automatically.node_modules → NODE_PATH
→ npm root -g. The script explains how to install instead of dying with
Cannot find module:
npm i lighthouse chrome-launcher # in the script's dir
# or globally:
npm i -g lighthouse chrome-launcher && export NODE_PATH=$(npm root -g)
--out) with per-category scores and only the
failed weighted audits (id, title, score, weight) — no 4000-line dump.0 all categories ≥ threshold, 1 below threshold, 2 runner error.Checks and their ids:
| id | what it verifies |
|---|---|
meta:title / meta:title-length |
title present, ≤ 60 chars |
meta:description / meta:description-length |
description present, ≤ 160 chars |
meta:canonical |
canonical link |
meta:og:*, meta:og:size |
OG tags; image must declare 1200×630 (crop-safe) |
meta:twitter:card |
twitter card tag |
meta:json-ld |
any application/ld+json script |
meta:robots |
not blocked with noindex/nofollow |
meta:sitemap-link |
sitemap referenced |
headings:single-h1 |
exactly one h1 |
headings:order |
h1→h6 sequence, no level skips (h1→h3 is a violation) |
tokens:raw-hex |
zero raw hex outside the token block (:root/tokens) |
contrast:wcag-aa |
computed WCAG relative luminance, fg/bg pairs ≥ 4.5:1 |
adaptive:scroll-padding |
fixed header ⇒ scroll-padding-top present |
adaptive:media-queries |
responsive breakpoints exist for tablet widths |
For static projects WITHOUT a build system (plain HTML/CSS/JS), a minimal design system still applies:
:root { --color-*: ...; } layer or a dedicated tokens.css).var(--color-*).meta_audit.py flags any raw hex outside the token block; this is the
enforceable version of “no hardcoded colors”.Social networks crop images differently (WhatsApp square-ish, Facebook center-crop). The skill’s rules, learned the hard way:
og-2026-08-09.png).screenshot() may capture the stale layout. Read
void element.offsetHeight (or getBoundingClientRect()) to force
layout sync, then shoot.og:image:width/og:image:height =
1200/630 so scrapers don’t guess and mis-trim.If position: fixed header exists, anchor jumps hide content underneath.
Fix: html { scroll-padding-top: <header-height> } (+ scroll-margin-top on
the anchors if needed). meta_audit.py reports adaptive:scroll-padding
when this is missing.
lighthouse
headless-shell in the default call.!important spray or target 100 by hiding audits: raise
the underlying metrics (real fix at the root).--out
files you name.localhost vs production differ (no CDN, no real
TLS); state this in the report when it matters.Full loop on a static site:
cd ~/projects/lovii_demo
python3 -m http.server 8377 &
node .../audit.js --url http://localhost:8377/ --mobile --out lh-mobile.json
node .../audit.js --url http://localhost:8377/ --desktop --out lh-desktop.json
python3 .../meta_audit.py --html index.html --css main.css css/demo.css --out meta.json
Iterate on one category until green:
node .../audit.js --url http://localhost:8377/ --mobile --only accessibility
See references/canonical-patterns.md for the canonical sources this skill
is aligned with, and the showcase in docs/showcase/showcase-frontend-perfection-lovii.md.