launchframe 0.4.3 → 0.4.5
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.
- package/.amazonq/cli-agents/launchframe.json +1 -1
- package/.augment/commands/launchframe.md +165 -10
- package/.claude/skills/launchframe/SKILL.md +165 -10
- package/.codex/skills/launchframe/SKILL.md +165 -10
- package/.continue/commands/launchframe.md +165 -10
- package/.cursor/commands/launchframe.md +165 -10
- package/.gemini/commands/launchframe.toml +165 -10
- package/.github/skills/launchframe/SKILL.md +165 -10
- package/.opencode/commands/launchframe.md +165 -10
- package/.windsurf/workflows/launchframe.md +165 -10
- package/package.json +1 -1
|
@@ -24,7 +24,7 @@ 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.
|
|
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
28
|
|
|
29
29
|
---
|
|
30
30
|
|
|
@@ -36,12 +36,13 @@ The target page(s) are the URL(s) you parsed in Pre-Flight. Clone exactly what's
|
|
|
36
36
|
- **In scope:** Visual layout and styling, component structure and interactions, responsive design, mock data for demo purposes
|
|
37
37
|
- **Out of scope:** Real backend / database, authentication, real-time features, SEO optimization, accessibility audit
|
|
38
38
|
- **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.
|
|
39
|
+
- **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**. Note in `docs/research/LAUNCHFRAME.md` which marks and assets are **original brand** versus **layout-only** extraction.
|
|
39
40
|
|
|
40
41
|
If the user provides additional instructions (specific fidelity level, customizations, extra context), honor those over the defaults.
|
|
41
42
|
|
|
42
43
|
## Pre-Flight
|
|
43
44
|
|
|
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.
|
|
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 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. **Pixel-perfect MCP:** every extract and QA pass must follow **Browser MCP: pixel-perfect capture** (Phase 1) — locked viewports, **verbatim** `getComputedStyle` strings (including fractional `px`, `rem`, `oklch`/`rgba`), and **geometry** from `getBoundingClientRect()` where layout matters. **Motion parity:** every pass 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
46
|
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
47
|
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
48
|
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 +58,7 @@ When you traverse the DOM and the Network panel, do **not** treat all nodes equa
|
|
|
57
58
|
|
|
58
59
|
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
60
|
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
|
|
61
|
+
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
62
|
|
|
62
63
|
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
64
|
|
|
@@ -150,11 +151,48 @@ Navigate to the target URL with browser MCP.
|
|
|
150
151
|
|
|
151
152
|
Follow **§0 (Visual crawl priority)** during the entire reconnaissance pass: images and backgrounds → SVGs/icons → motion/animations — before spending time on secondary copy tweaks.
|
|
152
153
|
|
|
154
|
+
### Multi-pass DOM reconnaissance (mandatory)
|
|
155
|
+
|
|
156
|
+
**A single scroll is not enough.** You must run the live page **multiple full cycles** in browser MCP — each time walking the **DOM**, the **asset graph**, and the **motion flow** — until what you write in specs is **exactly** what the reference does, not a remembered approximation.
|
|
157
|
+
|
|
158
|
+
**Minimum passes** (run **Pass 1–4 at 1440px first**; **repeat Pass 1–3 at 768px and 390px** wherever layout or node order differs; reconciliation can be width-specific):
|
|
159
|
+
|
|
160
|
+
1. **Structure pass (DOM, top → bottom):** Traverse from **`document.body`** in **depth-first order** (or section-by-section using regions you will later name in `PAGE_TOPOLOGY.md`). For every node that affects layout or visible content, record **tag**, **selector hint** (stable `id` / first meaningful classes), **`childNodes` order** (siblings matter — flex/grid gaps and wrappers are not optional), landmarks, and **which element is the scroll container** (`overflow` / `overscroll-behavior`). Produce a **literal hierarchy** in `docs/research/DOM_SKETCH.md` (whole page or per-section files under `docs/research/`) so builders cannot silently reorder or collapse wrapper divs. **Include “invisible” structure** (spacers, gradient overlays, absolutely positioned siblings).
|
|
161
|
+
2. **Asset pass (images & layered media):** **Second full traversal** focused on §0 priority 1–2: every `<img>`, `<picture>` / `srcset`, `<video>` / `poster`, computed **`background-image`** on the element **and** ancestors, CSS masks, inline SVG / sprites. Cross-check with the Network panel. Every URL must end up **downloaded to `public/`** with a documented path, or marked **blocked / generated** with a substitute and reason.
|
|
162
|
+
3. **Motion & flow pass:** **Third full journey** — slow scroll **top to bottom**, then **scroll again** (different speed) to catch lazy-mounted nodes, staggered `IntersectionObserver` reveals, and scroll-snapped stops. Run **`motionAudit`** (below) **per major section root** after scrolling that section into view. **Re-do click/hover sweeps** here while sampling `getComputedStyle` so **transitions and keyframe-driven flow** match the reference’s **order and timing**, not a generic fade-in.
|
|
163
|
+
4. **Reconciliation pass:** **Fourth pass** — read `DOM_SKETCH.md`, `BEHAVIORS.md`, asset inventory, and `MOTION.md` together; list **gaps** (missing wrapper, second image layer, unnamed animation, wrong child order). For every gap, return to the site and **repeat Pass 1–3** for that subtree until the spec is closed.
|
|
164
|
+
|
|
165
|
+
**Hard rule:** Every fact in a component spec must trace to **which pass** produced it. If you “kind of remember” a structure from an earlier visit, **run the page again** — do not guess.
|
|
166
|
+
|
|
153
167
|
### Screenshots
|
|
154
168
|
- Take **full-page screenshots** at desktop (1440px) and mobile (390px) viewports
|
|
155
169
|
- Save to `docs/design-references/` with descriptive names
|
|
156
170
|
- These are your master reference — builders will receive section-specific crops/screenshots later
|
|
157
171
|
|
|
172
|
+
### Browser MCP: pixel-perfect capture
|
|
173
|
+
|
|
174
|
+
MCP-driven inspection must be **pixel-perfect**, not “close.” Apply this on **every** reconnaissance width and again in Phase 5.
|
|
175
|
+
|
|
176
|
+
- **Viewport lock:** Resize the MCP-controlled window to exact **CSS widths** used for this project: **1440**, **768**, and **390** px (height large enough to avoid accidental mobile chrome quirks). After each resize, record **`window.innerWidth`**, **`document.documentElement.clientWidth`**, and **`devicePixelRatio`** (run the snippet below). Extraction and QA **use the same widths** so diffs are valid.
|
|
177
|
+
- **Zoom:** Ensure **browser zoom is 100%** (not 90%/110%). Zoom breaks `px` parity and screenshots.
|
|
178
|
+
- **Computed styles are verbatim:** When copying from `getComputedStyle()`, paste **exact returned strings** — including **fractional** lengths (`12.8px`), **negative** values, **`oklch()`/`lch()`/`rgba()`**, `letter-spacing`, `line-height`, `border`/`outline`, and **`calc()`**/`min()` that the cascade resolves to. **Do not round** for “clean” tokens (no `~16px`; no swapping `0.875rem` for `14px` unless the computed value truly equals that).
|
|
179
|
+
- **Geometry:** When alignment, gutters, or sticky offsets matter, record **`getBoundingClientRect()`** (`x`, `y`, `width`, `height`) at the relevant scroll position and width — not only padding/margin strings. Fixed/sticky layers need **viewport-relative** positions.
|
|
180
|
+
- **Pseudos & layers:** Extract **`::before` / `::after`** (and other pseudos the reference uses) with `getComputedStyle(el, '::before')` etc.; they often hold gradients, borders, or icons that define the pixel look.
|
|
181
|
+
- **Anti-aliasing & text:** Prefer **real Chrome** via MCP so **font rasterization** matches; load the **same font files/weights** in Next.js as on the reference. Note `font-feature-settings` / `font-variation-settings` / `-webkit-font-smoothing` if non-default.
|
|
182
|
+
- **Screenshots vs. DOM:** Screenshots are for **diffing**; the **spec values** still come from **computed style + rect**, not from eyeballing pixels.
|
|
183
|
+
|
|
184
|
+
**Viewport diagnostic** (run via browser MCP after each resize):
|
|
185
|
+
|
|
186
|
+
```javascript
|
|
187
|
+
JSON.stringify({
|
|
188
|
+
innerWidth: window.innerWidth,
|
|
189
|
+
clientWidth: document.documentElement.clientWidth,
|
|
190
|
+
clientHeight: document.documentElement.clientHeight,
|
|
191
|
+
devicePixelRatio: window.devicePixelRatio,
|
|
192
|
+
scrollY: window.scrollY
|
|
193
|
+
});
|
|
194
|
+
```
|
|
195
|
+
|
|
158
196
|
### Global Extraction
|
|
159
197
|
Extract these from the page before doing anything else:
|
|
160
198
|
|
|
@@ -194,6 +232,106 @@ This is a dedicated pass AFTER screenshots and BEFORE anything else. Its purpose
|
|
|
194
232
|
|
|
195
233
|
Save all findings to `docs/research/BEHAVIORS.md`. This is your behavior bible — reference it when writing every component spec.
|
|
196
234
|
|
|
235
|
+
### Chrome MCP: precise motion & animation extraction
|
|
236
|
+
|
|
237
|
+
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.
|
|
238
|
+
|
|
239
|
+
**Rules:**
|
|
240
|
+
|
|
241
|
+
- **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 equivalent in Tailwind only when it truly matches).
|
|
242
|
+
- **`@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.”
|
|
243
|
+
- **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).
|
|
244
|
+
- **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).
|
|
245
|
+
- **Libraries** — if Lenis/GSAP/Framer is present, document **version/hooks** from `package` on the page or script URLs, class hooks (e.g. `.lenis`), and any **inline style** the library sets at rest vs. mid-animation (sample via computed style after the interaction).
|
|
246
|
+
- **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.
|
|
247
|
+
|
|
248
|
+
**Motion audit script** (run via Chrome MCP; optional `rootSelector` limits to a subtree):
|
|
249
|
+
|
|
250
|
+
```javascript
|
|
251
|
+
(function motionAudit(rootSelector) {
|
|
252
|
+
const root = rootSelector ? document.querySelector(rootSelector) : document.body;
|
|
253
|
+
if (!root) return JSON.stringify({ error: 'root not found: ' + rootSelector });
|
|
254
|
+
|
|
255
|
+
function safeRules(sheet) {
|
|
256
|
+
try {
|
|
257
|
+
return [...sheet.cssRules];
|
|
258
|
+
} catch {
|
|
259
|
+
return [];
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
const walkKeyframes = (rules, out) => {
|
|
264
|
+
for (const rule of rules) {
|
|
265
|
+
if (rule.type === CSSRule.KEYFRAMES_RULE) {
|
|
266
|
+
out.push({ name: rule.name, cssText: rule.cssText });
|
|
267
|
+
} else if (rule.type === CSSRule.MEDIA_RULE && rule.cssRules) {
|
|
268
|
+
walkKeyframes(rule.cssRules, out);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
const keyframes = [];
|
|
274
|
+
for (const sheet of document.styleSheets) {
|
|
275
|
+
walkKeyframes(safeRules(sheet), keyframes);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
const animated = [];
|
|
279
|
+
const scope = root.querySelectorAll('*');
|
|
280
|
+
for (const el of scope) {
|
|
281
|
+
const cs = getComputedStyle(el);
|
|
282
|
+
const animName = cs.animationName;
|
|
283
|
+
const hasAnim = animName && animName !== 'none';
|
|
284
|
+
const transDurs = (cs.transitionDuration || '')
|
|
285
|
+
.split(',')
|
|
286
|
+
.map((s) => s.trim())
|
|
287
|
+
.filter(Boolean);
|
|
288
|
+
const hasTrans =
|
|
289
|
+
cs.transitionProperty &&
|
|
290
|
+
cs.transitionProperty !== 'none' &&
|
|
291
|
+
transDurs.some((d) => d !== '0s');
|
|
292
|
+
if (!hasAnim && !hasTrans) continue;
|
|
293
|
+
|
|
294
|
+
animated.push({
|
|
295
|
+
hint: el.tagName.toLowerCase() + (el.className
|
|
296
|
+
? '.' + String(el.className).trim().split(/\s+/).slice(0, 4).join('.')
|
|
297
|
+
: ''),
|
|
298
|
+
animation: cs.animation,
|
|
299
|
+
animationName: cs.animationName,
|
|
300
|
+
animationDuration: cs.animationDuration,
|
|
301
|
+
animationTimingFunction: cs.animationTimingFunction,
|
|
302
|
+
animationDelay: cs.animationDelay,
|
|
303
|
+
animationIterationCount: cs.animationIterationCount,
|
|
304
|
+
animationDirection: cs.animationDirection,
|
|
305
|
+
animationFillMode: cs.animationFillMode,
|
|
306
|
+
animationPlayState: cs.animationPlayState,
|
|
307
|
+
animationTimeline: cs.animationTimeline,
|
|
308
|
+
animationRange: cs.animationRange,
|
|
309
|
+
transition: cs.transition,
|
|
310
|
+
transitionProperty: cs.transitionProperty,
|
|
311
|
+
transitionDuration: cs.transitionDuration,
|
|
312
|
+
transitionTimingFunction: cs.transitionTimingFunction,
|
|
313
|
+
transitionDelay: cs.transitionDelay,
|
|
314
|
+
transform: cs.transform,
|
|
315
|
+
transformOrigin: cs.transformOrigin,
|
|
316
|
+
opacity: cs.opacity,
|
|
317
|
+
willChange: cs.willChange,
|
|
318
|
+
viewTimelineName: cs.viewTimelineName,
|
|
319
|
+
scrollTimelineName: cs.scrollTimelineName
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
return JSON.stringify(
|
|
324
|
+
{
|
|
325
|
+
prefersReducedMotion: window.matchMedia('(prefers-reduced-motion: reduce)').matches,
|
|
326
|
+
keyframes,
|
|
327
|
+
animatedElements: animated
|
|
328
|
+
},
|
|
329
|
+
null,
|
|
330
|
+
2
|
|
331
|
+
);
|
|
332
|
+
})(''); // Pass section selector string, e.g. 'section.hero', instead of ''
|
|
333
|
+
```
|
|
334
|
+
|
|
197
335
|
### Page Topology
|
|
198
336
|
Map out every distinct section of the page from top to bottom. Give each a working name. Document:
|
|
199
337
|
- Their visual order
|
|
@@ -284,7 +422,8 @@ For each section, use browser MCP to extract everything:
|
|
|
284
422
|
'borderRadius','border','borderTop','borderBottom','borderLeft','borderRight',
|
|
285
423
|
'boxShadow','overflow','overflowX','overflowY',
|
|
286
424
|
'position','top','right','bottom','left','zIndex',
|
|
287
|
-
'opacity','transform','transition','
|
|
425
|
+
'opacity','transform','transformOrigin','transition','transitionProperty','transitionDuration','transitionTimingFunction','transitionDelay',
|
|
426
|
+
'animation','animationName','animationDuration','animationTimingFunction','animationDelay','animationIterationCount','animationDirection','animationFillMode','animationPlayState','animationTimeline','animationRange','viewTimelineName','scrollTimelineName','cursor',
|
|
288
427
|
'objectFit','objectPosition','mixBlendMode','filter','backdropFilter',
|
|
289
428
|
'whiteSpace','textOverflow','WebkitLineClamp'
|
|
290
429
|
];
|
|
@@ -363,6 +502,15 @@ For each section (or sub-component, if you're breaking it up), create a spec fil
|
|
|
363
502
|
### <Child element N>
|
|
364
503
|
...
|
|
365
504
|
|
|
505
|
+
## Motion & animation (exact — from Chrome MCP `getComputedStyle` + stylesheet rules)
|
|
506
|
+
|
|
507
|
+
- **Keyframe names in use:** ...
|
|
508
|
+
- **Full `@keyframes` blocks** (paste `cssText` or equivalent); note **cross-origin** gaps and how you filled them
|
|
509
|
+
- **Per-element:** shorthand/longhand `animation` and `transition` values **verbatim** for resting state
|
|
510
|
+
- **Scroll/view timelines:** timeline name, range, scroll container, snap/observer thresholds
|
|
511
|
+
- **Libraries:** Lenis / GSAP / Framer / Lottie — hooks, init pattern, timing copied from reference
|
|
512
|
+
- **`prefers-reduced-motion`:** matched behavior on the reference
|
|
513
|
+
|
|
366
514
|
## States & Behaviors
|
|
367
515
|
|
|
368
516
|
### <Behavior name, e.g., "Scroll-triggered floating mode">
|
|
@@ -445,30 +593,34 @@ After all sections are built and merged, wire everything together in `src/app/pa
|
|
|
445
593
|
|
|
446
594
|
After assembly, do NOT declare the clone complete. Take side-by-side comparison screenshots:
|
|
447
595
|
|
|
448
|
-
1.
|
|
596
|
+
1. **Pixel-perfect comparison setup:** Match **Browser MCP: pixel-perfect capture** — same **CSS widths** (**1440**, **768**, **390**), **100% zoom**, and record `innerWidth`/`clientWidth`/`devicePixelRatio` on both reference and clone. Then open original and clone side-by-side or take paired screenshots at those widths.
|
|
449
597
|
2. Compare section by section, top to bottom, at desktop (1440px)
|
|
450
|
-
3. Compare again at mobile (390px)
|
|
598
|
+
3. Compare at tablet (768px) and again at mobile (390px)
|
|
451
599
|
4. For each discrepancy found:
|
|
452
600
|
- Check the component spec file — was the value extracted correctly?
|
|
453
601
|
- If the spec was wrong: re-extract from browser MCP, update the spec, fix the component
|
|
454
602
|
- If the spec was right but the builder got it wrong: fix the component to match the spec
|
|
455
603
|
5. Test all interactive behaviors: scroll through the page, click every button/tab, hover over interactive elements
|
|
456
|
-
6.
|
|
604
|
+
6. **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 — durations and easings must match character-for-character where the cascade specifies them. Re-record any `@keyframes` the reference still exposes so the clone can be patched until timings align.
|
|
605
|
+
7. Verify smooth scroll feels right, header transitions work, tab switching works, stagger and scroll-driven reveals match the reference
|
|
457
606
|
|
|
458
|
-
Only after this visual QA pass is the clone complete.
|
|
607
|
+
Only after this visual + motion QA pass is the clone complete.
|
|
459
608
|
|
|
460
609
|
## Pre-Dispatch Checklist
|
|
461
610
|
|
|
462
611
|
Before dispatching ANY builder agent, verify you can check every box. If you can't, go back and extract more.
|
|
463
612
|
|
|
613
|
+
- [ ] **Multi-pass DOM reconnaissance:** structure (`DOM_SKETCH.md`) + asset sweep + motion/flow sweeps + reconciliation; repeated at **768 / 390** when layout or DOM order differs from 1440
|
|
464
614
|
- [ ] Spec file written to `docs/research/components/<name>.spec.md` with ALL sections filled
|
|
465
|
-
- [ ] Every CSS value in the spec is from `getComputedStyle()`, not estimated
|
|
615
|
+
- [ ] Every CSS value in the spec is from `getComputedStyle()`, not estimated — **verbatim**, including fractional px and color functions
|
|
616
|
+
- [ ] **MCP pixel-perfect pass:** viewports **1440 / 768 / 390**, **100% zoom**, viewport diagnostic recorded; **`getBoundingClientRect()`** and **`::before`/`::after`** captured where they affect layout or visuals
|
|
466
617
|
- [ ] Interaction model is identified and documented (static / click / scroll / time)
|
|
467
618
|
- [ ] For stateful components: every state's content and styles are captured
|
|
468
619
|
- [ ] For scroll-driven components: trigger threshold, before/after styles, and transition are recorded
|
|
469
620
|
- [ ] For hover states: before/after values and transition timing are recorded
|
|
621
|
+
- [ ] 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
622
|
- [ ] All images in the section are identified (including overlays and layered compositions)
|
|
471
|
-
- [ ] Responsive behavior is documented for
|
|
623
|
+
- [ ] Responsive behavior is documented for **1440 / 768 / 390**
|
|
472
624
|
- [ ] Text content is verbatim from the site, not paraphrased
|
|
473
625
|
- [ ] The builder prompt is under ~150 lines of spec; if over, the section needs to be split
|
|
474
626
|
|
|
@@ -486,6 +638,8 @@ These are lessons from previous failed clones — each one cost hours of rework:
|
|
|
486
638
|
- **Don't skip asset extraction.** Without real images, videos, and fonts, the clone will always look fake regardless of how perfect the CSS is.
|
|
487
639
|
- **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.
|
|
488
640
|
- **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.
|
|
641
|
+
- **Don't round or “clean up” extracted values** for Tailwind guesses: `12.8px` stays `12.8px` in the spec unless the clone uses an exactly equivalent value.
|
|
642
|
+
- **Don't mix zoom levels or viewport widths** between reference extraction and QA — you will false-fail or false-pass pixel diffs.
|
|
489
643
|
- **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.
|
|
490
644
|
- **Don't forget smooth scroll libraries.** Check for Lenis (`.lenis` class), Locomotive Scroll, or similar. Default browser scrolling feels noticeably different and the user will spot it immediately.
|
|
491
645
|
- **Don't dispatch builders without a spec file.** The spec file forces exhaustive extraction and creates an auditable artifact. Skipping it means the builder gets whatever you can fit in a prompt from memory.
|
|
@@ -493,6 +647,7 @@ These are lessons from previous failed clones — each one cost hours of rework:
|
|
|
493
647
|
## Completion
|
|
494
648
|
|
|
495
649
|
When done, report:
|
|
650
|
+
- Multi-pass reconnaissance status (`docs/research/DOM_SKETCH.md` present; passes at **1440 / 768 / 390** as needed)
|
|
496
651
|
- Total sections built
|
|
497
652
|
- Total components created
|
|
498
653
|
- Total spec files written (should match components)
|
|
@@ -21,7 +21,7 @@ Before reconnaissance, write or update:
|
|
|
21
21
|
|
|
22
22
|
## SaaS copy overlay (Phase 4 assembly and final polish)
|
|
23
23
|
|
|
24
|
-
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.
|
|
24
|
+
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.
|
|
25
25
|
|
|
26
26
|
---
|
|
27
27
|
|
|
@@ -33,12 +33,13 @@ The target page(s) are the URL(s) you parsed in Pre-Flight. Clone exactly what's
|
|
|
33
33
|
- **In scope:** Visual layout and styling, component structure and interactions, responsive design, mock data for demo purposes
|
|
34
34
|
- **Out of scope:** Real backend / database, authentication, real-time features, SEO optimization, accessibility audit
|
|
35
35
|
- **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.
|
|
36
|
+
- **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**. Note in `docs/research/LAUNCHFRAME.md` which marks and assets are **original brand** versus **layout-only** extraction.
|
|
36
37
|
|
|
37
38
|
If the user provides additional instructions (specific fidelity level, customizations, extra context), honor those over the defaults.
|
|
38
39
|
|
|
39
40
|
## Pre-Flight
|
|
40
41
|
|
|
41
|
-
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.
|
|
42
|
+
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. **Pixel-perfect MCP:** every extract and QA pass must follow **Browser MCP: pixel-perfect capture** (Phase 1) — locked viewports, **verbatim** `getComputedStyle` strings (including fractional `px`, `rem`, `oklch`/`rgba`), and **geometry** from `getBoundingClientRect()` where layout matters. **Motion parity:** every pass 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.
|
|
42
43
|
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.
|
|
43
44
|
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.
|
|
44
45
|
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>/`.
|
|
@@ -54,7 +55,7 @@ When you traverse the DOM and the Network panel, do **not** treat all nodes equa
|
|
|
54
55
|
|
|
55
56
|
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.
|
|
56
57
|
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.
|
|
57
|
-
3. **Motion & animation** — CSS `@keyframes`, `animation`, `animation-timeline`, `transition`, `transform`, will-change
|
|
58
|
+
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.
|
|
58
59
|
|
|
59
60
|
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.
|
|
60
61
|
|
|
@@ -147,11 +148,48 @@ Navigate to the target URL with browser MCP.
|
|
|
147
148
|
|
|
148
149
|
Follow **§0 (Visual crawl priority)** during the entire reconnaissance pass: images and backgrounds → SVGs/icons → motion/animations — before spending time on secondary copy tweaks.
|
|
149
150
|
|
|
151
|
+
### Multi-pass DOM reconnaissance (mandatory)
|
|
152
|
+
|
|
153
|
+
**A single scroll is not enough.** You must run the live page **multiple full cycles** in browser MCP — each time walking the **DOM**, the **asset graph**, and the **motion flow** — until what you write in specs is **exactly** what the reference does, not a remembered approximation.
|
|
154
|
+
|
|
155
|
+
**Minimum passes** (run **Pass 1–4 at 1440px first**; **repeat Pass 1–3 at 768px and 390px** wherever layout or node order differs; reconciliation can be width-specific):
|
|
156
|
+
|
|
157
|
+
1. **Structure pass (DOM, top → bottom):** Traverse from **`document.body`** in **depth-first order** (or section-by-section using regions you will later name in `PAGE_TOPOLOGY.md`). For every node that affects layout or visible content, record **tag**, **selector hint** (stable `id` / first meaningful classes), **`childNodes` order** (siblings matter — flex/grid gaps and wrappers are not optional), landmarks, and **which element is the scroll container** (`overflow` / `overscroll-behavior`). Produce a **literal hierarchy** in `docs/research/DOM_SKETCH.md` (whole page or per-section files under `docs/research/`) so builders cannot silently reorder or collapse wrapper divs. **Include “invisible” structure** (spacers, gradient overlays, absolutely positioned siblings).
|
|
158
|
+
2. **Asset pass (images & layered media):** **Second full traversal** focused on §0 priority 1–2: every `<img>`, `<picture>` / `srcset`, `<video>` / `poster`, computed **`background-image`** on the element **and** ancestors, CSS masks, inline SVG / sprites. Cross-check with the Network panel. Every URL must end up **downloaded to `public/`** with a documented path, or marked **blocked / generated** with a substitute and reason.
|
|
159
|
+
3. **Motion & flow pass:** **Third full journey** — slow scroll **top to bottom**, then **scroll again** (different speed) to catch lazy-mounted nodes, staggered `IntersectionObserver` reveals, and scroll-snapped stops. Run **`motionAudit`** (below) **per major section root** after scrolling that section into view. **Re-do click/hover sweeps** here while sampling `getComputedStyle` so **transitions and keyframe-driven flow** match the reference’s **order and timing**, not a generic fade-in.
|
|
160
|
+
4. **Reconciliation pass:** **Fourth pass** — read `DOM_SKETCH.md`, `BEHAVIORS.md`, asset inventory, and `MOTION.md` together; list **gaps** (missing wrapper, second image layer, unnamed animation, wrong child order). For every gap, return to the site and **repeat Pass 1–3** for that subtree until the spec is closed.
|
|
161
|
+
|
|
162
|
+
**Hard rule:** Every fact in a component spec must trace to **which pass** produced it. If you “kind of remember” a structure from an earlier visit, **run the page again** — do not guess.
|
|
163
|
+
|
|
150
164
|
### Screenshots
|
|
151
165
|
- Take **full-page screenshots** at desktop (1440px) and mobile (390px) viewports
|
|
152
166
|
- Save to `docs/design-references/` with descriptive names
|
|
153
167
|
- These are your master reference — builders will receive section-specific crops/screenshots later
|
|
154
168
|
|
|
169
|
+
### Browser MCP: pixel-perfect capture
|
|
170
|
+
|
|
171
|
+
MCP-driven inspection must be **pixel-perfect**, not “close.” Apply this on **every** reconnaissance width and again in Phase 5.
|
|
172
|
+
|
|
173
|
+
- **Viewport lock:** Resize the MCP-controlled window to exact **CSS widths** used for this project: **1440**, **768**, and **390** px (height large enough to avoid accidental mobile chrome quirks). After each resize, record **`window.innerWidth`**, **`document.documentElement.clientWidth`**, and **`devicePixelRatio`** (run the snippet below). Extraction and QA **use the same widths** so diffs are valid.
|
|
174
|
+
- **Zoom:** Ensure **browser zoom is 100%** (not 90%/110%). Zoom breaks `px` parity and screenshots.
|
|
175
|
+
- **Computed styles are verbatim:** When copying from `getComputedStyle()`, paste **exact returned strings** — including **fractional** lengths (`12.8px`), **negative** values, **`oklch()`/`lch()`/`rgba()`**, `letter-spacing`, `line-height`, `border`/`outline`, and **`calc()`**/`min()` that the cascade resolves to. **Do not round** for “clean” tokens (no `~16px`; no swapping `0.875rem` for `14px` unless the computed value truly equals that).
|
|
176
|
+
- **Geometry:** When alignment, gutters, or sticky offsets matter, record **`getBoundingClientRect()`** (`x`, `y`, `width`, `height`) at the relevant scroll position and width — not only padding/margin strings. Fixed/sticky layers need **viewport-relative** positions.
|
|
177
|
+
- **Pseudos & layers:** Extract **`::before` / `::after`** (and other pseudos the reference uses) with `getComputedStyle(el, '::before')` etc.; they often hold gradients, borders, or icons that define the pixel look.
|
|
178
|
+
- **Anti-aliasing & text:** Prefer **real Chrome** via MCP so **font rasterization** matches; load the **same font files/weights** in Next.js as on the reference. Note `font-feature-settings` / `font-variation-settings` / `-webkit-font-smoothing` if non-default.
|
|
179
|
+
- **Screenshots vs. DOM:** Screenshots are for **diffing**; the **spec values** still come from **computed style + rect**, not from eyeballing pixels.
|
|
180
|
+
|
|
181
|
+
**Viewport diagnostic** (run via browser MCP after each resize):
|
|
182
|
+
|
|
183
|
+
```javascript
|
|
184
|
+
JSON.stringify({
|
|
185
|
+
innerWidth: window.innerWidth,
|
|
186
|
+
clientWidth: document.documentElement.clientWidth,
|
|
187
|
+
clientHeight: document.documentElement.clientHeight,
|
|
188
|
+
devicePixelRatio: window.devicePixelRatio,
|
|
189
|
+
scrollY: window.scrollY
|
|
190
|
+
});
|
|
191
|
+
```
|
|
192
|
+
|
|
155
193
|
### Global Extraction
|
|
156
194
|
Extract these from the page before doing anything else:
|
|
157
195
|
|
|
@@ -191,6 +229,106 @@ This is a dedicated pass AFTER screenshots and BEFORE anything else. Its purpose
|
|
|
191
229
|
|
|
192
230
|
Save all findings to `docs/research/BEHAVIORS.md`. This is your behavior bible — reference it when writing every component spec.
|
|
193
231
|
|
|
232
|
+
### Chrome MCP: precise motion & animation extraction
|
|
233
|
+
|
|
234
|
+
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.
|
|
235
|
+
|
|
236
|
+
**Rules:**
|
|
237
|
+
|
|
238
|
+
- **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 equivalent in Tailwind only when it truly matches).
|
|
239
|
+
- **`@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.”
|
|
240
|
+
- **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).
|
|
241
|
+
- **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).
|
|
242
|
+
- **Libraries** — if Lenis/GSAP/Framer is present, document **version/hooks** from `package` on the page or script URLs, class hooks (e.g. `.lenis`), and any **inline style** the library sets at rest vs. mid-animation (sample via computed style after the interaction).
|
|
243
|
+
- **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.
|
|
244
|
+
|
|
245
|
+
**Motion audit script** (run via Chrome MCP; optional `rootSelector` limits to a subtree):
|
|
246
|
+
|
|
247
|
+
```javascript
|
|
248
|
+
(function motionAudit(rootSelector) {
|
|
249
|
+
const root = rootSelector ? document.querySelector(rootSelector) : document.body;
|
|
250
|
+
if (!root) return JSON.stringify({ error: 'root not found: ' + rootSelector });
|
|
251
|
+
|
|
252
|
+
function safeRules(sheet) {
|
|
253
|
+
try {
|
|
254
|
+
return [...sheet.cssRules];
|
|
255
|
+
} catch {
|
|
256
|
+
return [];
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
const walkKeyframes = (rules, out) => {
|
|
261
|
+
for (const rule of rules) {
|
|
262
|
+
if (rule.type === CSSRule.KEYFRAMES_RULE) {
|
|
263
|
+
out.push({ name: rule.name, cssText: rule.cssText });
|
|
264
|
+
} else if (rule.type === CSSRule.MEDIA_RULE && rule.cssRules) {
|
|
265
|
+
walkKeyframes(rule.cssRules, out);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
const keyframes = [];
|
|
271
|
+
for (const sheet of document.styleSheets) {
|
|
272
|
+
walkKeyframes(safeRules(sheet), keyframes);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
const animated = [];
|
|
276
|
+
const scope = root.querySelectorAll('*');
|
|
277
|
+
for (const el of scope) {
|
|
278
|
+
const cs = getComputedStyle(el);
|
|
279
|
+
const animName = cs.animationName;
|
|
280
|
+
const hasAnim = animName && animName !== 'none';
|
|
281
|
+
const transDurs = (cs.transitionDuration || '')
|
|
282
|
+
.split(',')
|
|
283
|
+
.map((s) => s.trim())
|
|
284
|
+
.filter(Boolean);
|
|
285
|
+
const hasTrans =
|
|
286
|
+
cs.transitionProperty &&
|
|
287
|
+
cs.transitionProperty !== 'none' &&
|
|
288
|
+
transDurs.some((d) => d !== '0s');
|
|
289
|
+
if (!hasAnim && !hasTrans) continue;
|
|
290
|
+
|
|
291
|
+
animated.push({
|
|
292
|
+
hint: el.tagName.toLowerCase() + (el.className
|
|
293
|
+
? '.' + String(el.className).trim().split(/\s+/).slice(0, 4).join('.')
|
|
294
|
+
: ''),
|
|
295
|
+
animation: cs.animation,
|
|
296
|
+
animationName: cs.animationName,
|
|
297
|
+
animationDuration: cs.animationDuration,
|
|
298
|
+
animationTimingFunction: cs.animationTimingFunction,
|
|
299
|
+
animationDelay: cs.animationDelay,
|
|
300
|
+
animationIterationCount: cs.animationIterationCount,
|
|
301
|
+
animationDirection: cs.animationDirection,
|
|
302
|
+
animationFillMode: cs.animationFillMode,
|
|
303
|
+
animationPlayState: cs.animationPlayState,
|
|
304
|
+
animationTimeline: cs.animationTimeline,
|
|
305
|
+
animationRange: cs.animationRange,
|
|
306
|
+
transition: cs.transition,
|
|
307
|
+
transitionProperty: cs.transitionProperty,
|
|
308
|
+
transitionDuration: cs.transitionDuration,
|
|
309
|
+
transitionTimingFunction: cs.transitionTimingFunction,
|
|
310
|
+
transitionDelay: cs.transitionDelay,
|
|
311
|
+
transform: cs.transform,
|
|
312
|
+
transformOrigin: cs.transformOrigin,
|
|
313
|
+
opacity: cs.opacity,
|
|
314
|
+
willChange: cs.willChange,
|
|
315
|
+
viewTimelineName: cs.viewTimelineName,
|
|
316
|
+
scrollTimelineName: cs.scrollTimelineName
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
return JSON.stringify(
|
|
321
|
+
{
|
|
322
|
+
prefersReducedMotion: window.matchMedia('(prefers-reduced-motion: reduce)').matches,
|
|
323
|
+
keyframes,
|
|
324
|
+
animatedElements: animated
|
|
325
|
+
},
|
|
326
|
+
null,
|
|
327
|
+
2
|
|
328
|
+
);
|
|
329
|
+
})(''); // Pass section selector string, e.g. 'section.hero', instead of ''
|
|
330
|
+
```
|
|
331
|
+
|
|
194
332
|
### Page Topology
|
|
195
333
|
Map out every distinct section of the page from top to bottom. Give each a working name. Document:
|
|
196
334
|
- Their visual order
|
|
@@ -281,7 +419,8 @@ For each section, use browser MCP to extract everything:
|
|
|
281
419
|
'borderRadius','border','borderTop','borderBottom','borderLeft','borderRight',
|
|
282
420
|
'boxShadow','overflow','overflowX','overflowY',
|
|
283
421
|
'position','top','right','bottom','left','zIndex',
|
|
284
|
-
'opacity','transform','transition','
|
|
422
|
+
'opacity','transform','transformOrigin','transition','transitionProperty','transitionDuration','transitionTimingFunction','transitionDelay',
|
|
423
|
+
'animation','animationName','animationDuration','animationTimingFunction','animationDelay','animationIterationCount','animationDirection','animationFillMode','animationPlayState','animationTimeline','animationRange','viewTimelineName','scrollTimelineName','cursor',
|
|
285
424
|
'objectFit','objectPosition','mixBlendMode','filter','backdropFilter',
|
|
286
425
|
'whiteSpace','textOverflow','WebkitLineClamp'
|
|
287
426
|
];
|
|
@@ -360,6 +499,15 @@ For each section (or sub-component, if you're breaking it up), create a spec fil
|
|
|
360
499
|
### <Child element N>
|
|
361
500
|
...
|
|
362
501
|
|
|
502
|
+
## Motion & animation (exact — from Chrome MCP `getComputedStyle` + stylesheet rules)
|
|
503
|
+
|
|
504
|
+
- **Keyframe names in use:** ...
|
|
505
|
+
- **Full `@keyframes` blocks** (paste `cssText` or equivalent); note **cross-origin** gaps and how you filled them
|
|
506
|
+
- **Per-element:** shorthand/longhand `animation` and `transition` values **verbatim** for resting state
|
|
507
|
+
- **Scroll/view timelines:** timeline name, range, scroll container, snap/observer thresholds
|
|
508
|
+
- **Libraries:** Lenis / GSAP / Framer / Lottie — hooks, init pattern, timing copied from reference
|
|
509
|
+
- **`prefers-reduced-motion`:** matched behavior on the reference
|
|
510
|
+
|
|
363
511
|
## States & Behaviors
|
|
364
512
|
|
|
365
513
|
### <Behavior name, e.g., "Scroll-triggered floating mode">
|
|
@@ -442,30 +590,34 @@ After all sections are built and merged, wire everything together in `src/app/pa
|
|
|
442
590
|
|
|
443
591
|
After assembly, do NOT declare the clone complete. Take side-by-side comparison screenshots:
|
|
444
592
|
|
|
445
|
-
1.
|
|
593
|
+
1. **Pixel-perfect comparison setup:** Match **Browser MCP: pixel-perfect capture** — same **CSS widths** (**1440**, **768**, **390**), **100% zoom**, and record `innerWidth`/`clientWidth`/`devicePixelRatio` on both reference and clone. Then open original and clone side-by-side or take paired screenshots at those widths.
|
|
446
594
|
2. Compare section by section, top to bottom, at desktop (1440px)
|
|
447
|
-
3. Compare again at mobile (390px)
|
|
595
|
+
3. Compare at tablet (768px) and again at mobile (390px)
|
|
448
596
|
4. For each discrepancy found:
|
|
449
597
|
- Check the component spec file — was the value extracted correctly?
|
|
450
598
|
- If the spec was wrong: re-extract from browser MCP, update the spec, fix the component
|
|
451
599
|
- If the spec was right but the builder got it wrong: fix the component to match the spec
|
|
452
600
|
5. Test all interactive behaviors: scroll through the page, click every button/tab, hover over interactive elements
|
|
453
|
-
6.
|
|
601
|
+
6. **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 — durations and easings must match character-for-character where the cascade specifies them. Re-record any `@keyframes` the reference still exposes so the clone can be patched until timings align.
|
|
602
|
+
7. Verify smooth scroll feels right, header transitions work, tab switching works, stagger and scroll-driven reveals match the reference
|
|
454
603
|
|
|
455
|
-
Only after this visual QA pass is the clone complete.
|
|
604
|
+
Only after this visual + motion QA pass is the clone complete.
|
|
456
605
|
|
|
457
606
|
## Pre-Dispatch Checklist
|
|
458
607
|
|
|
459
608
|
Before dispatching ANY builder agent, verify you can check every box. If you can't, go back and extract more.
|
|
460
609
|
|
|
610
|
+
- [ ] **Multi-pass DOM reconnaissance:** structure (`DOM_SKETCH.md`) + asset sweep + motion/flow sweeps + reconciliation; repeated at **768 / 390** when layout or DOM order differs from 1440
|
|
461
611
|
- [ ] Spec file written to `docs/research/components/<name>.spec.md` with ALL sections filled
|
|
462
|
-
- [ ] Every CSS value in the spec is from `getComputedStyle()`, not estimated
|
|
612
|
+
- [ ] Every CSS value in the spec is from `getComputedStyle()`, not estimated — **verbatim**, including fractional px and color functions
|
|
613
|
+
- [ ] **MCP pixel-perfect pass:** viewports **1440 / 768 / 390**, **100% zoom**, viewport diagnostic recorded; **`getBoundingClientRect()`** and **`::before`/`::after`** captured where they affect layout or visuals
|
|
463
614
|
- [ ] Interaction model is identified and documented (static / click / scroll / time)
|
|
464
615
|
- [ ] For stateful components: every state's content and styles are captured
|
|
465
616
|
- [ ] For scroll-driven components: trigger threshold, before/after styles, and transition are recorded
|
|
466
617
|
- [ ] For hover states: before/after values and transition timing are recorded
|
|
618
|
+
- [ ] 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
|
|
467
619
|
- [ ] All images in the section are identified (including overlays and layered compositions)
|
|
468
|
-
- [ ] Responsive behavior is documented for
|
|
620
|
+
- [ ] Responsive behavior is documented for **1440 / 768 / 390**
|
|
469
621
|
- [ ] Text content is verbatim from the site, not paraphrased
|
|
470
622
|
- [ ] The builder prompt is under ~150 lines of spec; if over, the section needs to be split
|
|
471
623
|
|
|
@@ -483,6 +635,8 @@ These are lessons from previous failed clones — each one cost hours of rework:
|
|
|
483
635
|
- **Don't skip asset extraction.** Without real images, videos, and fonts, the clone will always look fake regardless of how perfect the CSS is.
|
|
484
636
|
- **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.
|
|
485
637
|
- **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.
|
|
638
|
+
- **Don't round or “clean up” extracted values** for Tailwind guesses: `12.8px` stays `12.8px` in the spec unless the clone uses an exactly equivalent value.
|
|
639
|
+
- **Don't mix zoom levels or viewport widths** between reference extraction and QA — you will false-fail or false-pass pixel diffs.
|
|
486
640
|
- **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.
|
|
487
641
|
- **Don't forget smooth scroll libraries.** Check for Lenis (`.lenis` class), Locomotive Scroll, or similar. Default browser scrolling feels noticeably different and the user will spot it immediately.
|
|
488
642
|
- **Don't dispatch builders without a spec file.** The spec file forces exhaustive extraction and creates an auditable artifact. Skipping it means the builder gets whatever you can fit in a prompt from memory.
|
|
@@ -490,6 +644,7 @@ These are lessons from previous failed clones — each one cost hours of rework:
|
|
|
490
644
|
## Completion
|
|
491
645
|
|
|
492
646
|
When done, report:
|
|
647
|
+
- Multi-pass reconnaissance status (`docs/research/DOM_SKETCH.md` present; passes at **1440 / 768 / 390** as needed)
|
|
493
648
|
- Total sections built
|
|
494
649
|
- Total components created
|
|
495
650
|
- Total spec files written (should match components)
|