launchframe 0.2.2 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -27,16 +27,35 @@ When you see that with no other instructions, **start the full clone-website pip
27
27
  ## Tech Stack
28
28
  - **Framework:** Next.js 16 (App Router, React 19, TypeScript strict)
29
29
  - **UI:** shadcn/ui (Radix primitives, Tailwind CSS v4, `cn()` utility)
30
+ - **Motion:** **Framer Motion** (`framer-motion`) — **default for non-trivial animation** (scroll reveals, staggers, layout, gestures). Use CSS `transition` / `@keyframes` only when they reproduce the target exactly without JS.
30
31
  - **Icons:** Lucide React (default — will be replaced/supplemented by extracted SVGs)
31
32
  - **Styling:** Tailwind CSS v4 with oklch design tokens
33
+ - **Media:** Real **images & videos** from the target URL, saved under `public/images/` and `public/videos/` (see `.claude/skills/clone-website/SKILL.md` and `docs/research/INSPECTION_GUIDE.md`). Do not ship a “pretty shell” with missing raster/video unless extraction is **blocked** and documented in `docs/research/EXTRACTION_LIMITATIONS.md`.
32
34
  - **Deployment:** Vercel
33
35
 
36
+ ## Priority: images, videos & motion
37
+ Treat these as **first-class deliverables**, not polish at the end.
38
+
39
+ 1. **Raster & video** — Early in recon, inventory every `<img>`, `<picture>` / `<source>`, `<video>`, poster image, and meaningful `background-image` URL. Download into `public/` and reference **local paths** in specs and components. Hero bands and marketing sections often fail visually when a single layer is skipped.
40
+ 2. **Motion** — Match the target’s feel: easing, duration, stagger, scroll triggers. Prefer **`motion` from `framer-motion`** for entrance sequences, viewport-driven animations, shared-layout-style transitions, and anything beyond a one-off CSS transition. Note in each component spec whether behavior is **CSS-only** vs **Framer Motion**.
41
+
34
42
  ## Commands
35
43
  - `npm run dev` — Start dev server
36
44
  - `npm run build` — Production build
37
45
  - `npm run lint` — ESLint check
38
46
  - `npm run typecheck` — TypeScript check
39
47
  - `npm run check` — Run lint + typecheck + build
48
+ - **`npm run recon`** — **Playwright** capture: full-page screenshots, `computed-snapshot.json`, `MEDIA_MANIFEST.md` (use when Browser MCP / Chrome DevTools MCP is broken or missing)
49
+ - **`npm run recon:headed`** — Same as `recon` but **headed** Chromium (often better for WAF / “Just a moment…” pages)
50
+
51
+ **Playwright browser binaries (once per machine):** `npx playwright install chromium`
52
+
53
+ ## When Browser MCP is down
54
+ Prefer **Playwright** for repeatable extraction in-repo — do **not** rely on Chrome DevTools MCP alone.
55
+
56
+ 1. Run **`npm run recon`** (or **`npm run recon:headed`** if headless hits a challenge page).
57
+ 2. Read **`docs/research/computed-snapshot.json`**, **`docs/research/MEDIA_MANIFEST.md`**, and **`docs/research/EXTRACTION_LIMITATIONS.md`** before writing specs.
58
+ 3. Fill **`scripts/download-assets.mjs`** from `MEDIA_MANIFEST.md` and run it to populate `public/images/` and `public/videos/`.
40
59
 
41
60
  ## Code Style
42
61
  - TypeScript strict mode, no `any`
@@ -46,6 +65,8 @@ When you see that with no other instructions, **start the full clone-website pip
46
65
  - Responsive: mobile-first
47
66
 
48
67
  ## Design Principles
68
+ - **Images & video fidelity** — prefer real downloaded assets; preserve aspect ratio, `object-fit`, layering, and poster frames. Rebrand pass may **swap** URLs for IP-safe alternates but must keep layout identical.
69
+ - **Motion fidelity** — timing and easing matter as much as color; use Framer Motion when CSS alone cannot match staggered or scroll-driven behavior.
49
70
  - **Pixel-perfect emulation** — match the target's spacing, colors, typography exactly
50
71
  - **No personal aesthetic changes during emulation phase** — match 1:1 first, rebrand later
51
72
  - **Real content during extraction** — use actual text and assets from the target site so the clone scaffolds against real shapes
@@ -79,83 +100,112 @@ scripts/ # Asset download scripts
79
100
  - After editing `AGENTS.md`, run `bash scripts/sync-agent-rules.sh` to regenerate platform-specific instruction files.
80
101
  - After editing `.claude/skills/clone-website/SKILL.md`, run `node scripts/sync-skills.mjs` to regenerate the skill for all platforms.
81
102
 
