Web Clone · Website Cloning Methodology
Make "cloning a website" a repeatable process. Working directory: ~/projects/website-clones/ (each clone is a subdirectory).
The #1 Rule: Real Source Code Above All, Never Trust AI-Guessed Code
Any AI-generated "clone analysis/blueprint"—the conceptual skeleton may be useful as a reference, but every executable code block within is, by default, fabricated. You must verify each line against the real source code; copying blindly will fail.
Evidence (marbles case): One AI analysis document misidentified the real architecture of the original site—"analytic ray-sphere intersection + encoding optical results into a displacement map, fed to SVG feDisplacementMap to warp the real DOM"—as "ray-marching + SDF + sampling the DOM as a texture." These are two completely different implementations; copying the latter would fail to reproduce the original effect and would be orders of magnitude slower. See references/marbles-case.md for details.
Therefore, the first action is always: obtain the real source code.
Decision Tree (Follow in Order, No Skipping)
Step 0 · Create Standard Project Skeleton First
node /Users/jane/.shared-skills/web-clone/scripts/init-clone.mjs <site-name> --url <original-site-URL>
This script creates ~/projects/website-clones/<site-name>-clone/, NOTES.md, and RECON/screenshots/, preventing you from forgetting any deliverables each time.
Step 1 · Search GitHub for Source Code First, Don't Scrape the Site Yet
unset SSL_CERT_FILE # macOS quirk, unset before bash
# Search by site/product name
SSL_CERT_FILE=/etc/ssl/cert.pem gh api "search/repositories?q=<keyword>" \
| jq -r '.items[] | "\(.full_name) ⭐\(.stargazers_count) \(.description)"' | head -10
# For vercel.app/netlify.app/github.io, the URL slug is often the repo name / deployer username
- Single-file sites (github.io / pure HTML) → grab raw directly:
curl -sL https://raw.githubusercontent.com/<user>/<repo>/main/index.html - If you find source code and the license permits → skip to Step 4 and clone directly. Lesson: searching GitHub first can save 30 minutes of detours.
Step 2 · No Source Code Found → Browser Reconnaissance (Probe)
Load the Browser skill or playwright MCP, run probes to extract signals (framework / window.THREE / number of canvases / smooth scroll libraries / fonts / scrollHeight). Take screenshots at 1440/768/390 three breakpoints + save reconnaissance JSON to <site>/RECON/.
Prefer using built-in scripts to run standard reconnaissance:
node /Users/jane/.shared-skills/web-clone/scripts/recon-site.mjs \
--url <original-site-URL> \
--out ~/projects/website-clones/<site-name>-clone/RECON \
--label original
node /Users/jane/.shared-skills/web-clone/scripts/asset-harvest.mjs \
--recon ~/projects/website-clones/<site-name>-clone/RECON/original-recon.json \
--out ~/projects/website-clones/<site-name>-clone/assets/original \
--manifest ~/projects/website-clones/<site-name>-clone/RECON/asset-manifest.json
node /Users/jane/.shared-skills/web-clone/scripts/network-capture.mjs \
--url <original-site-URL> \
--out ~/projects/website-clones/<site-name>-clone/RECON/network \
--label original
node /Users/jane/.shared-skills/web-clone/scripts/route-crawl.mjs \
--url <original-site-URL> \
--out ~/projects/website-clones/<site-name>-clone/RECON/routes \
--label original \
--max-pages 25 \
--max-depth 2
node /Users/jane/.shared-skills/web-clone/scripts/interaction-probe.mjs \
--url <original-site-URL> \
--out ~/projects/website-clones/<site-name>-clone/RECON/interactions \
--label original
node /Users/jane/.shared-skills/web-clone/scripts/sourcemap-hunt.mjs \
--recon ~/projects/website-clones/<site-name>-clone/RECON/original-recon.json \
--out ~/projects/website-clones/<site-name>-clone/RECON/sourcemaps
Use
bb-browseronly for login-walled private sites; useBrowserskill or playwright for localhost / public sites without login (don't touch bb-browser, it will steal Brave).
Step 2.5 · Assess Complexity First, Don't Make Blind Promises
Based on reconnaissance results, write a "pre-cloning assessment": complexity level L1-L6, recommended mode (faithful reproduction / visual reproduction / content overhaul), estimated scope of reproduction, and parts explicitly not cloned. Grading and scoring rules are in references/assessment.md.
If the mode is "Visual Reproduction" or "Content Overhaul" → generate a structured design identity design-dna.json. This turns "the feel of that site" into a versionable, comparable token specification, providing a basis for "keep the DNA, swap the content" during Step 6:
node /Users/jane/.shared-skills/web-clone/scripts/dna-scaffold.mjs \
--recon ~/projects/website-clones/<site-name>-clone/RECON/original-recon.json \
--out ~/projects/website-clones/<site-name>-clone/RECON/design-dna.json \
--name "<site-name>"
The script best-effort pre-fills detected font/color candidates/framework effect signals; remaining fields are to be manually analyzed and completed. For the three-dimensional structure (design_system / design_style / visual_effects), full schema, and applicability boundaries, see references/design-dna.md.
⚠️ Do NOT use DNA for "Faithful Reproduction" branch: Real source code is the truth; don't let an "approximate style" DNA dilute byte-for-byte discipline.
Step 3 · Choose Path Based on Recon Results
| Recon Result | Path to Take |
|---|---|
| Static HTML/CSS, no framework | wget --mirror to mirror → remove tracking scripts → rewrite copy |
| React / Vue / Next (content-focused) | Rebuild template (e.g., ai-website-cloner-template, Node 24+), inject content |
| SPA / SaaS / data-driven pages | Run network-capture.mjs first to save API fixtures → local JSON/mock server stand-in |
| Multi-page marketing / product site | Run route-crawl.mjs first for route map → extract template per page type → uniformly replace content |
| Complex interactive site | Run interaction-probe.mjs first to record hover/click/scroll/canvas drag states → supplement interactions per state; never capture only the above-the-fold |
| WebGL / Canvas / Three.js heavy frontend | Deep reverse engineering of real source code (see below) → faithful reproduction or find similar open-source 3D templates and swap content. For single-file native sites, byte-for-byte preservation often equals the most faithful reproduction. When real source code is unavailable, fall back to runtime frame capture + baseline gate, with discipline per references/effect-extraction.md (may delegate to web-shader-extractor) |
| Static build sites (Astro/Vite SSG/Hugo), including heavy WebGL | mirror-site.mjs full mirror of deployment assets → self-host fonts + remove trackers → serve locally with a web root = 1:1 faithful reproduction from real source code. For static sites, "getting real source code" = "mirroring the entire deployment asset set." Recipe in references/static-mirror.md. Example: oryzo.ai (Lusion, L6, Gaussian splatting, hero pixel diff 5/5) |
| Sites using off-the-shelf open-source themes (Astro/Hugo themes) | Find the source theme in the corresponding theme marketplace (only for sites using pre-built themes; for custom sites, use the full mirror path from the row above, not this one) |
For L4-L6 complex sites, follow references/complex-playbooks.md; do not use the standard marketing site flow alone.
Step 4 · Build the Project in the Clone Hub
mkdir ~/projects/website-clones/<site-name>-clone && cd $_
# Git source: clone inside; single file: drop inside. Keep a read-only baseline copy of the original source as index-original.html
# Check Node version (package.json engines), nvm use corresponding version, pin .nvmrc
Step 5 · Remove Tracking + Write Metadata + Validate
- Remove tracking: Google Analytics (
gtag/googletagmanager), pixels, heatmaps—precise line-by-line removal (GA blocks are often at top of<head>). - Write NOTES.md (required): includes complexity, clone mode, original vs. clone comparison, fidelity score, known gaps. Template in
references/deliverables.md. - For complex sites, write TEARDOWN.md (technical teardown). All conclusions must cite real source code line numbers.
- Score the clone: Use
references/assessment.mdto rate structure / visuals / interaction / responsiveness / content replacement / functional completeness. Scores must be supported by screenshots, source code, and runtime results. - Browser real validation (hard requirement, never just look at code and say "it should run"): Start local server → open in browser → check console (no JS/WebGL compilation errors) → compare screenshots with the original. Honestly document parts that cannot be verified (e.g., synthetic PointerEvent
isTrusted=falsecannot trigger drag operations; state this truthfully, don't fabricate "drag succeeded").
After cloning completion, run clone reconnaissance and generate an automated comparison report:
node /Users/jane/.shared-skills/web-clone/scripts/recon-site.mjs \
--url http://127.0.0.1:<port>/ \
--out ~/projects/website-clones/<site-name>-clone/RECON \
--label clone
node /Users/jane/.shared-skills/web-clone/scripts/route-crawl.mjs \
--url http://127.0.0.1:<port>/ \
--out ~/projects/website-clones/<site-name>-clone/RECON/routes-clone \
--label clone \
--max-pages 25 \
--max-depth 2
node /Users/jane/.shared-skills/web-clone/scripts/interaction-probe.mjs \
--url http://127.0.0.1:<port>/ \
--out ~/projects/website-clones/<site-name>-clone/RECON/interactions-clone \
--label clone
node /Users/jane/.shared-skills/web-clone/scripts/compare-recon.mjs \
--original ~/projects/website-clones/<site-name>-clone/RECON/original-recon.json \
--clone ~/projects/website-clones/<site-name>-clone/RECON/clone-recon.json \
--visual-diff ~/projects/website-clones/<site-name>-clone/RECON/visual-diff-1440.json \
--original-routes ~/projects/website-clones/<site-name>-clone/RECON/routes/original-route-map.json \
--clone-routes ~/projects/website-clones/<site-name>-clone/RECON/routes-clone/clone-route-map.json \
--original-interactions ~/projects/website-clones/<site-name>-clone/RECON/interactions/original-interactions.json \
--clone-interactions ~/projects/website-clones/<site-name>-clone/RECON/interactions-clone/clone-interactions.json \
--out ~/projects/website-clones/<site-name>-clone/CLONE_REPORT.md
node /Users/jane/.shared-skills/web-clone/scripts/visual-diff.mjs \
--original ~/projects/website-clones/<site-name>-clone/RECON/screenshots/original-1440.png \
--clone ~/projects/website-clones/<site-name>-clone/RECON/screenshots/clone-1440.png \
--out ~/projects/website-clones/<site-name>-clone/RECON/visual-diff-1440.json \
--diff ~/projects/website-clones/<site-name>-clone/RECON/screenshots/visual-diff-1440.png
node /Users/jane/.shared-skills/web-clone/scripts/audit-clone.mjs \
--project ~/projects/website-clones/<site-name>-clone \
--brand "<original-site-brand-name>" \
--out ~/projects/website-clones/<site-name>-clone/CLONE_AUDIT.md
Step 6 · Replace with Jane's Own Stuff
The goal is always "to build her own site," not to copy an identical one. Three-part replacement: text (index.html/data/*.json/content/*.md), media (public/assets), brand colors (CSS variables / Tailwind theme). If the structure is non-trivial, write REPLACE_GUIDE.md.
For those who created design-dna.json (visual/overhaul modes): this step is its payoff—keep the DNA, swap the content. Materialize design_system into CSS custom properties, make subjective trade-offs based on design_style, choose implementation layers per visual_effects.effect_intensity (lightweight CSS / medium Canvas+GSAP / heavy Three.js); prefer asset-harvest.mjs to get real images from the original site, don't redraw approximations with AI. Generation flow in references/design-dna.md.
Reverse Engineering WebGL/Canvas Heavy Frontends (Core Craft)
Break an interactive site down into technical pillars, locate the real implementation for each pillar + mark line numbers: rendering (WebGL/shader algorithm), compositing (SVG filter / multiple canvases / post-processing), physics, interaction, audio. Only then verify any second-hand analysis.
Three-piece discipline for reverse-engineering effects (to combat "tweak while beautifying, ending up neither accurate nor explainable"):
- Evidence Grading: Mark each conclusion as
SOURCE(real source code/source-map/runtime dump/frame capture),PARTIAL(name/snippet, pending verification), orGUESS(visual fit/magic number). Unmarked = GUESS; must be upgraded to SOURCE before copying. - No-compensation: Forbidden to adjust brightness/speed/position/noise to mask timing/coordinate/state errors; fitted values still marked GUESS, specify what evidence is needed to upgrade.
- Baseline-first gate: First use real draw calls/shaders/uniforms to create a "minimal faithfully reproducible RAW REPLAY" → verify frame-by-frame → only then allow engineering refactoring.
See
references/effect-extraction.md(including runtime capture fallback + when to delegate to web-shader-extractor).
Transferable advanced paradigm (worth collecting):
- Displacement map DOM refraction: Off-screen WebGL computes a "displacement map" (RG=displacement/B=Fresnel), then SVG
<filter><feDisplacementMap scale=N>uses it to warp real, live, interactive HTML—refracting true DOM, with WebGL never touching DOM pixels. This is the soul of marbles, and something Three.jsMeshPhysicalMaterial(transmission)cannot do (it can only create a "glass ball appearance," not "refract the entire webpage").
Detailed methodology + marbles real architecture step-by-step teardown → references/reverse-engineering.md, references/marbles-case.md.
Licensing and Attribution (Check Before Cloning)
SSL_CERT_FILE=/etc/ssl/cert.pem gh api repos/<u>/<r> | jq '.license' # + find LICENSE file + check README
| License | What You Can Do |
|---|---|
| MIT / Apache / BSD / Unlicense | Modify, deploy; just retain attribution |
| NONE (no LICENSE file / no declaration) | All rights reserved by default. Local learning/clone only; must credit original author; not permitted to publicly redeploy without permission. Don't assume public on GitHub means free to use |
| Proprietary / explicitly prohibited | Read-only learning; no copying or deployment |
⚠️ Don't equate "public on GitHub" or "temporarily not found by gh api" with MIT—verify thoroughly.
Deliverable Standards
- Root of each sub-project:
NOTES.md(source info/tech stack/license/replacement map/run command) - Complex interactive sites add:
TEARDOWN.md(technical teardown, with line numbers) - When external reporting or evaluation of skill effectiveness is needed, add:
CLONE_REPORT.md(complete original vs. clone comparison) - Before deployment, add:
CLONE_AUDIT.md(tracking scripts, original site brand/language remnants, TODOs, external link risks) RECON/screenshots/: original vs. clone comparison images- After cloning, update the hub
README.mdindex line
Built-in Scripts
scripts/init-clone.mjs: Initialize clone project skeleton andNOTES.md.scripts/recon-site.mjs: Open page with Playwright, collect framework/resources/DOM structure/console errors, and save screenshots at three breakpoints.scripts/asset-harvest.mjs: Download original site images, scripts, and styles from recon JSON; generate asset manifest.scripts/network-capture.mjs: Capture XHR/fetch requests and save JSON/text responses for SPA/SaaS local fixtures.scripts/mirror-site.mjs: True browser full-scroll capture of every real request → mirror same-origin assets (including.sog/.buf/.wasm/.riv/fonts fetched at JS runtime) path-by-path, for 1:1 faithful reproduction of static build sites (Astro/Vite SSG/Hugo). Seereferences/static-mirror.mdfor details.scripts/route-crawl.mjs: Crawl same-site internal links, save screenshots/title/H1/structure signals per route, solving the problem of only cloning the homepage for multi-page sites.scripts/interaction-probe.mjs: Automatically execute scroll, hover, safe click, canvas drag; save pre/post interaction states, screenshots, network and console evidence.scripts/sourcemap-hunt.mjs: Search for source maps in JS chunks; save source mappings if found.scripts/compare-recon.mjs: Read original and clone recon JSON, route maps, interaction evidence; generateCLONE_REPORT.md.scripts/visual-diff.mjs: Use browser canvas for screenshot pixel diff; output visual score and diff image.scripts/audit-clone.mjs: Scan for tracking scripts, original site brand remnants, Japanese text remnants, TODOs, external URL risks.scripts/dna-scaffold.mjs: Generatedesign-dna.jsondesign identity skeleton from recon JSON (font/color candidates/framework effect signals best-effort pre-filled), for use in "Visual Reproduction / Content Overhaul" modes. Seereferences/design-dna.mdfor details.
Capability Boundaries (Default Stance)
- Can do high-fidelity: Static marketing pages, corporate websites, content-focused React/Vue/Next frontends, animation sites with available source code.
- Can visually reproduce but will simplify: CMS backend data, complex scroll-driven narratives, multi-breakpoint responsiveness, WebGL/Canvas effects, third-party embeds.
- By default, do not promise full clone: Login, payments, checkout, search recommendations, permission systems, server-side business logic, proprietary APIs, copyright-restricted assets. Only build demonstrable frontend stand-ins when needed.
- When doing content overhaul: Prioritize preserving the original site's information architecture, rhythm, motion effects, and visual language; replace copy, images, brand colors, and business propositions with Jane's own content.
Flagship Case Study
~/projects/website-clones/marbles-clone/ — A glass marble site using native WebGL + SVG Filter + custom physics, faithfully reproduced byte-for-byte with a complete TEARDOWN. It serves as the exemplar for the "WebGL heavy frontend" branch.