launchframe 0.4.4 → 0.4.6
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 +121 -133
- package/.claude/skills/launchframe/SKILL.md +121 -133
- package/.codex/skills/launchframe/SKILL.md +121 -133
- package/.continue/commands/launchframe.md +121 -133
- package/.cursor/commands/launchframe.md +121 -133
- package/.gemini/commands/launchframe.toml +121 -133
- package/.github/skills/launchframe/SKILL.md +121 -133
- package/.opencode/commands/launchframe.md +121 -133
- package/.windsurf/workflows/launchframe.md +121 -133
- package/package.json +1 -1
|
@@ -12,7 +12,7 @@ user-invocable: true
|
|
|
12
12
|
1. **Reference URL(s)** — Every `http://` or `https://` token (clone each site; use `docs/research/<hostname>/` when there are multiple).
|
|
13
13
|
2. **SaaS idea** — All remaining text that is not a URL (often quoted): product pitch for hero and key marketing lines.
|
|
14
14
|
|
|
15
|
-
You are a **foreman walking the job site** — write specs per section, dispatch builders in parallel where possible, merge, QA. Not a shallow inspect-then-guess flow.
|
|
15
|
+
You are a **foreman walking the job site** — write specs per section, dispatch builders in parallel where possible, **dispatch verification subagents** after assembly to audit images / DOM / CSS / motion, merge their findings, then QA. Not a shallow inspect-then-guess flow.
|
|
16
16
|
|
|
17
17
|
## Step 0 — Persist Launchframe inputs
|
|
18
18
|
|
|
@@ -26,26 +26,24 @@ Before reconnaissance, write or update:
|
|
|
26
26
|
|
|
27
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
|
-
**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.
|
|
30
|
-
|
|
31
29
|
---
|
|
32
30
|
|
|
33
31
|
## Scope Defaults
|
|
34
32
|
|
|
35
33
|
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:
|
|
36
34
|
|
|
37
|
-
- **Fidelity level:** Pixel-perfect
|
|
35
|
+
- **Fidelity level:** Pixel-perfect — exact match in colors, spacing, typography, animations, **image presentation**, **DOM structure**, and **authored CSS intent** (computed values must match after extraction)
|
|
38
36
|
- **In scope:** Visual layout and styling, component structure and interactions, responsive design, mock data for demo purposes
|
|
39
37
|
- **Out of scope:** Real backend / database, authentication, real-time features, SEO optimization, accessibility audit
|
|
40
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.
|
|
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**.
|
|
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.
|
|
42
40
|
|
|
43
41
|
If the user provides additional instructions (specific fidelity level, customizations, extra context), honor those over the defaults.
|
|
44
42
|
|
|
45
43
|
## Pre-Flight
|
|
46
44
|
|
|
47
|
-
1. **
|
|
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
|
|
45
|
+
1. **Real browser automation is required.** Check for browser MCP tools (Chrome DevTools MCP first, then Playwright MCP, Browserbase MCP, Puppeteer MCP, etc.). **Prefer Chrome DevTools MCP** when it is connected: run **`evaluate_script` / in-page `evaluate`** on the live tab so motion is measured from the same rendering pipeline users see (`getComputedStyle`, Web Animations API, stylesheet keyframes where readable). If multiple tools are available, still use **Chrome MCP for reconnaissance and motion extraction**; other tools are fine for screenshots or navigation if needed. If no browser MCP is detected, ask the user once how to connect Chrome DevTools MCP (or another tool) — this skill cannot run blind. **Motion is first-class:** durations, delays, easings, keyframe curves, scroll/view timelines, and interaction triggers must be **copied from live measurements**, not invented from adjectives like “smooth” or “snappy.”
|
|
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 **Chrome MCP** (preferred) or your connected browser tool.
|
|
49
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.
|
|
50
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>/`.
|
|
51
49
|
5. When working with multiple sites in one command, optionally confirm whether to run them in parallel (recommended, if resources allow) or sequentially to avoid overload.
|
|
@@ -58,12 +56,30 @@ These are the truths that separate a successful clone from a "close enough" mess
|
|
|
58
56
|
|
|
59
57
|
When you traverse the DOM and the Network panel, do **not** treat all nodes equally. Work in this **priority order** so the clone feels like the original, not a wireframe:
|
|
60
58
|
|
|
61
|
-
1. **Images (raster + video stills)
|
|
59
|
+
1. **Images (raster + video stills) — HTML, files, and CSS together** — Enumeration is not enough: the clone must match **how** each asset is mounted and styled.
|
|
60
|
+
- **Markup parity:** Preserve `<picture>` / `<source>` **order**, **`media` / `type`** attributes, and **`sizes`** where the reference uses them; preserve **`srcset`** descriptor patterns (w/x qualifiers) on `<img>` or **equivalent** `next/image` `sizes` + `srcSet` (document the mapping in the spec). Copy **`loading`**, **`decoding`**, **`fetchpriority`**, **`alt`**, **`role`/`aria-*`** when they affect layout or LCP. **`width` / `height`** (or intrinsic aspect + CSS `aspect-ratio`) must stop layout shift the same way as the reference; note **`width`/`height` attributes vs CSS** if both exist.
|
|
61
|
+
- **Box + painting:** Extract and reproduce **`object-fit`**, **`object-position`**, **parent `overflow`**, **clipping `border-radius`**, **masks**, **`filter`**, and **`mix-blend-mode`** on the same stacking context as the live node. **`background-image`** on the element or **`::before` / `::after`** must use the **same** cover/contain behavior, **position**, **size**, **repeat**, and **attachment** (record pseudo-elements explicitly in the spec).
|
|
62
|
+
- **Files:** Download real bytes to `public/images/` (or videos/posters). **Provenance** in spec: URL hash or byte size so verifiers can confirm the correct asset. No “similar” stock swaps unless marked **substitute** per Scope Defaults.
|
|
62
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.
|
|
63
|
-
3. **Motion & animation
|
|
64
|
+
3. **Motion & animation (Chrome MCP)** — Treat this like color and spacing: **numeric fidelity**. In Chrome MCP, evaluate scripts against the live page to capture:
|
|
65
|
+
- Full **`animation`** shorthand plus **`animation-*` longhands** (`animation-name`, `-duration`, `-delay`, `-timing-function`, `-iteration-count`, `-direction`, `-fill-mode`, `-play-state`, **`animation-timeline`** / scroll timelines)
|
|
66
|
+
- Full **`transition`** shorthand plus **`transition-*` longhands**, and **`transform`** / **`will-change`** as applied during and after motion
|
|
67
|
+
- **Author `@keyframes`** — walk `document.styleSheets` / `cssRules` and copy `CSSKeyframesRule` bodies **where the browser exposes them** (same-origin stylesheets). For cross-origin CSS that throws on access, use DevTools **Sources** or fetch the CSS URL and paste the `@keyframes` into the spec — do not guess intermediate keyframe percentages
|
|
68
|
+
- **Web Animations API** — for each moving node, `element.getAnimations({ subtree: false })` and record each effect’s timing (`duration`, `delay`, `easing`, `iterations`, `direction`, `fill`)
|
|
69
|
+
- **Scroll-driven behavior** — exact scroll thresholds (px or intersection ratios), `scroll-snap-*`, and libraries (**Lenis**, **Locomotive Scroll**, etc.) with the same init/wrapper classes the reference uses
|
|
70
|
+
- **`prefers-reduced-motion`** — note whether the site alters or disables motion (evaluate `matchMedia('(prefers-reduced-motion: reduce)')` and compare to a forced reduced-motion emulation if DevTools allows)
|
|
71
|
+
Run the **Phase 1 motion audit script** and merge findings into `docs/research/BEHAVIORS.md`. Capture **numbers** (`ms`, `cubic-bezier(...)`, stagger offsets), not adjectives.
|
|
64
72
|
|
|
65
73
|
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.
|
|
66
74
|
|
|
75
|
+
### 0b. HTML / DOM structure (layout tree, not “vibes”)
|
|
76
|
+
|
|
77
|
+
**Exact** means the **visible layout tree** matches: **section order**, **sibling order**, **wrapper depth** (decorative `div`s, flex rows, grid shells), and **key hooks** (sticky wrappers, scroll containers). React may rename tags **only** if roles/landmarks still reflect the same outline and **computed layout** is unchanged — do not collapse three nested wrappers into one unless the spec proves they are redundant in the reference. Specs must include a short **DOM outline** (indentation sketch or bullet tree) for complex sections so builders and **Phase 6 verifiers** can diff structure.
|
|
78
|
+
|
|
79
|
+
### 0c. CSS fidelity (authored + computed)
|
|
80
|
+
|
|
81
|
+
Tailwind utilities are fine **only** as a transport for **measured** values. Every critical rule must trace back to **`getComputedStyle()`** (or authored sheet text) from Chrome MCP: **no “close” token swaps** (`rounded-lg` when the radius is `10px`, `gap-4` when gap is `18px`) unless values compile to the same pixel output. Prefer arbitrary values (`max-w-[872px]`, `rounded-[10px]`) when shadcn defaults don’t land on the measured number. **Pseudo-elements** and **custom properties** used by the reference must appear in the clone with the same cascade intent.
|
|
82
|
+
|
|
67
83
|
### 1. Completeness Beats Speed
|
|
68
84
|
|
|
69
85
|
Every builder agent must receive **everything** it needs to do its job perfectly: screenshot, exact CSS values, downloaded assets with local paths, real text content, component structure. If a builder has to guess anything — a color, a font size, a padding value — you have failed at extraction. Take the extra minute to extract one more property rather than shipping an incomplete brief.
|
|
@@ -80,8 +96,6 @@ Look at each section and judge its complexity. A simple banner with a heading an
|
|
|
80
96
|
|
|
81
97
|
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.
|
|
82
98
|
|
|
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
|
-
|
|
85
99
|
**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.
|
|
86
100
|
|
|
87
101
|
**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.
|
|
@@ -175,7 +189,7 @@ Extract these from the page before doing anything else:
|
|
|
175
189
|
|
|
176
190
|
This is a dedicated pass AFTER screenshots and BEFORE anything else. Its purpose is to discover every behavior on the page — many of which are invisible in a static screenshot.
|
|
177
191
|
|
|
178
|
-
**Scroll sweep:** Scroll the page slowly from top to bottom via
|
|
192
|
+
**Scroll sweep:** Scroll the page slowly from top to bottom via **Chrome MCP** (real wheel / scroll in the live tab). At each section, pause and observe:
|
|
179
193
|
- Does the header change appearance? Record the scroll position where it triggers.
|
|
180
194
|
- Do elements animate into view? Record which ones and the animation type.
|
|
181
195
|
- Does a sidebar or tab indicator auto-switch as you scroll? Record the mechanism.
|
|
@@ -191,119 +205,86 @@ This is a dedicated pass AFTER screenshots and BEFORE anything else. Its purpose
|
|
|
191
205
|
- Buttons, cards, links, images, nav items
|
|
192
206
|
- Record what changes: color, scale, shadow, underline, opacity
|
|
193
207
|
|
|
194
|
-
**Responsive sweep:** Test at 3 viewport widths via
|
|
208
|
+
**Responsive sweep:** Test at 3 viewport widths via **Chrome MCP**:
|
|
195
209
|
- Desktop: 1440px
|
|
196
210
|
- Tablet: 768px
|
|
197
211
|
- Mobile: 390px
|
|
198
212
|
- At each width, note which sections change layout (column → stack, sidebar disappears, etc.) and at approximately which breakpoint the change occurs.
|
|
199
213
|
|
|
200
|
-
Re-check **all three widths** again in **Phase 5: Visual QA Diff** so tablet regressions are not skipped.
|
|
201
|
-
|
|
202
214
|
Save all findings to `docs/research/BEHAVIORS.md`. This is your behavior bible — reference it when writing every component spec.
|
|
203
215
|
|
|
204
|
-
### Chrome MCP
|
|
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:**
|
|
216
|
+
### Motion & animation — Chrome MCP numeric audit (mandatory)
|
|
209
217
|
|
|
210
|
-
|
|
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
|
+
After the interaction sweeps, run this **once per URL** inside **Chrome DevTools MCP** (page evaluation / `evaluate_script`) and append the JSON under `## Motion audit (Chrome MCP)` in `docs/research/BEHAVIORS.md`. Re-run targeted evaluations on a section container selector if the capped sample misses hero, nav, or carousel motion.
|
|
218
219
|
|
|
219
220
|
```javascript
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
221
|
+
// Motion audit — run via Chrome MCP evaluate_script on the target URL
|
|
222
|
+
(function motionAudit() {
|
|
223
|
+
const props = [
|
|
224
|
+
'animation', 'animationName', 'animationDuration', 'animationDelay',
|
|
225
|
+
'animationTimingFunction', 'animationIterationCount', 'animationDirection',
|
|
226
|
+
'animationFillMode', 'animationPlayState', 'animationTimeline',
|
|
227
|
+
'transition', 'transitionProperty', 'transitionDuration',
|
|
228
|
+
'transitionTimingFunction', 'transitionDelay',
|
|
229
|
+
'transform', 'willChange'
|
|
230
|
+
];
|
|
231
|
+
const animated = [...document.querySelectorAll('*')].filter((el) => {
|
|
232
|
+
const cs = getComputedStyle(el);
|
|
233
|
+
return (
|
|
234
|
+
(cs.animationName && cs.animationName !== 'none') ||
|
|
235
|
+
(cs.transitionProperty && cs.transitionProperty !== 'none' && cs.transitionProperty !== 'all')
|
|
236
|
+
);
|
|
237
|
+
});
|
|
238
|
+
const label = (el) => {
|
|
239
|
+
const tag = el.tagName.toLowerCase();
|
|
240
|
+
const id = el.id ? '#' + el.id : '';
|
|
241
|
+
const cls = el.className && typeof el.className === 'string'
|
|
242
|
+
? '.' + el.className.trim().split(/\s+/).filter(Boolean).slice(0, 4).join('.')
|
|
243
|
+
: '';
|
|
244
|
+
return tag + id + cls;
|
|
240
245
|
};
|
|
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) {
|
|
246
|
+
const samples = animated.slice(0, 100).map((el) => {
|
|
251
247
|
const cs = getComputedStyle(el);
|
|
252
|
-
const
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
.
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
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')
|
|
248
|
+
const row = { path: label(el) };
|
|
249
|
+
props.forEach((p) => { row[p] = cs[p]; });
|
|
250
|
+
try {
|
|
251
|
+
row.webAnimations = el.getAnimations({ subtree: false }).map((a) => {
|
|
252
|
+
const t = a.effect && typeof a.effect.getTiming === 'function' ? a.effect.getTiming() : null;
|
|
253
|
+
return { playState: a.playState, currentTime: a.currentTime, timing: t };
|
|
254
|
+
});
|
|
255
|
+
} catch (e) {
|
|
256
|
+
row.webAnimationsError = String(e);
|
|
257
|
+
}
|
|
258
|
+
return row;
|
|
259
|
+
});
|
|
260
|
+
let keyframes = [];
|
|
261
|
+
try {
|
|
262
|
+
[...document.styleSheets].forEach((sheet, i) => {
|
|
263
|
+
let rules;
|
|
264
|
+
try { rules = sheet.cssRules; } catch { return; }
|
|
265
|
+
if (!rules) return;
|
|
266
|
+
[...rules].forEach((rule) => {
|
|
267
|
+
if (rule.type === CSSRule.KEYFRAMES_RULE) {
|
|
268
|
+
keyframes.push({ sheetIndex: i, name: rule.name, cssText: rule.cssText });
|
|
269
|
+
}
|
|
270
|
+
});
|
|
292
271
|
});
|
|
272
|
+
} catch (e) {
|
|
273
|
+
keyframes = [{ error: String(e), hint: 'Cross-origin stylesheets block cssRules — copy @keyframes from DevTools or fetched CSS.' }];
|
|
293
274
|
}
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
);
|
|
304
|
-
})(''); // Pass section selector string, e.g. 'section.hero', instead of ''
|
|
275
|
+
return JSON.stringify({
|
|
276
|
+
url: location.href,
|
|
277
|
+
prefersReducedMotion: matchMedia('(prefers-reduced-motion: reduce)').matches,
|
|
278
|
+
animatedElementCount: animated.length,
|
|
279
|
+
sampledElements: samples.length,
|
|
280
|
+
samples,
|
|
281
|
+
keyframesRules: keyframes
|
|
282
|
+
}, null, 2);
|
|
283
|
+
})();
|
|
305
284
|
```
|
|
306
285
|
|
|
286
|
+
**Implementation rule:** Component specs and React/CSS must match these **measured** values. If the audit omits an element (cap 100), run a second pass scoped to that section’s root selector.
|
|
287
|
+
|
|
307
288
|
### Page Topology
|
|
308
289
|
Map out every distinct section of the page from top to bottom. Give each a working name. Document:
|
|
309
290
|
- Their visual order
|
|
@@ -375,7 +356,7 @@ For each section, use browser MCP to extract everything:
|
|
|
375
356
|
|
|
376
357
|
1. **Screenshot** the section in isolation (scroll to it, screenshot the viewport). Save to `docs/design-references/`.
|
|
377
358
|
|
|
378
|
-
2. **Extract CSS** for every element in the section. Use the extraction script below — don't hand-measure individual properties. Run it
|
|
359
|
+
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
360
|
|
|
380
361
|
```javascript
|
|
381
362
|
// Per-component extraction — run via browser MCP
|
|
@@ -394,15 +375,13 @@ For each section, use browser MCP to extract everything:
|
|
|
394
375
|
'borderRadius','border','borderTop','borderBottom','borderLeft','borderRight',
|
|
395
376
|
'boxShadow','overflow','overflowX','overflowY',
|
|
396
377
|
'position','top','right','bottom','left','zIndex',
|
|
397
|
-
'opacity','transform','
|
|
398
|
-
'animation','animationName','animationDuration','animationTimingFunction','animationDelay','animationIterationCount','animationDirection','animationFillMode','animationPlayState','animationTimeline','animationRange','viewTimelineName','scrollTimelineName','cursor',
|
|
378
|
+
'opacity','transform','transition','cursor',
|
|
399
379
|
'objectFit','objectPosition','mixBlendMode','filter','backdropFilter',
|
|
400
380
|
'whiteSpace','textOverflow','WebkitLineClamp'
|
|
401
381
|
];
|
|
402
382
|
function extractStyles(element) {
|
|
403
383
|
const cs = getComputedStyle(element);
|
|
404
384
|
const styles = {};
|
|
405
|
-
// Heuristic filter — for layout-audits, re-add any dropped `auto` / `normal` / transparent values the spec calls out as significant
|
|
406
385
|
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; });
|
|
407
386
|
return styles;
|
|
408
387
|
}
|
|
@@ -475,15 +454,6 @@ For each section (or sub-component, if you're breaking it up), create a spec fil
|
|
|
475
454
|
### <Child element N>
|
|
476
455
|
...
|
|
477
456
|
|
|
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
|
-
|
|
487
457
|
## States & Behaviors
|
|
488
458
|
|
|
489
459
|
### <Behavior name, e.g., "Scroll-triggered floating mode">
|
|
@@ -566,34 +536,49 @@ After all sections are built and merged, wire everything together in `src/app/pa
|
|
|
566
536
|
|
|
567
537
|
After assembly, do NOT declare the clone complete. Take side-by-side comparison screenshots:
|
|
568
538
|
|
|
569
|
-
1. Open the original site and your clone side-by-side (or take screenshots at the same viewport widths)
|
|
539
|
+
1. Open the original site and your clone side-by-side (or take screenshots at the same viewport widths) using **Chrome MCP** on both if possible
|
|
570
540
|
2. Compare section by section, top to bottom, at desktop (1440px)
|
|
571
|
-
3. Compare again at
|
|
572
|
-
4.
|
|
573
|
-
5. For each discrepancy found:
|
|
541
|
+
3. Compare again at mobile (390px)
|
|
542
|
+
4. For each discrepancy found:
|
|
574
543
|
- Check the component spec file — was the value extracted correctly?
|
|
575
544
|
- If the spec was wrong: re-extract from browser MCP, update the spec, fix the component
|
|
576
545
|
- If the spec was right but the builder got it wrong: fix the component to match the spec
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
546
|
+
5. Test all interactive behaviors: scroll through the page, click every button/tab, hover over interactive elements
|
|
547
|
+
6. **Motion QA:** Re-run the **motion audit script** (or per-element `getAnimations`) on the reference and spot-check the clone in devtools — **durations, delays, and easing curves must match** (e.g. 320ms vs 300ms is a failure). Re-scroll hero and sticky headers; carousels and scroll-driven sections must trigger at the same thresholds documented in `BEHAVIORS.md`
|
|
548
|
+
|
|
549
|
+
Only after this visual QA pass is the clone ready for **subagent verification**.
|
|
550
|
+
|
|
551
|
+
## Phase 6: Subagent verification pass (mandatory)
|
|
552
|
+
|
|
553
|
+
Foreman self-review is insufficient — **dispatch independent checker agents** (subagents) after Phase 5 to audit the whole surface. Prefer **parallel** runs with **narrow rubrics**. When using multi-agent setups, follow **`AGENTS.md`**: give each subagent its **own git worktree/branch**, then merge after all reports are triaged.
|
|
554
|
+
|
|
555
|
+
**Minimum four verification passes** (one subagent each, or one agent run sequentially if the host limits parallelism):
|
|
556
|
+
|
|
557
|
+
1. **Images & media** — List every image/video poster referenced from `src/` (components, `app/`). Confirm **files exist** under `public/` with **correct paths**; compare presentation to specs: **`picture`/`source` behavior**, **`sizes` / responsive behavior**, **`object-fit` / `object-position`**, dimensions/aspect-ratio, **parent overflow and radius**, **`background-image`** and **pseudo-elements**. Flag wrong crops, missing layers, or lazy `next/image` `fill` misuse.
|
|
558
|
+
2. **HTML / DOM structure** — Diff **PAGE_TOPOLOGY.md** + component specs against the React tree: **section order**, **wrapper count**, **sibling order**, scroll/sticky containers. Any flattened structure that changes stacking or scroll must be **FAIL** until fixed.
|
|
559
|
+
3. **CSS parity** — Spot-check **hero, nav, first fold, footer** (and any section flagged risky) against spec CSS: tokens in **`globals.css`**, arbitrary Tailwind vs measured px, **keyframes** presence. Run **`npm run lint`** and **`npm run typecheck`** inside the verification worktree; failures = **FAIL** until green.
|
|
560
|
+
4. **Motion & interaction** — Re-walk **`docs/research/BEHAVIORS.md`** and motion audit JSON: headers, carousels, scroll-driven UI, smooth-scroll libs. Phase 5 motion QA must be **confirmed**, not assumed.
|
|
580
561
|
|
|
581
|
-
|
|
562
|
+
Each subagent returns **`PASS` or `FAIL`**, a **bullet list** of issues with **`file:line`** pointers, and **suggested fixes**. The foreman **resolves or explicitly documents** every `FAIL` (deferred items listed in the completion report under **Known gaps**). **Do not** declare Launchframe complete until all subagents **`PASS`** or gaps are accepted by the user context.
|
|
582
563
|
|
|
583
564
|
## Pre-Dispatch Checklist
|
|
584
565
|
|
|
585
566
|
Before dispatching ANY builder agent, verify you can check every box. If you can't, go back and extract more.
|
|
586
567
|
|
|
568
|
+
- [ ] **Image markup + styling** captured in spec: `picture`/`source`/`sizes`/`srcset` (or documented `next/image` mapping), `object-fit`/`object-position`, clipping parents, pseudo-element backgrounds if any
|
|
569
|
+
- [ ] **DOM outline** included for non-trivial sections (wrappers, order)
|
|
587
570
|
- [ ] Spec file written to `docs/research/components/<name>.spec.md` with ALL sections filled
|
|
588
571
|
- [ ] Every CSS value in the spec is from `getComputedStyle()`, not estimated
|
|
589
572
|
- [ ] Interaction model is identified and documented (static / click / scroll / time)
|
|
590
573
|
- [ ] For stateful components: every state's content and styles are captured
|
|
591
574
|
- [ ] For scroll-driven components: trigger threshold, before/after styles, and transition are recorded
|
|
592
575
|
- [ ] For hover states: before/after values and transition timing are recorded
|
|
593
|
-
- [ ] Motion
|
|
576
|
+
- [ ] **Motion audit JSON** from Chrome MCP is in `docs/research/BEHAVIORS.md` (`## Motion audit (Chrome MCP)`); follow-up passes exist for any capped/missed selectors
|
|
577
|
+
- [ ] Relevant **`@keyframes`** from the reference appear in `globals.css` or module CSS **verbatim** (or equivalent WAAPI) — not hand-waved
|
|
578
|
+
- [ ] Elements that move via **Web Animations API** have timing cross-checked with `getAnimations` output from Chrome MCP
|
|
594
579
|
- [ ] All images in the section are identified (including overlays and layered compositions)
|
|
595
|
-
- [ ] Responsive behavior is documented for desktop
|
|
596
|
-
- [ ] Text
|
|
580
|
+
- [ ] Responsive behavior is documented for at least desktop and mobile
|
|
581
|
+
- [ ] Text content is verbatim from the site, not paraphrased
|
|
597
582
|
- [ ] The builder prompt is under ~150 lines of spec; if over, the section needs to be split
|
|
598
583
|
|
|
599
584
|
## What NOT to Do
|
|
@@ -612,6 +597,8 @@ These are lessons from previous failed clones — each one cost hours of rework:
|
|
|
612
597
|
- **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.
|
|
613
598
|
- **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.
|
|
614
599
|
- **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.
|
|
600
|
+
- **Don't collapse responsive image markup.** Dropping `<picture>` / `<source media="…">` or `sizes` so “one JPEG is enough” changes which URL loads and breaks fidelity — mirror the reference’s responsive strategy.
|
|
601
|
+
- **Don't guess motion.** If `transition-duration` is 280ms with `cubic-bezier(0.4, 0, 0.2, 1)`, the clone must use those exact values from Chrome MCP — not "about 0.3s ease."
|
|
615
602
|
- **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.
|
|
616
603
|
|
|
617
604
|
## Completion
|
|
@@ -623,4 +610,5 @@ When done, report:
|
|
|
623
610
|
- Total assets downloaded (images, videos, SVGs, fonts)
|
|
624
611
|
- Build status (`npm run build` result)
|
|
625
612
|
- Visual QA results (any remaining discrepancies)
|
|
613
|
+
- **Subagent verification:** which audit passes ran (images / DOM / CSS / motion), **PASS/FAIL** each, and link or paste issue lists; unresolved items under **Known gaps**
|
|
626
614
|
- Any known gaps or limitations
|