Generated banner for Wix Headless Replatform
Generated logo for Wix Headless Replatform

Wix Headless Replatform

WixOfficialPublished by Wix

  • Skill
  • Workflow
  • Software development
  • MIT
  • Low risk
  • Has scripts

From the author

Clone, rebuild, migrate, or reverse-engineer a public website home page into a Wix Headless frontend while preserving source identity, SEO, interactions, and visual fidelity.
— the description by Wix

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill acts as a supervisor for cloning or migrating a public website's home page into a Wix Headless frontend. It manages the end-to-end process, including browser-based extraction, build planning, implementation, and quality assurance. The workflow ensures visual fidelity, SEO preservation, and structural integrity by utilizing a staged approach that moves from context resolution to final verification. It supports both standalone cloning and integration into existing migration projects via handoff files.

What it does

  • Clones or migrates a public home page to a Wix Headless frontend.
  • Performs browser-backed extraction to capture visual and structural evidence.
  • Generates a build plan based on a frozen extraction manifest.
  • Implements the frontend using Wix CLI Headless, Astro, TypeScript, and Tailwind.
  • Conducts automated visual review and gap-loop cycles to ensure quality.
  • Supports one-click continuation for automated migration workflows.

When to use it

  • When you need to clone a public website's home page into a new Wix Headless project.
  • When migrating an existing site to Wix Headless as part of a larger project.
  • When you require a high-fidelity frontend implementation that preserves source SEO and interactions.
  • When you need to automate the transition from a source website to a Wix-managed environment.

Advantages

  • Ensures visual and functional fidelity through strict extraction and review contracts.
  • Automates complex migration steps to reduce manual effort.
  • Maintains SEO and branding consistency during the transition.
  • Provides a structured, repeatable process for frontend reconstruction.
  • Supports iterative gap recovery to handle implementation challenges.

Usage examples

“Clone the website at example.com into a new Wix Headless project.”
The agent initiates the standalone cloning workflow, resolves the home page, and begins the extraction and build process.
“Continue the migration for the site at example.com using the handoff file at path/to/handoff.json.”
The agent enters migration mode, loads the specified handoff, and resumes the implementation or verification stage.

Install

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/wix/wix-headless-replatform/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip wix-headless-replatform.zip -d .agents/skills

Documentation by Wix

wix-headless-replatform

Role

Drive a close-enough, visually polished Wix Headless frontend from a source website. The implemented scope is one resolved home page and the default output is projects/<project-name>, derived from the hostname. Use Wix CLI Headless, Astro, TypeScript, and Tailwind; use React only for complex interactive islands. Reject additional-page and explicit-URL scope with an actionable explanation until a later approved workflow defines page resolution and shared evidence across routes.

This entry skill is the supervisor. It decides the next workflow stage and loads only the resource for that stage. Do not preload every resource or reference: stage-specific rules are deliberately demand-loaded.

Two modes exist:

  • Standalone clone: source URL to a new, real Wix CLI Headless project.

  • Migration phase: --handoff <migration-project>/website/handoff.json continues on the migration-owned destination. Never omit --handoff for an integrated migration: the standalone command creates a second site.

Non-negotiable invariants

  • Treat the requested public branded homepage as authorized; apply the boundaries in references/safety.md without asking a separate routine authorization question.

  • Browser-backed extraction is mandatory. Do not substitute HTML-only extraction.

  • Resolve the home page before capture. Build only from a validated frozen extraction manifest; raw observations are never builder inputs.

  • A standalone output must be a successful Wix CLI scaffold with valid Wix identity and runnable dev and build scripts. Never hand-create a Wix-shaped substitute.

  • In migration mode, reuse the handoff's site/project and route/data-binding intent; do not create or retarget a second destination.

  • Preserve source structure, first-viewport evidence, chrome hierarchy, source assets, fonts, core interactions, SEO, internal URL behavior, and branded fallback behavior.

  • A build is not completion. Completion requires the accepted post-build visual-review and gap-loop evidence described by rp-qa-gap-loop, plus optional facelift acceptance only when the user explicitly selected facelift mode.