82
- # Website Inspection Guide
83
-
84
- ## How to Reverse-Engineer Any Website
85
-
86
- This guide outlines what to capture when inspecting a target website via Chrome MCP or browser DevTools.
87
-
88
- ## Phase 1: Visual Audit
89
-
90
- ### Screenshots to Capture
91
- - [ ] Every distinct pagedesktop, tablet, mobile
92
- - [ ] Dark mode variants (if applicable)
93
- - [ ] Light mode variants (if applicable)
94
- - [ ] Key interaction states (hover, active, open menus, modals)
95
- - [ ] Loading/skeleton states
96
- - [ ] Empty states
97
- - [ ] Error states
98
-
99
- ### Design Tokens to Extract
100
- - [ ] **Colors** — background, text (primary/secondary/muted), accent, border, hover, error, success, warning
101
- - [ ] **Typography** — font family, sizes (h1-h6, body, caption, label), weights, line heights, letter spacing
102
- - [ ] **Spacing** — padding/margin patterns (look for a scale: 4px, 8px, 12px, 16px, 24px, 32px, etc.)
103
- - [ ] **Border radius** — buttons, cards, avatars, inputs
104
- - [ ] **Shadows/elevation** — card shadows, dropdown shadows, modal overlay
105
- - [ ] **Breakpoints** — when does the layout shift? (inspect with DevTools responsive mode)
106
- - [ ] **Icons** — which icon library? custom SVGs? sizes?
107
- - [ ] **Avatars** — sizes, shapes, fallback behavior
108
- - [ ] **Buttons** — all variants (primary, secondary, ghost, icon-only, danger)
109
- - [ ] **Inputs** text fields, textareas, selects, checkboxes, toggles
110
-
111
- ## Phase 2: Component Inventory
112
-
113
- For each distinct UI component, document:
114
- 1. **Name** — what would you call this component?
115
- 2. **Structure** what HTML elements / child components does it contain?
116
- 3. **Variants** does it have different sizes, colors, or states?
117
- 4. **States** default, hover, active, disabled, loading, error, empty
118
- 5. **Responsive behavior** how does it change at different breakpoints?
119
- 6. **Interactions** click, hover, focus, keyboard navigation
120
- 7. **Animations** transitions, entrance/exit animations, micro-interactions
121
-
122
- ### Common Components to Look For
123
- - Navigation (top bar, sidebar, bottom bar)
124
- - Cards / list items
125
- - Buttons and links
126
- - Forms and inputs
127
- - Modals and dialogs
128
- - Dropdowns and menus
129
- - Tabs and segmented controls
130
- - Avatars and user badges
131
- - Loading skeletons
132
- - Toast notifications
133
- - Tooltips and popovers
134
-
135
- ## Phase 3: Layout Architecture
136
-
137
- - [ ] **Grid system** — CSS Grid? Flexbox? Fixed widths?
138
- - [ ] **Column layout** — how many columns at each breakpoint?
139
- - [ ] **Max-width** — main content area max-width
140
- - [ ] **Sticky elements** — header, sidebar, floating buttons
141
- - [ ] **Z-index layers** — navigation, modals, tooltips, overlays
142
- - [ ] **Scroll behavior** — infinite scroll, pagination, virtual scrolling
143
-
144
- ## Phase 4: Technical Stack Analysis
145
-
146
- - [ ] **Framework** — React? Vue? Angular? Check `__NEXT_DATA__`, `__NUXT__`, `ng-version`
147
- - [ ] **CSS approach** — Tailwind (utility classes), CSS Modules, Styled Components, Emotion, vanilla CSS
148
- - [ ] **State management** — Redux (check DevTools), React Query, Zustand, Pinia
149
- - [ ] **API patterns** — REST, GraphQL (check network tab for `/graphql` requests)
150
- - [ ] **Font loading** — Google Fonts, self-hosted, system fonts
151
- - [ ] **Image strategy** — CDN, lazy loading, srcset, WebP/AVIF
152
- - [ ] **Animation library** — Framer Motion, GSAP, CSS transitions only
153
-
154
- ## Phase 5: Documentation Output
155
-
156
- After inspection, create these files in `docs/research/`:
157
- 1. `DESIGN_TOKENS.md` All extracted colors, typography, spacing
158
- 2. `COMPONENT_INVENTORY.md` — Every component with structure notes
159
- 3. `LAYOUT_ARCHITECTURE.md` — Page layouts, grid system, responsive behavior
160
- 4. `INTERACTION_PATTERNS.md` Animations, transitions, hover states
161
- 5. `TECH_STACK_ANALYSIS.md` What the site uses and our chosen equivalents
103
+ # Website Inspection Guide
104
+
105
+ ## Priority (read first): media & motion
106
+
107
+ Launchframe clones live pages for a **visual** result. Two things most often separate a convincing build from a hollow one:
108
+
109
+ ### 1. Images & video (do this before obsessing over utility classes)
110
+
111
+ - [ ] **Every `<img>`** — `src` / `srcset` / `currentSrc`, `sizes`, `loading`, `decoding`, `alt`, intrinsic dimensions
112
+ - [ ] **`<picture>` / `<source>`**resolution switches, art direction, `type` (WebP/AVIF)
113
+ - [ ] **Every `<video>`** `src` + nested `<source>`, **poster**, `autoplay`, `loop`, `muted`, `playsinline`, `controls`
114
+ - [ ] **Background images** `background-image` on ancestors (hero stacks are often **layers** of img + gradient + PNG mockup)
115
+ - [ ] **Lazy / below-fold** scroll the page once before asset discovery so `data-src` / lazy-loaded URLs resolve if the site uses them
116
+ - [ ] **Download** — mirror into `public/images/` and `public/videos/` with stable paths; list failures in `docs/research/EXTRACTION_LIMITATIONS.md`
117
+
118
+ If automation hits a bot wall, **do not pretend extraction succeeded** — capture what you can from successful fetches and document gaps.
119
+
120
+ ### 2. Motion (prefer Framer Motion in this repo)
121
+
122
+ - [ ] **Entrance** — fade/slide/scale on mount or on **scroll into view** (note threshold / `margin`)
123
+ - [ ] **Stagger** — children animating in sequence (hero bullets, card grids)
124
+ - [ ] **Scroll-linked** — progress, parallax, pinned sections (may combine with CSS `animation-timeline` or libs)
125
+ - [ ] **Gestures** — drag, pan, hover follow (often Framer Motion)
126
+ - [ ] **Implementation rule** — use **`framer-motion`** for anything beyond trivial single-property CSS `transition`. Record **duration, easing, delay, stagger**, and **trigger** (scroll, hover, tap) in specs.
127
+
128
+ ---
129
+
130
+ ## How to Reverse-Engineer Any Website
131
+
132
+ This guide outlines what to capture when inspecting a target website via Chrome MCP or browser DevTools.
133
+
134
+ ## Phase 1: Visual Audit
135
+
136
+ ### Screenshots to Capture
137
+ - [ ] Every distinct page desktop, tablet, mobile
138
+ - [ ] Dark mode variants (if applicable)
139
+ - [ ] Light mode variants (if applicable)
140
+ - [ ] Key interaction states (hover, active, open menus, modals)
141
+ - [ ] Loading/skeleton states
142
+ - [ ] Empty states
143
+ - [ ] Error states
144
+ - [ ] **Video frames** capture a frame mid-play for reference if motion is subtle
145
+ - [ ] **Hero / full-bleed** — wide crops where raster layers are easy to miss
146
+
147
+ ### Design Tokens to Extract
148
+ - [ ] **Colors** — background, text (primary/secondary/muted), accent, border, hover, error, success, warning
149
+ - [ ] **Typography** — font family, sizes (h1-h6, body, caption, label), weights, line heights, letter spacing
150
+ - [ ] **Spacing** — padding/margin patterns (look for a scale: 4px, 8px, 12px, 16px, 24px, 32px, etc.)
151
+ - [ ] **Border radius** — buttons, cards, avatars, inputs
152
+ - [ ] **Shadows/elevation** — card shadows, dropdown shadows, modal overlay
153
+ - [ ] **Breakpoints** — when does the layout shift? (inspect with DevTools responsive mode)
154
+ - [ ] **Icons** — which icon library? custom SVGs? sizes?
155
+ - [ ] **Avatars** — sizes, shapes, fallback behavior
156
+ - [ ] **Buttons** — all variants (primary, secondary, ghost, icon-only, danger)
157
+ - [ ] **Inputs** — text fields, textareas, selects, checkboxes, toggles
158
+
159
+ ## Phase 2: Component Inventory
160
+
161
+ For each distinct UI component, document:
162
+ 1. **Name** — what would you call this component?
163
+ 2. **Structure** — what HTML elements / child components does it contain?
164
+ 3. **Variants** — does it have different sizes, colors, or states?
165
+ 4. **States** default, hover, active, disabled, loading, error, empty
166
+ 5. **Responsive behavior** — how does it change at different breakpoints?
167
+ 6. **Interactions** — click, hover, focus, keyboard navigation
168
+ 7. **Animations** — transitions, entrance/exit, micro-interactions **`framer-motion` vs CSS** and exact timing
169
+
170
+ ### Common Components to Look For
171
+ - Navigation (top bar, sidebar, bottom bar)
172
+ - Cards / list items
173
+ - Buttons and links
174
+ - Forms and inputs
175
+ - Modals and dialogs
176
+ - Dropdowns and menus
177
+ - Tabs and segmented controls
178
+ - Avatars and user badges
179
+ - Loading skeletons
180
+ - Toast notifications
181
+ - Tooltips and popovers
182
+ - **Video / Lottie / canvas** blocks (do not substitute with static mockups without documenting why)
183
+
184
+ ## Phase 3: Layout Architecture
185
+
186
+ - [ ] **Grid system** — CSS Grid? Flexbox? Fixed widths?
187
+ - [ ] **Column layout** — how many columns at each breakpoint?
188
+ - [ ] **Max-width** — main content area max-width
189
+ - [ ] **Sticky elements** — header, sidebar, floating buttons
190
+ - [ ] **Z-index layers** — navigation, modals, tooltips, overlays
191
+ - [ ] **Scroll behavior** — infinite scroll, pagination, virtual scrolling
192
+
193
+ ## Phase 4: Technical Stack Analysis
194
+
195
+ - [ ] **Framework** — React? Vue? Angular? Check `__NEXT_DATA__`, `__NUXT__`, `ng-version`
196
+ - [ ] **CSS approach** — Tailwind (utility classes), CSS Modules, Styled Components, Emotion, vanilla CSS
197
+ - [ ] **State management** — Redux (check DevTools), React Query, Zustand, Pinia
198
+ - [ ] **API patterns** — REST, GraphQL (check network tab for `/graphql` requests)
199
+ - [ ] **Font loading** — Google Fonts, self-hosted, system fonts
200
+ - [ ] **Image strategy** — CDN, lazy loading, srcset, WebP/AVIF — **mirror URLs you are allowed to fetch**
201
+ - [ ] **Animation library** — site may use GSAP, Lottie, Rive, or CSS only — **in the Next.js clone, default to Framer Motion** unless a different lib is required for parity
202
+
203
+ ## Phase 5: Documentation Output
204
+
205
+ After inspection, create these files in `docs/research/`:
206
+ 1. `DESIGN_TOKENS.md` — All extracted colors, typography, spacing
207
+ 2. `COMPONENT_INVENTORY.md` — Every component with structure notes
208
+ 3. **`MEDIA_MANIFEST.md`** — (recommended) Table of every image/video/poster URL → local `public/` path or “blocked”
209
+ 4. `LAYOUT_ARCHITECTURE.md` — Page layouts, grid system, responsive behavior
210
+ 5. `INTERACTION_PATTERNS.md` — Animations: **CSS vs Framer Motion**, transitions, hover states
211
+ 6. `TECH_STACK_ANALYSIS.md` — What the site uses and our chosen equivalents (Framer Motion for React animation)
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: clone-website
3
- description: Reverse-engineer and clone one or more websites in one shot — extracts assets, CSS, and content section-by-section and proactively dispatches parallel builder agents in worktrees as it goes. Use this whenever the user wants to clone, replicate, rebuild, reverse-engineer, or copy any website. Also triggers on phrases like "make a copy of this site", "rebuild this page", "pixel-perfect clone", "launch a SaaS based on", "build me a clone of", and Launchframe shorthands **Build it**, **Go**, **Ship it**, **Clone the site** (read `launchframe.config.json` only — no URL in chat). This project was scaffolded by Launchframe — read `launchframe.config.json` for the target URL and the user's SaaS-idea rebranding directive before running. URLs can also be passed inline.
3
+ description: Reverse-engineer and clone one or more websites in one shot — **prioritizes real images/videos** (download to public/) and **motion via Framer Motion** for non-trivial animation. Extracts assets, CSS, and content section-by-section and dispatches parallel builder agents in worktrees. Use this whenever the user wants to clone, replicate, rebuild, reverse-engineer, or copy any website. Also triggers on phrases like "make a copy of this site", "rebuild this page", "pixel-perfect clone", "launch a SaaS based on", "build me a clone of", and Launchframe shorthands **Build it**, **Go**, **Ship it**, **Clone the site** (read `launchframe.config.json` only — no URL in chat). This project was scaffolded by Launchframe — read `launchframe.config.json` for the target URL and the user's SaaS-idea rebranding directive before running. URLs can also be passed inline.
4
4
  argument-hint: "[<url1> <url2> ...] (optional — defaults to launchframe.config.json)"
