ai-website-cloner-template Documentation

Clone any website with one command using AI coding agents

31,815 stars JavaScript JavaScript 1 file ยท ~2,852 tokens #ai#ai-agents#ai-tools#automation#boilerplate#claude#claude-code#clone
RAW Doc

Docker & Self-Hosted Deployment Verified OCI

Deploy ai-website-cloner-template on any server, homelab, or cloud container platform.

1-Click Terminal Command
bash (docker run)
docker run -d --name ai-website-cloner-template -p 3000:3000 --restart always ai-website-cloner:latest
Configured Services & Ports
โš™๏ธ app
image: ai-website-cloner:latest
๐Ÿ”Œ Ports: ${PORT:-3000}:3000
โš™๏ธ dev
image: ai-website-cloner:dev
๐Ÿ”Œ Ports: ${DEV_PORT:-3001}:3000
docker-compose.yml
yaml (docker-compose.yml)
services:
  app:
    build:
      context: .
      dockerfile: Dockerfile
      target: runner
    image: ai-website-cloner:latest
    container_name: ai-website-cloner
    restart: unless-stopped
    ports:
      - "${PORT:-3000}:3000"
    environment:
      - NODE_ENV=production
      - NEXT_TELEMETRY_DISABLED=1
    env_file:
      - path: .env.local
        required: false
      - path: .env
        required: false
    healthcheck:
      test: ["CMD-SHELL", "wget -qO- http://localhost:3000/ || exit 1"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 10s

  dev:
    build:
      context: .
      dockerfile: Dockerfile.dev
    image: ai-website-cloner:dev
    container_name: ai-website-cloner-dev
    restart: unless-stopped
    ports:
      - "${DEV_PORT:-3001}:3000"
    environment:
      - NODE_ENV=development
      - NEXT_TELEMETRY_DISABLED=1
    env_file:
      - path: .env.local
        required: false
      - path: .env
        required: false
    volumes:
      - .:/app
      - /app/node_modules
      - /app/.next
    healthcheck:
      test: ["CMD-SHELL", "wget -qO- http://localhost:3000/ || exit 1"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 15s

File: README.md


Demo

Click the image above to watch the full demo on YouTube.

Quick Start

Important: Start by making your own copy with GitHub's Use this template button. Do not clone this template repository directly for your website project, and do not open pull requests here with your generated website.

  1. Create your own repository from this template

    On the GitHub page for this project, click Use this template, then click Create a new repository.

    Give your new repository a name, choose whether it should be public or private, then click Create repository. If GitHub shows an Include all branches option, you can leave it off.

    This gives you your own separate project to work in, so your website changes stay in your account instead of coming back to the main template.

  2. Open your new repository on your computer

    After GitHub creates your copy, open that new repository. Click Code and open or clone your new repository with your preferred coding tool.

    If you use the terminal, the command will look like this:

    bash
    git clone https://github.com/YOUR-USERNAME/YOUR-NEW-REPOSITORY.git
    cd YOUR-NEW-REPOSITORY
  3. Install dependencies

    bash
    npm install
  4. Start your AI agent โ€” Claude Code recommended:

    bash
    claude --chrome
  5. Run the skill:

    text
    /clone-website <target-url1> [<target-url2> ...]
  6. Customize (optional) โ€” after the base clone is built, modify as needed

Most supported clients expose /clone-website directly. If your client activates skills from natural-language requests, enter Clone <target-url> using the clone-website workflow. Project instructions are in AGENTS.md.

Supported Platforms

Agent Status
Claude Code Recommended โ€” Opus 5
Codex CLI Supported
OpenCode Supported
GitHub Copilot Supported
Kiro Supported
Cursor Supported
Windsurf Supported
Gemini CLI Supported
Cline Supported
Roo Code Supported
Continue Supported
Amazon Q Supported
Augment Code Supported

Prerequisites

Tech Stack

  • Next.js 16 โ€” App Router, React 19, TypeScript strict
  • shadcn/ui โ€” Radix primitives + Tailwind CSS v4
  • Tailwind CSS v4 โ€” oklch design tokens
  • Lucide React โ€” default icons (replaced by extracted SVGs during cloning)

How It Works

The /clone-website skill runs a multi-phase pipeline:

mermaid
flowchart LR
    P1["1. Reconnaissance"] --> P2["2. Foundation"]
    P2 --> P3["3. Component Specs"]
    P3 --> P4["4. Parallel Build"]
    P4 --> P5["5. Assembly and QA"]
  1. Reconnaissance โ€” screenshots, design token extraction, interaction sweep (scroll, click, hover, responsive)
  2. Foundation โ€” updates fonts, colors, globals, downloads all assets
  3. Component Specs โ€” writes detailed spec files (docs/research/components/) with exact computed CSS values, states, behaviors, and content
  4. Parallel Build โ€” dispatches builder agents in git worktrees, one per section/component
  5. Assembly & QA โ€” merges worktrees, wires up the page, runs visual diff against the original

Each builder agent receives the full component specification inline โ€” exact getComputedStyle() values, interaction models, multi-state content, responsive breakpoints, and asset paths. No guessing.

Use Cases

  • Platform migration โ€” rebuild a site you own from WordPress/Webflow/Squarespace into a modern Next.js codebase
  • Lost source code โ€” your site is live but the repo is gone, the developer left, or the stack is legacy. Get the code back in a modern format
  • Learning โ€” deconstruct how production sites achieve specific layouts, animations, and responsive behavior by working with real code

Not Intended For

  • Phishing or impersonation โ€” this project must not be used for deceptive purposes, impersonation, or any activity that breaks the law.
  • Passing off someone's design as your own โ€” logos, brand assets, and original copy belong to their owners.
  • Violating terms of service โ€” some sites explicitly prohibit scraping or reproduction. Check first.

Project Structure

text
src/
  app/              # Next.js routes
  components/       # React components
    ui/             # shadcn/ui primitives
    icons.tsx       # Extracted SVG icons
  lib/utils.ts      # cn() utility
  types/            # TypeScript interfaces
  hooks/            # Custom React hooks
public/
  images/           # Downloaded images from target
  videos/           # Downloaded videos from target
  seo/              # Favicons, OG images
docs/
  research/         # Extraction output & component specs
  design-references/ # Screenshots
scripts/
  sync-agent-rules.sh  # Regenerate agent instruction files
  sync-skills.mjs      # Regenerate /clone-website for all platforms
.kiro/skills/          # Generated Kiro workspace skill
.cline/skills/         # Generated Cline workspace skill
.roo/skills/           # Generated Roo Code workspace skill
.roo/commands/         # Generated Roo Code slash command
AGENTS.md           # Agent instructions (single source of truth)
CLAUDE.md           # Claude Code config (imports AGENTS.md)
GEMINI.md           # Gemini CLI config (imports AGENTS.md)

Commands

bash
npm run dev    # Start dev server
npm run build  # Production build
npm run lint   # ESLint check
npm run typecheck # TypeScript check
npm run check  # Run lint + typecheck + build

If using docker

bash
docker compose up app --build # build and run the app
docker compose up dev --build # run the app in dev mode on port 3001

Updating for Other Platforms

Two source-of-truth files power all platform support. Edit the source, then run the sync script:

What Source of truth Sync command
Project instructions AGENTS.md bash scripts/sync-agent-rules.sh
/clone-website skill .claude/skills/clone-website/SKILL.md node scripts/sync-skills.mjs

Each script regenerates the platform-specific copies automatically. Agents that read the source files natively need no regeneration.

Star History

License

MIT

Translations: ๆ—ฅๆœฌ่ชž ยท Simplified Chinese


File: docs/research/INSPECTION_GUIDE.md

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