Supervisor protocol

On every new or resumed run:

  1. Resolve the source URL, output directory, and mode. In migration mode read website/handoff.json and docs/site-clone/frontend-automation-state.json first.

  2. Select the first incomplete stage from the table below and read only that resource's SKILL.md plus the references it explicitly needs.

  3. Execute that stage until it writes its required durable artifact, or records a specific genuine blocker with evidence and an exact unblock action.

  4. Re-select the stage after every boundary. Do not say that a required next step “needs to happen” and end the run; load its resource and perform it.

StageLoad only whenResourceDurable outcome
Contextmode, scope, project, or browser environment is unresolvedresources/rp-project-context/SKILL.mdvalid context, approval record, runnable project/plan state, or blocker
Evidencefrozen home-page extraction is absent or staleresources/rp-source-evidence/SKILL.mdvalidated extraction/latest.json and frozen manifest, or global blocker
Implementationfrozen build plan exists and home UI is incompleteresources/rp-ui-implementation/SKILL.mdmanifest-hash-aware runnable home implementation
Verify and improvebuild, QA, comparison, review, fix, report, release, or receipt is incompleteresources/rp-qa-gap-loop/SKILL.mdaccepted result, done_with_gaps, or global blocker
Optional faceliftnormal clone accepted and automation state says facelift is requestedresources/rp-facelift/SKILL.mdaccepted facelift review, or blocker

When frontendPhase.allowedNow is plan, complete only the plan-eligible context and evidence work and leave a resumable plan-state record. When it is build, continue through implementation and verification against the migration-owned project.

One-click continuation

A migration handoff declaring automationMode: "one_click" authorizes routine scope and frontend checkpoints. Record those approvals in docs/site-clone/frontend-automation-state.json; do not pause to ask whether to proceed with a required stage, screenshot review, or authorized gap-fix pass. An explicit facelift request may be carried from 1-click intake, but it remains gated until normal clone acceptance; 1-click never implies facelift by itself.

In a one-click build run, keep selecting and executing stages until one of these durable outcomes exists:

  • website/completion.json is valid and the latest visual review is complete with no open critical/high identity finding; or

  • five visual gap cycles have been completed and website/completion.json records the truthful terminal status done_with_gaps with the final reviewed evidence; or

  • a genuine blocker is recorded with owner, evidence, attempted recovery, and exact next authority/action needed.

An owned local extraction gap is not a genuine blocker. Continue unrelated work, use no more than two distinct targeted recovery attempts, then build the affected dependency closure provisionally and surface post-assembly choices in final-report.json and .md.

Before classifying a shell, browser, or network failure as a blocker, use the repo-local Wix/Yarn toolchain PATH ordering and follow the recovery order in resources/rp-project-context/SKILL.md: aligned-shell retry, then the required browser/network escalation and retry, then blocker only if it still fails or approval is pending. After every gap iteration, immediately return to the stage table; never treat a first build, a reported plan, or backend import as frontend completion.

Commands

Run node scripts/site-clone.mjs <source-url> for standalone mode, or node scripts/site-clone.mjs <source-url> --handoff <path> for migration mode. The active resource gives the exact commands and inputs for its stage.

References

Resources load their own references. The shared contracts are kept under references/: safety.md, workflow.md, extraction-schema.md, output-contract.md, qa-checklist.md, and the interaction/layout/control/normalization/gap contracts.

Files

scripts/generate-scene-contract.mjs

#!/usr/bin/env node
import path from "node:path";
import { docsDir, parseArgs, readJson, resolveOutputDir, writeJson } from "./lib/common.mjs";

async function main() {
  const args = parseArgs();
  const outputDir = resolveOutputDir(args._[0] || args.url, args.out);
  const contract = await generateSceneContract({ outputDir });
  if (args.json) process.stdout.write(`${JSON.stringify(contract, null, 2)}\n`);
}

