reskin
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesestardust:reskin — same content, donor design
stardust:reskin — 保留内容,应用donor设计
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 (hirslanden ×
stripe: 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.
用户拥有一个网站(content source,内容源),同时有一个已在别处存在的设计(donor,设计源:另一款已上线网站,或本地静态HTML原型目录;Figma属于未来规划范围)。Reskin会重建内容源网站的页面,确保所有可见内容的字节都完整保留——文本、有序图片、CTA、SEO元数据,而页面外观则完全来自donor的设计令牌和模块体系。
内容与设计遵循不同的规则:
- 内容不可协商:校验标准为经过空白字符归一化后的可见文本、有序可见图片集以及完整元数据迁移的字节级一致性。不是“接近一致”——而是完全一致,且需基于明确声明的可执行归一化规则集。
- 设计灵活适配:内容会重新布局到donor的模块上;轮播组件可能变为静态卡片网格,侧边栏可能变为横幅区域。内容结构(元素数量、标签序列)仅作为参考信息,而非校验标准——Reskin会根据设计重新构建标记结构。
经UC2-E1实验(hirslanden × stripe:2281/2281文本字节匹配、7/7图片匹配、47/47插槽匹配、13/13元数据匹配、17/17 donor令牌探测匹配)验证的核心规则:页面是从捕获的内容模型程序化生成的——内容字符串绝不会手动重新输入。字节级保真由此天然成立,内容校验也从调试工具转变为回归检查手段。
Inputs
输入参数
- — required. The site whose content is preserved.
<content-url> - Donor, exactly one of:
- — a live site whose design system is adopted.
--donor <url> - — 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
--donor-dir <path>§ Local prototypes.reference/donor-sources.md - — not yet implemented. The contract is defined (
--donor-figma <url>§ 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 withreference/donor-sources.md/--donor-dir. The Figma adapter — variables→palette, text styles→type, frame screenshots→vision references, provenance class--donor— is specced infigma-mcpand will land in a later release." Do not improvise a partial Figma capture.skills/reskin/reference/donor-sources.md
- — optional. Restrict the content capture to specific pages. Default: the archetype set (one page per page family; scale to siblings happens in Phase 6 via
--pages <slug,slug,...>).migrate - — optional. Pre-declare the content-root scope for a single-page run (comma-separated,
--scope <selectors>suffix keeps a scope whole; see!§ Scope declaration). Without it, run the scope-discovery procedure per page.reference/content-model.md
- — 必填。需保留内容的目标网站。
<content-url> - Donor,三选一:
- — 采用其设计系统的已上线网站。
--donor <url> - — 本地静态HTML原型目录(claude-design / Mobirise / Relume / Lovable / v0 / 手工编码)。需在本地主机上部署,并通过相同路径捕获——具体流程见
--donor-dir <path>§ Local prototypes。reference/donor-sources.md - — 尚未实现。相关规则已定义(
--donor-figma <url>§ Figma),但适配工具属于未来规划。需告知用户以下确切内容:*"Figma donor目前尚未实现。请将帧导出为静态HTML原型(或提供该设计的已上线预发布URL),然后使用reference/donor-sources.md/--donor-dir参数重新运行。Figma适配工具——变量→调色板、文本样式→字体、帧截图→视觉参考、来源类--donor——已在figma-mcp中定义,将在后续版本中推出。"*不得尝试实现部分Figma捕获功能。skills/reskin/reference/donor-sources.md
- — 可选。将内容捕获范围限制为特定页面。默认值:原型页面集(每个页面类型对应一个页面;在第6阶段通过
--pages <slug,slug,...>扩展至同类型兄弟页面)。migrate - — 可选。为单页面运行预声明内容根范围(逗号分隔,
--scope <selectors>后缀表示保留完整范围;详见!§ Scope declaration)。若无此参数,则针对每个页面执行范围发现流程。reference/content-model.md
Setup
准备步骤
- Run the master skill's setup (§ Setup): impeccable dep check, context loader, state read.
../stardust/SKILL.md - Playwright import-resolvability probe — same contract as
§ Setup:
../extract/SKILL.mdfrom the project root; on failurenode -e "import('playwright').then(()=>process.exit(0))". Re-run the probe at the start of every phase that renders — anpm i -D playwright --no-save --legacy-peer-depsinstall is pruned by any later real--no-save.npm i - Copy the scripts into the project. ESM resolves
from the script's directory and the plugin tree ships no
import('playwright'). Copynode_modules(all five files —skills/reskin/scripts/*andcapture-content.mjsimportdom-equality.mjsas a sibling) byte-identical tosource-normalize.mjs, andstardust/scripts/reskin/toskills/diff/scripts/ live-session.mjs— 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 forstardust/scripts/diff/or a local-file--helptarget. It supplies ALL live-target hardening (real-Chrome UA + standard headers, challenge detection, headed-stealth escalation), resolved from--renderednext to../diff/, so keep the two dirs siblings. Run the copies.../reskin/ - Origin collision — if records a different
stardust/state.json, stop and ask before mixing sites, persite.originUrl§ Setup.../extract/SKILL.md
- 运行主技能的准备流程(§ Setup):完整依赖检查、上下文加载、状态读取。
../stardust/SKILL.md - Playwright导入可访问性探测 — 与§ Setup遵循相同规则:在项目根目录运行
../extract/SKILL.md;若失败则执行node -e "import('playwright').then(()=>process.exit(0))"。在每个渲染阶段开始时重新运行探测——npm i -D playwright --no-save --legacy-peer-deps安装的依赖会被后续任何实际的--no-save操作清除。npm i - 将脚本复制到项目中。ESM会从脚本所在目录解析,而插件树未包含
import('playwright')。需将node_modules(共5个文件——skills/reskin/scripts/*和capture-content.mjs会导入同级的dom-equality.mjs)字节级完整复制到source-normalize.mjs,同时将stardust/scripts/reskin/复制到skills/diff/scripts/live-session.mjs——所有Reskin校验脚本(capture-content、dom-equality、donor-probe、以及slot-coverage)在启动时都会无条件导入该脚本,无论目标类型如何:若未复制,每个脚本都会立即退出并返回状态码2,即使是stardust/scripts/diff/或本地文件--help目标。该脚本提供所有实时目标的加固功能(真实Chrome UA + 标准请求头、挑战检测、带界面的隐身模式升级),从--rendered旁边的../reskin/目录解析,因此需保持这两个目录为同级目录。运行复制后的脚本。../diff/ - 源冲突 — 若记录的
stardust/state.json与当前目标不同,则停止操作并询问用户是否混合处理不同网站,遵循site.originUrl§ Setup的规则。../extract/SKILL.md
Procedure
执行流程
Phase 1 — INGEST DONOR
阶段1 — 导入DESIGN源
The donor's design system is captured separately from the content
site, into . Full recipes per donor type in
; summary:
stardust/canon-source/reference/donor-sources.md- Live URL (): invoke
--donor <url>— the existing skill, unchanged. It lands instardust:extract <content-url> --design-source <donor-url>: the donor'sstardust/canon-source/,pages/(screenshots included),assets/,_brand-extraction.json, and a descriptive_crawl-log.json+DESIGN.md, and stampsDESIGN.json— seestate.json.designSource = { url, capturedAt, path }§ Cross-site brand sources.../extract/SKILL.md - Local prototype dir (): serve the directory on localhost (
--donor-dir <path>) and run the samepython3 -m http.server <port> --directory <path>capture path against the localhost origin. Record the real provenance (localhost serve of--design-source) in<path>. Recipe details — page listing, index-less directories, port hygiene — incanon-source/_crawl-log.json§ Local prototypes.reference/donor-sources.md - Figma (): FUTURE. Surface the exact message from § Inputs and stop.
--donor-figma
Then author two reskin-owned donor artifacts (contracts in
):
reference/donor-sources.md- — 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
stardust/reskin/donor-tokens.json+canon-source/DESIGN.json+ the raw computed styles; cites the donor page each value came from. On a bounded donor capture (a single donor page, no full_brand-extraction.jsonrun) there is no--design-source,DESIGN.json, or_brand-extraction.jsonstamp to curate from — the token sheet is authored entirely from raw computed-style sampling of the donor page, a first-class parallel path (designSource§ Two first-class token-sourcing paths).reference/donor-sources.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.
stardust/reskin/donor-modules.md
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 ( + a note
naming the reference page), and demote the other pages to
corroboration.
donor-tokens.jsoncuratedFromDonor的设计系统会独立于内容源网站被捕获到目录中。针对不同类型Donor的完整流程见;摘要如下:
stardust/canon-source/reference/donor-sources.md- 已上线URL ():调用
--donor <url>——现有技能,无需修改。捕获结果会保存到stardust:extract <content-url> --design-source <donor-url>:包含donor的stardust/canon-source/、pages/(含截图)、assets/、_brand-extraction.json,以及描述性文件_crawl-log.json+DESIGN.md,并在DESIGN.json中标记——详见state.json.designSource = { url, capturedAt, path }§ Cross-site brand sources。../extract/SKILL.md - 本地原型目录 ():在本地主机上部署该目录(
--donor-dir <path>),然后针对本地主机源执行相同的python3 -m http.server <port> --directory <path>捕获流程。在--design-source中记录真实来源(本地主机部署的canon-source/_crawl-log.json)。具体流程细节——页面列表、无索引目录、端口规范——见<path>§ Local prototypes。reference/donor-sources.md - Figma ():未来规划。展示输入参数部分的确切提示信息并停止操作。
--donor-figma
随后创建两个Reskin专属的donor artifacts(规则见):
reference/donor-sources.md- — 可探测的精选令牌表:调色板角色、字体层级、布局度量、按钮规格、圆角、阴影、主题元素——每个值都是第5阶段探测工具可直接断言的计算样式字符串。从
stardust/reskin/donor-tokens.json+canon-source/DESIGN.json+ 原始计算样式中精选而来;并标注每个值对应的donor页面来源。若为有限donor捕获(仅单个donor页面,未执行完整_brand-extraction.json流程),则无--design-source、DESIGN.json或_brand-extraction.json标记可供精选——令牌表需完全从donor页面的原始计算样式采样中创建,这是一条平行的一等公民流程(designSource§ Two first-class token-sourcing paths)。reference/donor-sources.md - — 枚举的模块体系(M1..Mn):每个donor模块对应一行,包含截图证据和结构描述。这是第3阶段映射文档所依赖的闭合集合。
stardust/reskin/donor-modules.md
固定单一参考页面规则(强制)。实际donor可能同时运行多个设计系统——实验中的donor在首页使用4px圆角/1266px宽度,在旧产品页面使用胶囊形圆角/1080px宽度。跨页面合并会产生从未上线过的混合设计,导致令牌探测无实际参照。当donor页面在令牌上存在分歧时,为每个模块类型固定一个donor参考页面,并在中记录( + 标注参考页面的备注),将其他页面降级为佐证。
donor-tokens.jsoncuratedFromPhase 2 — CONTENT-MODEL CAPTURE
阶段2 — 内容模型捕获
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:
bash
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
(full contract in ): per section-slot —
headings with levels, eyebrows and other leftovers, body paragraphs,
list items, CTAs with absolute hrefs, ordered visible images
( + alt), plus the ordered stream () — 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.
stardust/reskin/content-model/<slug>/content-model.jsonreference/content-model.mdcurrentSrcorderedTwo 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 , outside the obvious
<header>root, and byte equality would have "passed" against the incomplete reference. Never trust#contentormainblind. Run the scope-discovery procedure (#content§ 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 (reference/content-model.md-style), not silent omissions. The capture script prints a coverage line (D1) to make the check mechanical.bodyTextLen / scopeTextLen / h1InScope - EXECUTABLE NORMALIZATION LEDGER. Cookie-consent chrome removal,
carousel de-duplication (hidden slides are absent from ; clone slides duplicate it — rotating carousels break byte determinism), and any page-specific cleanup live in a per-page ledger module
innerTextthat extends the shared default (stardust/reskin/normalize/<slug>.mjs). The same ledger file is passed verbatim to the capture and to every gate (scripts/source-normalize.mjs), so the gate measures exactly the normalization the capture declared. The ledger is code, not prose. Format in--normalize§ Normalization ledger.reference/content-model.md
新增能力:面向字节的每个内容页面捕获——与extract的面向设计捕获不同。针对每个页面运行移植后的捕获脚本:
bash
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>/脚本会生成(完整规则见):包含每个区域插槽——带层级的标题、眉栏及其他剩余内容、正文段落、列表项、带绝对href的CTA、有序可见图片( + alt),以及有序流()——按文档顺序排列的带类型标记节点,保留嵌套结构和分隔符标志,是第4阶段渲染所使用的表面数据;页面层面——完整SEO元数据(标题、描述、规范URL、OG、Twitter、JSON-LD、语言、图标)、经过空白字符归一化的范围可见文本(内容校验的参考字符串),以及全页面截图。
stardust/reskin/content-model/<slug>/content-model.jsonreference/content-model.mdcurrentSrcordered每个页面必须完成两项声明,这是实验中排名前两位的失败原因:
- 内容根范围声明。 naive范围选择会静默丢失实验页面30%的内容——Hero区域和横幅轮播位于内,在明显的
<header>根之外,而字节一致性校验会针对不完整的参考“通过”。切勿盲目信任#content或main。执行范围发现流程(#content§ Scope discovery):将捕获的范围文本与整个页面文本及页面截图进行对比,验证h1是否在范围内,使用逗号分隔的多范围选择器扩大范围,直到截图中所有可见的非声明chrome内容都被包含在模型中。Chrome排除项(导航栏、页脚)需声明为差异(reference/content-model.md格式),而非静默忽略。捕获脚本会输出覆盖率行(D1),使校验过程机械化。bodyTextLen / scopeTextLen / h1InScope - 可执行归一化规则集。Cookie同意栏移除、轮播去重(隐藏幻灯片不在中;克隆幻灯片会重复文本——旋转轮播会破坏字节确定性),以及任何页面特定清理操作都需放在每页的规则集模块
innerText中,该模块继承自共享默认规则(stardust/reskin/normalize/<slug>.mjs)。同一个规则集文件会被完整传递给捕获流程和所有校验流程(scripts/source-normalize.mjs参数),因此校验会完全按照捕获流程声明的归一化规则执行。规则集是代码,而非 prose。格式见--normalize§ Normalization ledger。reference/content-model.md
Phase 3 — MAPPING BRIEF
阶段3 — 映射文档
Author — the cross-origin mapping brief.
Full contract and entry schema in . Per
every content slot in the content model:
stardust/reskin/mapping.mdreference/mapping-brief.md- assigned donor module id (from 's closed vocabulary) + a one-line rationale grounded in slot anatomy vs module anatomy;
donor-modules.md - status ∈ — the last for sr-only/visually-hidden content inside the byte scope (carried verbatim into an equivalent hidden element, no donor module;
{mapped, new-module, chrome, carried-invisible}§ Status semantics).reference/mapping-brief.md
Gates before any rendering:
- ≥ 80% of content slots onto named donor modules. Below that, the donor vocabulary doesn't cover this content — stop and surface (see § Stop conditions).
mapped - Every 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.
new-module - 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 reflects
innerText, so captured text is rendered-case). The underlying text stays byte-faithful; casing is applied via CSStext-transformonly, never by editing the string. Policy details intext-transform§ Casing policy.reference/mapping-brief.md
Composite source sections (one wrapper div holding two logical
regions) are split into atomic slots in the brief — section ≠ slot.
创建——跨源映射文档。完整规则和条目 schema见。针对内容模型中的每个内容插槽:
stardust/reskin/mapping.mdreference/mapping-brief.md- 分配donor模块ID(来自的闭合体系) + 基于插槽结构与模块结构对比的一行理由;
donor-modules.md - 状态 ∈ — 最后一种状态用于字节范围内的屏幕阅读器专用/视觉隐藏内容(原样带入等效隐藏元素,不使用donor模块;详见
{mapped, new-module, chrome, carried-invisible}§ Status semantics)。reference/mapping-brief.md
渲染前的校验:
- ≥80%的内容插槽被到指定donor模块。若低于该比例,说明donor体系无法覆盖当前内容——停止操作并告知用户(详见§ Stop conditions)。
mapped - 每个条目都明确由donor令牌组合而成(注明所借用的令牌:输入规范 + 主按钮规范等),并在文档的统计块中列出。绝不能在渲染过程中静默创建新模块。
new-module - Chrome替换已记录——导航栏/页脚被替换为带有源链接的donor chrome需声明为差异,排除在内容校验范围之外。
- 大小写/文本转换策略已声明。donor可能将眉栏文本渲染为大写(或源网站可能如此——Chrome的会反映
innerText,因此捕获的文本是渲染后的大小写)。底层文本需保持字节级保真;大小写仅通过CSStext-transform应用,绝不编辑字符串。策略细节见text-transform§ Casing policy。reference/mapping-brief.md
复合源区域(一个包裹div包含两个逻辑区域)需在文档中拆分为原子插槽——区域≠插槽。
Phase 4 — PROGRAMMATIC RENDER
阶段4 — 程序化渲染
The decisive validated rule: the page is GENERATED from
— never retyped by hand. Write a renderer
script per archetype (,
modeled on the experiment's ) that:
content-model.jsonstardust/reskin/renderers/<archetype>.mjsrender-reskin.mjs- reads the page's 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;
content-model.json - takes each slot's structure from the ordered stream
(,
sections[].ordered§ The ordered stream): kind-tagged nodes in document order, nesting preserved (a CTA wrapping its heading and vice versa),reference/content-model.mdflags marking zero-separator inline joins. The stream is innerText-consistent by construction (its text nodes are sliced from the parent's renderedsep— the byte-gate basis), so emitting it verbatim is safe. Emit nodes in stream order; emitinnerTextneighbours with no whitespace between them (inline); never reorder, and never reconstruct order or separators fromsep: ""— the first field run did exactly that (per-type arrays matched greedily againstvisibleTextas an oracle) and burned three debug rounds on duplicate identical strings, both directions of CTA/container nesting, and zero-separator inlinevisibleTextruns, all of which the stream now captures structurally;li - renders nodes as equivalent controls, not text: a
formControlcarrying 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<select>, so dropping the control fails the byte gate with nothing structured to render from (innerText§ Slot taxonomy, formControls);reference/content-model.md - carries the metadata block verbatim into (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);
<head> - takes its surface exclusively from (emitted as CSS custom properties) + the donor module patterns assigned in
donor-tokens.json. Use the rendered-page conventions the Phase 5 probe asserts against: content inmapping.md,<main>for the measure,.containerfor the donor primary button (.btn§ Rendered-page conventions);reference/gates.md - writes , self-contained.
stardust/reskin/pages/<slug>.html
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 is is inspected
before rendering, never trusted blind; when inspection shows stream
text genuinely absent from the slot's , the
sanctioned fallback is to drop that text before rendering and
record the drop in the model's provenance — filtering ghosts against
is the documented resolution, distinct from the
forbidden order-reconstruction move
( § When is false).
orderedVerifiedfalsevisibleTextvisibleTextreference/content-model.mdorderedVerified经验证的核心规则:页面是从生成的——绝不手动重新输入。为每个原型页面编写渲染器脚本(,以实验中的为模板),需满足:
content-model.jsonstardust/reskin/renderers/<archetype>.mjsrender-reskin.mjs- 读取页面的,并从模型中插值所有可见字符串、href和图片URL(HTML转义)——若输出HTML中出现模型中没有的字符串,则渲染器存在错误;
content-model.json - 从有序流(,详见
sections[].ordered§ The ordered stream)获取每个插槽的结构:按文档顺序排列的带类型标记节点,保留嵌套结构(CTA包裹标题或反之),reference/content-model.md标志标记零分隔符的内联连接。有序流天生与innerText一致(其文本节点从父元素的渲染后sep中截取——这是字节校验的基础),因此原样输出是安全的。按流顺序输出节点;innerText的相邻节点之间无空白符(内联);绝不重新排序,绝不从sep: ""重构顺序或分隔符——第一次现场测试正是这样做的(按类型数组贪婪匹配visibleText作为参考),并在重复相同字符串、CTA/容器嵌套方向、零分隔符内联visibleText序列等问题上花费了三轮调试,而这些问题现在都被有序流结构化捕获;li - 将节点渲染为等效控件,而非文本:
formControl需原样保留捕获的选项文本及顺序;输入框/文本域保留值/占位符——使用donor令牌重新样式化(应用新模块组合规则),绝不扁平化为 prose 或丢弃。select的选项文本是源网站<select>的一部分,因此丢弃控件会导致字节校验失败,且无结构化内容可渲染(详见innerText§ Slot taxonomy, formControls);reference/content-model.md - 将元数据块原样带入(标题、描述、规范URL、OG、Twitter、JSON-LD——包括源网站的无效内容如损坏的JSON-LD URL:保真优先于修复;需在运行报告中标记此类内容,绝不静默修复或保留);
<head> - 外观完全取自(作为CSS自定义属性输出) +
donor-tokens.json中分配的donor模块模式。遵循第5阶段探测工具所断言的渲染页面约定:内容放在mapping.md中,<main>用于宽度限制,.container用于donor主按钮(详见.btn§ Rendered-page conventions);reference/gates.md - 生成,独立可运行。
stardust/reskin/pages/<slug>.html
渲染器可拆分单个节点的文本(将列表项行拆分为标题/日期/正文),但当解析无法重现节点文本时必须抛出错误——静默部分解析等同于静默丢失内容。为的插槽需在渲染前检查,绝不盲目信任;当检查发现流文本确实不在插槽的中时,认可的回退方案是在渲染前丢弃该文本,并在模型的来源记录中记录丢弃操作——根据过滤无效内容是文档化的解决方案,与禁止的顺序重构操作不同(详见 § When is false)。
orderedVerifiedfalsevisibleTextvisibleTextreference/content-model.mdorderedVerifiedPhase 5 — GATES
阶段5 — 校验
Three gate families per page; commands, pass bars, tolerances, and
failure modes in . Serve or -address the
rendered page and run:
reference/gates.mdfile://(a) CONTENT GATE — all three must pass:
bash
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.mddom-equality.mjsslot-coverage.mjs(b) DESIGN-ADOPTION GATE:
bash
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.mdComputed-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 § Tolerances.
Then the side-by-side judgment: open the rendered page next to the
donor reference-page screenshots ()
and judge adoption with your eyes — the probe proves tokens, the
eyeball proves the page reads as the donor. Record the verdict.
reference/gates.mdcanon-source/assets/screenshots/(c) Sanity — no horizontal overflow at 1440 and 360 (donor-probe
runs this automatically; to override).
--widthsOne 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
under the page's — 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.)
stardust/reskin/ledger.jsonresiduals[]每个页面包含三类校验;命令、通过标准、容差、失败模式见。部署渲染后的页面或使用地址访问,然后运行:
reference/gates.mdfile://(a) 内容校验 — 以下三项必须全部通过:
bash
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.mddom-equality.mjsslot-coverage.mjs(b) 设计适配校验:
bash
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对渲染页面上的donor令牌值进行计算样式断言——背景色/前景色、字体族令牌字符串、字体权重、按钮规格、容器宽度、横幅调色板、区域间距。容差(颜色/圆角/字体族精确匹配;按钮内边距±2px;容器宽度±20px;区域间距±16px)见 § Tolerances。然后进行并排判断:将渲染页面与donor参考页面截图()并排打开,用肉眼判断适配情况——探测工具验证令牌,肉眼验证页面看起来像donor。记录判断结果。
reference/gates.mdcanon-source/assets/screenshots/(c) 合理性校验 — 在1440px和360px宽度下无水平溢出(donor-probe会自动运行此校验;可使用参数覆盖)。
--widths每类校验允许一次修复迭代——内容校验一次,设计适配/合理性校验一次。若某类校验失败,修复一次后重新运行所有校验(针对一个校验的修复可能破坏另一个校验)。某类校验迭代后仍存在的残留失败需记录在中对应页面的下——绝不静默忽略,绝不无限循环。(两次现场测试都支持此预算:验证实验在360px chrome上花费了一次迭代;冒烟测试每类校验各花费一次——内容端修复分隔符输出,合理性端修复360px chrome。若共享一次迭代则会产生虚假残留;按类分配迭代可在不忽略真实失败的情况下限制循环次数。)
stardust/reskin/ledger.jsonresiduals[]Phase 6 — HANDOFF
阶段6 — 交付
Reskin owns the archetype pages; scale and shipping are the existing
pipeline, unchanged:
- Scale via (
stardust:migrate) with the donor-pinned target (the../migrate/SKILL.mdstamp Phase 1 wrote is exactly whatstate.json.designSource/directread for donor pinning; a bounded donor capture wrote no stamp — record the donor origin in the handoff instead,migrate§ 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 —reference/donor-sources.mdis inherited wholesale.../migrate/reference/content-preservation.md - Ship via /
stardust:deploy, unchanged.stardust:rollout
Reskin writes its own state under —
holds per-page status (), gate
results, and residuals. It makes no changes to the core state
machine (); the only
touch is the stamp that extract itself
writes in Phase 1.
stardust/reskin/ledger.jsoncaptured → mapped → rendered → gated../stardust/reference/state-machine.mdstate.jsondesignSourceReskin负责原型页面;扩展和上线使用现有流程,无需修改:
- 通过扩展(
stardust:migrate),使用固定donor的目标(第1阶段写入的../migrate/SKILL.md标记正是state.json.designSource/direct读取的donor固定信息;有限donor捕获未写入标记——需在交付时记录donor源,详见migrate§ Two first-class token-sourcing paths)。同类型兄弟页面会针对已校验的原型页面在兄弟层级渲染。内容规则遵循Reskin已执行的规则——完整继承reference/donor-sources.md。../migrate/reference/content-preservation.md - 通过/
stardust:deploy上线,无需修改。stardust:rollout
Reskin将自身状态写入目录下——保存每页状态()、校验结果和残留问题。它不会修改核心状态机();唯一对的修改是第1阶段extract自身写入的标记。
stardust/reskin/ledger.jsoncaptured → mapped → rendered → gated../stardust/reference/state-machine.mdstate.jsondesignSourceWhat reskin never does
Reskin绝不会执行的操作
- 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 or an explicit new-module entry in
donor-modules.md.mapping.md - No donor-token drift. No colors, fonts, radii, or spacing
outside . Licensed donor fonts are adopted as the family token string with local fallback, never rebundled.
donor-tokens.json - No silent slot drops. Anything excluded from the gate scope is a
declared chrome delta or a ledger normalization — declared in
, executable in the normalize module.
mapping.md
- 不会重写或总结内容。无论是标题、正文、CTA标签,还是通过编辑修改大小写。保真≠清理:源网站的无效内容会原样保留并标记,而非修复。
- 不会创建新区域。每个渲染的插槽都可追溯到内容模型中的插槽;每个模块都可追溯到或
donor-modules.md中明确的new-module条目。mapping.md - 不会偏离donor令牌。所有颜色、字体、圆角、间距都严格遵循。授权的donor字体会作为字体族令牌字符串使用,并带有本地回退,绝不会重新打包。
donor-tokens.json - 不会静默丢弃插槽。任何被排除在校验范围之外的内容都需声明为chrome差异或规则集归一化操作——在中声明,在归一化模块中可执行。
mapping.md
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.
- Donor捕获失败(带界面回退后仍被机器人拦截、原型目录无法部署)——原样展示extract的错误信息。
- 映射比例<80%——donor体系无法承载当前内容。询问用户:扩大donor捕获范围(更多donor页面→更多模块)或接受更大的明确new-module列表。
- 范围无法确定——内容页面的可见内容无法被任何选择器集覆盖(大量Shadow DOM、iframe嵌入内容)。附带截图证据告知用户。
- 请求Figma donor——未来规划;展示输入参数部分的确切提示信息。
Outputs
输出结果
| Path | Purpose |
|---|---|
| Donor capture + descriptive DESIGN.md/json (extract |
| Curated probe-able token sheet, pinned to one reference page |
| Enumerated donor module vocabulary (M1..Mn) with screenshot evidence |
| Byte-oriented per-page content model (+ source screenshot) |
| Per-page executable normalization ledger (shared capture ↔ gates) |
| The mapping brief: every slot → donor module, status, rationale |
| Programmatic renderers (model in, HTML out) |
| Rendered reskin pages |
| Per-page gate reports + screenshots |
| Per-page status, gate results, residuals |
| Project-local copies of the five skill scripts |
| 路径 | 用途 |
|---|---|
| Donor捕获结果 + 描述性DESIGN.md/json(extract的 |
| 可探测的精选令牌表,固定到单个参考页面 |
| 枚举的donor模块体系(M1..Mn),带截图证据 |
| 面向字节的每页内容模型(+源页面截图) |
| 每页可执行归一化规则集(捕获与校验共享) |
| 映射文档:每个插槽→donor模块、状态、理由 |
| 程序化渲染器(输入模型,输出HTML) |
| 渲染后的Reskin页面 |
| 每页校验报告 + 截图 |
| 每页状态、校验结果、残留问题 |
| 项目本地的5个技能脚本副本 |
References
参考文档
- — the three donor types and their capture recipes; pin-one-reference-page;
reference/donor-sources.mdanddonor-tokens.jsoncontracts; the Figma future contract.donor-modules.md - — the capture contract: slot taxonomy, the ordered stream (the render surface), scope-discovery procedure, normalization ledger format, provenance.
reference/content-model.md - — entry schema, the ≥80% gate, new-module composition rules, casing policy.
reference/mapping-brief.md - — both gates' commands, pass bars, tolerances, failure modes, residual logging.
reference/gates.md - § Cross-site brand sources — the
../extract/SKILL.mddonor-capture path Phase 1 delegates to.--design-source - — the content rules reskin inherits (and tightens to byte level).
../migrate/reference/content-preservation.md - — the pixel + structural probes; reuse them as a supplementary build-side check after Phase 6 deploy,
../diff/SKILL.md.--profile eds
- — 三类donor类型及其捕获流程;固定单一参考页面规则;
reference/donor-sources.md和donor-tokens.json规则;Figma未来规则。donor-modules.md - — 捕获规则:插槽分类、有序流(渲染表面)、范围发现流程、归一化规则集格式、来源记录。
reference/content-model.md - — 条目schema、≥80%校验规则、新模块组合规则、大小写策略。
reference/mapping-brief.md - — 两类校验的命令、通过标准、容差、失败模式、残留问题记录。
reference/gates.md - § Cross-site brand sources — 第1阶段委托的
../extract/SKILL.mddonor捕获流程。--design-source - — Reskin继承的内容规则(并收紧至字节级)。
../migrate/reference/content-preservation.md - — 像素+结构探测工具;第6阶段部署后可作为补充构建侧检查,使用
../diff/SKILL.md参数。",--profile eds