/stardust:difffrom stardust
Compares a prototype against its built web page using pixel/layout and structural content+typography probes. Catches stretched images, dropped wraps, mis-slotted headings, font forks, and missing CTAs. Stack-agnostic via profiles (eds | generic).
Ships in stardust. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Two probes that compare a source prototype against a built page. They catch disjoint failure classes — run BOTH; either alone gives a false "looks fine".
Both are framework-agnostic Playwright probes that compare two rendered URLs by
computed style + DOM (not pixels). All stack-specific language lives in a
profile (--profile eds|generic); the comparison logic is generic.
deploy skill's Step 10) — use --profile eds.--profile generic.Not for: a single static file with no JS decoration (use the build/harness URL so components are decorated — a raw .plain.html has no roles to classify).
| Probe | Script | Sees | Blind to |
|---|---|---|---|
| Pixel / layout | skills/diff/scripts/visual-diff.mjs | stretched images (vs the source), dropped max-width wraps, blank renders, surface/ground colour flips, heading size/face deltas, image-count gaps | "right text, wrong slot"; a dropped CTA (full pixels, plausible colours → no flag) |
| Structural content + type | skills/diff/scripts/content-diff.mjs | MISSING / ROLE-SWAPPED headings·eyebrows·CTAs, invented/dropped body copy, rendered-FACE font forks (width probe); dropped placeholder/aria-label/title values, missing/wrong/moved icons — on the main root AND the header/footer chrome roots by default | geometry / layout regressions |
content-diff extracts an ordered, role-classified inventory (heading / eyebrow /
cta+href / body) from each root — the --main root(s) plus, by default, the header
and footer chrome roots — classifying by computed style + tag so the prototype's DOM
and the built DOM compare symmetrically, then diffs them root by root; a second inventory per
root carries the placeholder / aria-label / title values and the icons.
# Prereq 0: playwright importable from the project root (node -e "import('playwright')"), else
# npm i -D playwright pixelmatch pngjs cheerio --legacy-peer-deps
# (never --no-save; extract SKILL.md § Setup). Run the copied scripts from the project
# root: ESM resolves from the script.
# Copy the WHOLE skills/diff/scripts/ dir: content-diff imports its local diff-profiles.mjs
# AND content-inventory.mjs (deploy keeps its own synced copies for #93/#94), plus the
# master's scripts/ (browser.mjs, the one entry to the browser) in stardust/scripts/stardust/.
# Prereq: a RENDERABLE source. Static → serve from its own dir (python3 -m http.server).
# The build URL must be the DECORATED page (live/preview or a local harness), not raw markup.
# ONE server, ONE port — probe before starting one (curl is always present, lsof is not):
curl -sI localhost:8791/ | head -1 # 200/404 = something serves the port; no line = free
curl -sI localhost:8791/<prototype>.html | head -1 # 200 = it serves YOUR dir: reuse it
command -v lsof >/dev/null && lsof -nP -iTCP:8791 -sTCP:LISTEN # optional: names the pid
# Nothing answered → start yours. A foreign server: never kill it; use a per-project port
# (the traps: ../deploy/SKILL.md § Step 10).
PROTO="http://localhost:8791/<prototype>.html"
BUILD="https://<branch>--<repo>--<owner>.aem.page/<path>" # or http://localhost:3000/<harness>
# 1. PIXEL/layout
node skills/diff/scripts/visual-diff.mjs "$PROTO" "$BUILD" --profile eds --sections ".hero"
# 2. STRUCTURAL content + type
node skills/diff/scripts/content-diff.mjs "$PROTO" "$BUILD" --profile eds # --json dumps both inventories
Flags (both tools): --profile eds|generic (default eds), --width <px> (default 1280),
--main <selector[,selector…]> (content root; content-diff defaults from the profile and takes a
comma-separated list — every root is inventoried and diffed on its own and each finding line
carries its root as [root]; visual-diff takes one selector, default main), content-diff only:
--chrome / --no-chrome (default on — the header and footer roots, resolved as the first
<header>/[role=banner] and <footer>/[role=contentinfo] outside the main root(s), are
compared beside it; a side lacking one is measured as empty there and the root line says so),
plus the live-target set (shared engine: skills/stardust/scripts/live-session.mjs — real Chrome presents its
user agent without the headless token and matching client hints; automation-signal handling stays on unless
STARDUST_STEALTH=0; every context sends standard Chrome request headers, and live navigations to one host are paced
STARDUST_LIVE_PACE_MS apart (default 1000), capped by STARDUST_LIVE_MAX_PARALLEL (default 2)
and STARDUST_LIVE_MAX_WAIT_MS (default 300000; 0 disables):
--ua <string> — user agent override (default: the browser's own with HeadlessChrome replaced by Chrome).
--wait-until <state> — goto wait override. Default rule (one shared
defaultWaitUntil in skills/stardust/scripts/live-session.mjs), decided per URL side, three tiers:
networkidle (local prototypes / harnesses, unchanged);.aem.page, .aem.live, .hlx.page,
.hlx.live → networkidle (they decorate asynchronously and reliably reach
networkidle; measuring at domcontentloaded reads the pre-decoration DOM — flaky
false reds / FONT FORK on deploy Step 10);domcontentloaded (live sites with analytics beacons
never reach networkidle).--wait-until overrides all three tiers.
--dismiss [sel,...] — dismiss overlays on both sides: cookie consent (clicked, not
removed) AND timed marketing/newsletter modals, plus optional extra site-specific
selectors; the mouse is parked afterwards.
--headed — escalation for bot-managed sites: the same real Chrome plus the challenge-solve
window and existing launch flags, window-free; STARDUST_STEALTH=0 disables the flags and
context spoof, while STARDUST_HEADED_WINDOW=1 opens a window.
--locale <tag> — pin Accept-Language + context locale (geo-redirecting sites capture a
different locale per run otherwise).
visual-diff also: --out <dir>, --sections a,b (per-section screenshots).
A bot-management challenge/blocked interstitial on either navigation fails LOUD with
exit 3 — it is never measured as the source. Escalate with --headed; if that is still
blocked, the site needs crawl.mjs-class capture and the check cannot run unattended.
A plain (non-challenge) HTTP error on either side — e.g. a 404 build side, normal on aem.page before preview propagation — is NOT fatal: the probe logs a loud warning, measures the error page, and the flags (BLANK RENDER / content asymmetry) carry the signal with exit 0. That is the probes' advisory contract: 0 = ran (flags advisory), 1 = probe error, 3 = bot challenge.
content-diff reconciles a prototype with its build; against a LIVE commerce origin its per-node
findings were false, and the pixel gate passed a page whose every card was clipped
(../replica/reference/source-fidelity-gate.md § The all-pages published-origin gate). Three
probes ask the checkable questions; all load both sides in the same window-free real-Chrome tier
and settle them the same way (scripts/measure-live.mjs).
ORIGIN="https://www.example.com/<path>"; SERVED="https://main--repo--owner.aem.live/<path>"
node stardust/scripts/diff/clip-probe.mjs "$SERVED" [--json clip.json] # D1: exit 2 on cut / hidden text or controls
node stardust/scripts/diff/content-presence.mjs "$ORIGIN" "$SERVED" [--variable "<selO>=<selE>"] # D2: exit 2 on MISSING/HIDDEN link or heading
node stardust/scripts/diff/unit-geometry.mjs "$ORIGIN" "$SERVED" --unit "<selO>=<selE>" --n 2 # D3: exit 2 on an element off / hidden / missing
Reading: a 🔴 clip group names the clipper (a fixed-height box with overflow: hidden) — fix
that block's CSS, never the content. HIDDEN LINK = in the DOM but clipped (CSS); MISSING LINK =
not served (encoder); CONTROL STATE = same control, another value; COUNT … = session-variable
region, confirm by eye. The origin side fails loud on HTTP ≥ 400 (exit 4) and a bot challenge
(exit 3). Traps: an infinite-scroll origin keeps loading under the settle — mark the region
--variable; a live origin without <main> compares whole page against whole page (the scope
line says so), header / footer left to the chrome crop gate unless --chrome; the count-phrase
and "read more" heuristics are English word lists (--count-words, --more-words).
Every probe above sees the header at rest (pointer parked, motion frozen), so it passes with every menu wrong; runs shipped boilerplate click dropdowns for hover mega menus, search and cart as plain links, a static list for a drill-down drawer. The header's behaviour is recorded from the source once and the build compared with it:
node stardust/scripts/diff/chrome-explore.mjs "$ORIGIN" stardust/chrome/header-contract.json # 1440 + 390
node stardust/scripts/diff/chrome-explore.mjs "$SERVED" stardust/chrome/header-build.json --max-requests 0 --pace-ms 0 --reload-pause-ms 0 # our host: source-edge protections do not apply
node stardust/scripts/diff/chrome-compare.mjs stardust/chrome/header-contract.json stardust/chrome/header-build.json \
--profile replica --json stardust/chrome/header-parity.json # functional under redesign and reskin
The explorer hovers (desktop), clicks and keys every header control and records each opened state (links,
headings, crop, aria-expanded, focus, scroll lock, motion, close paths), nested levels within --max-states 400 --max-depth 4, search typeahead and submit, and the header scrolled; its summary line sizes the work. The comparer
exits 2 on a missing control or state (hover rebuilt as click included), panel links, keyboard, close paths or
scroll lock; replica adds open-state crops (2 %), motion (max(80 ms, 25 %)) and scroll states. Only the site
owner clears a finding: stardust/chrome/header-decisions.json ({ decisions: [{ finding, decision, reason, by, at }] }), never signed by an agent. It runs at extract --prep (the contract), on the foundation shell and in
deploy Step 10, on the live host before handover (done-check header_parity), and in qa. Crops stay in
stardust/.work/chrome/.
--json accepted, not a finding), heading → body/eyebrow 🟡 ROLE DOWNGRADE. Lost visually hidden (sr-only) text is 🟡 MISSING SR-ONLY TEXT; a lost sr-only link stays 🔴 MISSING CTA.<img> (SAME ICON) is accepted. A laid-out 0×0 icon is not one.<button> host that anchors as button#n): CONFIRM its placement. 🟡 ICON KIND (pixels not compared, e.g. a hidden icon) and every EXTRA.🔴 MISSING PLACEHOLDER [header]: … — and the report prints one block per root (root "main", root "header", …; a root a side lacks is measured as empty there and the line says which side).document.fonts.check). source X→sys means the prototype named font X but never loaded it and fell back to system — the build self-hosting the intended fallback is then CORRECT, not a bug. All forked lines are grouped into one advisory.Pass bar: visual red flags none/justified AND content-diff 0 🔴 and 0 nothing-lost 🟡 (../replica/reference/source-fidelity-gate.md § Pass bar item 1). Re-run BOTH after each fix.
skills/diff/scripts/diff-profiles.mjs holds them. A profile supplies the source/target labels,
per-flag remediation hints, the font-delta threshold, the default content-root
selector, and the eyebrow classifier thresholds. The engines carry no stack
strings.
eds (default) — Edge Delivery / DA remediation language + the stardust deploy skill's finding numbers.generic — neutral source/build language for any stack.Add a profile by copying generic in diff-profiles.mjs and editing hints.
The structural probe's classifier + differ live in skills/diff/scripts/content-inventory.mjs
(deploy imports its synced copy). They measure with the same instrument as two gates of the stardust deploy skill:
section-schema.mjs (the pre-code ENCODE/DECODE contract, deploy #93) and block-roundtrip.mjs
(the in-loop per-block gate, deploy #94 — the same inventory diff, run per block at authoring time
against a local decorate() harness, no DA needed, exit-code gated). Run the in-loop gate while
converting; run THIS skill's two probes as the final post-deploy proof. A defect first found here
that the in-loop gate passed = the delivery pipeline reshaped the content in transport — fix the
block's flattened-shape fallback, not the authoring.
Call both scripts in a validation phase and gate on the output, as deploy's Validate phase does on a served,
decorated build (local harness or branch preview): fix visual-diff's STRETCHED/FLUSH-LEFT/SURFACE-GROUND/GAP/
HEADING FACE flags (unless justified — a font substitution is one HEADING FACE ×N line) and every content-diff 🔴,
confirm 🟡/🟠, loop until both are clean.
CHANGELOG.md (opens in a new tab)scripts/chrome-compare.mjs (opens in a new tab)scripts/chrome-explore.mjs (opens in a new tab)scripts/clip-probe.mjs (opens in a new tab)scripts/content-diff.mjs (opens in a new tab)scripts/content-inventory.mjs (opens in a new tab)scripts/content-presence.mjs (opens in a new tab)scripts/diff-profiles.mjs (opens in a new tab)scripts/image-signature.mjs (opens in a new tab)scripts/measure-live.mjs (opens in a new tab)scripts/test/chrome-compare.test.mjs (opens in a new tab)scripts/test/chrome-explore.test.mjs (opens in a new tab)scripts/test/chrome-fixtures.mjs (opens in a new tab)scripts/test/clip-probe.test.mjs (opens in a new tab)scripts/test/content-diff.test.mjs (opens in a new tab)scripts/test/content-presence.test.mjs (opens in a new tab)scripts/test/image-signature.test.mjs (opens in a new tab)scripts/test/unit-geometry.test.mjs (opens in a new tab)scripts/test/visual-diff.test.mjs (opens in a new tab)scripts/unit-geometry.mjs (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
16 skills in this plugin
/auditFull three-perspective audit of an existing website from one URL — design (tensions + concrete improvement opportunities), SEO/technical, and LLM/AI-search visibility — plus Core Web Vitals, synthesized into a scored, evidence-bound report. Use when the user asks to "audit this site", "site audit", "design audit", "SEO audit", "why is my site underperforming", "LLM visibility", "how does my site look to AI", or invokes `$stardust audit` (`/stardust:audit` in Claude Code) <url>./deployConvert per-page styled HTML prototypes (stardust under stardust/prototypes/**, or claude-design / Mobirise / Relume / Lovable / v0 / Figma-derived pages, or JSX prototypes pre-rendered to HTML, often under samples/) into Edge Delivery Services (EDS / AEM) blocks and content pages, then deploy via DA. Each prototype section becomes one EDS block; the prototype's per-section CSS becomes that block's CSS scoped under the block class. Use when the user wants to lift styled per-page HTML prototypes into a working EDS site under blocks/ and content/./directSet a redesign direction for an existing website. Analyzes the user's intent, picks a palette and visual direction, and writes the target spec (PRODUCT.md, DESIGN.md, DESIGN.json) plus a reasoning trace at stardust/direction.md. Use when the user asks to redesign a site, refresh the design, set a new design direction, define a redesign target, or invokes `$stardust direct` (`/stardust:direct` in Claude Code).npx claudepluginhub adobe/skills --plugin stardustOther plugins' skills for the same job