export async function generateSceneContract({ outputDir, pages: suppliedPages, interactionMap: suppliedInteractionMap } = {}) {
  const docs = docsDir(outputDir);
  const interactionMap = suppliedInteractionMap || await readJson(path.join(docs, "interaction-map.json"));
  let sourceMap = null;
  if (!suppliedPages) {
    try {
      sourceMap = await readJson(path.join(docs, "source-map.json"));
    } catch {
      // Standalone interaction extraction embeds enriched pages in interaction-map.json.
    }
  }
  const pages = suppliedPages || sourceMap?.pages || interactionMap.pages || [];
  const interactions = interactionMap.interactions || [];
  const media = interactionMap.structural?.media || [];
  const scenes = pages.flatMap((page) => (page.sections || []).map((section) => buildScene({ page, section, interactions, media }))).filter(Boolean);
  const contract = {
    schemaVersion: 3,
    generatedAt: new Date().toISOString(),
    sourceUrl: interactionMap.sourceUrl || pages[0]?.url || "",
    scenes,
  };
  await writeJson(path.join(docs, "scene-contract.json"), contract);
  return contract;
}

export function buildScene({ page, section, interactions, media }) {
  const sectionInteractions = page.interactionDiscovery?.sectionInteractions?.find((entry) => entry.sectionId === section.id)?.interactions || [];
  const kinds = new Set(sectionInteractions.map((item) => item.kind));
  const classText = `${section.kind || ""} ${section.className || ""} ${(section.domRef?.classTokens || []).join(" ")} ${section.heading || ""}`.toLowerCase();
  const isHero = section.kind === "hero" || /hero/.test(classText) || section === page.sections?.[0];
  if (isHero && media.some((item) => item.role === "background")) kinds.add("embedded-media");
  if (/carousel|slider|rail|gallery/.test(classText)) kinds.add("carousel");
  if (/scroll|scene|sticky|pinned/.test(classText)) {
    if (interactions.some((item) => item.kind === "scroll-state")) kinds.add("scroll-state");
    if (interactions.some((item) => item.kind === "tabs")) kinds.add("tabs");
  }
  if (!kinds.size) return null;

  const sceneInteractions = interactions.filter((item) =>
    item.sectionIds?.includes(section.id) || sectionInteractions.some((summary) => interactionMatchesSummary(item, summary))
  );
  const sceneMedia = media.filter((item) => {
    const tokenText = `${item.domRef?.id || ""} ${(item.domRef?.classTokens || []).join(" ")} ${(item.domRef?.parentClassTokens || []).join(" ")} ${(item.domRef?.sectionClassTokens || []).join(" ")}`.toLowerCase();
    if (isHero) return item.id === media.find((candidate) => candidate.role === "background")?.id;
    if (kinds.has("scroll-state")) return item.role === "background" && /scroll|scene|sticky|pin|embed/.test(tokenText);
    return false;
  });
  const activeKinds = Array.from(kinds);
  const primitive = modelFor(activeKinds);
  const requirements = [];
  if (sceneMedia.some((item) => item.src)) requirements.push("Render each listed source-backed media surface with the recorded playback flags and scene role.");
  if (sceneMedia.some((item) => item.fallback?.policy === "fallback-only")) requirements.push("Treat recorded posters/backgrounds as loading, blocked-media, or error fallbacks only; do not visibly blend them behind active media.");
  if (sceneMedia.some((item) => !item.src)) requirements.push("Recreate the recorded runtime visual surface and its scene behavior; do not replace it with unrelated static imagery.");
  if (kinds.has("carousel")) requirements.push("Render a finite-width data-rp-viewport that clips or scrolls a wider data-rp-track, preserve the captured card geometry, separation mechanism, and exact initial active state, then manage the captured active-card state on click plus every captured hover state.");
  if (kinds.has("scroll-state")) requirements.push("Implement both entry progress and internal scroll progress: preserve media framing/sideways expansion through the captured entry and pinned phases, while applying transforms only to the measured motion owner and keeping static copy outside the visual scale scope.");
  if (kinds.has("tabs")) requirements.push("Implement visible labels as buttons and switch the captured content state without replacing the scene background.");
  const acceptance = [];
  if (sceneMedia.some((item) => item.src)) acceptance.push("The implementation references the exact source URLs and preserves applicable playback flags.");
  if (sceneMedia.some((item) => item.fallback?.policy === "fallback-only")) acceptance.push("No full-cover poster or image remains visibly composited with the active video/iframe.");
  if (sceneMedia.some((item) => !item.src)) acceptance.push("The implementation preserves the runtime surface's visual role and recorded state changes.");
  if (kinds.has("carousel")) acceptance.push("The viewport is narrower than the content track, and clicking a card changes its active/expanded state rather than only scrolling.");
  if (kinds.has("scroll-state")) acceptance.push("Each captured scroll phase produces the corresponding distinct media/copy geometry; add a midpoint phase if source evidence has only endpoints.");
  if (kinds.has("tabs")) acceptance.push("Each visible tab changes the text/content state while the section remains a single scene.");
  return {
    id: `${safeId(page)}-${section.id}`,
    sectionId: section.id,
    heading: section.heading || section.tag || "Untitled scene",
    sourceScreenshot: screenshotFor(section, page),
    interactionIds: sceneInteractions.map((item) => item.id),
    media: sceneMedia,
    states: sceneInteractions.map(sceneStateFor),
    implementation: {
      model: primitive,
      primitive,
      runtimeAdapter: runtimeAdapterFor(primitive),
      runtimeModule: "/site-clone/rp-interactions-bootstrap.mjs",
      bootstrap: "<script type=\"module\" src=\"/site-clone/rp-interactions-bootstrap.mjs\"></script>",
      markerContract: markerContractFor(primitive, sceneInteractions),
      initialState: initialStateFor(primitive, sceneInteractions),
      assertions: assertionsFor({ primitive, interactions: sceneInteractions, media: sceneMedia }),
      recipe: recipeFor(primitive),
      requirements,
      acceptance,
    },
    manualContentInventory: kinds.has("carousel") && !(page.repeaters || []).length,
  };
}

