launchframe 0.4.9 → 0.4.11

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.
Files changed (35) hide show
  1. package/.amazonq/cli-agents/launchframe.json +1 -1
  2. package/.amazonq/rules/project.md +119 -80
  3. package/.augment/commands/launchframe.md +16 -0
  4. package/.claude/skills/launchframe/SKILL.md +16 -0
  5. package/.clinerules +119 -80
  6. package/.codex/skills/launchframe/SKILL.md +16 -0
  7. package/.continue/commands/launchframe.md +16 -0
  8. package/.continue/rules/project.md +119 -80
  9. package/.cursor/commands/launchframe.md +16 -0
  10. package/.gemini/commands/launchframe.toml +16 -0
  11. package/.github/copilot-instructions.md +119 -80
  12. package/.github/skills/launchframe/SKILL.md +16 -0
  13. package/.gitignore +4 -0
  14. package/.opencode/commands/launchframe.md +16 -0
  15. package/.windsurf/workflows/launchframe.md +16 -0
  16. package/AGENTS.md +2 -2
  17. package/README.md +38 -165
  18. package/bin/launchframe.mjs +380 -380
  19. package/docs/research/INSPECTION_GUIDE.md +117 -78
  20. package/docs/research/example.com/page-inspection/example.com-2026-05-15T21-24-43-488Z/README.txt +16 -0
  21. package/docs/research/example.com/page-inspection/example.com-2026-05-15T21-24-43-488Z/body-outer.html +2 -0
  22. package/docs/research/example.com/page-inspection/example.com-2026-05-15T21-24-43-488Z/capture-meta.json +19 -0
  23. package/docs/research/example.com/page-inspection/example.com-2026-05-15T21-24-43-488Z/document.html +2 -0
  24. package/docs/research/example.com/page-inspection/example.com-2026-05-15T21-24-43-488Z/inline-styles.json +7 -0
  25. package/docs/research/example.com/page-inspection/example.com-2026-05-15T21-24-43-488Z/motion-summary.json +18 -0
  26. package/docs/research/page-captures/example.com-2026-05-15T21-21-31-863Z/README.txt +16 -0
  27. package/docs/research/page-captures/example.com-2026-05-15T21-21-31-863Z/body-outer.html +2 -0
  28. package/docs/research/page-captures/example.com-2026-05-15T21-21-31-863Z/capture-meta.json +19 -0
  29. package/docs/research/page-captures/example.com-2026-05-15T21-21-31-863Z/document.html +2 -0
  30. package/docs/research/page-captures/example.com-2026-05-15T21-21-31-863Z/inline-styles.json +7 -0
  31. package/docs/research/page-captures/example.com-2026-05-15T21-21-31-863Z/motion-summary.json +18 -0
  32. package/package.json +5 -3
  33. package/scripts/page-inspection-dump.mjs +386 -0
  34. package/scripts/sync-agent-rules.sh +88 -88
  35. package/tsconfig.json +34 -34
@@ -2,89 +2,128 @@
2
2
 
3
3
  ## How to Reverse-Engineer Any Website
4
4
 
5
- This guide outlines what to capture when inspecting a target website via Chrome MCP or browser DevTools.
5
+ This guide is the **canonical workflow** when inspecting a target site (Chrome MCP, DevTools, or similar). Execute the steps **in order**: structure and styles establish the blueprint; motion and assets define feel and legality; implementation is always a deliberate rebuild—not a pasted dump.
6
6
 
7
- ## Priority: media, SVGs, and motion (do this early)
7
+ ---
8
8
 
9
- When crawling the DOM and network, **tackle these before fine-tuning copy or spacing**:
9
+ ## Step 1 Structure (DOM hierarchy only)
10
10
 
