diff --git a/.changeset/qprobe-design-command.md b/.changeset/qprobe-design-command.md new file mode 100644 index 0000000..c3b3920 --- /dev/null +++ b/.changeset/qprobe-design-command.md @@ -0,0 +1,5 @@ +--- +"@questpie/probe": minor +--- + +Add `qprobe design ` — measure the rendered UI for layout and design-token defects, deterministically and without a vision model. Launches headless Chromium, and for each `--viewport` runs a DOM geometry scan (overflow, truncation, collapse, sibling overlap, near-miss misalignment, tap targets, sub-16px input fonts) plus a CSS-variable token-conformance scan (off-palette colors, off-token box-shadows, off-token border-radii), printing JSON findings. The scanners are shared verbatim with the agent-board `agent-board-design-qa` skill. diff --git a/src/browser/design-scanners.ts b/src/browser/design-scanners.ts new file mode 100644 index 0000000..37ec469 --- /dev/null +++ b/src/browser/design-scanners.ts @@ -0,0 +1,125 @@ +// Deterministic design-QA scanners, injected via page.evaluate(). +// +// Each is an IIFE *string* that runs in page context and returns an array of +// findings: { layer, severity, selector, prop, measured, expected, message }. +// They are kept as strings (not imported functions) on purpose: the exact same +// source is shared with the agent-board `agent-board-design-qa` skill, which +// pastes them into whatever page-eval tool a harness exposes. Keeping one source +// of truth means a fix here is a fix there. They are dependency-free and +// backtick-free so they embed cleanly in either place. +// +// Both were hardened by dogfooding on a real board UI: read the viewport from +// documentElement.clientWidth (the eval context can report 0), report only the +// outermost overflowing element, skip SVG internals, ignore native