function sceneStateFor(item) {
  return {
    id: item.id,
    kind: item.kind,
    trigger: item.trigger,
    importance: item.importance,
    interactionMapRef: `interaction-map.json#${item.id}`,
    states: item.states,
    ...(item.scope ? { scope: item.scope } : {}),
    ...(item.timeline ? {
      timelineSummary: {
        sampledAtMs: item.timeline.sampledAtMs,
        observedSettleMs: item.timeline.observedSettleMs,
        changedNodeCount: item.timeline.changedNodeCount,
        changedNodes: (item.timeline.changes || []).slice(0, 16).map((change) => ({
          path: change.path,
          role: change.role,
          changedProperties: change.changedProperties,
        })),
        animations: item.timeline.animations || [],
      },
    } : {}),
    ...(item.invariants ? { invariants: item.invariants } : {}),
    screenshot: item.evidence?.screenshot || null,
  };
}

function interactionMatchesSummary(interaction, summary) {
  if (summary.id) return summary.id === interaction.id;
  const interactionTrigger = typeof interaction.trigger === "string" ? interaction.trigger : interaction.trigger?.type;
  const summaryTrigger = typeof summary.trigger === "string" ? summary.trigger : summary.trigger?.type;
  return interaction.kind === summary.kind && interaction.label === summary.label && interactionTrigger === summaryTrigger;
}

function markerContractFor(primitive, interactions = []) {
  const base = { scene: "data-rp-scene", initialized: "data-rp-initialized" };
  if (primitive === "active-card-rail") {
    const mode = interactions.find((item) => item.kind === "carousel")?.invariants?.initialState || "single-active";
    return { ...base, initialState: `data-rp-initial-state=\"${mode}\"`, viewport: "data-rp-viewport", track: "data-rp-track", item: "data-rp-item", hoverTarget: "data-rp-hover-target", activate: "data-rp-activate", control: "data-rp-direction", active: "data-rp-active=true" };
  }
  if (primitive === "content-switcher") {
    return { ...base, item: "data-rp-item", activate: "data-rp-activate", active: "data-rp-active=true", panel: "data-rp-panel", state: "data-rp-state" };
  }
  if (primitive === "scroll-scene") {
    return { ...base, phase: "data-rp-phase", visual: "data-rp-visual", content: "data-rp-content", curtain: "data-rp-curtain", panel: "data-rp-panel", item: "data-rp-item", activate: "data-rp-activate", active: "data-rp-active=true", state: "data-rp-state" };
  }
  return base;
}