11
- 1. **Raster imagery** — Every `<img>`, `<picture>` / `source`, `srcset` / `sizes`, CDN URLs, lazy-loaded `data-src`, `loading="lazy"` nodes, **CSS `background-image`** on the element and ancestors (including `::before` / `::after`), masks that use `url()`, `<video>` still / poster frames. Prefer **downloading** originals via scripts or MCP; if a URL is blocked or session-gated, **export a screenshot** of the element’s bounding box at a crisp DPR and store it under `public/images/`, and note the substitute in the spec.
12
- 2. **SVGs** — Inline `<svg>`, `<use>` / sprite sheets, **SVG in CSS** (`mask-image`, `background-image`), favicons as SVG, logo marks. Prefer extracting path/viewBox into React components or static files under `public/` — **recreate** from a screenshot/trace only when the markup is obfuscated or blocked.
13
- 3. **Motion & animation** — Inspect Styles for `animation`, `animation-name`, `animation-timeline`, `transition`, `transform`, `@keyframes`; check for libraries (Framer Motion, GSAP, Lottie, Lenis). Capture **durations, easings, delays, fill-modes**, scroll/view triggers, and `prefers-reduced-motion` handling. Motion often defines perceived quality — do not leave it as an afterthought.
11
+ Treat HTML as a **map of hierarchy**, not as shippable source code.
14
12
 
15
- Then continue with typography, spacing, and component structure as usual.
13
+ - **DevTools limitation:** Copying `<head>` and `<body>` with “Copy Copy outerHTML” gives **one frozen snapshot**. It omits most **stylesheet and script** behavior and may inline classes whose meaning lives in external bundles.
14
+ - **What to extract anyway:** Landmark regions, heading levels, nesting (sections → rows → cards), repeated patterns, form fields, navigation trees, semantic roles.
15
+ - **What not to do:** Do not paste a single giant HTML file into production or assume it reproduces routing, hydration, or data fetching.
16
16
 
17
- ## Phase 1: Visual Audit
17
+ ### Component & layout checklist (supports Step 1)
18
+
19
+ **Component inventory** — For each distinct UI block, capture:
18
20
 
19
- ### Screenshots to Capture
20
- - [ ] Every distinct page — desktop, tablet, mobile
21
- - [ ] Dark mode variants (if applicable)
22
- - [ ] Light mode variants (if applicable)
23
- - [ ] Key interaction states (hover, active, open menus, modals)
24
- - [ ] Loading/skeleton states
25
- - [ ] Empty states
26
- - [ ] Error states
27
-
28
- ### Design Tokens to Extract
29
- - [ ] **Colors** — background, text (primary/secondary/muted), accent, border, hover, error, success, warning
30
- - [ ] **Typography** — font family, sizes (h1-h6, body, caption, label), weights, line heights, letter spacing
31
- - [ ] **Spacing** — padding/margin patterns (look for a scale: 4px, 8px, 12px, 16px, 24px, 32px, etc.)
32
- - [ ] **Border radius** — buttons, cards, avatars, inputs
33
- - [ ] **Shadows/elevation** — card shadows, dropdown shadows, modal overlay
34
- - [ ] **Breakpoints** — when does the layout shift? (inspect with DevTools responsive mode)
35
- - [ ] **Icons** — which icon library? custom SVGs? sizes?
36
- - [ ] **Avatars** — sizes, shapes, fallback behavior
37
- - [ ] **Buttons** — all variants (primary, secondary, ghost, icon-only, danger)
38
- - [ ] **Inputs** — text fields, textareas, selects, checkboxes, toggles
39
-
40
- ## Phase 2: Component Inventory
41
-
42
- For each distinct UI component, document:
43
21
  1. **Name** — what would you call this component?
44
- 2. **Structure** — what HTML elements / child components does it contain?
45
- 3. **Variants** — does it have different sizes, colors, or states?
22
+ 2. **Structure** — HTML elements / child components and order
23
+ 3. **Variants** — sizes, tones, densities
46
24
  4. **States** — default, hover, active, disabled, loading, error, empty
