Communitygithub.com

Jane-xiaoer/claude-skill-web-clone

网站复刻 / 克隆方法论。USE WHEN 用户说 复刻网站、克隆网站、clone website、抄个站、仿站、 照着这个站做一个、reproduce site、还原某个网页效果、把这个站搬下来改成我的、 复刻某个交互/WebGL/Canvas/Three.js 效果。提供「先拿真源码 → 判路径 → 逆向拆解 → 搭工程 → 替换内容」的可移植决策树,覆盖静态站 / React-Vue-Next 内容站 / WebGL-Canvas 重前端站三大分支,并强制核对任何 AI 二手分析里的可执行代码。

claude-skill-web-clone 是什么?

claude-skill-web-clone is a Claude Code agent skill that 网站复刻 / 克隆方法论。USE WHEN 用户说 复刻网站、克隆网站、clone website、抄个站、仿站、 照着这个站做一个、reproduce site、还原某个网页效果、把这个站搬下来改成我的、 复刻某个交互/WebGL/Canvas/Three.js 效果。提供「先拿真源码 → 判路径 → 逆向拆解 → 搭工程 → 替换内容」的可移植决策树,覆盖静态站 / React-Vue-Next 内容站 / WebGL-Canvas 重前端站三大分支,并强制核对任何 AI 二手分析里的可执行代码。.

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add Jane-xiaoer/claude-skill-web-clone

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

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-browser only for login-walled private sites; use Browser skill 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 ResultPath to Take
Static HTML/CSS, no frameworkwget --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 pagesRun network-capture.mjs first to save API fixtures → local JSON/mock server stand-in
Multi-page marketing / product siteRun route-crawl.mjs first for route map → extract template per page type → uniformly replace content
Complex interactive siteRun 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 frontendDeep 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 WebGLmirror-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.md to 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=false cannot 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"):

  1. Evidence Grading: Mark each conclusion as SOURCE (real source code/source-map/runtime dump/frame capture), PARTIAL (name/snippet, pending verification), or GUESS (visual fit/magic number). Unmarked = GUESS; must be upgraded to SOURCE before copying.
  2. 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.
  3. 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.js MeshPhysicalMaterial(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
LicenseWhat You Can Do
MIT / Apache / BSD / UnlicenseModify, 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 prohibitedRead-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.md index line

Built-in Scripts

  • scripts/init-clone.mjs: Initialize clone project skeleton and NOTES.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). See references/static-mirror.md for 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; generate CLONE_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: Generate design-dna.json design identity skeleton from recon JSON (font/color candidates/framework effect signals best-effort pre-filled), for use in "Visual Reproduction / Content Overhaul" modes. See references/design-dna.md for 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.

相关技能