function initialStateFor(primitive, interactions) {
  if (primitive !== "active-card-rail") return null;
  const invariants = interactions.find((item) => item.kind === "carousel")?.invariants || {};
  return {
    mode: invariants.initialState || "single-active",
    activeIndexes: invariants.initialActiveIndexes || [],
  };
}

function runtimeAdapterFor(primitive) {
  if (primitive === "active-card-rail") return "bindActiveItemRail";
  if (primitive === "content-switcher") return "bindContentSwitcher";
  if (primitive === "scroll-scene") return "bindScrollScene + bindContentSwitcher";
  return null;
}

function assertionsFor({ primitive, interactions, media }) {
  const assertions = [];
  if (primitive === "active-card-rail") {
    const observed = interactions.find((item) => item.kind === "carousel")?.invariants || {};
    assertions.push(
      { kind: "scene-present" },
      { kind: "runtime-initialized", primitive: "active-card-rail" },
      { kind: "minimum-item-count", value: Math.max(3, Number(observed.itemCount) || 3) },
      { kind: "horizontal-overflow", minimumRatio: roundTolerance(observed.horizontalOverflowRatio, 0.8, 1.05) },
      { kind: "initial-active-item-count", value: Number(observed.initialActiveCount) || 0 },
      { kind: "single-active-item", value: 1 },
      { kind: "activation-changes-state" },
    );
    if (Number(observed.expandedWidthRatio) > 1.1) {
      assertions.push({ kind: "active-item-width-ratio", minimumRatio: roundTolerance(observed.expandedWidthRatio, 0.8, 1.15) });
    }
    if (Number(observed.observedSettleMs) > 0) {
      assertions.push({ kind: "transition-settles", maximumMs: Math.ceil(Number(observed.observedSettleMs) * 1.5 + 100) });
    }
    if (observed.separation) assertions.push({ kind: "item-separation", observed: observed.separation });
    if (interactions.some((item) => (typeof item.trigger === "string" ? item.trigger : item.trigger?.type) === "hover")) {
      assertions.push({ kind: "hover-changes-visual-state" });
    }
  }
  if (primitive === "content-switcher" || primitive === "scroll-scene" && interactions.some((item) => item.kind === "tabs")) {
    assertions.push({ kind: "runtime-initialized", primitive: "content-switcher" });
    assertions.push({ kind: "activation-changes-content" }, { kind: "single-active-item", value: 1 });
  }
  if (primitive === "scroll-scene") {
    assertions.push({ kind: "runtime-initialized", primitive: "scroll-scene" });
    assertions.push({ kind: "scroll-produces-distinct-phases", minimumPhaseCount: 2 });
    const scrollInteraction = interactions.find((item) => item.kind === "scroll-state") || {};
    const phases = scrollInteraction.states || [];
    if (JSON.stringify(phases).includes('"position":"fixed"')) assertions.push({ kind: "visual-pins-during-scroll" });
    const expansion = scrollInteraction.invariants?.visualExpansion;
    const expansionRatio = Math.max(Number(expansion?.score) || 1, Number(expansion?.widthRatio) || 1, Number(expansion?.transformScaleRatio) || 1);
    if (expansionRatio > 1.1) {
      assertions.push({
        kind: "scroll-visual-expansion",
        minimumRatio: rangeRatioTolerance(expansionRatio, 0.8, 1.05),
      });
    }
    const contentMotion = scrollInteraction.invariants?.motionOwnership?.content;
    if (contentMotion && contentMotion.scales === false) {
      assertions.push({ kind: "scroll-content-scale-bound", maximumRatio: Number(contentMotion.maximumAllowedScaleRatio) || 1.03 });
    }
  }
  for (const item of media.filter((entry) => entry.src)) {
    assertions.push({ kind: "media-source-present", source: item.src, playback: item.playback || {} });
    if (item.fallback?.policy === "fallback-only") assertions.push({ kind: "exclusive-media-layer", fallbackSource: item.fallback.src });
  }
  return assertions;
}

