launchframe 0.4.3 → 0.4.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.
@@ -25,7 +25,9 @@ Before reconnaissance, write or update:
25
25
 
26
26
  ## SaaS copy overlay (Phase 4 assembly and final polish)
27
27
 
28
- After structure and styles match the reference, apply the **SaaS idea** to hero, headings, and primary CTAs where the reference uses interchangeable marketing copy, **without** changing layout grids, spacing, or motion from extracted specs. Respect third-party brands.
28
+ After structure and styles match the reference, apply the **SaaS idea** to hero, headings, and primary CTAs where the reference uses interchangeable marketing copy, **without** changing layout grids, spacing, or motion from extracted specs. **Brand identity** (below) must be **original** for anything you ship as the user’s product — never pass off the reference company’s trademarks or distinctive marks.
29
+
30
+ **Precedence:** For those surfaces (hero, main headings, primary CTAs), **final ship copy comes from the SaaS idea**, not the reference — still capture reference strings in research/specs if useful for QA diffs. Everywhere else, keep **verbatim** reference text unless the user overrides.
29
31
 
30
32
  ---
31
33
 
@@ -33,16 +35,17 @@ After structure and styles match the reference, apply the **SaaS idea** to hero,
33
35
 
34
36
  The target page(s) are the URL(s) you parsed in Pre-Flight. Clone exactly what's visible at each URL. Unless the user specifies otherwise, use these defaults:
35
37
 
36
- - **Fidelity level:** Pixel-perfect exact match in colors, spacing, typography, animations
38
+ - **Fidelity level:** Pixel-perfect **layout, spacing, typography scale, and motion** (durations, easings, keyframes, triggers) matched to the reference. **Colors** match where you are emulating neutral/UI chrome from the reference; where **Brand identity** applies, use the **new palette** and assets while keeping the same CSS structure (fills land on different tokens). **Animations** stay reference-faithful unless the user opts out.
37
39
  - **In scope:** Visual layout and styling, component structure and interactions, responsive design, mock data for demo purposes
38
40
  - **Out of scope:** Real backend / database, authentication, real-time features, SEO optimization, accessibility audit
39
41
  - **Customization:** Structure and visuals — pure emulation of the reference. **Marketing copy** — apply the parsed **SaaS idea** where hero/headlines/CTAs are interchangeable (see “SaaS copy overlay” above); do not invent a different product than the user’s idea.
42
+ - **Brand identity:** The reference is a **pattern** for layout, motion, and UI craft — **not** permission to ship their brand. Unless the user **explicitly** asks for a faithful copy of the reference brand (e.g. licensed work, clearly labeled internal mock, private design audit), **invent an original brand** aligned with the SaaS idea: product name, wordmark or simple logomark (SVG or styled text) sized to the same logo slot, favicon / app icon, OG imagery, and a cohesive palette. Do **not** reuse their trademarked logo paths, mascot art, or distinctive illustrative brand assets; use originals or functional UI icons instead. Hero or lifestyle images that center the reference brand should be replaced with **original** imagery or neutral compositions that keep the **same layout rhythm**. **Keep** reference-faithful neutrals where they are clearly **non-brand** UI (borders, subtle grays, default body text color roles) unless they are unmistakably part of their distinctive palette. Note in `docs/research/LAUNCHFRAME.md` which marks and assets are **original brand** versus **layout-only** extraction.
40
43
 
41
44
  If the user provides additional instructions (specific fidelity level, customizations, extra context), honor those over the defaults.
42
45
 
43
46
  ## Pre-Flight
44
47
 
45
- 1. **Browser automation is required.** Check for available browser MCP tools (Chrome MCP, Playwright MCP, Browserbase MCP, Puppeteer MCP, etc.). Use whichever is available — if multiple exist, prefer Chrome MCP. If none are detected, ask the user which browser tool they have and how to connect it. This skill cannot work without browser automation.
48
+ 1. **Browser automation is required.** Check for available browser MCP tools (Chrome MCP, Playwright MCP, Browserbase MCP, Puppeteer MCP, etc.). Use whichever is available — if multiple exist, **prefer Chrome DevTools MCP** for inspection: it maps to the same engine the user sees and preserves **computed `animation` / `transition` / scroll-driven** values accurately. If none are detected, ask the user which browser tool they have and how to connect it. This skill cannot work without browser automation. **Motion parity:** every pass (reconnaissance, per-section extract, QA) must treat **motion as first-class** — same **durations, delays, easings (`cubic-bezier` / steps), iteration counts, fill modes, directions, keyframe percentages, and scroll/view-timeline bindings** as the live site, not “similar” motion.
46
49
  2. **Parse arguments** — extract every `http://` / `https://` URL token (there may be several). **SaaS idea** = the remaining non-URL text (trim outer quotes). Normalize and validate each URL; if any are invalid, or the SaaS idea is missing, ask the user once. For each valid URL, verify it is accessible via your browser MCP tool.
47
50
  3. Verify the base project builds: `npm run build`. The Next.js + shadcn/ui + Tailwind v4 scaffold should already be in place. If not, tell the user to set it up first.