47
- 5. **Responsive behavior** — how does it change at different breakpoints?
48
- 6. **Interactions** — click, hover, focus, keyboard navigation
49
- 7. **Animations** — transitions, entrance/exit animations, micro-interactions
50
-
51
- ### Common Components to Look For
52
- - Navigation (top bar, sidebar, bottom bar)
53
- - Cards / list items
54
- - Buttons and links
55
- - Forms and inputs
56
- - Modals and dialogs
57
- - Dropdowns and menus
58
- - Tabs and segmented controls
59
- - Avatars and user badges
60
- - Loading skeletons
61
- - Toast notifications
62
- - Tooltips and popovers
63
-
64
- ## Phase 3: Layout Architecture
65
-
66
- - [ ] **Grid system** — CSS Grid? Flexbox? Fixed widths?
67
- - [ ] **Column layout** — how many columns at each breakpoint?
68
- - [ ] **Max-width** main content area max-width
69
- - [ ] **Sticky elements** — header, sidebar, floating buttons
70
- - [ ] **Z-index layers** navigation, modals, tooltips, overlays
71
- - [ ] **Scroll behavior** — infinite scroll, pagination, virtual scrolling
72
-
73
- ## Phase 4: Technical Stack Analysis
74
-
75
- - [ ] **Framework** — React? Vue? Angular? Check `__NEXT_DATA__`, `__NUXT__`, `ng-version`
76
- - [ ] **CSS approach** — Tailwind (utility classes), CSS Modules, Styled Components, Emotion, vanilla CSS
77
- - [ ] **State management** — Redux (check DevTools), React Query, Zustand, Pinia
78
- - [ ] **API patterns** — REST, GraphQL (check network tab for `/graphql` requests)
79
- - [ ] **Font loading** — Google Fonts, self-hosted, system fonts
80
- - [ ] **Image strategy** — CDN, lazy loading, srcset, WebP/AVIF
81
- - [ ] **Animation library** — Framer Motion, GSAP, CSS transitions only
82
-
83
- ## Phase 5: Documentation Output
84
-
85
- After inspection, create these files in `docs/research/`:
86
- 1. `DESIGN_TOKENS.md` All extracted colors, typography, spacing
87
- 2. `COMPONENT_INVENTORY.md`Every component with structure notes
88
- 3. `LAYOUT_ARCHITECTURE.md` — Page layouts, grid system, responsive behavior
89
- 4. `INTERACTION_PATTERNS.md` — Animations, transitions, hover states
90
- 5. `TECH_STACK_ANALYSIS.md` — What the site uses and our chosen equivalents
25
+ 5. **Responsive behavior** — changes per breakpoint
26
+ 6. **Interactions** — click, hover, focus, keyboard
27
+
28
+ **Layout architecture**
29
+
30
+ - [ ] **Grid vs flex** — primary layout mechanism
31
+ - [ ] **Columns** — count per breakpoint
32
+ - [ ] **Max-width** — content well width
33
+ - [ ] **Sticky / fixed** — header, sidebars, floating CTAs
34
+ - [ ] **Z-index layers** — nav, overlays, tooltips
35
+ - [ ] **Scroll model** — normal, infinite, virtual lists, snap
36
+
37
+ **Screenshots** (tie each shot to a section in the hierarchy)
38
+
39
+ - [ ] Every distinct page — desktop, tablet, mobile
40
+ - [ ] Theme variants (light / dark if applicable)
41
+ - [ ] Hover, active, menus open, modals
42
+ - [ ] Loading / skeleton / empty / error states
43
+
44
+ ---
45
+
46
+ ## Step 2Styles (computed appearance + real CSS)
47
+
48
+ Rendered look comes from **CSS** (linked files, injected `<style>` blocks, build output)—not from raw element copy alone.
49
+
50
+ - **Per-element:** In DevTools **Styles** / **Computed**, capture what matters for fidelity: typography, spacing, colors, borders, shadows, breakpoints where rules change.
51
+ - **Global:** From **Sources** or **Network**, identify main stylesheets / CSS chunks; note filenames or URLs for the agents or scripts that will mirror tokens.
52
+ - **Design tokens to extract**
53
+
54
+ - [ ] **Colors** — background, text (primary / secondary / muted), accent, border, hover / focus, semantic (error, success, warning)
55
+ - [ ] **Typography** — families, scale (h1–h6, body, captions), weights, line-height, letter-spacing
56
+ - [ ] **Spacing** — padding/margin rhythm (e.g. 4/8/12/16…)
57
+ - [ ] **Radius & elevation** — cards, buttons, inputs, overlays
58
+ - [ ] **Breakpoints** — layout shifts (responsive mode)
59
+ - [ ] **Icons & avatars** — sizes, masks, fallbacks
60
+
61
+ **Technical CSS context** (informs Tailwind mapping)
62
+
63
+ - [ ] **CSS approach** utilities vs modules vs styled components vs vanilla
64
+ - [ ] **Fonts** Google, self-hosted, system stacks
65
+ - [ ] **Image CSS** `object-fit`, `aspect-ratio`, background layers
66
+
67
+ ---
68
+
69
+ ## Step 3 — Motion (what moves and how)
70
+
71
+ Motion is rarely recoverable from HTML copy; it lives in **CSS animations/transitions** and often **JavaScript** (scroll, gestures, carousel timing).
72
+
73
+ - **Catalog behaviors:** Entrance, hover, focus, drag, scroll-linked, carousel stagger, modal open/close, page transitions.
74
+ - **From Styles / Sources:** `animation-*`, `@keyframes`, `transition`, `transform`, `will-change`; note **duration, easing, delay, fill-mode**.
75
+ - **Libraries:** Identify Framer Motion, GSAP, Lottie, Lenis, CSS-only, etc.
76
+ - **Accessibility:** Note `prefers-reduced-motion` behavior if present.
77
+
78
+ **Priority reminder:** Capture **motion early** alongside media—perceived polish depends on it; do not leave it until the end.
79
+
80
+ ---
81
+
82
+ ## Step 4 — Assets (permission-neutral bytes + originals where required)
83
+
84
+ **Early capture**
85
+
86
+ 1. **Raster imagery** — `<img>`, `<picture>` / `<source>`, `srcset` / `sizes`, CDN URLs, lazy `data-src`, `loading="lazy"`, **`background-image`** on elements and ancestors (including `::before` / `::after`), masks using `url()`, video posters / stills.
87
+ 2. **SVGs** — Inline `<svg>`, `<use>` / sprites, **SVG in CSS** (`mask-image`, backgrounds), favicons. Prefer extracting path/viewBox into React components or files under `public/` — recreate from screenshot/trace only when markup is blocked or obfuscated.
88
+ 3. **Brand-safe slots** — **Marketing photos and illustrative hero/feature art** must not be photocopied when policy requires originality: ship **committed** files under `public/images/` (etc.), generated for **your** product idea; document paths in `docs/research/LAUNCHFRAME.md`. Blank placeholders are unfinished.
89
+ 4. **Fallbacks** — If URLs are gated, export a crisp screenshot of the element’s box (note DPR) and record the substitution in research notes.
90
+
91
+ **Technical**
92
+
93
+ - [ ] CDN vs origin paths
94
+ - [ ] Lazy loading and responsive image strategy
95
+
96
+ ---
97
+
98
+ ## Step 5 — Implementation (Next.js + components)
99
+
100
+ Rebuild deliberately in **this template’s stack** (Next.js App Router, React, TypeScript strict, shadcn/ui, Tailwind v4).
101
+
102
+ - **Do:** Small composable components, shared tokens, `cn()`, extracted icons in `src/components/icons.tsx` (or adjacent), routes under `src/app/`.
103
+ - **Don’t:** Ship one monolithic HTML string as the app or skip TypeScript/component boundaries.
104
+
105
+ ### Stack parity (helps choose libraries)
106
+
107
+ - [ ] **Framework signals** — e.g. `__NEXT_DATA__`, `__NUXT__`, `ng-version`
108
+ - [ ] **State / data** — REST, GraphQL, client stores (infer from Network)
109
+ - [ ] **Animation stack** — match or approximate with CSS or an approved motion library
110
+
111
+ ### Documentation output (`docs/research/`)
112
+
113
+ After inspection, produce durable notes:
114
+
115
+ 1. `DESIGN_TOKENS.md` — colors, typography, spacing, radius, shadows
116
+ 2. `COMPONENT_INVENTORY.md` — components with structure and states
117
+ 3. `LAYOUT_ARCHITECTURE.md` — grids, breakpoints, sticky layers
118
+ 4. `INTERACTION_PATTERNS.md` — motion, transitions, hover/focus
119
+ 5. `TECH_STACK_ANALYSIS.md` — source stack vs chosen equivalents
120
+
121
+ ### Common components to hunt for
122
+
123
+ Navigation (top/side/bottom), cards, buttons, links, forms, modals, menus, tabs, avatars/badges, skeletons, toasts, tooltips/popovers.
124
+
125
+ ---
126
+
127
+ ## Reference: Chrome MCP / agent crawl habits
128
+
129
+ Walk the DOM and network **top-down**. When multiple agents collaborate, reconcile tokens and animation specs in shared research files so Step 5 does not drift. For **`/launchframe`**, tie findings to `launchframe.context.json` and `docs/research/LAUNCHFRAME.md` per project conventions.
@@ -0,0 +1,16 @@
1
+ LaunchFrame page inspection capture
2
+ ====================================
3
+ Source: https://example.com/
4
+
5
+ Files:
6
+ document.html — Full <html> outerHTML after JS (attach this for an agent)
7
+ body-outer.html — <body> outerHTML only (smaller)
8
+ inline-styles.json — All inline <style> tag contents
9
+ motion-summary.json— @keyframes + animation/transition-related lines
10
+ capture-meta.json — Viewport, stylesheet URLs, <script> inventory
11
+ *.css — Stylesheets observed on the network (unless --no-css-files)
12
+
13
+ Notes:
14
+ • Some sites lazy-load CSS; use --scroll-full to force more requests.
15
+ • Cross-origin styles you cannot access via JS are still captured here if the browser downloaded them.
16
+ • Motion inside bundled JS (not CSS) is not fully extracted—check script src in capture-meta.json.
@@ -0,0 +1,2 @@
1
+ <body><div><h1>Example Domain</h1><p>This domain is for use in documentation examples without needing permission. Avoid use in operations.</p><p><a href="https://iana.org/domains/example">Learn more</a></p></div>
2
+ </body>
@@ -0,0 +1,19 @@
1
+ {
2
+ "sourceUrl": "https://example.com/",
3
+ "generatedAt": "2026-05-15T21:24:44.058Z",
4
+ "viewport": {
5
+ "width": 1440,
6
+ "height": 900
7
+ },
8
+ "waitUntil": "domcontentloaded",
9
+ "options": {
10
+ "scrollFull": false,
11
+ "wroteCssFiles": true
12
+ },
13
+ "outputs": {
14
+ "documentHtmlBytes": 513,
15
+ "bodyOuterHtmlBytes": 220,
16
+ "networkStylesheets": []
17
+ },
18
+ "scripts": []
19
+ }
@@ -0,0 +1,2 @@
1
+ <html lang="en"><head><title>Example Domain</title><meta name="viewport" content="width=device-width, initial-scale=1"><style>body{background:#eee;width:60vw;margin:15vh auto;font-family:system-ui,sans-serif}h1{font-size:1.5em}div{opacity:0.8}a:link,a:visited{color:#348}</style></head><body><div><h1>Example Domain</h1><p>This domain is for use in documentation examples without needing permission. Avoid use in operations.</p><p><a href="https://iana.org/domains/example">Learn more</a></p></div>
2
+ </body></html>
@@ -0,0 +1,7 @@
1
+ [
2
+ {
3
+ "index": 0,
4
+ "media": "",
5
+ "text": "body{background:#eee;width:60vw;margin:15vh auto;font-family:system-ui,sans-serif}h1{font-size:1.5em}div{opacity:0.8}a:link,a:visited{color:#348}"
6
+ }
7
+ ]
@@ -0,0 +1,18 @@
1
+ {
2
+ "sourceUrl": "https://example.com/",
3
+ "generatedAt": "2026-05-15T21:24:44.057Z",
4
+ "viewport": {
5
+ "width": 1440,
6
+ "height": 900
7
+ },
8
+ "counts": {
9
+ "keyframeRules": 0,
10
+ "motionRelatedLines": 0,
11
+ "inlineStyleTags": 1,
12
+ "networkStylesheets": 0,
13
+ "scriptElements": 0
14
+ },
15
+ "keyframes": [],
16
+ "motionLinesSample": [],
17
+ "motionLinesTotal": 0
18
+ }
@@ -0,0 +1,16 @@
1
+ LaunchFrame page inspection capture
2
+ ====================================
3
+ Source: https://example.com/
4
+
5
+ Files:
6
+ document.html — Full <html> outerHTML after JS (attach this for an agent)
7
+ body-outer.html — <body> outerHTML only (smaller)
8
+ inline-styles.json — All inline <style> tag contents
9
+ motion-summary.json— @keyframes + animation/transition-related lines
10
+ capture-meta.json — Viewport, stylesheet URLs, <script> inventory
11
+ *.css — Stylesheets observed on the network (unless --no-css-files)
12
+
13
+ Notes:
14
+ • Some sites lazy-load CSS; use --scroll-full to force more requests.
15
+ • Cross-origin styles you cannot access via JS are still captured here if the browser downloaded them.
16
+ • Motion inside bundled JS (not CSS) is not fully extracted—check script src in capture-meta.json.
@@ -0,0 +1,2 @@
1
+ <body><div><h1>Example Domain</h1><p>This domain is for use in documentation examples without needing permission. Avoid use in operations.</p><p><a href="https://iana.org/domains/example">Learn more</a></p></div>
2
+ </body>
@@ -0,0 +1,19 @@
1
+ {
2
+ "sourceUrl": "https://example.com/",
3
+ "generatedAt": "2026-05-15T21:21:39.771Z",
4
+ "viewport": {
5
+ "width": 1440,
6
+ "height": 900
7
+ },
8
+ "waitUntil": "domcontentloaded",
9
+ "options": {
10
+ "scrollFull": false,
11
+ "wroteCssFiles": true
12
+ },
13
+ "outputs": {
14
+ "documentHtmlBytes": 513,
15
+ "bodyOuterHtmlBytes": 220,
16
+ "networkStylesheets": []
17
+ },
18
+ "scripts": []
19
+ }
@@ -0,0 +1,2 @@
1
+ <html lang="en"><head><title>Example Domain</title><meta name="viewport" content="width=device-width, initial-scale=1"><style>body{background:#eee;width:60vw;margin:15vh auto;font-family:system-ui,sans-serif}h1{font-size:1.5em}div{opacity:0.8}a:link,a:visited{color:#348}</style></head><body><div><h1>Example Domain</h1><p>This domain is for use in documentation examples without needing permission. Avoid use in operations.</p><p><a href="https://iana.org/domains/example">Learn more</a></p></div>
2
+ </body></html>
@@ -0,0 +1,7 @@
1
+ [
2
+ {
3
+ "index": 0,
4
+ "media": "",
5
+ "text": "body{background:#eee;width:60vw;margin:15vh auto;font-family:system-ui,sans-serif}h1{font-size:1.5em}div{opacity:0.8}a:link,a:visited{color:#348}"
6
+ }
7
+ ]
@@ -0,0 +1,18 @@
1
+ {
2
+ "sourceUrl": "https://example.com/",
3
+ "generatedAt": "2026-05-15T21:21:39.770Z",
4
+ "viewport": {
5
+ "width": 1440,
6
+ "height": 900
7
+ },
8
+ "counts": {
9
+ "keyframeRules": 0,
10
+ "motionRelatedLines": 0,
11
+ "inlineStyleTags": 1,
12
+ "networkStylesheets": 0,
13
+ "scriptElements": 0
14
+ },
15
+ "keyframes": [],
16
+ "motionLinesSample": [],
17
+ "motionLinesTotal": 0
18
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "launchframe",
3
- "version": "0.4.9",
3
+ "version": "0.4.11",
4
4
  "private": false,
5
5
  "description": "Scaffold a Next.js app from a reference URL plus your SaaS idea — AI-ready website cloning",
6
6
  "author": "JCodesMore",
@@ -72,7 +72,8 @@
72
72
  "start": "next start",
73
73
  "lint": "eslint",
74
74
  "typecheck": "tsc --noEmit",
75
- "check": "npm run lint && npm run typecheck && npm run build"
75
+ "check": "npm run lint && npm run typecheck && npm run build",
76
+ "inspect:page": "node scripts/page-inspection-dump.mjs"
76
77
  },
77
78
  "dependencies": {
78
79
  "@base-ui/react": "^1.3.0",
@@ -94,6 +95,7 @@
94
95
  "eslint": "^9",
95
96
  "eslint-config-next": "16.2.1",
96
97
  "tailwindcss": "^4",
97
- "typescript": "^5"
98
+ "typescript": "^5",
99
+ "playwright": "^1.57.0"
98
100
  }
99
101
  }