5
5
  user-invocable: true
6
6
  ---
@@ -39,16 +39,22 @@ If the user provides additional instructions (specific fidelity level, deeper cu
39
39
  ## Pre-Flight
40
40
 
41
41
  1. **Read `launchframe.config.json`** (see Step 0 above). After a fresh `npx launchframe` scaffold, proceed immediately — only echo `url`/`idea` for confirmation if the config looks wrong or the user asked to verify.
42
- 2. **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.
42
+ 2. **Browser automation.** Prefer an MCP (Chrome DevTools MCP, Playwright MCP, Browserbase MCP, etc.) when it is healthy. **If MCP is missing or in an error state, run `npm run recon` (Playwright)** — see `scripts/recon-playwright.mjs`. It writes `docs/research/computed-snapshot.json`, `docs/research/MEDIA_MANIFEST.md`, and full-page screenshots under `docs/design-references/`. Use `npm run recon:headed` if headless hits a WAF/challenge page. One-time install: `npx playwright install chromium`. Do not skip extraction — adapt the pipeline to the tools that work.
43
43
  3. Validate the resolved URL(s). Normalize and verify each is accessible via your browser MCP tool. If any are invalid, ask the user to correct `launchframe.config.json` (or pass an override) before proceeding.
44
44
  4. 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 run `npm install` first.
45
- 5. Create the output directories if they don't exist: `docs/research/`, `docs/research/components/`, `docs/design-references/`, `scripts/`. For multiple clones, also prepare per-site folders like `docs/research/<hostname>/` and `docs/design-references/<hostname>/`.
45
+ 5. Create the output directories if they don't exist: `docs/research/`, `docs/research/components/`, `docs/design-references/`, `scripts/`. Plan `docs/research/MEDIA_MANIFEST.md` as soon as media is inventoried. For multiple clones, also prepare per-site folders like `docs/research/<hostname>/` and `docs/design-references/<hostname>/`.
46
46
  6. When working with multiple sites in one command, optionally confirm whether to run them in parallel (recommended, if resources allow) or sequentially to avoid overload.
47
47
 
48
48
  ## Guiding Principles
49
49
 
50
50
  These are the truths that separate a successful clone from a "close enough" mess. Internalize them — they should inform every decision you make.
51
51
 
52
+ ### 0. Launchframe priorities: media & motion (do not defer)
53
+
54
+ **Raster & video are first-class.** Before you treat the page as “mostly typography,” run a dedicated **media inventory** (see `@docs/research/INSPECTION_GUIDE.md` Priority section): every `<img>`, `<picture>` / `<source>`, `<video>` (+ poster), and non-trivial `background-image`. Download to `public/images/` and `public/videos/` and write `docs/research/MEDIA_MANIFEST.md` (URL → local path, or `BLOCKED` + reason). Component specs MUST list concrete `public/...` paths; if you use a placeholder, say why in `docs/research/EXTRACTION_LIMITATIONS.md`. Never silently drop a hero layer, reel, or og visual.
55
+
56
+ **Motion defaults to Framer Motion.** This template lists `framer-motion` as a dependency. After foundation tokens, ensure `import { motion } from "framer-motion"` (and related APIs: `useScroll`, `useTransform`, `AnimatePresence`, `LayoutGroup`) for: scroll-triggered reveals, staggered children, layout transitions, and gestures — anything beyond a trivial one-property CSS `transition`. In each spec file, add a **Motion** subsection: trigger, duration, easing, delay/stagger, and **implementation: CSS | framer-motion**. Prefer CSS only when it matches the target exactly without JS.
57
+
52
58
  ### 1. Completeness Beats Speed
53
59
 
54
60
  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.
@@ -193,11 +199,12 @@ Save this as `docs/research/PAGE_TOPOLOGY.md` — it becomes your assembly bluep
193
199
  This is sequential. Do it yourself (not delegated to an agent) since it touches many files:
194
200
 
195
201
  1. **Update fonts** in `layout.tsx` to match the target site's actual fonts
196
- 2. **Update globals.css** with the target's color tokens, spacing values, keyframe animations, utility classes, and any **global scroll behaviors** (Lenis, smooth scroll CSS, scroll-snap on body)
197
- 3. **Create TypeScript interfaces** in `src/types/` for the content structures you've observed
198
- 4. **Extract SVG icons** — find all inline `<svg>` elements on the page, deduplicate them, and save as named React components in `src/components/icons.tsx`. Name them by visual function (e.g., `SearchIcon`, `ArrowRightIcon`, `LogoIcon`).
199
- 5. **Download global assets** write and run a Node.js script (`scripts/download-assets.mjs`) that downloads all images, videos, and other binary assets from the page to `public/`. Preserve meaningful directory structure.
200
- 6. Verify: `npm run build` passes
202
+ 2. **Confirm Framer Motion** `framer-motion` should already be in `package.json`. If missing, add it (`npm install framer-motion`) so builders can import `motion` without ad-hoc library drift.
203
+ 3. **Update globals.css** with the target's color tokens, spacing values, keyframe animations, utility classes, and any **global scroll behaviors** (Lenis, smooth scroll CSS, scroll-snap on body)
204
+ 4. **Media inventory + download (early, high priority)** — run the asset discovery script (below) via browser MCP, write `docs/research/MEDIA_MANIFEST.md`, then implement **`scripts/download-assets.mjs`** and execute it so **images** land in `public/images/` and **videos** (+ posters) in `public/videos/` (or a clear subdirectory scheme under `public/`). Batch parallel downloads (4 concurrent) with errors logged — do not claim success if URLs failed. This step should complete **before** most section components are built so builders use real paths.
205
+ 5. **Create TypeScript interfaces** in `src/types/` for the content structures you've observed
206
+ 6. **Extract SVG icons** — find all inline `<svg>` elements on the page, deduplicate them, and save as named React components in `src/components/icons.tsx`. Name them by visual function (e.g., `SearchIcon`, `ArrowRightIcon`, `LogoIcon`).
207
+ 7. Verify: `npm run build` passes
201
208
 
202
209
  ### Asset Discovery Script Pattern
203
210
 
@@ -354,11 +361,16 @@ For each section (or sub-component, if you're breaking it up), create a spec fil
354
361
  - **State A (before):** maxWidth: 100vw, boxShadow: none, borderRadius: 0
355
362
  - **State B (after):** maxWidth: 1200px, boxShadow: 0 4px 20px rgba(0,0,0,0.1), borderRadius: 16px
356
363
  - **Transition:** transition: all 0.3s ease
357
- - **Implementation approach:** <CSS transition + scroll listener | IntersectionObserver | CSS animation-timeline | etc.>
364
+ - **Implementation approach:** <CSS transition + scroll listener | IntersectionObserver | CSS animation-timeline | **framer-motion** (`motion`, `whileInView`, stagger container) | etc.>
358
365
 
359
366
  ### Hover states
360
367
  - **<Element>:** <property>: <before> → <after>, transition: <value>
361
368
 
369
+ ## Motion (Framer Motion vs CSS)
370
+ - **Entrance / scroll reveals:** <e.g. fade+translateY, staggerChildren — specify duration, easing, delay, viewport `once`/`margin`>
371
+ - **Library:** <`framer-motion` | CSS-only — justify if CSS-only>
372
+ - **Keyframes / springs:** <if any — match target curve>
373
+
362
374
  ## Per-State Content (if applicable)
363
375
 
364
376
  ### State: "Featured"
@@ -370,9 +382,10 @@ For each section (or sub-component, if you're breaking it up), create a spec fil
370
382
  - Title: "..."
371
383
  - Cards: [...]
372
384
 
373
- ## Assets
374
- - Background image: `public/images/<file>.webp`
375
- - Overlay image: `public/images/<file>.png`
385
+ ## Assets (images & video — required detail)
386
+ - Raster: `public/images/<file>` — dimensions, `object-fit`, lazy if below fold
387
+ - Video: `public/videos/<file>` — poster `public/images/...` or `public/videos/...`, autoplay/muted/loop, controls
388
+ - Background layers: which div uses `background-image` and resolved URL → local path
376
389
  - Icons used: <ArrowIcon>, <SearchIcon> from icons.tsx
377
390
 
378
391
  ## Text Content (verbatim)
@@ -446,7 +459,7 @@ For every section, replace:
446
459
  7. **Metadata** — update `<title>`, meta description, OG tags, and favicon manifest in `src/app/layout.tsx` to reflect the new SaaS. Generate a simple favicon (initial letter on a brand-colored square) if no asset is provided.
447
460
 
448
461
  What you must NOT change in this pass:
449
- - Spacing, padding, typography scale, color tokens, animations, responsive breakpoints — those are still 1:1 to the original
462
+ - Spacing, padding, typography scale, color tokens, **animation timing & motion choreography** (including Framer Motion `variants` / `transition` props), responsive breakpoints — those are still 1:1 to the original
450
463
  - Section order, section count, component structure
451
464
  - Interaction models (scroll-driven stays scroll-driven, etc.)
452
465
  - Any computed-style value extracted in Phase 3
@@ -480,6 +493,8 @@ Before dispatching ANY builder agent, verify you can check every box. If you can
480
493
  - [ ] For scroll-driven components: trigger threshold, before/after styles, and transition are recorded
481
494
  - [ ] For hover states: before/after values and transition timing are recorded
482
495
  - [ ] All images in the section are identified (including overlays and layered compositions)
496
+ - [ ] Any `<video>` (and poster), Lottie, or canvas-driven hero is identified — not approximated as a static div
497
+ - [ ] **Motion** subsection filled: CSS vs **framer-motion**, durations, easings, stagger, scroll triggers
483
498
  - [ ] Responsive behavior is documented for at least desktop and mobile
484
499
  - [ ] Text content is verbatim from the site, not paraphrased
485
500
  - [ ] The builder prompt is under ~150 lines of spec; if over, the section needs to be split
@@ -496,6 +511,8 @@ These are lessons from previous failed clones — each one cost hours of rework:
496
511
  - **Don't build everything in one monolithic commit.** The whole point of this pipeline is incremental progress with verified builds at each step.
497
512
  - **Don't reference docs from builder prompts.** Each builder gets the CSS spec inline in its prompt — never "see DESIGN_TOKENS.md for colors." The builder should have zero need to read external docs.
498
513
  - **Don't skip asset extraction.** Without real images, videos, and fonts, the clone will always look fake regardless of how perfect the CSS is.
514
+ - **Don't defer image/video download to the end.** Run `MEDIA_MANIFEST.md` + `download-assets.mjs` during foundation so components reference real `public/` paths from the first build.
515
+ - **Don't fake complex motion with a single CSS `transition` when the target uses staggered, scroll-scrubbed, or layout-driven animation** — use **`framer-motion`** (`motion`, `whileInView`, `variants`, `staggerChildren`) and match duration/easing from extraction.
499
516
  - **Don't give a builder agent too much scope.** If you're writing a builder prompt and it's getting long because the section is complex, that's a signal to break it into smaller tasks.
500
517
  - **Don't bundle unrelated sections into one agent.** A CTA section and a footer are different components with different designs — don't hand them both to one agent and hope for the best.
501
518
  - **Don't skip responsive extraction.** If you only inspect at desktop width, the clone will break at tablet and mobile. Test at 1440, 768, and 390 during extraction.
@@ -510,7 +527,7 @@ When done, report:
510
527
  - Total sections built
511
528
  - Total components created
512
529
  - Total spec files written (should match components)
513
- - Total assets downloaded (images, videos, SVGs, fonts)
530
+ - Total assets downloaded (images, videos, SVGs, fonts) — path to `docs/research/MEDIA_MANIFEST.md`
514
531
  - Rebrand summary (path to `docs/research/REBRAND.md`)
515
532
  - Build status (`npm run build` result)
516
533
  - Visual QA results (any remaining discrepancies)
@@ -41,16 +41,22 @@ If the user provides additional instructions (specific fidelity level, deeper cu
41
41
  ## Pre-Flight
42
42
 
43
43
  1. **Read `launchframe.config.json`** (see Step 0 above). After a fresh `npx launchframe` scaffold, proceed immediately — only echo `url`/`idea` for confirmation if the config looks wrong or the user asked to verify.
44
- 2. **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.
44
+ 2. **Browser automation.** Prefer an MCP (Chrome DevTools MCP, Playwright MCP, Browserbase MCP, etc.) when it is healthy. **If MCP is missing or in an error state, run `npm run recon` (Playwright)** — see `scripts/recon-playwright.mjs`. It writes `docs/research/computed-snapshot.json`, `docs/research/MEDIA_MANIFEST.md`, and full-page screenshots under `docs/design-references/`. Use `npm run recon:headed` if headless hits a WAF/challenge page. One-time install: `npx playwright install chromium`. Do not skip extraction — adapt the pipeline to the tools that work.
45
45
  3. Validate the resolved URL(s). Normalize and verify each is accessible via your browser MCP tool. If any are invalid, ask the user to correct `launchframe.config.json` (or pass an override) before proceeding.
46
46
  4. 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 run `npm install` first.
47
- 5. Create the output directories if they don't exist: `docs/research/`, `docs/research/components/`, `docs/design-references/`, `scripts/`. For multiple clones, also prepare per-site folders like `docs/research/<hostname>/` and `docs/design-references/<hostname>/`.
47
+ 5. Create the output directories if they don't exist: `docs/research/`, `docs/research/components/`, `docs/design-references/`, `scripts/`. Plan `docs/research/MEDIA_MANIFEST.md` as soon as media is inventoried. For multiple clones, also prepare per-site folders like `docs/research/<hostname>/` and `docs/design-references/<hostname>/`.
48
48
  6. When working with multiple sites in one command, optionally confirm whether to run them in parallel (recommended, if resources allow) or sequentially to avoid overload.
49
49
 
50
50
  ## Guiding Principles
51
51
 
52
52
  These are the truths that separate a successful clone from a "close enough" mess. Internalize them — they should inform every decision you make.
53
53
 
54
+ ### 0. Launchframe priorities: media & motion (do not defer)
55
+
56
+ **Raster & video are first-class.** Before you treat the page as “mostly typography,” run a dedicated **media inventory** (see `@docs/research/INSPECTION_GUIDE.md` Priority section): every `<img>`, `<picture>` / `<source>`, `<video>` (+ poster), and non-trivial `background-image`. Download to `public/images/` and `public/videos/` and write `docs/research/MEDIA_MANIFEST.md` (URL → local path, or `BLOCKED` + reason). Component specs MUST list concrete `public/...` paths; if you use a placeholder, say why in `docs/research/EXTRACTION_LIMITATIONS.md`. Never silently drop a hero layer, reel, or og visual.
57
+
58
+ **Motion defaults to Framer Motion.** This template lists `framer-motion` as a dependency. After foundation tokens, ensure `import { motion } from "framer-motion"` (and related APIs: `useScroll`, `useTransform`, `AnimatePresence`, `LayoutGroup`) for: scroll-triggered reveals, staggered children, layout transitions, and gestures — anything beyond a trivial one-property CSS `transition`. In each spec file, add a **Motion** subsection: trigger, duration, easing, delay/stagger, and **implementation: CSS | framer-motion**. Prefer CSS only when it matches the target exactly without JS.
59
+
54
60
  ### 1. Completeness Beats Speed
55
61
 
56
62
  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.
@@ -195,11 +201,12 @@ Save this as `docs/research/PAGE_TOPOLOGY.md` — it becomes your assembly bluep
195
201
  This is sequential. Do it yourself (not delegated to an agent) since it touches many files:
196
202
 
197
203
  1. **Update fonts** in `layout.tsx` to match the target site's actual fonts
198
- 2. **Update globals.css** with the target's color tokens, spacing values, keyframe animations, utility classes, and any **global scroll behaviors** (Lenis, smooth scroll CSS, scroll-snap on body)
199
- 3. **Create TypeScript interfaces** in `src/types/` for the content structures you've observed
200
- 4. **Extract SVG icons** — find all inline `<svg>` elements on the page, deduplicate them, and save as named React components in `src/components/icons.tsx`. Name them by visual function (e.g., `SearchIcon`, `ArrowRightIcon`, `LogoIcon`).
201
- 5. **Download global assets** write and run a Node.js script (`scripts/download-assets.mjs`) that downloads all images, videos, and other binary assets from the page to `public/`. Preserve meaningful directory structure.
202
- 6. Verify: `npm run build` passes
204
+ 2. **Confirm Framer Motion** `framer-motion` should already be in `package.json`. If missing, add it (`npm install framer-motion`) so builders can import `motion` without ad-hoc library drift.
205
+ 3. **Update globals.css** with the target's color tokens, spacing values, keyframe animations, utility classes, and any **global scroll behaviors** (Lenis, smooth scroll CSS, scroll-snap on body)
206
+ 4. **Media inventory + download (early, high priority)** — run the asset discovery script (below) via browser MCP, write `docs/research/MEDIA_MANIFEST.md`, then implement **`scripts/download-assets.mjs`** and execute it so **images** land in `public/images/` and **videos** (+ posters) in `public/videos/` (or a clear subdirectory scheme under `public/`). Batch parallel downloads (4 concurrent) with errors logged — do not claim success if URLs failed. This step should complete **before** most section components are built so builders use real paths.
207
+ 5. **Create TypeScript interfaces** in `src/types/` for the content structures you've observed
208
+ 6. **Extract SVG icons** — find all inline `<svg>` elements on the page, deduplicate them, and save as named React components in `src/components/icons.tsx`. Name them by visual function (e.g., `SearchIcon`, `ArrowRightIcon`, `LogoIcon`).
209
+ 7. Verify: `npm run build` passes
203
210
 
204
211
  ### Asset Discovery Script Pattern
205
212
 
@@ -356,11 +363,16 @@ For each section (or sub-component, if you're breaking it up), create a spec fil
356
363
  - **State A (before):** maxWidth: 100vw, boxShadow: none, borderRadius: 0
357
364
  - **State B (after):** maxWidth: 1200px, boxShadow: 0 4px 20px rgba(0,0,0,0.1), borderRadius: 16px
358
365
  - **Transition:** transition: all 0.3s ease
359
- - **Implementation approach:** <CSS transition + scroll listener | IntersectionObserver | CSS animation-timeline | etc.>
366
+ - **Implementation approach:** <CSS transition + scroll listener | IntersectionObserver | CSS animation-timeline | **framer-motion** (`motion`, `whileInView`, stagger container) | etc.>
360
367
 
361
368
  ### Hover states
362
369
  - **<Element>:** <property>: <before> → <after>, transition: <value>
363
370
 
371
+ ## Motion (Framer Motion vs CSS)
372
+ - **Entrance / scroll reveals:** <e.g. fade+translateY, staggerChildren — specify duration, easing, delay, viewport `once`/`margin`>
373
+ - **Library:** <`framer-motion` | CSS-only — justify if CSS-only>
374
+ - **Keyframes / springs:** <if any — match target curve>
375
+
364
376
  ## Per-State Content (if applicable)
365
377
 
366
378
  ### State: "Featured"
@@ -372,9 +384,10 @@ For each section (or sub-component, if you're breaking it up), create a spec fil
372
384
  - Title: "..."
373
385
  - Cards: [...]
374
386
 
375
- ## Assets
376
- - Background image: `public/images/<file>.webp`
377
- - Overlay image: `public/images/<file>.png`
387
+ ## Assets (images & video — required detail)
388
+ - Raster: `public/images/<file>` — dimensions, `object-fit`, lazy if below fold
389
+ - Video: `public/videos/<file>` — poster `public/images/...` or `public/videos/...`, autoplay/muted/loop, controls
390
+ - Background layers: which div uses `background-image` and resolved URL → local path
378
391
  - Icons used: <ArrowIcon>, <SearchIcon> from icons.tsx
379
392
 
380
393
  ## Text Content (verbatim)
@@ -448,7 +461,7 @@ For every section, replace:
448
461
  7. **Metadata** — update `<title>`, meta description, OG tags, and favicon manifest in `src/app/layout.tsx` to reflect the new SaaS. Generate a simple favicon (initial letter on a brand-colored square) if no asset is provided.
449
462
 
450
463
  What you must NOT change in this pass:
451
- - Spacing, padding, typography scale, color tokens, animations, responsive breakpoints — those are still 1:1 to the original
464
+ - Spacing, padding, typography scale, color tokens, **animation timing & motion choreography** (including Framer Motion `variants` / `transition` props), responsive breakpoints — those are still 1:1 to the original
452
465
  - Section order, section count, component structure
453
466
  - Interaction models (scroll-driven stays scroll-driven, etc.)
454
467
  - Any computed-style value extracted in Phase 3
@@ -482,6 +495,8 @@ Before dispatching ANY builder agent, verify you can check every box. If you can
482
495
  - [ ] For scroll-driven components: trigger threshold, before/after styles, and transition are recorded
483
496
  - [ ] For hover states: before/after values and transition timing are recorded
484
497
  - [ ] All images in the section are identified (including overlays and layered compositions)
498
+ - [ ] Any `<video>` (and poster), Lottie, or canvas-driven hero is identified — not approximated as a static div
499
+ - [ ] **Motion** subsection filled: CSS vs **framer-motion**, durations, easings, stagger, scroll triggers
485
500
  - [ ] Responsive behavior is documented for at least desktop and mobile
486
501
  - [ ] Text content is verbatim from the site, not paraphrased
487
502
  - [ ] The builder prompt is under ~150 lines of spec; if over, the section needs to be split
@@ -498,6 +513,8 @@ These are lessons from previous failed clones — each one cost hours of rework:
498
513
  - **Don't build everything in one monolithic commit.** The whole point of this pipeline is incremental progress with verified builds at each step.
499
514
  - **Don't reference docs from builder prompts.** Each builder gets the CSS spec inline in its prompt — never "see DESIGN_TOKENS.md for colors." The builder should have zero need to read external docs.
500
515
  - **Don't skip asset extraction.** Without real images, videos, and fonts, the clone will always look fake regardless of how perfect the CSS is.
516
+ - **Don't defer image/video download to the end.** Run `MEDIA_MANIFEST.md` + `download-assets.mjs` during foundation so components reference real `public/` paths from the first build.
517
+ - **Don't fake complex motion with a single CSS `transition` when the target uses staggered, scroll-scrubbed, or layout-driven animation** — use **`framer-motion`** (`motion`, `whileInView`, `variants`, `staggerChildren`) and match duration/easing from extraction.
501
518
  - **Don't give a builder agent too much scope.** If you're writing a builder prompt and it's getting long because the section is complex, that's a signal to break it into smaller tasks.
502
519
  - **Don't bundle unrelated sections into one agent.** A CTA section and a footer are different components with different designs — don't hand them both to one agent and hope for the best.
503
520
  - **Don't skip responsive extraction.** If you only inspect at desktop width, the clone will break at tablet and mobile. Test at 1440, 768, and 390 during extraction.
@@ -512,7 +529,7 @@ When done, report:
512
529
  - Total sections built
513
530
  - Total components created
514
531
  - Total spec files written (should match components)
515
- - Total assets downloaded (images, videos, SVGs, fonts)
532
+ - Total assets downloaded (images, videos, SVGs, fonts) — path to `docs/research/MEDIA_MANIFEST.md`
516
533
  - Rebrand summary (path to `docs/research/REBRAND.md`)
517
534
  - Build status (`npm run build` result)
518
535
  - Visual QA results (any remaining discrepancies)