48
51
  4. 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>/`.
@@ -58,7 +61,7 @@ When you traverse the DOM and the Network panel, do **not** treat all nodes equa
58
61
 
59
62
  1. **Images (raster + video stills)** — Enumerate `<img>`, `<picture>`, responsive `srcset`, `data-*` lazy URLs, **computed `background-image`** on the element and parents (including pseudo-elements), mask images, `<video poster>`, hero media. **Scrape:** download binary assets to `public/images/` (or `public/videos/`) with stable paths referenced in specs. **Create** a replacement PNG/WebP/SVG only when the asset is blocked (CORS, auth cookie, 403), ephemeral, or impossible to URL-fetch — use a high-DPI screenshot crop, traced artwork, or CSS gradient approximation, and mark `ASSET_SOURCE: generated` in the component spec with a short reason.
60
63
  2. **SVGs & iconography** — Inline `<svg>`, sprite `symbol` defs, **SVG used as masks/filters**, icon fonts (prefer path extraction). Convert to `@/components/icons.tsx` (or section-local components) with meaningful names. Prioritize crisp edges and correct `viewBox` over shrinking bundle size during emulation.
61
- 3. **Motion & animation** — CSS `@keyframes`, `animation`, `animation-timeline`, `transition`, `transform`, will-change hints; JS-driven motion (carousel timing, IntersectionObserver reveals); libraries (GSAP, Framer, Lottie JSON, Lenis). Capture **numbers** (ms, easing curves, stagger, scroll thresholds), not adjectives. Include **reduced-motion** behavior if present.
64
+ 3. **Motion & animation** — CSS `@keyframes`, `animation`, `animation-timeline` / `view-timeline` / `animation-range`, `transition`, `transform`, `transform-origin`, will-change; JS-driven motion (carousel timing, IntersectionObserver reveals); libraries (GSAP, Framer, Lottie JSON, Lenis). Capture **numbers** (ms, `cubic-bezier()`, `steps()`, stagger, scroll thresholds, **named keyframe blocks**), not adjectives — paste **verbatim** `cssText` for relevant `@keyframes` into specs when obtainable. Include **reduced-motion** (`matchMedia('(prefers-reduced-motion: reduce)'))` behavior if present.
62
65
 
63
66
  Only after the above are accounted for should you spend cycle time on minor text or non-visual refactors. A perfect grid with missing hero art and dead animation still fails the clone.
64
67
 
@@ -78,6 +81,8 @@ Look at each section and judge its complexity. A simple banner with a heading an
78
81
 
79
82
  Extract the actual text, images, videos, and SVGs from the live site. This is a clone, not a mockup. Use `element.textContent`, download every `<img>` and `<video>`, extract inline `<svg>` elements as React components. The only time you generate content is when something is clearly server-generated and unique per session.
80
83
 
84
+ **Marketing surfaces** (hero, primary headings, main CTAs) follow the **SaaS copy overlay** and **Brand identity** rules — capture reference copy for audit, but **ship** the user’s idea there.
85
+
81
86
  **Prioritize** (see §0): downloadable imagery and backgrounds first, then SVG/icon layers, then motion. If you must **fabricate** an asset, prefer screenshot-based exports or traced vectors tied to measured box sizes — avoid unrelated stock art.
82
87
 
83
88
  **Layered assets matter.** A section that looks like one image is often multiple layers — a background watercolor/gradient, a foreground UI mockup PNG, an overlay icon. Inspect each container's full DOM tree and enumerate ALL `<img>` elements and background images within it, including absolutely-positioned overlays. Missing an overlay image makes the clone look empty even if the background is correct.
@@ -193,8 +198,113 @@ This is a dedicated pass AFTER screenshots and BEFORE anything else. Its purpose
193
198
  - Mobile: 390px
194
199
  - At each width, note which sections change layout (column → stack, sidebar disappears, etc.) and at approximately which breakpoint the change occurs.
195
200
 
201
+ Re-check **all three widths** again in **Phase 5: Visual QA Diff** so tablet regressions are not skipped.
202
+
196
203
  Save all findings to `docs/research/BEHAVIORS.md`. This is your behavior bible — reference it when writing every component spec.
197
204
 
205
+ ### Chrome MCP: precise motion & animation extraction
206
+
207
+ Use **evaluate script** (or equivalent) in Chrome MCP **during** the scroll/click/hover sweeps so you capture **live computed values**, not guesses from DevTools screenshots alone.
208
+
209
+ **Rules:**
210
+
211
+ - **No hand-waving** — if the reference uses `0.45s cubic-bezier(0.4, 0, 0.2, 1)`, the spec and implementation use that exact string (or Tailwind utilities **only** when the **resolved computed** animation/transition longhands match — class names alone are not proof).
212
+ - **`@keyframes` source of truth** — for each animated element, record `getComputedStyle(el).animationName` and resolve the **full `@keyframes` rule** from stylesheets when allowed. Many sites inline CSS or use same-origin sheets: iterate `document.styleSheets` / `cssRules` inside `try/catch`; for **cross-origin** sheets that throw on `cssRules`, copy the rule from the **Network** response or **Sources** panel in Chrome and paste into `docs/research/MOTION.md` / the component spec. Never substitute a different easing or keyframe shape “because it looks close.”
213
+ - **Scroll-driven animations** — for `animation-timeline: view()` / named timelines, capture **`view-timeline` / `scroll-timeline` on ancestors**, `animation-range`, `scroll-padding` / snap containers, and **which scroll container** is the timeline root (often `html`, sometimes a nested `overflow-y: auto` div). **`getComputedStyle` support varies** for scroll-animation longhands; also read **`cs.getPropertyValue('view-timeline-name')`**, **`scroll-timeline-name`**, **`animation-timeline`**, etc., when camelCase mirrors are missing in the engine you’re using.
214
+ - **Before/after pairs** — for scroll- or hover-driven motion, capture computed `transform`, `opacity`, and longhand `animation-*` / `transition-*` **in both states** (see §7) and the **exact trigger** (px, ratio, or event).
215
+ - **Libraries** — if Lenis/GSAP/Framer is present, document **version/hooks** from **script `src` URLs** (path often includes version), `//# sourceMappingURL` / comment banners in the bundle if visible, global identifiers on `window` when safe to read, **npm lockfile** only if this repo vendors that script, and **class/DOM hooks** (e.g. `.lenis`). Sample **computed style** at rest vs. mid-animation after interactions.
216
+ - **Deliverable** — maintain `docs/research/MOTION.md`: page-level keyframes inventory, global scroll/smooth-scroll setup, and per-section pointers into component specs. Large pages may scope the audit script to a **section root selector** to avoid noise.
217
+
218
+ **Motion audit script** (run via Chrome MCP; optional `rootSelector` limits to a subtree):
219
+
220
+ ```javascript
221
+ (function motionAudit(rootSelector) {
222
+ const root = rootSelector ? document.querySelector(rootSelector) : document.body;
223
+ if (!root) return JSON.stringify({ error: 'root not found: ' + rootSelector });
224
+
225
+ function safeRules(sheet) {
226
+ try {
227
+ return [...sheet.cssRules];
228
+ } catch {
229
+ return [];
230
+ }
231
+ }
232
+
233
+ const walkKeyframes = (rules, out) => {
234
+ for (const rule of rules) {
235
+ if (rule.type === CSSRule.KEYFRAMES_RULE) {
236
+ out.push({ name: rule.name, cssText: rule.cssText });
237
+ } else if (rule.type === CSSRule.MEDIA_RULE && rule.cssRules) {
238
+ walkKeyframes(rule.cssRules, out);
239
+ }
240
+ }
241
+ };
242
+
243
+ const keyframes = [];
244
+ for (const sheet of document.styleSheets) {
245
+ walkKeyframes(safeRules(sheet), keyframes);
246
+ }
247
+
248
+ const animated = [];
249
+ // Include `root` — querySelectorAll('*') misses animations on the section container itself
250
+ const scope = [root, ...root.querySelectorAll('*')];
251
+ for (const el of scope) {
252
+ const cs = getComputedStyle(el);
253
+ const animName = cs.animationName;
254
+ const hasAnim = animName && animName !== 'none';
255
+ const transDurs = (cs.transitionDuration || '')
256
+ .split(',')
257
+ .map((s) => s.trim())
258
+ .filter(Boolean);
259
+ const hasTrans =
260
+ cs.transitionProperty &&
261
+ cs.transitionProperty !== 'none' &&
262
+ transDurs.some((d) => d !== '0s' && d !== '0ms');
263
+ if (!hasAnim && !hasTrans) continue;
264
+
265
+ animated.push({
266
+ hint: el.tagName.toLowerCase() + (el.className
267
+ ? '.' + String(el.className).trim().split(/\s+/).slice(0, 4).join('.')
268
+ : ''),
269
+ animation: cs.animation,
270
+ animationName: cs.animationName,
271
+ animationDuration: cs.animationDuration,
272
+ animationTimingFunction: cs.animationTimingFunction,
273
+ animationDelay: cs.animationDelay,
274
+ animationIterationCount: cs.animationIterationCount,
275
+ animationDirection: cs.animationDirection,
276
+ animationFillMode: cs.animationFillMode,
277
+ animationPlayState: cs.animationPlayState,
278
+ animationTimeline: cs.animationTimeline,
279
+ animationRange: cs.animationRange,
280
+ transition: cs.transition,
281
+ transitionProperty: cs.transitionProperty,
282
+ transitionDuration: cs.transitionDuration,
283
+ transitionTimingFunction: cs.transitionTimingFunction,
284
+ transitionDelay: cs.transitionDelay,
285
+ transform: cs.transform,
286
+ transformOrigin: cs.transformOrigin,
287
+ opacity: cs.opacity,
288
+ willChange: cs.willChange,
289
+ viewTimelineName: cs.viewTimelineName,
290
+ scrollTimelineName: cs.scrollTimelineName,
291
+ viewTimelineNameRaw: cs.getPropertyValue('view-timeline-name'),
292
+ scrollTimelineNameRaw: cs.getPropertyValue('scroll-timeline-name')
293
+ });
294
+ }
295
+
296
+ return JSON.stringify(
297
+ {
298
+ prefersReducedMotion: window.matchMedia('(prefers-reduced-motion: reduce)').matches,
299
+ keyframes,
300
+ animatedElements: animated
301
+ },
302
+ null,
303
+ 2
304
+ );
305
+ })(''); // Pass section selector string, e.g. 'section.hero', instead of ''
306
+ ```
307
+
198
308
  ### Page Topology
