stardust:reskin — same content, donor design
The user has a site (the content source) and a design that already
exists somewhere else (the donor: another live site, or a directory
of static HTML prototypes; Figma is future scope). Reskin rebuilds the
content site's pages so that every visible byte of content survives —
text, ordered images, CTAs, SEO metadata — while the surface comes
entirely from the donor's tokens and module vocabulary.
The two halves have different contracts:
- Content is non-negotiable. The gate is byte equality of
whitespace-normalized visible text, the ordered visible-image set,
and full metadata carry-over. Not "close" — equal, after an
explicitly declared, executable normalization ledger.
- Design is flexible. Content is re-laid-out onto donor modules; a
carousel may become a static card grid, a sidebar may become a band.
Structure (element counts, tag sequences) is informational, never
gating — a reskin re-structures markup by design.
The decisive rule, validated in the UC2-E1 experiment (a healthcare site ×
a fintech donor: 2281/2281 text bytes, 7/7 images, 47/47 slots, 13/13 metadata,
17/17 donor-token probe): the page is generated programmatically from
the captured content model — content strings are never retyped. Byte
fidelity then holds by construction and the content gate becomes a
regression check instead of a debugging tool.
Inputs
<content-url> — required. The site whose content is preserved.
- Donor, exactly one of:
--donor <url> — a live site whose design system is adopted.
--donor-dir <path> — a directory of local static HTML
prototypes (claude-design / Mobirise / Relume / Lovable / v0 /
hand-coded). Served on localhost and captured through the same
path — recipe in reference/donor-sources.md § Local prototypes.
--donor-figma <url> — not yet implemented. The contract is
defined (reference/donor-sources.md § Figma) but the adapter is
future scope. Tell the user exactly this: "Figma donors are not
implemented yet. Export the frames as static HTML prototypes (or
point me at a live staging URL of the design) and re-run with
--donor-dir / --donor. The Figma adapter — variables→palette,
text styles→type, frame screenshots→vision references, provenance
class figma-mcp — is specced in
skills/reskin/reference/donor-sources.md and will land in a
later release." Do not improvise a partial Figma capture.
--pages <slug,slug,...> — optional. Restrict the content capture
to specific pages. Default: the archetype set (one page per page
family; a spec's archetypes.json names them; scale to siblings happens in Phase 6 via migrate).
--scope <selectors> — optional. Pre-declare the content-root
scope for a single-page run (comma-separated, ! suffix keeps a
scope whole; see reference/content-model.md § Scope declaration).
Without it, run the scope-discovery procedure per page.
Setup
- Run the master skill's setup (
../stardust/SKILL.md § Setup):
impeccable dep check, context loader, state read. Flow. Stamp
state.json.flow: "reskin" if unset
(../stardust/reference/state-machine.md § Flow keys); if another
flow is set, print it and the switch command
($stardust reskin --switch-flow) instead of running.
- Playwright import-resolvability probe — same contract as
../extract/SKILL.md § Setup:
node -e "import('playwright').then(()=>process.exit(0))" from the
project root; on failure
npm i -D playwright --no-save --legacy-peer-deps. Re-run the
probe at the start of every phase that renders — a --no-save
install is pruned by any later real npm i.
- Copy the scripts into the project. ESM resolves
import('playwright') from the script's directory and the plugin
tree ships no node_modules. Copy skills/reskin/scripts/* (all
five files — capture-content.mjs and dom-equality.mjs import
source-normalize.mjs as a sibling) byte-identical to
stardust/scripts/reskin/, and skills/diff/scripts/ live-session.mjs to stardust/scripts/diff/ — every reskin gate
script (capture-content, dom-equality, donor-probe, and
slot-coverage) imports it unconditionally at startup, regardless
of target type: without the copy each one exits 2 immediately,
even for --help or a local-file --rendered target. It supplies
ALL live-target hardening (real Chrome's own identity + standard
headers, challenge detection, --headed escalation), resolved from
../diff/ next to ../reskin/, so keep the two dirs siblings.
Run the copies.
- Origin collision — if
stardust/state.json records a different
site.originUrl, stop and ask before mixing sites, per
../extract/SKILL.md § Setup.
Procedure
Phase 1 — INGEST DONOR
The donor's design system is captured separately from the content
site, into stardust/canon-source/. Full recipes per donor type in
reference/donor-sources.md; summary:
- Live URL (
--donor <url>): invoke
$stardust extract <content-url> --design-source <donor-url> — the
existing skill, unchanged. It lands in stardust/canon-source/: the
donor's pages/, assets/ (screenshots included),
_brand-extraction.json, _crawl-log.json, and a descriptive
DESIGN.md + DESIGN.json, and stamps
state.json.designSource = { url, capturedAt, path } — see
../extract/SKILL.md § Cross-site brand sources.
- Local prototype dir (
--donor-dir <path>): serve the directory
on localhost (python3 -m http.server <port> --directory <path>)
and run the same --design-source capture path against the
localhost origin. Record the real provenance (localhost serve of
<path>) in canon-source/_crawl-log.json. Recipe details —
page listing, index-less directories, port hygiene — in
reference/donor-sources.md § Local prototypes.
- Figma (
--donor-figma): FUTURE. Surface the exact message from
§ Inputs and stop.
Then author two reskin-owned donor artifacts (contracts in
reference/donor-sources.md):
stardust/reskin/donor-tokens.json — the curated, probe-able
token sheet: palette roles, type ramp, layout metrics, button
specs, radii, shadows, motifs — every value a computed-style string
the Phase 5 probe can assert verbatim. Curated from
canon-source/DESIGN.json + _brand-extraction.json + the raw
computed styles; cites the donor page each value came from. On a
bounded donor capture (a single donor page, no full
--design-source run) there is no DESIGN.json,
_brand-extraction.json, or designSource stamp to curate from —
the token sheet is authored entirely from raw computed-style
sampling of the donor page, a first-class parallel path
(reference/donor-sources.md § Two first-class token-sourcing
paths).
stardust/reskin/donor-modules.md — the enumerated module
vocabulary (M1..Mn): one row per donor module with where-seen
screenshot evidence and an anatomy description. This is the closed
set the Phase 3 mapping brief maps onto.
The pin-one-reference-page rule (hard). Real donors run multiple
design systems concurrently — the experiment's donor served radius-4px
/ 1266px on its homepage and pill-radius / 1080px on older product
pages. Consolidating across them produces a chimera no live page ever
shipped, and the token probe then asserts against nothing. When donor
pages disagree on a token, pin ONE donor reference page per module
family, record it in donor-tokens.json (curatedFrom + a note
naming the reference page), and demote the other pages to
corroboration.
Phase 2 — CONTENT-MODEL CAPTURE
The new capability: a byte-oriented capture of each content page —
distinct from extract's design-oriented capture. Run the ported
capture script per page:
node stardust/scripts/reskin/capture-content.mjs \
--url <page-url> \
--scope '<sel1,sel2!,...>' \
--normalize stardust/reskin/normalize/<slug>.mjs \
--out stardust/reskin/content-model/<slug>/
It writes stardust/reskin/content-model/<slug>/content-model.json
(full contract in reference/content-model.md): per section-slot —
headings with levels, eyebrows and other leftovers, body paragraphs,
list items, CTAs with absolute hrefs, ordered visible images
(currentSrc + alt), plus the ordered stream (ordered) — the
same content as kind-tagged nodes in document order with nesting and
separator flags, the render surface Phase 4 consumes; page-level —
full SEO metadata (title,
description, canonical, OG, Twitter, JSON-LD, lang, favicon), the
whitespace-normalized visible text of the scope (the content-gate
reference string), and a full-page screenshot.
Two declarations are mandatory per page, because they are the
experiment's top two failure modes:
- CONTENT-ROOT SCOPE declaration. Naive scoping silently dropped
30% of the experiment page's content — the hero and a banner
carousel lived inside
<header>, outside the obvious #content
root, and byte equality would have "passed" against the incomplete
reference. Never trust main or #content blind. Run the
scope-discovery procedure (reference/content-model.md
§ Scope discovery): compare the captured scope text against the
whole-body text and the page screenshot, verify the h1 is inside
the scope, widen with comma-separated multi-scope selectors until
everything visible in the screenshot that isn't declared chrome is
in the model. Chrome exclusions (nav, footer) are declared deltas
(D1-style), not silent omissions. The capture script prints a
coverage line (bodyTextLen / scopeTextLen / h1InScope) to make
the check mechanical.
- EXECUTABLE NORMALIZATION LEDGER. Cookie-consent chrome removal,
carousel de-duplication (hidden slides are absent from
innerText;
clone slides duplicate it — rotating carousels break byte
determinism), and any page-specific cleanup live in a per-page
ledger module stardust/reskin/normalize/<slug>.mjs that extends
the shared default (scripts/source-normalize.mjs). The same
ledger file is passed verbatim to the capture and to every gate
(--normalize), so the gate measures exactly the normalization the
capture declared. The ledger is code, not prose. Format in
reference/content-model.md § Normalization ledger.
Phase 3 — MAPPING BRIEF
Author stardust/reskin/mapping.md — the cross-origin mapping brief.
Full contract and entry schema in reference/mapping-brief.md. Per
every content slot in the content model:
- assigned donor module id (from
donor-modules.md's closed
vocabulary) + a one-line rationale grounded in slot anatomy vs
module anatomy;
- status ∈
{mapped, new-module, chrome, carried-invisible} —
the last for sr-only/visually-hidden content inside the byte scope
(carried verbatim into an equivalent hidden element, no donor
module; reference/mapping-brief.md § Status semantics).
Gates before any rendering:
- ≥ 80% of content slots
mapped onto named donor modules. Below
that, the donor vocabulary doesn't cover this content — stop and
surface (see § Stop conditions).
- Every
new-module entry is explicitly composed from donor
tokens (name the tokens it borrows: input spec + primary button
spec, etc.) and listed in the brief's stats block. New modules are
never silently improvised mid-render.
- Chrome swaps documented — nav/footer replaced by donor chrome
carrying the source's links is a declared delta, excluded from the
content-gate scope.
- Casing / text-transform policy declared. The donor may render
eyebrows uppercase (or the source may — Chrome's
innerText
reflects text-transform, so captured text is rendered-case).
The underlying text stays byte-faithful; casing is applied via CSS
text-transform only, never by editing the string. Policy details
in reference/mapping-brief.md § Casing policy.
Composite source sections (one wrapper div holding two logical
regions) are split into atomic slots in the brief — section ≠ slot.
Phase 4 — PROGRAMMATIC RENDER
The decisive validated rule: the page is GENERATED from
content-model.json — never retyped by hand. Write a renderer
script per archetype (stardust/reskin/renderers/<archetype>.mjs,
modeled on the experiment's render-reskin.mjs) that:
- reads the page's
content-model.json and interpolates every
visible string, href, and image URL from the model (HTML-escaped) —
if a string appears in the output HTML but not in the model, the
renderer is wrong;
- takes each slot's structure from the ordered stream
(
sections[].ordered, reference/content-model.md § The ordered
stream): kind-tagged nodes in document order, nesting preserved
(a CTA wrapping its heading and vice versa), sep flags marking
zero-separator inline joins. The stream is innerText-consistent
by construction (its text nodes are sliced from the parent's
rendered innerText — the byte-gate basis), so emitting it
verbatim is safe. Emit nodes in stream order; emit
sep: "" neighbours with no whitespace between them (inline);
never reorder, and never reconstruct order or separators from
visibleText —
the first field run did exactly that (per-type arrays matched
greedily against visibleText as an oracle) and burned three
debug rounds on duplicate identical strings, both directions of
CTA/container nesting, and zero-separator inline li runs, all
of which the stream now captures structurally;
- renders
formControl nodes as equivalent controls, not text:
a <select> carrying the captured option texts verbatim, in
order; inputs/textareas carrying value/placeholder — restyled
with donor tokens (the new-module composition rules apply), never
flattened to prose and never dropped. A select's option text is
part of the source's innerText, so dropping the control fails
the byte gate with nothing structured to render from
(reference/content-model.md § Slot taxonomy, formControls);
- carries the metadata block verbatim into
<head> (title,
description, canonical, OG, Twitter, JSON-LD — including source
garbage like broken JSON-LD URLs: fidelity over repair; flag
such items for the human in the run report, never silently fix or
silently keep);
- takes its surface exclusively from
donor-tokens.json (emitted as
CSS custom properties) + the donor module patterns assigned in
mapping.md. Use the rendered-page conventions the Phase 5 probe
asserts against: content in <main>, .container for the measure,
.btn for the donor primary button (reference/gates.md
§ Rendered-page conventions);
- writes
stardust/reskin/pages/<slug>.html, self-contained.
Renderers may parse a single node's text apart (split a list-item row
into kicker/date/title) but must fail loudly (throw) when a parse
doesn't reproduce the node's text — a silent partial parse is a silent
content drop. A slot whose orderedVerified is false is inspected
before rendering, never trusted blind; when inspection shows stream
text genuinely absent from the slot's visibleText, the
sanctioned fallback is to drop that text before rendering and
record the drop in the model's provenance — filtering ghosts against
visibleText is the documented resolution, distinct from the
forbidden order-reconstruction move
(reference/content-model.md § When orderedVerified is false).
Phase 5 — GATES
Three gate families per page; commands, pass bars, tolerances, and
failure modes in reference/gates.md. Serve or file://-address the
rendered page and run:
(a) CONTENT GATE — all three must pass:
node stardust/scripts/reskin/dom-equality.mjs \
--source <page-url> --source-scope '<declared scope>' \
--normalize stardust/reskin/normalize/<slug>.mjs \
--rendered stardust/reskin/pages/<slug>.html --rendered-scope main \
--report stardust/reskin/reports/<slug>-content-gate.md
node stardust/scripts/reskin/slot-coverage.mjs \
--model stardust/reskin/content-model/<slug>/content-model.json \
--rendered stardust/reskin/pages/<slug>.html \
--report stardust/reskin/reports/<slug>-slot-coverage.md
dom-equality.mjs (vendored + adapted from github.com/aemcoder/skills,
Apache-2.0) gates on whitespace-normalized visible-text byte
equality and the ordered, URL-normalized visible-image set;
element count and tag sequence are reported but informational.
slot-coverage.mjs additionally proves every model slot present
(slot text substring, every CTA as a (text, absolute-href) pair,
every image) and asserts metadata carry-over field by field.
(b) DESIGN-ADOPTION GATE:
node stardust/scripts/reskin/donor-probe.mjs \
--tokens stardust/reskin/donor-tokens.json \
--rendered stardust/reskin/pages/<slug>.html \
--report stardust/reskin/reports/<slug>-donor-probe.md
Computed-style assertions of donor token values on the rendered page —
bg/fg, font-family token string, display weight, button spec,
container width, band palette, section rhythm. Tolerances (exact for
colors/radius/family; ±2px button padding; ±20px container; ±16px
section rhythm) documented in reference/gates.md § Tolerances.
Then the side-by-side judgment: open the rendered page next to the
donor reference-page screenshots (canon-source/assets/screenshots/)
and judge adoption with your eyes — the probe proves tokens, the
eyeball proves the page reads as the donor. Record the verdict.
(c) Sanity — no horizontal overflow at 1440 and 360 (donor-probe
runs this automatically; --widths to override).
One fix iteration per gate family — one for the content gate,
one for design-adoption/sanity. On a failure in a family, fix once,
re-run all gates (a fix for one gate can break another). Residual
failures after a family's iteration is spent are logged in
stardust/reskin/ledger.json under the page's residuals[] — never
silently absorbed, never looped on indefinitely. (Both field runs
support the budget: the validation experiment spent one iteration on
360px chrome; the smoke run spent exactly one per family — a
content-side separator emission fix and a sanity-side 360px chrome
fix. A single shared iteration would have forced a false residual;
per-family keeps the loop bounded without absorbing real failures.)
Phase 6 — HANDOFF
Reskin owns the archetype pages; scale and shipping are the existing
pipeline, unchanged:
- Scale via the stardust
migrate skill (../migrate/SKILL.md) with the
donor-pinned target (the state.json.designSource stamp Phase 1
wrote is exactly what direct/migrate read for donor pinning;
a bounded donor capture wrote no stamp — record the donor origin
in the handoff instead, reference/donor-sources.md § Two
first-class token-sourcing paths).
Same-type sibling pages render at the sibling tier against the
gated archetype. Content rules are the ones reskin already
enforces — ../migrate/reference/content-preservation.md is
inherited wholesale.
- Ship via the stardust
deploy and rollout skills, unchanged. Blocks
written for donor modules obey the Experience Workspace editability
contract (deploy SKILL.md § 8, EW1–EW10) and pass the EW gate
(block-roundtrip --ew) before they are done.
Reskin writes its own state under stardust/reskin/ — ledger.json
holds per-page status (captured → mapped → rendered → gated), gate
results, and residuals. It makes no changes to the core state
machine (../stardust/reference/state-machine.md); the only
state.json touch is the designSource stamp that extract itself
writes in Phase 1.
What reskin never does
- No content rewriting or summarizing. Not headlines, not body,
not CTA labels, not casing-by-editing. Faithful ≠ clean: source
garbage is carried verbatim and flagged, not fixed.
- No invented sections. Every rendered slot traces to a
content-model slot; every module traces to
donor-modules.md or an
explicit new-module entry in mapping.md.
- No donor-token drift. No colors, fonts, radii, or spacing
outside
donor-tokens.json. Licensed donor fonts are adopted as the
family token string with local fallback, never rebundled.
- No silent slot drops. Anything excluded from the gate scope is a
declared chrome delta or a ledger normalization — declared in
mapping.md, executable in the normalize module.
Stop conditions
- Donor capture fails (bot-block past the headed fallback,
prototypes dir unservable) — surface extract's error verbatim.
- Mapping ratio < 80% — the donor vocabulary can't carry this
content. Ask: widen the donor capture (more donor pages → more
modules) or accept a larger explicit new-module list.
- Scope undecidable — the content page's visible content cannot be
covered by any selector set (heavy shadow-DOM, iframe-embedded
content). Surface with the screenshot evidence.
- Figma donor requested — future scope; exact message in § Inputs.
Outputs
| Path |
Purpose |
stardust/canon-source/ |
Donor capture + descriptive DESIGN.md/json (extract --design-source, unchanged) |
stardust/reskin/donor-tokens.json |
Curated probe-able token sheet, pinned to one reference page |
stardust/reskin/donor-modules.md |
Enumerated donor module vocabulary (M1..Mn) with screenshot evidence |
stardust/reskin/content-model/<slug>/content-model.json |
Byte-oriented per-page content model (+ source screenshot) |
stardust/reskin/normalize/<slug>.mjs |
Per-page executable normalization ledger (shared capture ↔ gates) |
stardust/reskin/mapping.md |
The mapping brief: every slot → donor module, status, rationale |
stardust/reskin/renderers/<archetype>.mjs |
Programmatic renderers (model in, HTML out) |
stardust/reskin/pages/<slug>.html |
Rendered reskin pages |
stardust/reskin/reports/ |
Per-page gate reports + screenshots |
stardust/reskin/ledger.json |
Per-page status, gate results, residuals |
stardust/scripts/reskin/ |
Project-local copies of the five skill scripts |
References
reference/donor-sources.md — the three donor types and their
capture recipes; pin-one-reference-page; donor-tokens.json and
donor-modules.md contracts; the Figma future contract.
reference/content-model.md — the capture contract: slot taxonomy,
the ordered stream (the render surface), scope-discovery procedure,
normalization ledger format, provenance.
reference/mapping-brief.md — entry schema, the ≥80% gate,
new-module composition rules, casing policy.
reference/gates.md — both gates' commands, pass bars, tolerances,
failure modes, residual logging.
../extract/SKILL.md § Cross-site brand sources — the
--design-source donor-capture path Phase 1 delegates to.
../migrate/reference/content-preservation.md — the content rules
reskin inherits (and tightens to byte level).
../diff/SKILL.md — the pixel + structural probes; reuse them as a
supplementary build-side check after Phase 6 deploy, --profile eds.
1---2name: reskin-23description: Rebuild an existing site's pages with byte-faithful content on a separately-defined donor design system — another live site, or local static HTML prototypes (Figma donors are contract-defined, not yet implemented). Content fidelity is gated byte-level (text, ordered images, SEO metadata); design application is flexible (content re-laid-out onto donor modules). Use when the user says "reskin my site with this design", "apply this design system to my content", "restyle my site to look like <other site>", "new design, same content", "rebrand my site using these prototypes", or names a content site plus a design donor. NOT for redesigning from intent (that's the stardust core extract/direct/prototype chain) and NOT for keeping the current design while migrating (that's the replica flow).4license: Apache-2.05compatibility: Requires Node 22+, Playwright with Chromium resolvable from the project, playwright-cli on PATH, and the impeccable skill (github.com/pbakaus/impeccable) installed alongside stardust.6metadata:7 source: https://skillmd.com/skills/adobe/reskin-28---910# stardust:reskin — same content, donor design1112The user has a site (the **content source**) and a design that already13exists somewhere else (the **donor**: another live site, or a directory14of static HTML prototypes; Figma is future scope). Reskin rebuilds the15content site's pages so that every visible byte of content survives —16text, ordered images, CTAs, SEO metadata — while the surface comes17entirely from the donor's tokens and module vocabulary.1819The two halves have different contracts:2021- **Content is non-negotiable.** The gate is byte equality of22 whitespace-normalized visible text, the ordered visible-image set,23 and full metadata carry-over. Not "close" — equal, after an24 explicitly declared, executable normalization ledger.25- **Design is flexible.** Content is re-laid-out onto donor modules; a26 carousel may become a static card grid, a sidebar may become a band.27 Structure (element counts, tag sequences) is informational, never28 gating — a reskin re-structures markup by design.2930The decisive rule, validated in the UC2-E1 experiment (a healthcare site ×31a fintech donor: 2281/2281 text bytes, 7/7 images, 47/47 slots, 13/13 metadata,3217/17 donor-token probe): **the page is generated programmatically from33the captured content model — content strings are never retyped.** Byte34fidelity then holds by construction and the content gate becomes a35regression check instead of a debugging tool.3637## Inputs3839- `<content-url>` — required. The site whose content is preserved.40- Donor, exactly one of:41 - `--donor <url>` — a live site whose design system is adopted.42 - `--donor-dir <path>` — a directory of local static HTML43 prototypes (claude-design / Mobirise / Relume / Lovable / v0 /44 hand-coded). Served on localhost and captured through the same45 path — recipe in `reference/donor-sources.md` § Local prototypes.46 - `--donor-figma <url>` — **not yet implemented.** The contract is47 defined (`reference/donor-sources.md` § Figma) but the adapter is48 future scope. Tell the user exactly this: *"Figma donors are not49 implemented yet. Export the frames as static HTML prototypes (or50 point me at a live staging URL of the design) and re-run with51 `--donor-dir` / `--donor`. The Figma adapter — variables→palette,52 text styles→type, frame screenshots→vision references, provenance53 class `figma-mcp` — is specced in54 `skills/reskin/reference/donor-sources.md` and will land in a55 later release."* Do not improvise a partial Figma capture.56- `--pages <slug,slug,...>` — optional. Restrict the content capture57 to specific pages. Default: the archetype set (one page per page58 family; a spec's `archetypes.json` names them; scale to siblings happens in Phase 6 via `migrate`).59- `--scope <selectors>` — optional. Pre-declare the content-root60 scope for a single-page run (comma-separated, `!` suffix keeps a61 scope whole; see `reference/content-model.md` § Scope declaration).62 Without it, run the scope-discovery procedure per page.6364## Setup65661. Run the master skill's setup (`../stardust/SKILL.md` § Setup):67 impeccable dep check, context loader, state read. **Flow.** Stamp68 `state.json.flow: "reskin"` if unset69 (`../stardust/reference/state-machine.md` § Flow keys); if another70 flow is set, print it and the switch command71 (`$stardust reskin --switch-flow`) instead of running.722. **Playwright import-resolvability probe** — same contract as73 `../extract/SKILL.md` § Setup:74 `node -e "import('playwright').then(()=>process.exit(0))"` from the75 project root; on failure76 `npm i -D playwright --no-save --legacy-peer-deps`. Re-run the77 probe at the start of every phase that renders — a `--no-save`78 install is pruned by any later real `npm i`.793. **Copy the scripts into the project.** ESM resolves80 `import('playwright')` from the *script's* directory and the plugin81 tree ships no `node_modules`. Copy `skills/reskin/scripts/*` (all82 five files — `capture-content.mjs` and `dom-equality.mjs` import83 `source-normalize.mjs` as a sibling) byte-identical to84 `stardust/scripts/reskin/`, **and** `skills/diff/scripts/85 live-session.mjs` to `stardust/scripts/diff/` — every reskin gate86 script (capture-content, dom-equality, donor-probe, **and**87 slot-coverage) imports it unconditionally at startup, regardless88 of target type: without the copy each one exits 2 immediately,89 even for `--help` or a local-file `--rendered` target. It supplies90 ALL live-target hardening (real Chrome's own identity + standard91 headers, challenge detection, `--headed` escalation), resolved from92 `../diff/` next to `../reskin/`, so keep the two dirs siblings.93 Run the copies.944. **Origin collision** — if `stardust/state.json` records a different95 `site.originUrl`, stop and ask before mixing sites, per96 `../extract/SKILL.md` § Setup.9798## Procedure99100### Phase 1 — INGEST DONOR101102The donor's design system is captured **separately** from the content103site, into `stardust/canon-source/`. Full recipes per donor type in104`reference/donor-sources.md`; summary:105106- **Live URL** (`--donor <url>`): invoke107 `$stardust extract <content-url> --design-source <donor-url>` — the108 existing skill, unchanged. It lands in `stardust/canon-source/`: the109 donor's `pages/`, `assets/` (screenshots included),110 `_brand-extraction.json`, `_crawl-log.json`, and a descriptive111 `DESIGN.md` + `DESIGN.json`, and stamps112 `state.json.designSource = { url, capturedAt, path }` — see113 `../extract/SKILL.md` § Cross-site brand sources.114- **Local prototype dir** (`--donor-dir <path>`): serve the directory115 on localhost (`python3 -m http.server <port> --directory <path>`)116 and run the **same** `--design-source` capture path against the117 localhost origin. Record the real provenance (localhost serve of118 `<path>`) in `canon-source/_crawl-log.json`. Recipe details —119 page listing, index-less directories, port hygiene — in120 `reference/donor-sources.md` § Local prototypes.121- **Figma** (`--donor-figma`): FUTURE. Surface the exact message from122 § Inputs and stop.123124Then author two reskin-owned donor artifacts (contracts in125`reference/donor-sources.md`):126127- `stardust/reskin/donor-tokens.json` — the **curated, probe-able128 token sheet**: palette roles, type ramp, layout metrics, button129 specs, radii, shadows, motifs — every value a computed-style string130 the Phase 5 probe can assert verbatim. Curated from131 `canon-source/DESIGN.json` + `_brand-extraction.json` + the raw132 computed styles; cites the donor page each value came from. On a133 **bounded donor capture** (a single donor page, no full134 `--design-source` run) there is no `DESIGN.json`,135 `_brand-extraction.json`, or `designSource` stamp to curate from —136 the token sheet is authored entirely from raw computed-style137 sampling of the donor page, a first-class parallel path138 (`reference/donor-sources.md` § Two first-class token-sourcing139 paths).140- `stardust/reskin/donor-modules.md` — the **enumerated module141 vocabulary** (M1..Mn): one row per donor module with where-seen142 screenshot evidence and an anatomy description. This is the closed143 set the Phase 3 mapping brief maps onto.144145**The pin-one-reference-page rule (hard).** Real donors run multiple146design systems concurrently — the experiment's donor served radius-4px147/ 1266px on its homepage and pill-radius / 1080px on older product148pages. Consolidating across them produces a chimera no live page ever149shipped, and the token probe then asserts against nothing. When donor150pages disagree on a token, **pin ONE donor reference page per module151family**, record it in `donor-tokens.json` (`curatedFrom` + a note152naming the reference page), and demote the other pages to153corroboration.154155### Phase 2 — CONTENT-MODEL CAPTURE156157The new capability: a **byte-oriented** capture of each content page —158distinct from extract's design-oriented capture. Run the ported159capture script per page:160161```bash162node stardust/scripts/reskin/capture-content.mjs \163 --url <page-url> \164 --scope '<sel1,sel2!,...>' \165 --normalize stardust/reskin/normalize/<slug>.mjs \166 --out stardust/reskin/content-model/<slug>/167```168169It writes `stardust/reskin/content-model/<slug>/content-model.json`170(full contract in `reference/content-model.md`): per section-slot —171headings with levels, eyebrows and other leftovers, body paragraphs,172list items, CTAs with **absolute** hrefs, ordered **visible** images173(`currentSrc` + alt), plus the **ordered stream** (`ordered`) — the174same content as kind-tagged nodes in document order with nesting and175separator flags, the render surface Phase 4 consumes; page-level —176full SEO metadata (title,177description, canonical, OG, Twitter, JSON-LD, lang, favicon), the178whitespace-normalized visible text of the scope (the content-gate179reference string), and a full-page screenshot.180181Two declarations are mandatory per page, because they are the182experiment's top two failure modes:1831841. **CONTENT-ROOT SCOPE declaration.** Naive scoping silently dropped185 30% of the experiment page's content — the hero and a banner186 carousel lived inside `<header>`, outside the obvious `#content`187 root, and byte equality would have "passed" against the incomplete188 reference. Never trust `main` or `#content` blind. Run the189 **scope-discovery procedure** (`reference/content-model.md`190 § Scope discovery): compare the captured scope text against the191 whole-body text and the page screenshot, verify the h1 is inside192 the scope, widen with comma-separated multi-scope selectors until193 everything visible in the screenshot that isn't declared chrome is194 in the model. Chrome exclusions (nav, footer) are declared deltas195 (`D1`-style), not silent omissions. The capture script prints a196 coverage line (`bodyTextLen / scopeTextLen / h1InScope`) to make197 the check mechanical.1982. **EXECUTABLE NORMALIZATION LEDGER.** Cookie-consent chrome removal,199 carousel de-duplication (hidden slides are absent from `innerText`;200 clone slides duplicate it — rotating carousels break byte201 determinism), and any page-specific cleanup live in a per-page202 ledger module `stardust/reskin/normalize/<slug>.mjs` that extends203 the shared default (`scripts/source-normalize.mjs`). The **same204 ledger file is passed verbatim to the capture and to every gate**205 (`--normalize`), so the gate measures exactly the normalization the206 capture declared. The ledger is code, not prose. Format in207 `reference/content-model.md` § Normalization ledger.208209### Phase 3 — MAPPING BRIEF210211Author `stardust/reskin/mapping.md` — the cross-origin mapping brief.212Full contract and entry schema in `reference/mapping-brief.md`. Per213**every** content slot in the content model:214215- assigned donor module id (from `donor-modules.md`'s closed216 vocabulary) + a one-line rationale grounded in slot anatomy vs217 module anatomy;218- status ∈ `{mapped, new-module, chrome, carried-invisible}` —219 the last for sr-only/visually-hidden content inside the byte scope220 (carried verbatim into an equivalent hidden element, no donor221 module; `reference/mapping-brief.md` § Status semantics).222223Gates before any rendering:224225- **≥ 80% of content slots `mapped`** onto named donor modules. Below226 that, the donor vocabulary doesn't cover this content — stop and227 surface (see § Stop conditions).228- **Every `new-module` entry is explicitly composed from donor229 tokens** (name the tokens it borrows: input spec + primary button230 spec, etc.) and listed in the brief's stats block. New modules are231 never silently improvised mid-render.232- **Chrome swaps documented** — nav/footer replaced by donor chrome233 carrying the source's links is a declared delta, excluded from the234 content-gate scope.235- **Casing / text-transform policy declared.** The donor may render236 eyebrows uppercase (or the source may — Chrome's `innerText`237 reflects `text-transform`, so captured text is *rendered-case*).238 The underlying text stays byte-faithful; casing is applied via CSS239 `text-transform` only, never by editing the string. Policy details240 in `reference/mapping-brief.md` § Casing policy.241242Composite source sections (one wrapper div holding two logical243regions) are split into atomic slots in the brief — section ≠ slot.244245### Phase 4 — PROGRAMMATIC RENDER246247The decisive validated rule: **the page is GENERATED from248`content-model.json` — never retyped by hand.** Write a renderer249script per archetype (`stardust/reskin/renderers/<archetype>.mjs`,250modeled on the experiment's `render-reskin.mjs`) that:251252- reads the page's `content-model.json` and interpolates **every**253 visible string, href, and image URL from the model (HTML-escaped) —254 if a string appears in the output HTML but not in the model, the255 renderer is wrong;256- takes each slot's structure from the **ordered stream**257 (`sections[].ordered`, `reference/content-model.md` § The ordered258 stream): kind-tagged nodes in document order, nesting preserved259 (a CTA wrapping its heading and vice versa), `sep` flags marking260 zero-separator inline joins. The stream is **innerText-consistent261 by construction** (its text nodes are sliced from the parent's262 rendered `innerText` — the byte-gate basis), so emitting it263 verbatim is safe. Emit nodes in stream order; emit264 `sep: ""` neighbours with no whitespace between them (inline);265 never reorder, and never reconstruct **order or separators** from266 `visibleText` —267 the first field run did exactly that (per-type arrays matched268 greedily against `visibleText` as an oracle) and burned three269 debug rounds on duplicate identical strings, both directions of270 CTA/container nesting, and zero-separator inline `li` runs, all271 of which the stream now captures structurally;272- renders `formControl` nodes as **equivalent controls**, not text:273 a `<select>` carrying the captured option texts **verbatim, in274 order**; inputs/textareas carrying value/placeholder — restyled275 with donor tokens (the new-module composition rules apply), never276 flattened to prose and never dropped. A select's option text is277 part of the source's `innerText`, so dropping the control fails278 the byte gate with nothing structured to render from279 (`reference/content-model.md` § Slot taxonomy, formControls);280- carries the metadata block verbatim into `<head>` (title,281 description, canonical, OG, Twitter, JSON-LD — including source282 garbage like broken JSON-LD URLs: fidelity over repair; **flag**283 such items for the human in the run report, never silently fix or284 silently keep);285- takes its surface exclusively from `donor-tokens.json` (emitted as286 CSS custom properties) + the donor module patterns assigned in287 `mapping.md`. Use the rendered-page conventions the Phase 5 probe288 asserts against: content in `<main>`, `.container` for the measure,289 `.btn` for the donor primary button (`reference/gates.md`290 § Rendered-page conventions);291- writes `stardust/reskin/pages/<slug>.html`, self-contained.292293Renderers may parse a single node's text apart (split a list-item row294into kicker/date/title) but must **fail loudly** (throw) when a parse295doesn't reproduce the node's text — a silent partial parse is a silent296content drop. A slot whose `orderedVerified` is `false` is inspected297before rendering, never trusted blind; when inspection shows stream298text genuinely absent from the slot's `visibleText`, the299**sanctioned fallback** is to drop that text before rendering and300record the drop in the model's provenance — filtering ghosts against301`visibleText` is the documented resolution, distinct from the302forbidden order-reconstruction move303(`reference/content-model.md` § When `orderedVerified` is false).304305### Phase 5 — GATES306307Three gate families per page; commands, pass bars, tolerances, and308failure modes in `reference/gates.md`. Serve or `file://`-address the309rendered page and run:310311**(a) CONTENT GATE** — all three must pass:312313```bash314node stardust/scripts/reskin/dom-equality.mjs \315 --source <page-url> --source-scope '<declared scope>' \316 --normalize stardust/reskin/normalize/<slug>.mjs \317 --rendered stardust/reskin/pages/<slug>.html --rendered-scope main \318 --report stardust/reskin/reports/<slug>-content-gate.md319node stardust/scripts/reskin/slot-coverage.mjs \320 --model stardust/reskin/content-model/<slug>/content-model.json \321 --rendered stardust/reskin/pages/<slug>.html \322 --report stardust/reskin/reports/<slug>-slot-coverage.md323```324325`dom-equality.mjs` (vendored + adapted from github.com/aemcoder/skills,326Apache-2.0) gates on whitespace-normalized visible-text **byte327equality** and the **ordered, URL-normalized visible-image set**;328element count and tag sequence are reported but informational.329`slot-coverage.mjs` additionally proves every model slot present330(slot text substring, every CTA as a (text, absolute-href) pair,331every image) and asserts metadata carry-over field by field.332333**(b) DESIGN-ADOPTION GATE:**334335```bash336node stardust/scripts/reskin/donor-probe.mjs \337 --tokens stardust/reskin/donor-tokens.json \338 --rendered stardust/reskin/pages/<slug>.html \339 --report stardust/reskin/reports/<slug>-donor-probe.md340```341342Computed-style assertions of donor token values on the rendered page —343bg/fg, font-family token string, display weight, button spec,344container width, band palette, section rhythm. Tolerances (exact for345colors/radius/family; ±2px button padding; ±20px container; ±16px346section rhythm) documented in `reference/gates.md` § Tolerances.347Then the **side-by-side judgment**: open the rendered page next to the348donor reference-page screenshots (`canon-source/assets/screenshots/`)349and judge adoption with your eyes — the probe proves tokens, the350eyeball proves the page *reads as* the donor. Record the verdict.351352**(c) Sanity** — no horizontal overflow at 1440 and 360 (donor-probe353runs this automatically; `--widths` to override).354355**One fix iteration per gate family** — one for the content gate,356one for design-adoption/sanity. On a failure in a family, fix once,357re-run all gates (a fix for one gate can break another). Residual358failures after a family's iteration is spent are logged in359`stardust/reskin/ledger.json` under the page's `residuals[]` — never360silently absorbed, never looped on indefinitely. (Both field runs361support the budget: the validation experiment spent one iteration on362360px chrome; the smoke run spent exactly one per family — a363content-side separator emission fix and a sanity-side 360px chrome364fix. A single shared iteration would have forced a false residual;365per-family keeps the loop bounded without absorbing real failures.)366367### Phase 6 — HANDOFF368369Reskin owns the archetype pages; scale and shipping are the existing370pipeline, unchanged:371372- **Scale via the stardust `migrate` skill** (`../migrate/SKILL.md`) with the373 donor-pinned target (the `state.json.designSource` stamp Phase 1374 wrote is exactly what `direct`/`migrate` read for donor pinning;375 a bounded donor capture wrote no stamp — record the donor origin376 in the handoff instead, `reference/donor-sources.md` § Two377 first-class token-sourcing paths).378 Same-type sibling pages render at the **sibling tier** against the379 gated archetype. Content rules are the ones reskin already380 enforces — `../migrate/reference/content-preservation.md` is381 inherited wholesale.382- **Ship via the stardust `deploy` and `rollout` skills**, unchanged. Blocks383 written for donor modules obey the Experience Workspace editability384 contract (deploy SKILL.md § 8, EW1–EW10) and pass the EW gate385 (`block-roundtrip --ew`) before they are done.386387Reskin writes its own state under `stardust/reskin/` — `ledger.json`388holds per-page status (`captured → mapped → rendered → gated`), gate389results, and residuals. It makes **no changes to the core state390machine** (`../stardust/reference/state-machine.md`); the only391`state.json` touch is the `designSource` stamp that extract itself392writes in Phase 1.393394## What reskin never does395396- **No content rewriting or summarizing.** Not headlines, not body,397 not CTA labels, not casing-by-editing. Faithful ≠ clean: source398 garbage is carried verbatim and *flagged*, not fixed.399- **No invented sections.** Every rendered slot traces to a400 content-model slot; every module traces to `donor-modules.md` or an401 explicit new-module entry in `mapping.md`.402- **No donor-token drift.** No colors, fonts, radii, or spacing403 outside `donor-tokens.json`. Licensed donor fonts are adopted as the404 family *token string* with local fallback, never rebundled.405- **No silent slot drops.** Anything excluded from the gate scope is a406 declared chrome delta or a ledger normalization — declared in407 `mapping.md`, executable in the normalize module.408409## Stop conditions410411- **Donor capture fails** (bot-block past the headed fallback,412 prototypes dir unservable) — surface extract's error verbatim.413- **Mapping ratio < 80%** — the donor vocabulary can't carry this414 content. Ask: widen the donor capture (more donor pages → more415 modules) or accept a larger explicit new-module list.416- **Scope undecidable** — the content page's visible content cannot be417 covered by any selector set (heavy shadow-DOM, iframe-embedded418 content). Surface with the screenshot evidence.419- **Figma donor requested** — future scope; exact message in § Inputs.420421## Outputs422423| Path | Purpose |424|---|---|425| `stardust/canon-source/` | Donor capture + descriptive DESIGN.md/json (extract `--design-source`, unchanged) |426| `stardust/reskin/donor-tokens.json` | Curated probe-able token sheet, pinned to one reference page |427| `stardust/reskin/donor-modules.md` | Enumerated donor module vocabulary (M1..Mn) with screenshot evidence |428| `stardust/reskin/content-model/<slug>/content-model.json` | Byte-oriented per-page content model (+ source screenshot) |429| `stardust/reskin/normalize/<slug>.mjs` | Per-page executable normalization ledger (shared capture ↔ gates) |430| `stardust/reskin/mapping.md` | The mapping brief: every slot → donor module, status, rationale |431| `stardust/reskin/renderers/<archetype>.mjs` | Programmatic renderers (model in, HTML out) |432| `stardust/reskin/pages/<slug>.html` | Rendered reskin pages |433| `stardust/reskin/reports/` | Per-page gate reports + screenshots |434| `stardust/reskin/ledger.json` | Per-page status, gate results, residuals |435| `stardust/scripts/reskin/` | Project-local copies of the five skill scripts |436437## References438439- `reference/donor-sources.md` — the three donor types and their440 capture recipes; pin-one-reference-page; `donor-tokens.json` and441 `donor-modules.md` contracts; the Figma future contract.442- `reference/content-model.md` — the capture contract: slot taxonomy,443 the ordered stream (the render surface), scope-discovery procedure,444 normalization ledger format, provenance.445- `reference/mapping-brief.md` — entry schema, the ≥80% gate,446 new-module composition rules, casing policy.447- `reference/gates.md` — both gates' commands, pass bars, tolerances,448 failure modes, residual logging.449- `../extract/SKILL.md` § Cross-site brand sources — the450 `--design-source` donor-capture path Phase 1 delegates to.451- `../migrate/reference/content-preservation.md` — the content rules452 reskin inherits (and tightens to byte level).453- `../diff/SKILL.md` — the pixel + structural probes; reuse them as a454 supplementary build-side check after Phase 6 deploy, `--profile eds`.