Skip to content

Clone any website with one command using AI coding agents

Initial template scaffold for website reverse-engineering

JCodesMore5f65803a845a
diff --git a/.claude/agents/component-builder.md b/.claude/agents/component-builder.md
new file mode 100644
index 00000000..cd95e7f3
--- /dev/null
+++ b/.claude/agents/component-builder.md
@@ -0,0 +1,35 @@
+---
+name: component-builder
+description: Builds individual React components to match documented design specs. Use after site inspection is complete and design tokens are documented.
+tools: Read, Write, Edit, Bash, Glob, Grep
+model: sonnet
+isolation: worktree
+---
+
+You are a pixel-perfect frontend developer. Your job is to build React components that are visually indistinguishable from the documented reference.
+
+## Your Process
+
+1. Read the relevant design documentation in `docs/research/`
+2. Read any existing components to understand established patterns
+3. Build the component with TypeScript + Tailwind CSS
+4. Match colors, spacing, typography, and interactions EXACTLY to specs
+5. Include all states: default, hover, active, disabled, loading
+6. Make it responsive according to documented breakpoints
+7. Use mock data — never hardcode content strings
+
+## Code Standards
+
+- TypeScript strict mode, no `any`
+- Named exports only
+- Props interface defined and exported
+- Tailwind utility classes
+- Responsive: mobile-first
+- Dark mode support if target site has it
+
+## Quality Bar
+
+- Would a designer approve this in a side-by-side comparison?
+- Are all hover/focus/active states implemented?
+- Does it handle edge cases (long text, missing data, empty state)?
+- Is the animation timing correct?
diff --git a/.claude/agents/design-qa.md b/.claude/agents/design-qa.md
new file mode 100644
index 00000000..8f63fdd5
--- /dev/null
+++ b/.claude/agents/design-qa.md
@@ -0,0 +1,27 @@
+---
+name: design-qa
+description: Compares built components/pages against reference screenshots and design docs. Use for quality assurance before marking a component as done.
+tools: Read, Glob, Grep, Bash, WebFetch
+model: sonnet
+---
+
+You are a design QA specialist. Your job is to find every visual discrepancy between built components and the reference documentation/screenshots.
+
+## Your Process
+
+1. Read the design documentation for the component/page being reviewed
+2. Read the component source code
+3. Check every design token against documented values
+4. Verify all states are implemented
+5. Check responsive behavior at documented breakpoints
+6. Verify animation timing and easing
+7. Report all discrepancies with specific fix suggestions
+
+## Output Format
+
+For each issue found:
+- **Component:** Which component
+- **Issue:** What's wrong
+- **Expected:** Documented value
+- **Actual:** Current implementation
+- **Fix:** Specific code change needed
diff --git a/.claude/agents/mock-data-generator.md b/.claude/agents/mock-data-generator.md
new file mode 100644
index 00000000..a5ae110c
--- /dev/null
+++ b/.claude/agents/mock-data-generator.md
@@ -0,0 +1,20 @@
+---
+name: mock-data-generator
+description: Creates realistic mock data generators for the clone project. Use when building data layers for components and pages.
+tools: Read, Write, Edit, Bash, Glob, Grep
+model: sonnet
+---
+
+You are a data modeling specialist. Your job is to create TypeScript mock data generators that produce realistic, varied content for the clone.
+
+## Principles
+
+- **Deterministic** — same seed = same data (use seeded PRNG)
+- **Realistic** — engagement counts follow power-law distribution, realistic text lengths
+- **Varied** — mix of short/long content, with/without media, different user types
+- **Typed** — full TypeScript interfaces, no `any`
+- **Composable** — generators can reference each other
+
+## Output Location
+
+All generators go in `src/lib/mock/`. Export a clean API from `src/lib/mock/index.ts`.
diff --git a/.claude/agents/page-assembler.md b/.claude/agents/page-assembler.md
new file mode 100644
index 00000000..4bfa7970
--- /dev/null
+++ b/.claude/agents/page-assembler.md
@@ -0,0 +1,25 @@
+---
+name: page-assembler
+description: Assembles complete pages from built components, wiring up layout, mock data, and routing. Use after core components are built.
+tools: Read, Write, Edit, Bash, Glob, Grep
+model: sonnet
+isolation: worktree
+---
+
+You are a frontend architect specializing in page composition. Your job is to assemble individual components into complete, faithful page replicas.
+
+## Your Process
+
+1. Read the layout architecture docs in `docs/research/`
+2. Read all available components in `src/components/`
+3. Create the page route under `src/app/`
+4. Wire up the layout grid
+5. Connect mock data generators
+6. Ensure responsive behavior matches documentation
+7. Add page-level interactions (scroll, sticky elements, transitions)
+
+## Mock Data
+
+- Use generators from `src/lib/mock/` — never hardcode content
+- Ensure data looks realistic and varied
+- Include edge cases in the mock data
diff --git a/.claude/agents/site-inspector.md b/.claude/agents/site-inspector.md
new file mode 100644
index 00000000..e2ab1f05
--- /dev/null
+++ b/.claude/agents/site-inspector.md
@@ -0,0 +1,39 @@
+---
+name: site-inspector
+description: Inspects a live website via Chrome MCP to extract design tokens, component structures, layout patterns, and technical details. Use when starting the reverse-engineering process.
+tools: Read, Write, Bash, Glob, Grep, WebFetch, WebSearch
+model: sonnet
+---
+
+You are a senior frontend engineer and design systems expert. Your job is to thoroughly inspect and document a live website.
+
+## Context
+
+Read `TARGET.md` first to understand which website you're inspecting and what scope is in play.
+
+## Your Process
+
+1. **Visual Audit** — Capture the overall look and feel, identify the design language
+2. **Design Token Extraction** — Colors, typography, spacing, borders, shadows, breakpoints
+3. **Component Inventory** — Every distinct UI component, its variants, states, and structure
+4. **Layout Analysis** — Grid system, responsive breakpoints, sticky elements, z-index layers
+5. **Interaction Patterns** — Hover states, animations, transitions, loading states
+6. **Technical Stack** — Framework, CSS methodology, state management, API patterns
+
+## Output
+
+Write your findings as structured Markdown files in `docs/research/`:
+- `DESIGN_TOKENS.md`
+- `COMPONENT_INVENTORY.md`
+- `LAYOUT_ARCHITECTURE.md`
+- `INTERACTION_PATTERNS.md`
+- `TECH_STACK_ANALYSIS.md`
+
+## Key Principles
+
+- Be EXHAUSTIVE — miss nothing
+- Use EXACT values — `#1DA1F2` not "blue", `15px` not "small padding"
+- Note VARIATIONS — how components change across breakpoints and states
+- Compare to COMMON LIBRARIES — identify Tailwind, Material UI, etc.
+- Document the HIERARCHY — nesting depth, parent-child relationships
+- Follow the checklist in `docs/research/INSPECTION_GUIDE.md`
diff --git a/.claude/skills/reverse-engineer/SKILL.md b/.claude/skills/reverse-engineer/SKILL.md
new file mode 100644
index 00000000..01484b5f
--- /dev/null
+++ b/.claude/skills/reverse-engineer/SKILL.md
@@ -0,0 +1,16 @@
+---
+name: reverse-engineer
+description: Full reverse-engineering workflow for the target website. Inspects, documents, and scaffolds the project.
+---
+
+Reverse-engineer the target website defined in TARGET.md:
+
+1. Read TARGET.md to understand scope and fidelity requirements
+2. Use the site-inspector agent to inspect the target URL via Chrome MCP
+3. Review and organize all findings in docs/research/
+4. Extract design tokens into DESIGN_TOKENS.md
+5. Create component inventory in COMPONENT_INVENTORY.md
+6. Document layout architecture in LAYOUT_ARCHITECTURE.md
+7. Scaffold the Next.js project if not already done
+8. Configure Tailwind with extracted design tokens
+9. Report summary of findings and recommended build order
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000..be52a60d
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,42 @@
+# Dependencies
+node_modules/
+.pnp
+.pnp.js
+
+# Build
+.next/
+out/
+build/
+dist/
+
+# Environment
+.env
+.env.local
+.env.development.local
+.env.test.local
+.env.production.local
+
+# Debug
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+
+# IDE
+.idea/
+.vscode/
+*.swp
+*.swo
+
+# OS
+.DS_Store
+Thumbs.db
+
+# TypeScript
+*.tsbuildinfo
+next-env.d.ts
+
+# Vercel
+.vercel
+
+# Local settings (not project config)
+.claude/settings.local.json
diff --git a/CLAUDE.md b/CLAUDE.md
new file mode 100644
index 00000000..beea48ef
--- /dev/null
+++ b/CLAUDE.md
@@ -0,0 +1,79 @@
+# Website Reverse-Engineer Template
+
+## What This Is
+A reusable template for reverse-engineering any website and rebuilding it as a faithful clone using Claude Code. Fork this template, fill in the target website details, and follow the workflow.
+
+## Quick Start
+1. Copy this template to a new project folder
+2. Update `TARGET.md` with your target website URL and scope
+3. Run the inspection workflow with the `site-inspector` agent
+4. Review and refine the captured design tokens and component inventory
+5. Scaffold the project with `npm create next-app`
+6. Build component-by-component using the `component-builder` agent
+7. Assemble pages using the `page-assembler` agent
+8. QA with the `design-qa` agent
+
+## Tech Stack (Default — Adjust Per Project)
+- **Framework:** Next.js 15 (App Router, React 19, TypeScript strict)
+- **Styling:** Tailwind CSS v4
+- **Icons:** Lucide React (or match target site's icon set)
+- **Mock Data:** Seeded generators in `src/lib/mock/`
+- **Deployment:** Vercel
+
+IMPORTANT: Inspect the target site first. If they use a different paradigm (e.g., Vue, Angular), consider whether to match their stack or use React anyway. For demo purposes, React/Next.js is almost always the right call.
+
+## Commands
+- `npm run dev` — Start dev server
+- `npm run build` — Production build
+- `npm run lint` — ESLint check
+
+## Code Style
+- TypeScript strict mode, no `any`
+- Named exports, PascalCase components, camelCase utils
+- Tailwind utility classes, no inline styles
+- 2-space indentation
+- Responsive: mobile-first
+
+## Design Principles
+- **Pixel-perfect emulation** — match the target's spacing, colors, typography exactly
+- **No personal aesthetic changes during emulation phase** — match 1:1 first, customize later
+- **Demo-quality** — must look real but uses mock data throughout
+- **Beauty-first** — every pixel matters
+
+## Workflow Phases
+
+### Phase 1: Inspection & Documentation
+Use the `site-inspector` agent + Chrome MCP to crawl the target site. Output goes to `docs/research/`.
+
+### Phase 2: Design System Extraction
+Extract design tokens into `docs/research/DESIGN_TOKENS.md`. This becomes the source of truth for all component styling.
+
+### Phase 3: Component Development
+Build components one at a time in isolation. Use `component-builder` agent with worktree isolation. Each component gets fully polished before moving on.
+
+### Phase 4: Page Assembly
+Wire components into full pages. Use `page-assembler` agent. Connect mock data.
+
+### Phase 5: QA & Polish
+Run `design-qa` agent against every page. Fix discrepancies. Side-by-side screenshot comparison.
+
+### Phase 6: Customization (Optional)
+After the base emulation is complete, add your own features or design tweaks.
+
+## Project Structure
+```
+src/
+ app/ # Next.js routes (one folder per page)
+ components/ # React components (organized by feature)
+ lib/
+ mock/ # Mock data generators
+ utils/ # Shared utilities
+ types/ # TypeScript interfaces
+ hooks/ # Custom React hooks
+docs/
+ research/ # Inspection output (design tokens, components, layout, etc.)
+ design-references/ # Screenshots and visual references
+```
+
+@docs/research/INSPECTION_GUIDE.md
diff --git a/TARGET.md b/TARGET.md
new file mode 100644
index 00000000..1302b894
--- /dev/null
+++ b/TARGET.md
@@ -0,0 +1,41 @@
+# Target Website
+
+## URL
+<!-- Replace with the URL of the website you're reverse-engineering -->
+https://example.com
+
+## Scope
+
+### Pages to Replicate
+<!-- List every page you want to rebuild. Be specific. -->
+- [ ] Home page
+- [ ] (add more pages here)
+
+### Fidelity Level
+<!-- Choose one -->
+- [ ] **Pixel-perfect** — exact match in colors, spacing, typography, animations
+- [ ] **High fidelity** — visually similar, same layout and feel, minor deviations OK
+- [ ] **Structural** — same layout and components, custom styling acceptable
+
+### In Scope
+<!-- What you're building -->
+- Visual layout and styling
+- Component structure and interactions
+- Responsive design
+- Mock data for demo purposes
+
+### Out of Scope
+<!-- What you're NOT building -->
+- Real backend / database
+- Authentication
+- Real-time features
+- SEO optimization
+- Accessibility audit (unless specifically needed)
+
+## Why
+<!-- Brief explanation of why you're cloning this site -->
+(Fill in your reason — portfolio piece, learning exercise, demo, template for custom features, etc.)
+
+## Customization Plans
+<!-- After the base emulation, what changes do you want to make? -->
+- (List planned modifications or say "none — pure emulation")
diff --git a/WORKFLOW.md b/WORKFLOW.md
new file mode 100644
index 00000000..6f74f7b9
--- /dev/null
+++ b/WORKFLOW.md
@@ -0,0 +1,82 @@
+# Reverse-Engineering Workflow
+
+## The Complete Process
+
+This documents the proven workflow for reverse-engineering a website, based on the `claude-code-users-globe` project where we successfully reverse-engineered DataFast's realtime globe visualization.
+
+---
+
+## Step 1: Set Your Target
+1. Fill out `TARGET.md` with the URL, pages to replicate, and fidelity level
+2. Decide scope — which pages, which interactions, what level of polish
+
+## Step 2: Inspect the Site
+1. Open the target site in Chrome
+2. Use Chrome MCP (or manual DevTools inspection) to crawl every page
+3. Launch the `site-inspector` agent to systematically document findings
+4. Capture screenshots for `docs/design-references/`
+
+**Agent command:**
+```
+Use the site-inspector agent to inspect [URL] and document all design tokens, components, layout patterns, and technical details.
+```
+
+## Step 3: Extract Design Tokens
+1. Review `docs/research/DESIGN_TOKENS.md`
+2. Verify color values, typography, spacing against the live site
+3. Note any patterns (e.g., 4px spacing grid, consistent border-radius)
+4. This file becomes the single source of truth for all styling
+
+## Step 4: Scaffold the Project
+1. Initialize Next.js: `npx create-next-app@latest . --typescript --tailwind --app --src-dir`
+2. Configure Tailwind with extracted design tokens
+3. Set up the project structure per CLAUDE.md
+4. Install dependencies (icon library, font, etc.)
+5. Create the base layout (sidebar, main, right panel)
+
+## Step 5: Build Components (Parallel)
+1. Prioritize core components (navigation, main content cards, user elements)
+2. Launch `component-builder` agents in parallel worktrees — one per component
+3. Each component should be self-contained with mock data
+4. Review and merge completed components
+
+**Agent command:**
+```
+Use the component-builder agent to build the [ComponentName] component matching the specs in docs/research/COMPONENT_INVENTORY.md
+```
+
+## Step 6: Build Mock Data
+1. Launch `mock-data-generator` agent to create typed generators
+2. Study real data shapes from inspection
+3. Generators should produce realistic, seeded, deterministic data
+
+## Step 7: Assemble Pages
+1. Launch `page-assembler` agents — one per page
+2. Wire components into full page layouts
+3. Connect mock data generators
+4. Implement page-level interactions (scroll, sticky, transitions)
+
+## Step 8: QA & Polish
+1. Launch `design-qa` agent against each page
+2. Fix all reported discrepancies
+3. Do manual side-by-side screenshot comparison
+4. Polish animations, transitions, loading states
+5. Test responsive behavior at all breakpoints
+
+## Step 9: Customize (Optional)
+1. Base emulation is complete — the clone should be visually faithful
+2. Now add your own features, branding, or modifications
+3. Keep the base components intact, extend rather than modify
+4. Document your changes in a `CUSTOMIZATIONS.md`
+
+---
+
+## Tips from Prior Projects
+
+- **Document BEFORE you code.** The inspection phase is critical. A thorough inspection doc saves 10x the time during implementation.
+- **One component at a time.** Fully polish each component before moving on. Half-done components accumulate into an ugly whole.
+- **Use worktree agents.** Parallel development with isolated worktrees prevents merge conflicts and lets you build faster.
+- **Seeded mock data is magic.** Deterministic data (same seed = same output) makes debugging and screenshot comparison trivial.
+- **Side-by-side comparison is your QA tool.** Open the real site and your clone side by side at every milestone.
+- **Don't over-engineer the architecture.** For a demo clone, keep it simple. No need for elaborate state management or server-side data fetching.
+- **The fog effect (atmosphere) matters.** In the globe project, the Mapbox fog configuration was the single biggest contributor to visual quality. Find your equivalent — the one CSS/config detail that makes everything feel real.
diff --git a/docs/research/INSPECTION_GUIDE.md b/docs/research/INSPECTION_GUIDE.md
new file mode 100644
index 00000000..88afaf28
--- /dev/null
+++ b/docs/research/INSPECTION_GUIDE.md
@@ -0,0 +1,80 @@
+# Website Inspection Guide
+
+## How to Reverse-Engineer Any Website
+
+This guide outlines what to capture when inspecting a target website via Chrome MCP or browser DevTools.
+
+## Phase 1: Visual Audit
+
+### Screenshots to Capture
+- [ ] Every distinct page — desktop, tablet, mobile
+- [ ] Dark mode variants (if applicable)
+- [ ] Light mode variants (if applicable)
+- [ ] Key interaction states (hover, active, open menus, modals)
+- [ ] Loading/skeleton states
+- [ ] Empty states
+- [ ] Error states
+
+### Design Tokens to Extract
+- [ ] **Colors** — background, text (primary/secondary/muted), accent, border, hover, error, success, warning
+- [ ] **Typography** — font family, sizes (h1-h6, body, caption, label), weights, line heights, letter spacing
+- [ ] **Spacing** — padding/margin patterns (look for a scale: 4px, 8px, 12px, 16px, 24px, 32px, etc.)
+- [ ] **Border radius** — buttons, cards, avatars, inputs
+- [ ] **Shadows/elevation** — card shadows, dropdown shadows, modal overlay
+- [ ] **Breakpoints** — when does the layout shift? (inspect with DevTools responsive mode)
+- [ ] **Icons** — which icon library? custom SVGs? sizes?
+- [ ] **Avatars** — sizes, shapes, fallback behavior
+- [ ] **Buttons** — all variants (primary, secondary, ghost, icon-only, danger)
+- [ ] **Inputs** — text fields, textareas, selects, checkboxes, toggles
+
+## Phase 2: Component Inventory
+
+For each distinct UI component, document:
+1. **Name** — what would you call this component?
+2. **Structure** — what HTML elements / child components does it contain?
+3. **Variants** — does it have different sizes, colors, or states?
+4. **States** — default, hover, active, disabled, loading, error, empty
+5. **Responsive behavior** — how does it change at different breakpoints?
+6. **Interactions** — click, hover, focus, keyboard navigation
+7. **Animations** — transitions, entrance/exit animations, micro-interactions
+
+### Common Components to Look For
+- Navigation (top bar, sidebar, bottom bar)
+- Cards / list items
+- Buttons and links
+- Forms and inputs
+- Modals and dialogs
+- Dropdowns and menus
+- Tabs and segmented controls
+- Avatars and user badges
+- Loading skeletons
+- Toast notifications
+- Tooltips and popovers
+
+## Phase 3: Layout Architecture
+
+- [ ] **Grid system** — CSS Grid? Flexbox? Fixed widths?
+- [ ] **Column layout** — how many columns at each breakpoint?
+- [ ] **Max-width** — main content area max-width
+- [ ] **Sticky elements** — header, sidebar, floating buttons
+- [ ] **Z-index layers** — navigation, modals, tooltips, overlays
+- [ ] **Scroll behavior** — infinite scroll, pagination, virtual scrolling
+
+## Phase 4: Technical Stack Analysis
+
+- [ ] **Framework** — React? Vue? Angular? Check `__NEXT_DATA__`, `__NUXT__`, `ng-version`
+- [ ] **CSS approach** — Tailwind (utility classes), CSS Modules, Styled Components, Emotion, vanilla CSS
+- [ ] **State management** — Redux (check DevTools), React Query, Zustand, Pinia
+- [ ] **API patterns** — REST, GraphQL (check network tab for `/graphql` requests)
+- [ ] **Font loading** — Google Fonts, self-hosted, system fonts
+- [ ] **Image strategy** — CDN, lazy loading, srcset, WebP/AVIF
+- [ ] **Animation library** — Framer Motion, GSAP, CSS transitions only
+
+## Phase 5: Documentation Output
+
+After inspection, create these files in `docs/research/`:
+1. `DESIGN_TOKENS.md` — All extracted colors, typography, spacing
+2. `COMPONENT_INVENTORY.md` — Every component with structure notes
+3. `LAYOUT_ARCHITECTURE.md` — Page layouts, grid system, responsive behavior
+4. `INTERACTION_PATTERNS.md` — Animations, transitions, hover states
+5. `TECH_STACK_ANALYSIS.md` — What the site uses and our chosen equivalents