199
309
  Map out every distinct section of the page from top to bottom. Give each a working name. Document:
200
310
  - Their visual order
@@ -266,7 +376,7 @@ For each section, use browser MCP to extract everything:
266
376
 
267
377
  1. **Screenshot** the section in isolation (scroll to it, screenshot the viewport). Save to `docs/design-references/`.
268
378
 
269
- 2. **Extract CSS** for every element in the section. Use the extraction script below — don't hand-measure individual properties. Run it once per component container and capture the full output:
379
+ 2. **Extract CSS** for every element in the section. Use the extraction script below — don't hand-measure individual properties. Run it **once per spec scope**: usually the **section wrapper** selector (one subtree). For very large sections, run again on **inner selectors** (e.g. each card type) — the `depth` / `children.slice(0, 20)` limits are **deliberately capped** for MCP payload size; raise them or narrow `SELECTOR` when the spec is incomplete.
270
380
 
271
381
  ```javascript
272
382
  // Per-component extraction — run via browser MCP
@@ -285,13 +395,15 @@ For each section, use browser MCP to extract everything:
285
395
  'borderRadius','border','borderTop','borderBottom','borderLeft','borderRight',
286
396
  'boxShadow','overflow','overflowX','overflowY',
287
397
  'position','top','right','bottom','left','zIndex',
288
- 'opacity','transform','transition','cursor',
398
+ 'opacity','transform','transformOrigin','transition','transitionProperty','transitionDuration','transitionTimingFunction','transitionDelay',
399
+ 'animation','animationName','animationDuration','animationTimingFunction','animationDelay','animationIterationCount','animationDirection','animationFillMode','animationPlayState','animationTimeline','animationRange','viewTimelineName','scrollTimelineName','cursor',
289
400
  'objectFit','objectPosition','mixBlendMode','filter','backdropFilter',
290
401
  'whiteSpace','textOverflow','WebkitLineClamp'
291
402
  ];
292
403
  function extractStyles(element) {
293
404
  const cs = getComputedStyle(element);
294
405
  const styles = {};
406
+ // Heuristic filter — for layout-audits, re-add any dropped `auto` / `normal` / transparent values the spec calls out as significant
295
407
  props.forEach(p => { const v = cs[p]; if (v && v !== 'none' && v !== 'normal' && v !== 'auto' && v !== '0px' && v !== 'rgba(0, 0, 0, 0)') styles[p] = v; });
296
408
  return styles;
297
409
  }
@@ -364,6 +476,15 @@ For each section (or sub-component, if you're breaking it up), create a spec fil
364
476
  ### <Child element N>
365
477
  ...
366
478
 
479
+ ## Motion & animation (exact — from Chrome MCP `getComputedStyle` + stylesheet rules)
480
+
481
+ - **Keyframe names in use:** ...
482
+ - **Full `@keyframes` blocks** (paste `cssText` or equivalent); note **cross-origin** gaps and how you filled them
483
+ - **Per-element:** shorthand/longhand `animation` and `transition` values **verbatim** for resting state
484
+ - **Scroll/view timelines:** timeline name, range, scroll container, snap/observer thresholds
485
+ - **Libraries:** Lenis / GSAP / Framer / Lottie — hooks, init pattern, timing copied from reference
486
+ - **`prefers-reduced-motion`:** matched behavior on the reference
487
+
367
488
  ## States & Behaviors
368
489
 
369
490
  ### <Behavior name, e.g., "Scroll-triggered floating mode">
@@ -448,15 +569,17 @@ After assembly, do NOT declare the clone complete. Take side-by-side comparison
448
569
 
449
570
  1. Open the original site and your clone side-by-side (or take screenshots at the same viewport widths)
450
571
  2. Compare section by section, top to bottom, at desktop (1440px)
451
- 3. Compare again at mobile (390px)
452
- 4. For each discrepancy found:
572
+ 3. Compare again at tablet (768px) — same widths as **Responsive sweep**
573
+ 4. Compare again at mobile (390px)
574
+ 5. For each discrepancy found:
453
575
  - Check the component spec file — was the value extracted correctly?
454
576
  - If the spec was wrong: re-extract from browser MCP, update the spec, fix the component
455
577
  - If the spec was right but the builder got it wrong: fix the component to match the spec
456
- 5. Test all interactive behaviors: scroll through the page, click every button/tab, hover over interactive elements
457
- 6. Verify smooth scroll feels right, header transitions work, tab switching works, animations play
578
+ 6. Test all interactive behaviors: scroll through the page, click every button/tab, hover over interactive elements
579
+ 7. **Motion QA (Chrome MCP again if needed):** For every animated or transitioned element, re-run `getComputedStyle` on the reference vs. the clone at the **same scroll position / interaction state** and compare **`animation-*`, `transition-*`, `transform`, `opacity`** longhands — **resolved** durations/easings must match where the cascade specifies them (Tailwind classes are fine when they compile to the same longhands; verify in **Computed**, not by class name alone). Re-record any `@keyframes` the reference still exposes so the clone can be patched until timings align.
580
+ 8. Verify smooth scroll feels right, header transitions work, tab switching works, stagger and scroll-driven reveals match the reference
458
581
 
459
- Only after this visual QA pass is the clone complete.
582
+ Only after this visual + motion QA pass is the clone complete.
460
583
 
461
584
  ## Pre-Dispatch Checklist
462
585
 
@@ -468,9 +591,10 @@ Before dispatching ANY builder agent, verify you can check every box. If you can
468
591
  - [ ] For stateful components: every state's content and styles are captured
469
592
  - [ ] For scroll-driven components: trigger threshold, before/after styles, and transition are recorded
470
593
  - [ ] For hover states: before/after values and transition timing are recorded
594
+ - [ ] Motion: relevant `@keyframes` captured (or cross-origin gap documented with manual paste), `docs/research/MOTION.md` updated, component specs include **exact** `animation*` / `transition*` / timeline fields from Chrome MCP
471
595
  - [ ] All images in the section are identified (including overlays and layered compositions)
472
- - [ ] Responsive behavior is documented for at least desktop and mobile
473
- - [ ] Text content is verbatim from the site, not paraphrased
596
+ - [ ] Responsive behavior is documented for desktop, tablet, and mobile (1440 / 768 / 390)
597
+ - [ ] Text: **verbatim** from the reference **except** hero, main headings, and primary CTAs — those match the **SaaS idea** (reference copy still captured for audit if useful)
474
598
  - [ ] The builder prompt is under ~150 lines of spec; if over, the section needs to be split
475
599
 
476
600
  ## What NOT to Do
@@ -24,7 +24,9 @@ Before reconnaissance, write or update:
24
24
 
25
25
  ## SaaS copy overlay (Phase 4 assembly and final polish)
26
26
 
27
- After structure and styles match the reference, apply the **SaaS idea** to hero, headings, and primary CTAs where the reference uses interchangeable marketing copy, **without** changing layout grids, spacing, or motion from extracted specs. Respect third-party brands.
27
+ After structure and styles match the reference, apply the **SaaS idea** to hero, headings, and primary CTAs where the reference uses interchangeable marketing copy, **without** changing layout grids, spacing, or motion from extracted specs. **Brand identity** (below) must be **original** for anything you ship as the user’s product — never pass off the reference company’s trademarks or distinctive marks.
28
+
29
+ **Precedence:** For those surfaces (hero, main headings, primary CTAs), **final ship copy comes from the SaaS idea**, not the reference — still capture reference strings in research/specs if useful for QA diffs. Everywhere else, keep **verbatim** reference text unless the user overrides.
28
30
 
29
31
  ---
30
32
 
@@ -32,16 +34,17 @@ After structure and styles match the reference, apply the **SaaS idea** to hero,
32
34
 
33
35
  The target page(s) are the URL(s) you parsed in Pre-Flight. Clone exactly what's visible at each URL. Unless the user specifies otherwise, use these defaults:
34
36
 
35
- - **Fidelity level:** Pixel-perfect exact match in colors, spacing, typography, animations
37
+ - **Fidelity level:** Pixel-perfect **layout, spacing, typography scale, and motion** (durations, easings, keyframes, triggers) matched to the reference. **Colors** match where you are emulating neutral/UI chrome from the reference; where **Brand identity** applies, use the **new palette** and assets while keeping the same CSS structure (fills land on different tokens). **Animations** stay reference-faithful unless the user opts out.
36
38
  - **In scope:** Visual layout and styling, component structure and interactions, responsive design, mock data for demo purposes
37
39
  - **Out of scope:** Real backend / database, authentication, real-time features, SEO optimization, accessibility audit
38
40
  - **Customization:** Structure and visuals — pure emulation of the reference. **Marketing copy** — apply the parsed **SaaS idea** where hero/headlines/CTAs are interchangeable (see “SaaS copy overlay” above); do not invent a different product than the user’s idea.
41
+ - **Brand identity:** The reference is a **pattern** for layout, motion, and UI craft — **not** permission to ship their brand. Unless the user **explicitly** asks for a faithful copy of the reference brand (e.g. licensed work, clearly labeled internal mock, private design audit), **invent an original brand** aligned with the SaaS idea: product name, wordmark or simple logomark (SVG or styled text) sized to the same logo slot, favicon / app icon, OG imagery, and a cohesive palette. Do **not** reuse their trademarked logo paths, mascot art, or distinctive illustrative brand assets; use originals or functional UI icons instead. Hero or lifestyle images that center the reference brand should be replaced with **original** imagery or neutral compositions that keep the **same layout rhythm**. **Keep** reference-faithful neutrals where they are clearly **non-brand** UI (borders, subtle grays, default body text color roles) unless they are unmistakably part of their distinctive palette. Note in `docs/research/LAUNCHFRAME.md` which marks and assets are **original brand** versus **layout-only** extraction.
39
42
 
40
43
  If the user provides additional instructions (specific fidelity level, customizations, extra context), honor those over the defaults.
41
44
 
42
45
  ## Pre-Flight
43
46
 
44
- 1. **Browser automation is required.** Check for available browser MCP tools (Chrome MCP, Playwright MCP, Browserbase MCP, Puppeteer MCP, etc.). Use whichever is available — if multiple exist, prefer Chrome MCP. If none are detected, ask the user which browser tool they have and how to connect it. This skill cannot work without browser automation.
47
+ 1. **Browser automation is required.** Check for available browser MCP tools (Chrome MCP, Playwright MCP, Browserbase MCP, Puppeteer MCP, etc.). Use whichever is available — if multiple exist, **prefer Chrome DevTools MCP** for inspection: it maps to the same engine the user sees and preserves **computed `animation` / `transition` / scroll-driven** values accurately. If none are detected, ask the user which browser tool they have and how to connect it. This skill cannot work without browser automation. **Motion parity:** every pass (reconnaissance, per-section extract, QA) must treat **motion as first-class** — same **durations, delays, easings (`cubic-bezier` / steps), iteration counts, fill modes, directions, keyframe percentages, and scroll/view-timeline bindings** as the live site, not “similar” motion.
45
48
  2. **Parse arguments** — extract every `http://` / `https://` URL token (there may be several). **SaaS idea** = the remaining non-URL text (trim outer quotes). Normalize and validate each URL; if any are invalid, or the SaaS idea is missing, ask the user once. For each valid URL, verify it is accessible via your browser MCP tool.
