Clone any website with one command using AI coding agents
TypeScript aiai-agentsai-toolsautomationboilerplateclaudeclaude-codeclonedeveloper-toolsnextjsreactreverse-engineeringshadcn-uiskillstailwindcsstemplatetypescriptweb-scrapingwebsite-clone
Enhance build-from-spec and reverse-engineer skills for improved precision and clarity
JCodesMore936c51d06a89
diff --git a/.claude/skills/build-from-spec/SKILL.md b/.claude/skills/build-from-spec/SKILL.mdindex 70a33913..90f9dbf7 100644--- a/.claude/skills/build-from-spec/SKILL.md+++ b/.claude/skills/build-from-spec/SKILL.md@@ -1,6 +1,6 @@---name: build-from-spec-description: Read the reverse-engineering documentation and launch an agent team to build the full website clone from the spec. Scaffolds the project, creates mock data, builds components in parallel worktrees, assembles pages, and runs QA.+description: Read the reverse-engineering documentation and launch an agent team to build the full website clone from the spec. Scaffolds the project, creates mock data, builds components in parallel worktrees, assembles pages, and runs QA. Each agent gets ONE atomic component with its exact CSS spec — no guessing, no generalizing.user-invocable: true---@@ -8,150 +8,238 @@ user-invocable: trueYou are about to build a full website clone from the reverse-engineering documentation in `docs/research/`.-This skill emulates the proven build workflow from `claude-code-users-globe`, where a globe visualization was built from a reverse-engineering spec using parallel worktree agents.+The key principle: **each agent gets ONE small, atomic task with ALL the exact CSS values it needs**. Agents should never need to guess or approximate. If a spec says "padding: 64px 40px 32px 0", that's what gets implemented — not "some padding".++## Why Small Tasks Matter++When agents get large tasks like "build the entire features section", they gloss over details — they approximate spacing, guess at font sizes, and produce layouts that are "close enough" but clearly wrong. When they get a single, atomic component with exact CSS values, they nail it every time. More agents doing smaller tasks = higher fidelity.## Pre-Flight Checks-1. Read ALL files in `docs/research/` — you need the full picture before launching anything:- - `DESIGN_TOKENS.md` — colors, typography, spacing, borders, shadows, breakpoints- - `COMPONENT_INVENTORY.md` — every component with structure and states- - `LAYOUT_ARCHITECTURE.md` — page layouts, grid system, responsive behavior+1. Read ALL files in `docs/research/`:+ - `DESIGN_TOKENS.md` — exact colors, typography, spacing values+ - `COMPONENT_INVENTORY.md` — every component with exact CSS specs+ - `LAYOUT_ARCHITECTURE.md` — page layouts with exact measurements- `INTERACTION_PATTERNS.md` — animations, transitions, hover states- - `TECH_STACK_ANALYSIS.md` — their stack mapped to our chosen equivalents- - `BUILD_PLAN.md` — component order, parallel tracks, build sequence+ - `TECH_STACK_ANALYSIS.md` — their stack mapped to our equivalents+ - `BUILD_PLAN.md` — atomic task list in dependency order+ - `ASSET_MANIFEST.md` — all downloaded assets and where they go++2. If any of these are missing, STOP and tell the user to run `/reverse-engineer` first.-2. If any of these files are missing, STOP and tell the user to run `/reverse-engineer` first.+3. Read `CLAUDE.md` and `TARGET.md` for project context.-3. Read `CLAUDE.md` and `TARGET.md` for project-level context and scope.+4. Verify that assets have been downloaded to `public/` — if the asset directories are empty, the assets need to be downloaded first (run the download script from the reverse-engineer phase).## Phase 1: Foundation (Sequential — Must Complete First)-Launch a single agent to scaffold the project foundation:+Launch a single agent to scaffold the project:**Task: Project Scaffold**-- Initialize Next.js 15 with App Router, TypeScript strict, Tailwind CSS v4-- Configure Tailwind theme with extracted design tokens from `DESIGN_TOKENS.md`:- - Custom colors matching the target site- - Typography scale (font families, sizes, weights)- - Spacing scale- - Border radius values- - Shadow definitions- - Breakpoint values-- Create the base layout component (`src/app/layout.tsx`) with:- - Font loading (match target site's fonts)- - Global styles- - Dark/light mode setup if applicable-- Create TypeScript interfaces in `src/types/` for all data entities-- Install necessary dependencies (icon library, UI components, etc.)-- Verify: `npm run build` should pass with zero errors--IMPORTANT: Wait for this to complete before launching Phase 2. Everything else depends on the foundation.--## Phase 2: Data Layer + Core Components (Parallel Agent Team)--Launch these agents simultaneously as an agent team:--### Agent 1: Mock Data Generator-**Task:** Create seeded mock data generators in `src/lib/mock/`-- Read `COMPONENT_INVENTORY.md` and `TECH_STACK_ANALYSIS.md` to understand data shapes-- Create TypeScript interfaces for every data entity-- Build deterministic generators (same seed = same output) using a seeded PRNG-- Data should be realistic: real-sounding names, varied content lengths, power-law distributions for engagement metrics-- Export clean API from `src/lib/mock/index.ts`-- Include edge cases: very long text, empty fields, missing optional data--### Agent 2: Navigation Component-**Task:** Build the primary navigation component-- Read `COMPONENT_INVENTORY.md` for the navigation spec-- Build with exact design token values from `DESIGN_TOKENS.md`-- Include all nav items, icons, active states-- Responsive behavior: sidebar on desktop, bottom bar or drawer on mobile-- Sticky positioning per `LAYOUT_ARCHITECTURE.md`--### Agent 3: Primary Content Card-**Task:** Build the main content card component (tweet card, post card, list item — whatever the primary repeating unit is)-- This is usually the most important component — the one that appears dozens of times-- Match every detail: layout, spacing, typography, hover states, interaction buttons-- Include all variants documented in `COMPONENT_INVENTORY.md`-- Support mock data props--### Agent 4: User/Profile Elements-**Task:** Build user-related components (avatar, username display, user card, badges)-- Avatar component with all sizes documented-- Username/display name with verification badges if applicable-- User card (hover card, profile snippet)-- Any badge or indicator components--### Agent 5: Secondary UI Components-**Task:** Build remaining shared components-- Buttons (all variants: primary, secondary, ghost, icon-only)-- Input fields and forms-- Tabs and segmented controls-- Dropdown menus-- Tooltips and popovers-- Loading skeletons-- Toast notifications-- Modal/dialog wrapper-- Any other components from the inventory not covered above--## Phase 3: Page Assembly (Parallel — After Phase 2)--Wait for ALL Phase 2 agents to complete. Then launch page assembler agents:--### For each page in the target scope:--**Task:** Assemble the [PageName] page-- Create the route at `src/app/[route]/page.tsx`-- Wire up the layout grid per `LAYOUT_ARCHITECTURE.md`-- Import and compose all relevant components-- Connect mock data generators-- Implement page-level interactions:- - Scroll behavior (infinite scroll, pagination)- - Sticky elements- - Page transitions- - Loading states-- Responsive behavior at all documented breakpoints--Launch one agent per page, all in parallel.--## Phase 4: Polish & QA (Parallel — After Phase 3)--Launch QA agents against every completed page:--### For each page:--**Task:** QA the [PageName] page against reference documentation-- Compare every design token against `DESIGN_TOKENS.md`-- Verify all component states are implemented-- Check responsive behavior at each breakpoint from `LAYOUT_ARCHITECTURE.md`-- Verify interaction patterns match `INTERACTION_PATTERNS.md`-- Check animation timing and easing-- Report all discrepancies with specific fix suggestions--### Also launch:--**Task:** Full build verification-- Run `npm run build` — must pass with zero errors-- Run `npm run lint` — fix any issues-- Check TypeScript strict compliance — no `any` types-- Verify all imports resolve-- Check for unused code--## Phase 5: Integration & Final Review--After QA fixes are applied:-1. Do a final `npm run build` to verify everything compiles-2. Start the dev server and manually review each page-3. Create a summary of what was built:- - Pages completed- - Components built- - Any known gaps or compromises- - Recommended next steps (run `/customize` to add personal features)--## Agent Team Coordination Notes--- Each agent should read the shared documentation before starting-- Agents building components should check what other components already exist to maintain consistency-- Use the design tokens from `DESIGN_TOKENS.md` as the single source of truth — never hardcode colors/spacing-- If a component depends on another that isn't built yet, use a simple placeholder and note the dependency-- All agents should follow the code style defined in `CLAUDE.md`+- Initialize Next.js with App Router, TypeScript strict, Tailwind CSS+- Configure fonts (match exact fonts from DESIGN_TOKENS.md)+- Set up global CSS with:+ - CSS custom properties from the design tokens+ - Utility classes used by the original site (hide-scrollbar, frost effects, etc.)+ - All keyframe animations documented in INTERACTION_PATTERNS.md+- Create TypeScript interfaces in `src/types/` matching every data shape+- Install dependencies (Radix UI, Lucide, etc. per TECH_STACK_ANALYSIS.md)+- Verify: `npm run build` must pass++WAIT for this to complete before Phase 2.++## Phase 2: Mock Data + Icon Components (Parallel)++Launch 2-3 agents:++### Agent: Mock Data+- Create `src/lib/mock/index.ts` with all mock data+- Match the data shapes from the original site+- Include realistic content (names, messages, timestamps)+- Export clean typed API++### Agent: Icon Components+- Create `src/components/icons.tsx` with all SVG icons extracted during reverse-engineering+- Each icon is a typed React component accepting `className` prop+- Include: logos, UI icons, brand icons for integrations++### Agent: Shared UI Primitives+- Build the smallest shared components first: buttons, badges, tags+- Each with EXACT CSS from the component spec+- Example task for a button:+ ```+ Build FrostBorderButton:+ - Classes: inline-flex items-center gap-1.5 rounded-full px-3 py-2 font-dm-sans text-sm font-medium text-[#161616]+ - Background: linear-gradient(#EEEEEE, #EEEEEE)+ - Border: 1px solid white+ - Backdrop-filter: blur(4px)+ - Hover: background changes to linear-gradient(#FFFFFF, #FFFFFF)+ - Props: children, className, onClick, href, showArrow (boolean)+ - When showArrow=true, render ArrowRightIcon after children+ ```++## Phase 3: Atomic Component Build (Parallel — Max Parallelism)++This is where the magic happens. Launch ONE agent per component, each in its own worktree. Each agent gets:++1. The exact component spec from COMPONENT_INVENTORY.md+2. The exact CSS values (not approximations)+3. The list of assets it needs (images, videos, icons)+4. The list of child components it depends on (which should already be built in Phase 2)++### Agent Task Template++For each component, the agent prompt should include:++```+Build the [ComponentName] component.++**File:** src/components/[ComponentName].tsx++**Exact CSS Spec:**+[Paste the COMPLETE CSS spec from COMPONENT_INVENTORY.md]++**Props:**+[List every prop with its TypeScript type]++**Assets:**+[List every image, video, or icon this component uses, with local paths]++**Children:**+[List child components to import]++**States:**+[List every interactive state with exact CSS changes]++**Responsive:**+[List breakpoint-specific changes]++Read the existing codebase first to understand imports, design tokens, and patterns.+Then build this ONE component to EXACTLY match the spec.+Run `npx tsc --noEmit` after to verify it compiles.+```++### Grouping Rules++- Components with NO dependencies on other custom components → launch first+- Components that depend on shared primitives → launch after Phase 2 completes+- Page-level components → launch after all their children are built++### Example Atomic Tasks++Instead of "Build the hero section", break it into:+1. `BackgroundGradient` — absolute-positioned gradient + hero background images+2. `HeroSection` — sticky sidebar with text, bullets, CTA, and use-case nav+3. `UseCaseContextHeader` — sticky gradient header for right column+4. `UseCaseSection` — section wrapper with title, description, video slot+5. `UseCaseVideo` — lazy-loaded video player with IntersectionObserver++Instead of "Build the features section", break it into:+1. `SearchTabPanel` — search results mockup with tab navigation+2. `FeatureCard` — individual feature card (search/everywhere/integrations variants)+3. `FeaturesSection` — horizontal scroll layout with left sidebar and card row++Each of these is a 2-3 minute task for an agent. Small tasks = perfect results.++## Phase 4: Page Assembly (After All Components)++Launch one agent per page to wire everything together:++**Task: Assemble [PageName]**+- The agent gets the EXACT page layout from LAYOUT_ARCHITECTURE.md+- It imports all the components built in Phase 3+- It wires up mock data from the data layer+- It implements page-level behaviors:+ - Scroll snap configuration+ - Scroll spy hooks+ - Section tracking+ - Dark-to-light transitions+- The agent gets the exact container classes and structure++Example for a home page:+```+Wire the Home page (src/app/page.tsx):++Scroll container: id="new-landing-scroll-root", classes="light h-screen overflow-y-auto overflow-x-hidden overscroll-none hide-scrollbar snap-y snap-mandatory"++Structure:+1. Fixed overlays: FloatingNavBar, TopFadeGradient, ScrollDimOverlay+2. Dark section wrapper: classes="relative isolate min-h-screen overscroll-none"+ - BackgroundGradient (absolute)+ - Flex container: classes="relative z-0 mx-auto flex min-h-screen w-full max-w-[100rem] flex-col overflow-clip lg:flex-row"+ - Left: HeroSection (sticky, 512px max-width)+ - Right: div.relative.z-10.grow.bg-black/10+ - UseCaseContextHeader (sticky)+ - 7x UseCaseSection with UseCaseVideo children+3. White section: classes="relative z-10 snap-start rounded-t-[40px] bg-white divide-y divide-black/10"+ - CTASection+ - FeaturesSection+ - Footer rounded bottom+ - FooterSection+```++## Phase 5: Visual QA (Critical — Don't Skip)++After assembly, launch QA agents that use Chrome MCP to do SIDE-BY-SIDE comparison:++### For each section of the page:++**Task: QA [SectionName]**+1. Open the ORIGINAL site in one tab+2. Open localhost clone in another tab+3. Screenshot both at the same viewport size+4. Compare element by element:+ - Font sizes match?+ - Spacing/padding match?+ - Colors match?+ - Border radius match?+ - Layout proportions match?+ - Images/videos present and correctly positioned?+5. Use Chrome MCP JavaScript to extract computed styles from BOTH sites and compare numerically+6. Report every discrepancy with:+ - Element identifier+ - Original value+ - Clone value+ - Fix needed (exact CSS change)++### Automated CSS Comparison Script++For critical elements, run this on both sites:+```javascript+const el = document.querySelector('.some-selector');+const cs = getComputedStyle(el);+JSON.stringify({+ fontSize: cs.fontSize,+ fontWeight: cs.fontWeight,+ lineHeight: cs.lineHeight,+ padding: cs.padding,+ margin: cs.margin,+ color: cs.color,+ backgroundColor: cs.backgroundColor,+ borderRadius: cs.borderRadius,+ width: cs.width,+ height: cs.height,+ gap: cs.gap,+ display: cs.display,+ flexDirection: cs.flexDirection+});+```++Compare the JSON outputs — any mismatch is a fix task.++## Phase 6: Fix Discrepancies++For each discrepancy found in QA:+1. Create a targeted fix task for an agent+2. The fix task includes: which file, which element, current value, target value+3. Agent makes the fix and verifies with `npx tsc --noEmit`+4. Re-run the comparison for that element to confirm the fix++## Agent Team Coordination++- Each agent gets COMPLETE information — never assume they'll figure it out+- Paste exact CSS values into every agent prompt — don't reference "see DESIGN_TOKENS.md"+- Each agent should verify its work compiles before finishing+- Merge worktree branches after each phase completes+- Resolve any merge conflicts with full context of what each agent built+- Build passes cleanly before moving to the next phasediff --git a/.claude/skills/reverse-engineer/SKILL.md b/.claude/skills/reverse-engineer/SKILL.mdindex 1d2c3520..3c24945b 100644--- a/.claude/skills/reverse-engineer/SKILL.md+++ b/.claude/skills/reverse-engineer/SKILL.md@@ -1,176 +1,335 @@---name: reverse-engineer-description: Reverse-engineer a website using Chrome MCP — crawl it, extract design tokens, document every component, capture the full tech stack, and produce a complete build specification. Provide the target URL as an argument.+description: Reverse-engineer a website using Chrome MCP — crawl it, extract ALL assets (videos, images, SVGs, fonts, favicons), extract exact CSS computed styles for every element, document every component with pixel-perfect precision, and produce a complete build specification. Use this whenever the user wants to clone, replicate, rebuild, or reverse-engineer any website. Provide the target URL as an argument.argument-hint: "<url> [brief description of what to emulate]"user-invocable: true---# Reverse-Engineer a Website-You are about to reverse-engineer **$ARGUMENTS** into a comprehensive build specification.+You are about to reverse-engineer **$ARGUMENTS** into a comprehensive, pixel-perfect build specification.-This skill emulates the proven workflow from the `claude-code-users-globe` project, where Marc Lou's DataFast realtime globe was reverse-engineered into a 20KB technical blueprint that became the foundation for a pixel-perfect rebuild.+The goal is to extract EVERYTHING needed to build a perfect clone — not approximations, not summaries, but exact values. Every font size, every padding value, every color, every asset. When agents later build from this spec, they should never have to guess.++## Why Precision Matters++Previous attempts at reverse-engineering produced specs that were "close enough" — documenting "large heading" instead of "48px/500/48px-line-height Geist font", or "some padding" instead of "padding: 64px 40px 32px 0". This led to clones that looked roughly similar but were clearly off in spacing, typography, and positioning. The fix is simple: extract exact computed CSS values for every element, not eyeball approximations.## Phase 1: Preparation1. Read `TARGET.md` if it exists — check if scope and fidelity are already defined2. Read `docs/research/INSPECTION_GUIDE.md` for the inspection checklist-3. If TARGET.md doesn't exist or doesn't match the URL provided, create/update it with:- - The target URL- - Initial scope assumptions (list all visible pages)- - Default to pixel-perfect fidelity--## Phase 2: Site Crawl via Chrome MCP--Use the Chrome MCP browser tools to systematically inspect the target website. Work through each area methodically:--### 2a: Visual Audit-- Navigate to every distinct page/route on the site-- For each page, observe and document:- - Overall layout structure (columns, sidebars, headers, footers)- - Key UI components visible- - Color scheme and visual tone- - Typography choices- - Spacing patterns--### 2b: Design Token Extraction-Inspect elements to extract exact values:-- **Colors:** Background (primary, secondary), text (primary, secondary, muted, link), accent/brand, border, hover states, error/success/warning. Get exact hex/rgb values.-- **Typography:** Font family (check `<link>` tags and computed styles), font sizes (every distinct size used), font weights, line heights, letter spacing-- **Spacing:** Identify the spacing scale (e.g., 4/8/12/16/24/32/48/64px). Check padding and margins on key elements.-- **Borders:** Border radius values (buttons, cards, avatars, inputs), border colors and widths-- **Shadows:** Box-shadow values on cards, dropdowns, modals-- **Breakpoints:** Resize the viewport to find where layout shifts occur--### 2c: Component Inventory-For each distinct UI component:-- Name it descriptively-- Document its HTML structure (what elements, nesting)-- List all variants (sizes, colors, states)-- Note interactive states (hover, active, focus, disabled)-- Identify child components it contains-- Note responsive behavior (how it changes at breakpoints)--### 2d: Layout Architecture-- Identify the grid system (CSS Grid, Flexbox, fixed widths)-- Document column layout at each breakpoint-- Find max-width constraints on content areas-- Identify sticky/fixed elements and their z-index-- Document scroll behavior (infinite scroll, pagination, virtual)--### 2e: Technical Stack Analysis-Inspect the page source and network tab:-- Check for framework indicators: `__NEXT_DATA__` (Next.js), `__NUXT__` (Nuxt), `ng-version` (Angular), React DevTools-- Inspect class names for CSS methodology: utility classes (Tailwind), BEM, CSS Modules, styled-components-- Check network tab for API patterns: REST endpoints, GraphQL queries-- Identify font loading: Google Fonts links, self-hosted, system fonts-- Check for state management: Redux DevTools, React Query, etc.-- Inspect image optimization: CDN patterns, lazy loading, srcset--### 2f: Interaction Patterns-- Hover effects on interactive elements-- Click/tap animations-- Page transition animations-- Loading states (skeletons, spinners, shimmer)-- Modal/dialog enter/exit animations-- Scroll-triggered effects-- Micro-interactions (like button animation, follow button state change)--## Phase 3: Document Everything--Write structured documentation files in `docs/research/`:--### `DESIGN_TOKENS.md`-```-# Design Tokens-## Colors-### Light Mode-- Background Primary: #___-- Background Secondary: #___-- Text Primary: #___-...-### Dark Mode (if applicable)-...-## Typography-- Font Family: ___-- Headings: ___px / weight ___-...-## Spacing Scale-- xs: ___px, sm: ___px, md: ___px, lg: ___px, xl: ___px-## Border Radius-...-## Shadows-...-## Breakpoints-...+3. If TARGET.md doesn't exist or doesn't match the URL, create/update it+4. Create the output directory structure: `docs/research/`, `docs/design-references/`++## Phase 2: Asset Extraction (Do This FIRST)++Before documenting anything, extract ALL real assets from the target site. This is the single most impactful step — without real assets, the clone will always look fake.++### 2a: Discover All Assets++Use Chrome MCP JavaScript execution to find every asset on the page:++```javascript+// Run this on each page to discover all assets+const assets = {+ images: [...document.querySelectorAll('img')].map(img => ({+ src: img.src || img.currentSrc,+ srcset: img.srcset,+ alt: img.alt,+ width: img.naturalWidth,+ height: img.naturalHeight,+ context: img.closest('[class]')?.className?.substring(0, 100)+ })),+ videos: [...document.querySelectorAll('video')].map(v => ({+ src: v.src || v.querySelector('source')?.src,+ poster: v.poster,+ autoplay: v.autoplay,+ loop: v.loop,+ muted: v.muted,+ context: v.closest('[class]')?.className?.substring(0, 100)+ })),+ backgroundImages: [...document.querySelectorAll('*')].filter(el => {+ const bg = getComputedStyle(el).backgroundImage;+ return bg && bg !== 'none';+ }).map(el => ({+ url: getComputedStyle(el).backgroundImage,+ element: el.tagName,+ context: el.className?.substring(0, 100)+ })),+ fonts: [...document.querySelectorAll('link[rel*="font"], link[href*="font"]')].map(l => l.href),+ favicons: [...document.querySelectorAll('link[rel*="icon"]')].map(l => ({+ href: l.href,+ type: l.type,+ sizes: l.sizes?.toString()+ })),+ ogImages: [...document.querySelectorAll('meta[property*="image"]')].map(m => m.content)+};```-### `COMPONENT_INVENTORY.md`-For each component:+### 2b: Download All Assets++Write a Node.js download script (`scripts/download-assets.mjs`) that:+1. Downloads every discovered image, video, SVG, font, favicon, and OG image+2. Preserves the original directory structure under `public/`+3. Uses batched parallel downloads (4 at a time to avoid overwhelming the server)+4. Logs each download's status+5. Handles Next.js `/_next/image` URLs by extracting the original `url` parameter++### 2c: Extract SVG Icons++Many sites use inline SVGs for icons. Extract them individually:+1. Use Chrome MCP to find all `<svg>` elements+2. Extract each unique SVG's markup+3. Save as React components in `src/components/icons.tsx`+4. Name them based on their visual function (e.g., `SearchIcon`, `ArrowRightIcon`)++### 2d: Identify and Download Fonts++1. Check `<link>` tags for Google Fonts or self-hosted fonts+2. Inspect computed `font-family` on key elements+3. Document every font family, weight, and style used+4. For Google Fonts: note the exact import URL with all weights+5. For self-hosted: download the font files++### 2e: Video Configuration++For each video on the site, document:+- Source URL and file format+- Autoplay, loop, muted settings+- Poster image (if any)+- CSS styling (border-radius, max-width, object-fit)+- Which section/component it belongs to+- Lazy loading behavior (eager vs. intersection-observer)++### 2f: Create Asset Manifest++Write `docs/research/ASSET_MANIFEST.md` listing every asset with:+- Original URL+- Local path in `public/`+- Which component uses it+- Dimensions (for images/videos)+- Any special rendering (mix-blend-mode, object-fit, etc.)++## Phase 3: Exact CSS Extraction++This is where precision matters most. For EVERY distinct element on the page, extract exact computed CSS values using Chrome MCP JavaScript execution.++### 3a: Page-Level Layout++Extract the overall page structure with exact measurements:++```javascript+// For each major container element, extract:+const el = document.querySelector('.some-container');+const cs = getComputedStyle(el);+const data = {+ classes: el.className,+ display: cs.display,+ flexDirection: cs.flexDirection,+ position: cs.position,+ width: cs.width,+ maxWidth: cs.maxWidth,+ height: cs.height,+ padding: cs.padding,+ margin: cs.margin,+ gap: cs.gap,+ overflow: cs.overflow,+ zIndex: cs.zIndex,+ // For sticky elements:+ top: cs.top,+ // For backgrounds:+ background: cs.background,+ borderRadius: cs.borderRadius,+ border: cs.border,+ boxShadow: cs.boxShadow,+};```++### 3b: Component-Level Extraction++For each component, extract a COMPLETE CSS specification. Don't summarize — list every property:++**For text elements:**+- `fontSize`, `fontWeight`, `fontFamily`, `lineHeight`, `letterSpacing`+- `color`, `textTransform`, `textDecoration`+- `margin`, `padding`++**For container elements:**+- `display`, `flexDirection`, `justifyContent`, `alignItems`, `gap`+- `width`, `height`, `maxWidth`, `minHeight`+- `padding`, `margin`+- `background`, `backgroundColor`+- `borderRadius`, `border`, `boxShadow`+- `overflow`, `position`, `zIndex`++**For interactive elements:**+- All of the above, plus hover/active/focus states+- `cursor`, `transition`, `transform`++### 3c: Document in Atomic Detail++For each component, create a spec that looks like this:++```markdown## ComponentName-**Purpose:** What it does-**Structure:** HTML hierarchy-**Variants:** List all variants-**States:** default, hover, active, disabled, loading, error, empty-**Responsive:** How it changes at breakpoints-**Interactions:** Click, hover, focus behaviors-**Design Tokens Used:** Which colors, fonts, spacing it references-```-### `LAYOUT_ARCHITECTURE.md`-```-## Page: [Name]-**Desktop Layout:** [columns, widths, sticky elements]-**Tablet Layout:** [what changes]-**Mobile Layout:** [what changes]-**Sticky Elements:** [what sticks and at what scroll position]-**Z-Index Map:** [layering of overlapping elements]-```+### Container+- Classes: `relative flex flex-col pl-5 snap-start scroll-mt-[68px] h-screen`+- CSS: display:flex, flex-direction:column, padding-left:20px, scroll-snap-align:start, height:100vh++### Title (h3)+- Classes: `font-geist text-4xl font-medium`+- CSS: font-family:Geist, font-size:36px, font-weight:500, line-height:40px, color:#EDEDED+- Margin: 0-### `INTERACTION_PATTERNS.md`+### Description (p)+- Classes: `pr-10 font-geist text-base`+- CSS: font-size:16px, font-weight:400, line-height:24px, padding-right:40px, color:#EDEDED++### Video Container+- Classes: `relative flex-1 overflow-hidden`+- Video element: border-radius:19px 19px 0 0, object-fit:contain, max-width:100%```-## [Pattern Name]-**Trigger:** What initiates it-**Animation:** Duration, easing, properties animated-**CSS/JS:** How it's likely implemented++This level of detail is what makes the difference between a "close enough" clone and a pixel-perfect one.++## Phase 4: Component Inventory (Atomic Breakdown)++Break the site into the SMALLEST possible components. Don't lump things together. Each component should be independently buildable and verifiable.++### Component Decomposition Rules:+1. If an element has distinct styling, it's a separate component+2. If an element repeats with variations, document each variation+3. If an element has interactive states, document every state+4. If an element behaves differently at breakpoints, document each breakpoint+5. Navigation, headers, footers, cards, buttons, inputs — each is its own spec++### For each atomic component, document:++```markdown+## ComponentName++**File path:** `src/components/ComponentName.tsx`+**Props:** list every prop with type++### Exact CSS Spec (Desktop)+[Exhaustive list of every CSS property, extracted via getComputedStyle]++### Exact CSS Spec (Tablet — if different)+[Only properties that change]++### Exact CSS Spec (Mobile — if different)+[Only properties that change]++### States+- Default: [exact CSS]+- Hover: [exact CSS changes]+- Active: [exact CSS changes]+- Disabled: [exact CSS changes]++### Assets Used+- Image: `/images/some-image.png` (downloaded to public/)+- Icon: `SearchIcon` from icons.tsx+- Video: `/videos/some-video.mp4`++### Children+- Lists child components this component contains++### Animation/Transitions+- Transition properties, duration, easing+- Any keyframe animations with exact values```-### `TECH_STACK_ANALYSIS.md`+## Phase 5: Layout Architecture++Document the page layout with exact measurements, not descriptions:++```markdown+## Page: Home++### Scroll Container+- ID: `new-landing-scroll-root`+- Classes: `light h-screen overflow-y-auto overflow-x-hidden snap-y snap-mandatory`++### Two-Column Layout+- Container: max-width:1600px, display:flex, flex-direction:row (desktop)+- Left column: width:512px, position:sticky, top:0, max-height:100vh+- Right column: flex-grow:1, background:rgba(0,0,0,0.1)++### Section Heights+- First section: height:100vh+- Other sections: height:calc(100vh - 68px)+- Sticky header: height:69px, position:sticky, top:0++### Z-Index Map+1. z-50: Floating nav bar, sticky headers+2. z-40: Left column (hero sidebar)+3. z-20: Fade gradients+4. z-10: Right column, white section+5. z-0: Background gradients```-## Observed Stack-- Framework: ___-- CSS: ___-- State Management: ___-- API Pattern: ___-...--## Our Chosen Stack-- Framework: Next.js 15 (App Router)-- CSS: Tailwind CSS v4-- (fill in based on what makes sense)-...--## Mapping-| Their Approach | Our Equivalent |-|---|---|++## Phase 6: Build Plan (Atomic Tasks)++Create `docs/research/BUILD_PLAN.md` with tasks broken into the SMALLEST possible units. Each task should take a single agent no more than a few minutes.++```markdown+## Build Order++### Foundation (Sequential)+1. Project scaffold (Next.js, Tailwind, fonts, global CSS)+2. Design tokens (CSS variables, theme config)+3. TypeScript interfaces++### Asset Integration+4. Download all binary assets (images, videos, favicons)+5. Extract all SVG icons as React components+6. Configure favicon and OG image metadata++### Atomic Components (Parallel — one agent per component)+7. DimensionLogo icon component+8. ArrowRightIcon component+9. FrostBorderButton component+10. FloatingNavBar component+11. BackgroundGradient component (with real hero images)+12. HeroSection (text + bullets + CTA)+13. UseCaseNavList (vertical list in hero sidebar)+14. UseCaseContextHeader (sticky gradient header)+15. UseCaseSection (section wrapper with title + description + video area)+16. UseCaseVideo (lazy-loaded video player)+17. SearchTabPanel (search feature card content)+18. FeatureCard (individual feature card)+... (continue for every component)++### Page Assembly (After components)+19. Wire Home page layout (page.tsx)+20. Connect mock data to components+21. Configure scroll snap behavior+22. Wire up scroll spy + section tracking++### QA (After assembly)+23. Side-by-side screenshot comparison per section+24. CSS value verification per component+25. Responsive behavior check at 3 breakpoints+26. Animation/interaction verification```-## Phase 4: Build Plan+## Phase 7: Verification Protocol-After all documentation is complete, create `docs/research/BUILD_PLAN.md`:+After documenting everything, do a completeness check:-1. List components in dependency order (foundations first, composites last)-2. Group into parallel build tracks (what can be built simultaneously)-3. Identify the "secret sauce" — the one config/style detail that makes everything feel real (like Mapbox fog in the globe project)-4. Estimate mock data needs-5. Recommend build order for pages+1. **Asset completeness:** Every image, video, SVG, and font from the original is downloaded locally+2. **CSS completeness:** Every element has exact computed styles, not approximations+3. **Component completeness:** Every UI element is documented as an atomic component+4. **Layout completeness:** Page structure has exact measurements at every breakpoint+5. **Interaction completeness:** Every hover, click, scroll, and transition is documented## OutputWhen done, summarize:-- How many pages documented-- How many components inventoried-- Key design tokens extracted-- Tech stack identified vs. our chosen equivalents-- Recommended next step: run `/build-from-spec` to start implementation+- Total assets downloaded (images, videos, SVGs, fonts, favicons)+- Components inventoried (with exact CSS specs)+- Design tokens extracted+- Pages documented+- Recommended next step: run `/build-from-spec`