packages/shared-skills/skills/frontend/references/design/clone-from-url.md
Use this when the user gives a live site or a URL to clone: "clone aside.com", "rebuild this page", "make it look exactly like <url>". A live URL affords what a screenshot cannot — the browser's runtime truth. Extract that truth with the real browser, make it the DESIGN.md contract, then build reusable primitives against it. Never eyeball a screenshot into a one-off.
A DESIGN.md whose every token, interaction state, and motion value was read from the running page with getComputedStyle, plus a component-level clone that an independent reviewer confirms is an extensible design system (live DOM, reused primitives) — not a screenshot-matched or pasted-image fake. Done is defined by /visual-qa reference-fidelity mode passing on fresh evidence, not by your own glance.
Drive a real browser: Codex browser:control-in-app-browser first, otherwise the project's agent-browser / playwright / dev-browser tooling. Do NOT parse CSS files — minification, CORS, CSS-in-JS, and Tailwind utilities make source unreliable. getComputedStyle returns what the browser ACTUALLY rendered, so it is the only source of truth.
Sweep the page and read, for every meaningful element and every repeated pattern:
default/hover/focus/active (plus disabled/loading/empty/error where they exist) by DRIVING the state, then re-reading the computed style. A system with only the resting state is incomplete.transition (property, duration, timing function, delay), @keyframes (walk document.styleSheets for CSSKeyframesRule), and transform. Motion is part of the contract, not decoration.@font-face files, video sources. Download the REAL assets; never substitute stock or placeholders.A compact sweep payload to inject through the browser's evaluate action (extend the recorded fields as needed):
() => {
const out = [];
for (const el of document.querySelectorAll("*")) {
const s = getComputedStyle(el);
out.push({
tag: el.tagName,
color: s.color, background: s.backgroundColor, border: s.borderColor,
font: s.fontFamily, size: s.fontSize, weight: s.fontWeight,
lineHeight: s.lineHeight, letterSpacing: s.letterSpacing,
radius: s.borderRadius, shadow: s.boxShadow,
padding: s.padding, margin: s.margin, gap: s.gap,
transition: s.transition, animation: s.animation, transform: s.transform,
});
}
return out;
}
Turn the extraction into DESIGN.md per design-system-architecture.md: token scales, typography, spacing, the component anatomy with every captured state, the motion rules, and the responsive deltas. Name which source each value came from. If a value is not in DESIGN.md, it may not appear in code.
Build primitives against the contract, not the screenshot. One component per cycle: implement, render, compare to the source region, fix, then move on. Use the downloaded assets. Never paste a raster or background-image where a live element belongs. Never approximate a token you already extracted.
Verify through /visual-qa in reference-fidelity mode against the source captures, for every page and every breakpoint. Interaction states and animations are IN SCOPE: drive hover/focus/click/scroll, then compare the settled states AND the motion itself against the source. You are not done until the dual-oracle gate passes on fresh evidence.
getComputedStyle — the rendered truth is the only source.This runtime-extraction workflow follows the MIT-licensed JCodesMore/ai-website-cloner-template clone-website approach: browser automation plus a getComputedStyle sweep, state/motion/asset capture, spec files, and visual QA. It is a project-original synthesis, not a copy of that template. Do not treat this file as a license to copy any target site's trademarks, brand assets, logos, or proprietary copy — extract the design system (tokens, layout grammar, component anatomy, interaction states, motion) and apply it to the user's own product and content.