46
49
  3. Verify the base project builds: `npm run build`. The Next.js + shadcn/ui + Tailwind v4 scaffold should already be in place. If not, tell the user to set it up first.
47
50
  4. 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>/`.
@@ -57,7 +60,7 @@ When you traverse the DOM and the Network panel, do **not** treat all nodes equa
57
60
 
58
61
  1. **Images (raster + video stills)** — Enumerate `<img>`, `<picture>`, responsive `srcset`, `data-*` lazy URLs, **computed `background-image`** on the element and parents (including pseudo-elements), mask images, `<video poster>`, hero media. **Scrape:** download binary assets to `public/images/` (or `public/videos/`) with stable paths referenced in specs. **Create** a replacement PNG/WebP/SVG only when the asset is blocked (CORS, auth cookie, 403), ephemeral, or impossible to URL-fetch — use a high-DPI screenshot crop, traced artwork, or CSS gradient approximation, and mark `ASSET_SOURCE: generated` in the component spec with a short reason.
59
62
  2. **SVGs & iconography** — Inline `<svg>`, sprite `symbol` defs, **SVG used as masks/filters**, icon fonts (prefer path extraction). Convert to `@/components/icons.tsx` (or section-local components) with meaningful names. Prioritize crisp edges and correct `viewBox` over shrinking bundle size during emulation.
60
- 3. **Motion & animation** — CSS `@keyframes`, `animation`, `animation-timeline`, `transition`, `transform`, will-change hints; JS-driven motion (carousel timing, IntersectionObserver reveals); libraries (GSAP, Framer, Lottie JSON, Lenis). Capture **numbers** (ms, easing curves, stagger, scroll thresholds), not adjectives. Include **reduced-motion** behavior if present.
63
+ 3. **Motion & animation** — CSS `@keyframes`, `animation`, `animation-timeline` / `view-timeline` / `animation-range`, `transition`, `transform`, `transform-origin`, will-change; JS-driven motion (carousel timing, IntersectionObserver reveals); libraries (GSAP, Framer, Lottie JSON, Lenis). Capture **numbers** (ms, `cubic-bezier()`, `steps()`, stagger, scroll thresholds, **named keyframe blocks**), not adjectives — paste **verbatim** `cssText` for relevant `@keyframes` into specs when obtainable. Include **reduced-motion** (`matchMedia('(prefers-reduced-motion: reduce)'))` behavior if present.
61
64
 
62
65
  Only after the above are accounted for should you spend cycle time on minor text or non-visual refactors. A perfect grid with missing hero art and dead animation still fails the clone.
63
66
 
@@ -77,6 +80,8 @@ Look at each section and judge its complexity. A simple banner with a heading an
77
80
 
78
81
  Extract the actual text, images, videos, and SVGs from the live site. This is a clone, not a mockup. Use `element.textContent`, download every `<img>` and `<video>`, extract inline `<svg>` elements as React components. The only time you generate content is when something is clearly server-generated and unique per session.
79
82
 
83
+ **Marketing surfaces** (hero, primary headings, main CTAs) follow the **SaaS copy overlay** and **Brand identity** rules — capture reference copy for audit, but **ship** the user’s idea there.
84
+
80
85
  **Prioritize** (see §0): downloadable imagery and backgrounds first, then SVG/icon layers, then motion. If you must **fabricate** an asset, prefer screenshot-based exports or traced vectors tied to measured box sizes — avoid unrelated stock art.
81
86
 
82
87
  **Layered assets matter.** A section that looks like one image is often multiple layers — a background watercolor/gradient, a foreground UI mockup PNG, an overlay icon. Inspect each container's full DOM tree and enumerate ALL `<img>` elements and background images within it, including absolutely-positioned overlays. Missing an overlay image makes the clone look empty even if the background is correct.
@@ -192,8 +197,113 @@ This is a dedicated pass AFTER screenshots and BEFORE anything else. Its purpose
192
197
  - Mobile: 390px
193
198
  - At each width, note which sections change layout (column → stack, sidebar disappears, etc.) and at approximately which breakpoint the change occurs.
194
199
 
200
+ Re-check **all three widths** again in **Phase 5: Visual QA Diff** so tablet regressions are not skipped.
201
+
195
202
  Save all findings to `docs/research/BEHAVIORS.md`. This is your behavior bible — reference it when writing every component spec.
196
203
 
204
+ ### Chrome MCP: precise motion & animation extraction
205
+
206
+ Use **evaluate script** (or equivalent) in Chrome MCP **during** the scroll/click/hover sweeps so you capture **live computed values**, not guesses from DevTools screenshots alone.
207
+
208
+ **Rules:**
209
+
210
+ - **No hand-waving** — if the reference uses `0.45s cubic-bezier(0.4, 0, 0.2, 1)`, the spec and implementation use that exact string (or Tailwind utilities **only** when the **resolved computed** animation/transition longhands match — class names alone are not proof).
211
+ - **`@keyframes` source of truth** — for each animated element, record `getComputedStyle(el).animationName` and resolve the **full `@keyframes` rule** from stylesheets when allowed. Many sites inline CSS or use same-origin sheets: iterate `document.styleSheets` / `cssRules` inside `try/catch`; for **cross-origin** sheets that throw on `cssRules`, copy the rule from the **Network** response or **Sources** panel in Chrome and paste into `docs/research/MOTION.md` / the component spec. Never substitute a different easing or keyframe shape “because it looks close.”
212
+ - **Scroll-driven animations** — for `animation-timeline: view()` / named timelines, capture **`view-timeline` / `scroll-timeline` on ancestors**, `animation-range`, `scroll-padding` / snap containers, and **which scroll container** is the timeline root (often `html`, sometimes a nested `overflow-y: auto` div). **`getComputedStyle` support varies** for scroll-animation longhands; also read **`cs.getPropertyValue('view-timeline-name')`**, **`scroll-timeline-name`**, **`animation-timeline`**, etc., when camelCase mirrors are missing in the engine you’re using.
213
+ - **Before/after pairs** — for scroll- or hover-driven motion, capture computed `transform`, `opacity`, and longhand `animation-*` / `transition-*` **in both states** (see §7) and the **exact trigger** (px, ratio, or event).
214
+ - **Libraries** — if Lenis/GSAP/Framer is present, document **version/hooks** from **script `src` URLs** (path often includes version), `//# sourceMappingURL` / comment banners in the bundle if visible, global identifiers on `window` when safe to read, **npm lockfile** only if this repo vendors that script, and **class/DOM hooks** (e.g. `.lenis`). Sample **computed style** at rest vs. mid-animation after interactions.
215
+ - **Deliverable** — maintain `docs/research/MOTION.md`: page-level keyframes inventory, global scroll/smooth-scroll setup, and per-section pointers into component specs. Large pages may scope the audit script to a **section root selector** to avoid noise.
216
+
217
+ **Motion audit script** (run via Chrome MCP; optional `rootSelector` limits to a subtree):
218
+
219
+ ```javascript
220
+ (function motionAudit(rootSelector) {
221
+ const root = rootSelector ? document.querySelector(rootSelector) : document.body;
222
+ if (!root) return JSON.stringify({ error: 'root not found: ' + rootSelector });
223
+
224
+ function safeRules(sheet) {
225
+ try {
226
+ return [...sheet.cssRules];
227
+ } catch {
228
+ return [];
229
+ }
230
+ }
231
+
232
+ const walkKeyframes = (rules, out) => {
233
+ for (const rule of rules) {
234
+ if (rule.type === CSSRule.KEYFRAMES_RULE) {
235
+ out.push({ name: rule.name, cssText: rule.cssText });
236
+ } else if (rule.type === CSSRule.MEDIA_RULE && rule.cssRules) {
237
+ walkKeyframes(rule.cssRules, out);
238
+ }
239
+ }
240
+ };
241
+
242
+ const keyframes = [];
243
+ for (const sheet of document.styleSheets) {
244
+ walkKeyframes(safeRules(sheet), keyframes);
245
+ }
246
+
247
+ const animated = [];
248
+ // Include `root` — querySelectorAll('*') misses animations on the section container itself
249
+ const scope = [root, ...root.querySelectorAll('*')];
250
+ for (const el of scope) {
251
+ const cs = getComputedStyle(el);
252
+ const animName = cs.animationName;
253
+ const hasAnim = animName && animName !== 'none';
254
+ const transDurs = (cs.transitionDuration || '')
255
+ .split(',')
256
+ .map((s) => s.trim())
257
+ .filter(Boolean);
258
+ const hasTrans =
259
+ cs.transitionProperty &&
260
+ cs.transitionProperty !== 'none' &&
261
+ transDurs.some((d) => d !== '0s' && d !== '0ms');
262
+ if (!hasAnim && !hasTrans) continue;
263
+
264
+ animated.push({
265
+ hint: el.tagName.toLowerCase() + (el.className
266
+ ? '.' + String(el.className).trim().split(/\s+/).slice(0, 4).join('.')
267
+ : ''),
268
+ animation: cs.animation,
269
+ animationName: cs.animationName,
270
+ animationDuration: cs.animationDuration,
271
+ animationTimingFunction: cs.animationTimingFunction,
272
+ animationDelay: cs.animationDelay,
273
+ animationIterationCount: cs.animationIterationCount,
274
+ animationDirection: cs.animationDirection,
275
+ animationFillMode: cs.animationFillMode,
276
+ animationPlayState: cs.animationPlayState,
277
+ animationTimeline: cs.animationTimeline,
278
+ animationRange: cs.animationRange,
279
+ transition: cs.transition,
280
+ transitionProperty: cs.transitionProperty,
281
+ transitionDuration: cs.transitionDuration,
282
+ transitionTimingFunction: cs.transitionTimingFunction,
283
+ transitionDelay: cs.transitionDelay,
284
+ transform: cs.transform,
285
+ transformOrigin: cs.transformOrigin,
286
+ opacity: cs.opacity,
287
+ willChange: cs.willChange,
288
+ viewTimelineName: cs.viewTimelineName,
289
+ scrollTimelineName: cs.scrollTimelineName,
290
+ viewTimelineNameRaw: cs.getPropertyValue('view-timeline-name'),
291
+ scrollTimelineNameRaw: cs.getPropertyValue('scroll-timeline-name')
292
+ });
293
+ }
294
+
295
+ return JSON.stringify(
296
+ {
297
+ prefersReducedMotion: window.matchMedia('(prefers-reduced-motion: reduce)').matches,
298
+ keyframes,
299
+ animatedElements: animated
300
+ },
301
+ null,
302
+ 2
303
+ );
304
+ })(''); // Pass section selector string, e.g. 'section.hero', instead of ''
305
+ ```
306
+
197
307
  ### Page Topology