function recipeFor(primitive) {
  const common = {
    bootstrap: "Add exactly once near the end of the document: <script type=\"module\" src=\"/site-clone/rp-interactions-bootstrap.mjs\"></script>",
    warning: "A raw browser script must not import a relative module from src/. Use the public bootstrap above, or use the framework's compiled source import without type=module.",
  };
  if (primitive === "active-card-rail") return {
    ...common,
    steps: [
      "Put data-rp-viewport on a finite-width overflow-x:auto or overflow:hidden element.",
      "Put data-rp-track on its wider max-content flex/grid row; never put overflow on a max-content track.",
      "Put data-rp-item on every card and data-rp-activate on the card activation control.",
      "Set data-rp-initial-state to the captured invariant. Use all-collapsed when the source has no active item; never pre-open a card for visual variety.",
      "Reproduce the recorded separation mechanism (track gap, margins, divider, or inner inset) rather than guessing a generic gap.",
      "Mark the element with the source hover treatment as data-rp-hover-target and reproduce that treatment with :hover/:focus-visible CSS.",
      "Style data-rp-active=true to reproduce the observed expanded/collapsed ratio; keep active links above any activation hit target.",
    ],
  };
  if (primitive === "scroll-scene") return {
    ...common,
    steps: [
      "Give the scene enough scroll height and mark only the measured pinned/scaled wrapper with data-rp-visual.",
      "Mark independently positioned copy with data-rp-content. Do not nest it inside a scaling visual wrapper unless the source evidence explicitly records content scaling.",
      "Use --rp-entry-progress for the approach expansion and --rp-scroll-progress for pinned/release phases.",
      "When the source uses side curtains/masks, mark both with data-rp-curtain and reduce their widths as entry progress increases.",
      "If tabs exist, give controls and panels matching data-rp-state values.",
      "Do not render a fallback poster at the same time as an opaque active video/iframe.",
    ],
  };
  if (primitive === "content-switcher") return {
    ...common,
    steps: [
      "Give each visible control data-rp-item, data-rp-activate, and a unique data-rp-state.",
      "Give its content panel the matching data-rp-panel and data-rp-state.",
    ],
  };
  return common;
}

function roundTolerance(value, factor, floor) {
  const numeric = Number(value) || 0;
  return Math.round(Math.max(floor, numeric * factor) * 1000) / 1000;
}

function rangeRatioTolerance(value, factor, floor) {
  const numeric = Math.max(1, Number(value) || 1);
  return Math.round(Math.max(floor, 1 + (numeric - 1) * factor) * 1000) / 1000;
}

function modelFor(kinds) {
  if (kinds.includes("scroll-state")) return "scroll-scene";
  if (kinds.includes("carousel")) return "active-card-rail";
  if (kinds.includes("tabs")) return "content-switcher";
  return "media-scene";
}

function screenshotFor(section, page) {
  if (section.kind === "hero") return page.screenshots?.desktop || null;
  return page.screenshots?.desktop || page.screenshots?.tablet || null;
}

function safeId(page) {
  return `${page.area || "page"}-${String(page.path || "home").replace(/[^a-z0-9]+/gi, "-").replace(/^-+|-+$/g, "") || "home"}`;
}

if (import.meta.url === `file://${process.argv[1]}`) {
  main().catch((error) => {
    console.error(error.stack || error.message);
    process.exit(1);
  });
}

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Needs Node.js

Security

What our scanner noticed· Low risk

  • Scripts that your agent may run

This skill includes scripts that your agent may run. Read them before you use it.

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Published by
Wix
Publisher
Wix (Official)
Source
wix/skills · wix-headless-replatform · commit d168bc2
Licence
MIT License (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Wix.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download wix-headless-replatform.zip