# Clone Website

> Reverse-engineer and rebuild a website as a pixel-perfect clone in one pass — extracts assets, CSS, animations, and content section-by-section and dispatches parallel builder agents in worktrees as it goes. Use whenever the user wants to clone, replicate, rebuild, reverse-engineer, or copy any web page. Provide the target URL as the argument.

- **Type:** Skill
- **Install:** `agentstack add skill-david-vrba-claude-power-skills-clone-website`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [david-vrba](https://agentstack.voostack.com/s/david-vrba)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [david-vrba](https://github.com/david-vrba)
- **Source:** https://github.com/david-vrba/claude-power-skills/tree/master/skills/clone-website

## Install

```sh
agentstack add skill-david-vrba-claude-power-skills-clone-website
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Clone Website

You are about to reverse-engineer and rebuild **$ARGUMENTS** as a pixel-perfect clone.

This is not a two-phase process (inspect then build). You are a **foreman walking the job site** — as you inspect each section of the page, you write a detailed specification to a file, then hand that file to a specialist builder agent with everything they need. Extraction and construction happen in parallel, but extraction is meticulous and produces auditable artifacts.

## Scope Defaults

The target is whatever page `$ARGUMENTS` resolves to. Clone exactly what's visible at that URL. Unless the user specifies otherwise, use these defaults:

- **Fidelity level:** Pixel-perfect — exact match in colors, spacing, typography, animations
- **In scope:** Visual layout and styling, component structure and interactions, responsive design, animations, scroll behaviors, mock data for demo purposes
- **Out of scope:** Real backend / database, authentication, real-time features, SEO optimization, accessibility audit
- **Customization:** None — pure emulation

If the user provides additional instructions (specific fidelity level, customizations, extra context), honor those over the defaults.

## Pre-Flight

1. **Browser automation is required.** Check for available browser MCP tools (Chrome MCP, Playwright MCP, Browserbase MCP, Puppeteer MCP, etc.). Use whichever is available — if multiple exist, prefer Chrome MCP. If none are detected, ask the user which browser tool they have and how to connect it. This skill cannot work without browser automation.
2. Verify the target URL from `$ARGUMENTS` is valid and accessible via your browser MCP tool.
3. Verify the base project builds: `npm run build`. The Next.js + shadcn/ui + Tailwind v4 scaffold should already be in place. If not, tell the user to set it up first.
4. Create the output directories if they don't exist: `docs/research/`, `docs/research/components/`, `docs/design-references/`, `scripts/`.

## Guiding Principles

These are the truths that separate a successful clone from a "close enough" mess. Internalize them — they should inform every decision you make.

### 1. Completeness Beats Speed

Every builder agent must receive **everything** it needs to do its job perfectly: screenshot, exact CSS values, downloaded assets with local paths, real text content, component structure. If a builder has to guess anything — a color, a font size, a padding value — you have failed at extraction. Take the extra minute to extract one more property rather than shipping an incomplete brief.

### 2. Small Tasks, Perfect Results

When an agent gets "build the entire features section," it glosses over details — it approximates spacing, guesses font sizes, and produces something "close enough" but clearly wrong. When it gets a single focused component with exact CSS values, it nails it every time.

Look at each section and judge its complexity. A simple banner with a heading and a button? One agent. A complex section with 3 different card variants, each with unique hover states and internal layouts? One agent per card variant plus one for the section wrapper. When in doubt, make it smaller.

**Complexity budget rule:** If a builder prompt exceeds ~150 lines of spec content, the section is too complex for one agent. Break it into smaller pieces.

### 3. Real Content, Real Assets

Extract the actual text, images, videos, and SVGs from the live site. This is a clone, not a mockup. Use `element.textContent`, download every `` and ``, extract inline `` elements as React components. The only time you generate content is when something is clearly server-generated and unique per session.

**Layered assets matter.** A section that looks like one image is often multiple layers — a background watercolor/gradient, a foreground UI mockup PNG, an overlay icon. Inspect each container's full DOM tree and enumerate ALL `` elements and background images within it, including absolutely-positioned overlays.

### 4. Foundation First

Nothing can be built until the foundation exists: global CSS with the target site's design tokens (colors, fonts, spacing, keyframes), TypeScript types, and global assets. This is sequential and non-negotiable. Everything after this can be parallel.

### 5. Extract How It Looks AND How It Behaves — Including Every Animation

A website is not a screenshot — it's a living thing. Elements move, change, appear, and disappear in response to scrolling, hovering, clicking, resizing, and time. If you only extract the static CSS of each element, your clone will look right in a screenshot but feel dead when someone actually uses it.

For every element, extract its **appearance** (exact computed CSS via `getComputedStyle()`) AND its **behavior** (what changes, what triggers the change, and how the transition happens). Not "it looks like 16px" — extract the actual computed value. Not "the nav changes on scroll" — document the exact trigger, the before and after states, and the transition.

**Animation fidelity is non-negotiable.** Every `@keyframes` animation, every CSS transition, every scroll-driven animation, every GSAP tween parameter must be captured. See the dedicated **Animation Extraction** section for systematic procedures.

Examples of behaviors to watch for:
- A navbar that shrinks, changes background, or gains a shadow after scrolling past a threshold
- Elements that animate into view when they enter the viewport (fade-up, slide-in, stagger delays)
- Sections that snap into place on scroll (`scroll-snap-type`)
- Parallax layers that move at different rates than the scroll
- Hover states that animate (the transition duration and easing matter, not just the end value)
- Dropdowns, modals, accordions with enter/exit animations
- Scroll-driven progress indicators or opacity transitions
- Auto-playing carousels or cycling content
- Dark-to-light (or any theme) transitions between page sections
- **Tabbed/pill content that cycles** — buttons that switch visible card sets with transitions
- **Scroll-driven tab/accordion switching** — sidebars where the active item auto-changes as content scrolls past
- **Smooth scroll libraries** (Lenis, Locomotive Scroll) — check for `.lenis` class or scroll container wrappers
- **Custom cursors** — a div that follows the mouse, changes shape on hover
- **CSS scroll-driven animations** (native) — `animation-timeline: scroll()` or `view-timeline` on elements

### 6. Identify the Interaction Model Before Building

This is the single most expensive mistake in cloning: building a click-based UI when the original is scroll-driven, or vice versa. Before writing any builder prompt for an interactive section, you must definitively answer: **Is this section driven by clicks, scrolls, hovers, time, or some combination?**

How to determine this:
1. **Don't click first.** Scroll through the section slowly and observe if things change on their own as you scroll.
2. If they do, it's scroll-driven. Extract the mechanism: `IntersectionObserver`, `scroll-snap`, `position: sticky`, `animation-timeline`, or JS scroll listeners.
3. If nothing changes on scroll, THEN click/hover to test for click/hover-driven interactivity.
4. Document the interaction model explicitly in the component spec.

A section with a sticky sidebar and scrolling content panels is fundamentally different from a tabbed interface. Getting this wrong means a complete rewrite, not a CSS tweak.

### 7. Extract Every State, Not Just the Default

Many components have multiple visual states — a tab bar shows different cards per tab, a header looks different at scroll position 0 vs 100, a card has hover effects. You must extract ALL states.

For tabbed/stateful content: click each tab/button, extract the content and styles for EACH state. For scroll-dependent elements: capture at scroll 0, then scroll past the trigger and capture again. The diff between states IS the behavior specification.

### 8. Spec Files Are the Source of Truth

Every component gets a specification file in `docs/research/components/` BEFORE any builder is dispatched. The builder receives the spec file contents inline in its prompt. No guessing. No "go read the spec file." Everything inline.

### 9. Build Must Always Compile

Every builder agent must verify `npx tsc --noEmit` passes before finishing. After merging worktrees, verify `npm run build` passes. A broken build is never acceptable.

---

## Phase 0: Pre-Navigation Instrumentation

**Before navigating to the target URL**, inject these interception scripts using browser MCP's `addInitScript` (or equivalent). These scripts capture animation parameters that would otherwise be invisible — they must be in place BEFORE the page loads, or they miss the initialization calls.

### GSAP Tween Interception

```javascript
// Inject BEFORE navigation — intercepts all gsap.to/from/fromTo calls
window.__cloneCapture = { tweens: [], timelines: [], scrollTriggers: [] };

document.addEventListener('DOMContentLoaded', () => {
  if (!window.gsap) return;
  const wrap = (fn, type) => (target, ...args) => {
    try {
      const vars = args[args.length - 1];
      window.__cloneCapture.tweens.push({
        type,
        target: typeof target === 'string' ? target : (target?.className || target?.id || String(target).slice(0, 80)),
        vars: JSON.parse(JSON.stringify(vars || {})),
      });
    } catch {}
    return fn.call(window.gsap, target, ...args);
  };
  gsap.to   = wrap(gsap.to.bind(gsap), 'to');
  gsap.from = wrap(gsap.from.bind(gsap), 'from');
  gsap.fromTo = (t, f, v) => {
    try { window.__cloneCapture.tweens.push({ type: 'fromTo', target: String(t?.className || t).slice(0, 80), from: JSON.parse(JSON.stringify(f || {})), vars: JSON.parse(JSON.stringify(v || {})) }); } catch {}
    return gsap.fromTo.originalFn(t, f, v);
  };
});
```

### IntersectionObserver Interception

```javascript
// Inject BEFORE navigation — captures all IntersectionObserver registrations
window.__ioCapture = [];
const _OrigIO = window.IntersectionObserver;
window.IntersectionObserver = function(callback, options) {
  window.__ioCapture.push({
    options,
    callbackPreview: callback.toString().slice(0, 600),
  });
  return new _OrigIO(callback, options);
};
```

After the page loads and settles, retrieve the captured data:
```javascript
// Run AFTER page settles
JSON.stringify({ tweens: window.__cloneCapture, observers: window.__ioCapture }, null, 2)
```

Save to `docs/research/animation-capture.json`.

---

## Phase 1: Reconnaissance

Navigate to the target URL with browser MCP.

### Screenshots
- Take **full-page screenshots** at desktop (1440px) and mobile (390px) viewports
- Save to `docs/design-references/` with descriptive names
- These are your master reference — builders will receive section-specific crops later

### Tech Stack Detection

Run this via browser MCP immediately after page load:

```javascript
(() => ({
  // Frameworks
  react: !!(window.React || window.__REACT_DEVTOOLS_GLOBAL_HOOK__),
  nextjs: !!window.__NEXT_DATA__,
  vue: !!(window.Vue || window.__vue_app__),
  // Animation libraries
  gsap: !!window.gsap, gsapVersion: window.gsap?.version,
  gsapScrollTrigger: !!(window.ScrollTrigger || window.gsap?.plugins?.scrollTrigger),
  framerMotion: !!document.querySelector('[data-framer-component-type]'),
  animejs: !!window.anime,
  lottie: !!(window.lottie || window.bodymovin),
  // Scroll libraries
  lenis: !!(window.lenis || window.Lenis || document.documentElement.classList.contains('lenis')),
  locomotive: !!document.querySelector('.c-scrollbar, [data-scroll-container]'),
  // 3D / WebGL
  threeJs: !!window.THREE, pixiJs: !!window.PIXI,
  spline: !!document.querySelector('spline-viewer'),
  hasCanvas: !!document.querySelector('canvas'),
  // CSS capabilities
  nativeScrollDrivenAnimations: CSS.supports('animation-timeline: scroll()'),
  // Special elements
  hasCustomCursor: [...document.querySelectorAll('*')].some(el => getComputedStyle(el).cursor === 'none' && !['INPUT','TEXTAREA'].includes(el.tagName)),
  hasVideoBackground: !!document.querySelector('video[autoplay], video[muted]'),
  hasStickyNav: !!(document.querySelector('nav, header') && ['sticky','fixed'].includes(getComputedStyle(document.querySelector('nav, header')).position)),
  googleFonts: !!document.querySelector('link[href*="fonts.googleapis.com"]'),
}))()
```

Save to `docs/research/tech-stack.json`.

### Global Extraction
Extract these from the page before doing anything else:

**Fonts** — Inspect `` tags for Google Fonts or self-hosted fonts. Check computed `font-family` on key elements (headings, body, code, labels). Document every family, weight, and style actually used. Configure them in `src/app/layout.tsx` using `next/font/google` or `next/font/local`.

**Colors** — Extract the site's color palette from computed styles across the page. Update `src/app/globals.css` with the target's actual colors in the `:root` and `.dark` CSS variable blocks. Map them to shadcn's token names where they fit.

```javascript
// Extract ALL CSS custom properties (design tokens) with resolved values
(() => {
  const rootStyle = getComputedStyle(document.documentElement);
  const allRules = [];
  for (const sheet of document.styleSheets) {
    try { allRules.push(...sheet.cssRules); } catch {}
  }
  const props = [...new Set(
    allRules.flatMap(r => r.style ? [...r.style] : []).filter(p => p.startsWith('--'))
  )];
  const tokens = {};
  props.forEach(p => { tokens[p] = rootStyle.getPropertyValue(p).trim(); });
  return JSON.stringify(tokens, null, 2);
})()
```

**Global @keyframes** — Extract ALL keyframe animation rules from all accessible stylesheets:

```javascript
(() => {
  const keyframes = {};
  const blocked = [];
  for (const sheet of document.styleSheets) {
    try {
      for (const rule of sheet.cssRules) {
        if (rule.type === CSSRule.KEYFRAMES_RULE) {
          keyframes[rule.name] = rule.cssText;
        }
      }
    } catch { blocked.push(sheet.href); }
  }
  return JSON.stringify({ keyframes, blockedSheets: blocked }, null, 2);
})()
```

For any CORS-blocked sheets in `blockedSheets`: use browser MCP's network log to retrieve the CSS response body directly (it was already downloaded — CORS only blocks DOM API access). Extract @keyframes from those files manually by reading the response body text.

Save extracted @keyframes to `docs/research/keyframes.json`. These get added to `globals.css` during Phase 2.

**CSS Scroll-Driven Animations (native):**

```javascript
// Find all elements using animation-timeline or view-timeline
(() => {
  const results = [];
  // From stylesheets
  for (const sheet of document.styleSheets) {
    try {
      for (const rule of sheet.cssRules) {
        if (rule.cssText?.includes('animation-timeline') || rule.cssText?.includes('view-timeline')) {
          results.push({ type: 'stylesheet-rule', cssText: rule.cssText });
        }
      }
    } catch {}
  }
  // From computed styles on elements
  [...document.querySelectorAll('*')].forEach(el => {
    const cs = getComputedStyle(el);
    const timeline = cs.getPropertyValue('animation-timeline');
    if (timeline && timeline !== 'none' && timeline !== 'auto') {
      results.push({
        type: 'element',
        selector: el.className || el.id || el.tagName,
        animationTimeline: timeline,
        animationRange: cs.getPropertyValue('animation-range'),
        animationName: cs.animationName,
      });
    }
  });
  return JSON.stringify(results, null, 2);
})()
```

**Favicons & Meta** — Download favicons, apple-touch-icons, OG images, webmanifest to `public/seo/`. Update `layout.tsx` metadata.

**Global UI patterns** — Identify any site-wide CSS or JS: custom scrollbar hiding, scroll-snap on the page container, global keyframe animations, backdrop filters, **smooth scroll libraries** (Lenis, Locomotive Scroll). Add these to `globals.css` and note any libraries that need to be installed.

### Mandatory Int

…

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [david-vrba](https://github.com/david-vrba)
- **Source:** [david-vrba/claude-power-skills](https://github.com/david-vrba/claude-power-skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-david-vrba-claude-power-skills-clone-website
- Seller: https://agentstack.voostack.com/s/david-vrba
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