198
308
  Map out every distinct section of the page from top to bottom. Give each a working name. Document:
199
309
  - Their visual order
@@ -265,7 +375,7 @@ For each section, use browser MCP to extract everything:
265
375
 
266
376
  1. **Screenshot** the section in isolation (scroll to it, screenshot the viewport). Save to `docs/design-references/`.
267
377
 
268
- 2. **Extract CSS** for every element in the section. Use the extraction script below — don't hand-measure individual properties. Run it once per component container and capture the full output:
378
+ 2. **Extract CSS** for every element in the section. Use the extraction script below — don't hand-measure individual properties. Run it **once per spec scope**: usually the **section wrapper** selector (one subtree). For very large sections, run again on **inner selectors** (e.g. each card type) — the `depth` / `children.slice(0, 20)` limits are **deliberately capped** for MCP payload size; raise them or narrow `SELECTOR` when the spec is incomplete.
269
379
 
270
380
  ```javascript
271
381
  // Per-component extraction — run via browser MCP
@@ -284,13 +394,15 @@ For each section, use browser MCP to extract everything:
284
394
  'borderRadius','border','borderTop','borderBottom','borderLeft','borderRight',
285
395
  'boxShadow','overflow','overflowX','overflowY',
286
396
  'position','top','right','bottom','left','zIndex',
287
- 'opacity','transform','transition','cursor',
397
+ 'opacity','transform','transformOrigin','transition','transitionProperty','transitionDuration','transitionTimingFunction','transitionDelay',
398
+ 'animation','animationName','animationDuration','animationTimingFunction','animationDelay','animationIterationCount','animationDirection','animationFillMode','animationPlayState','animationTimeline','animationRange','viewTimelineName','scrollTimelineName','cursor',
288
399
  'objectFit','objectPosition','mixBlendMode','filter','backdropFilter',
289
400
  'whiteSpace','textOverflow','WebkitLineClamp'
290
401
  ];
291
402
  function extractStyles(element) {
292
403
  const cs = getComputedStyle(element);
293
404
  const styles = {};
405
+ // Heuristic filter — for layout-audits, re-add any dropped `auto` / `normal` / transparent values the spec calls out as significant
294
406
  props.forEach(p => { const v = cs[p]; if (v && v !== 'none' && v !== 'normal' && v !== 'auto' && v !== '0px' && v !== 'rgba(0, 0, 0, 0)') styles[p] = v; });
295
407
  return styles;
296
408
  }
@@ -363,6 +475,15 @@ For each section (or sub-component, if you're breaking it up), create a spec fil
363
475
  ### <Child element N>
364
476
  ...
365
477
 
478
+ ## Motion & animation (exact — from Chrome MCP `getComputedStyle` + stylesheet rules)
479
+
480
+ - **Keyframe names in use:** ...
481
+ - **Full `@keyframes` blocks** (paste `cssText` or equivalent); note **cross-origin** gaps and how you filled them
482
+ - **Per-element:** shorthand/longhand `animation` and `transition` values **verbatim** for resting state
483
+ - **Scroll/view timelines:** timeline name, range, scroll container, snap/observer thresholds
484
+ - **Libraries:** Lenis / GSAP / Framer / Lottie — hooks, init pattern, timing copied from reference
485
+ - **`prefers-reduced-motion`:** matched behavior on the reference
486
+
366
487
  ## States & Behaviors
367
488
 
368
489
  ### <Behavior name, e.g., "Scroll-triggered floating mode">
@@ -447,15 +568,17 @@ After assembly, do NOT declare the clone complete. Take side-by-side comparison
447
568
 
448
569
  1. Open the original site and your clone side-by-side (or take screenshots at the same viewport widths)
449
570
  2. Compare section by section, top to bottom, at desktop (1440px)
450
- 3. Compare again at mobile (390px)
451
- 4. For each discrepancy found:
571
+ 3. Compare again at tablet (768px) — same widths as **Responsive sweep**
572
+ 4. Compare again at mobile (390px)
573
+ 5. For each discrepancy found:
452
574
  - Check the component spec file — was the value extracted correctly?
453
575
  - If the spec was wrong: re-extract from browser MCP, update the spec, fix the component
454
576
  - If the spec was right but the builder got it wrong: fix the component to match the spec
455
- 5. Test all interactive behaviors: scroll through the page, click every button/tab, hover over interactive elements
456
- 6. Verify smooth scroll feels right, header transitions work, tab switching works, animations play
577
+ 6. Test all interactive behaviors: scroll through the page, click every button/tab, hover over interactive elements
578
+ 7. **Motion QA (Chrome MCP again if needed):** For every animated or transitioned element, re-run `getComputedStyle` on the reference vs. the clone at the **same scroll position / interaction state** and compare **`animation-*`, `transition-*`, `transform`, `opacity`** longhands — **resolved** durations/easings must match where the cascade specifies them (Tailwind classes are fine when they compile to the same longhands; verify in **Computed**, not by class name alone). Re-record any `@keyframes` the reference still exposes so the clone can be patched until timings align.
579
+ 8. Verify smooth scroll feels right, header transitions work, tab switching works, stagger and scroll-driven reveals match the reference
457
580
 
458
- Only after this visual QA pass is the clone complete.
581
+ Only after this visual + motion QA pass is the clone complete.
459
582
 
460
583
  ## Pre-Dispatch Checklist
461
584
 
@@ -467,9 +590,10 @@ Before dispatching ANY builder agent, verify you can check every box. If you can
467
590
  - [ ] For stateful components: every state's content and styles are captured
468
591
  - [ ] For scroll-driven components: trigger threshold, before/after styles, and transition are recorded
469
592
  - [ ] For hover states: before/after values and transition timing are recorded
593
+ - [ ] Motion: relevant `@keyframes` captured (or cross-origin gap documented with manual paste), `docs/research/MOTION.md` updated, component specs include **exact** `animation*` / `transition*` / timeline fields from Chrome MCP
470
594
  - [ ] All images in the section are identified (including overlays and layered compositions)
471
- - [ ] Responsive behavior is documented for at least desktop and mobile
472
- - [ ] Text content is verbatim from the site, not paraphrased
595
+ - [ ] Responsive behavior is documented for desktop, tablet, and mobile (1440 / 768 / 390)
596
+ - [ ] Text: **verbatim** from the reference **except** hero, main headings, and primary CTAs — those match the **SaaS idea** (reference copy still captured for audit if useful)
473
597
  - [ ] The builder prompt is under ~150 lines of spec; if over, the section needs to be split
474
598
 
475
599
  ## What NOT to Do