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.
- package/.amazonq/cli-agents/launchframe.json +1 -1
- package/.amazonq/rules/project.md +119 -80
- package/.augment/commands/launchframe.md +16 -0
- package/.claude/skills/launchframe/SKILL.md +16 -0
- package/.clinerules +119 -80
- package/.codex/skills/launchframe/SKILL.md +16 -0
- package/.continue/commands/launchframe.md +16 -0
- package/.continue/rules/project.md +119 -80
- package/.cursor/commands/launchframe.md +16 -0
- package/.gemini/commands/launchframe.toml +16 -0
- package/.github/copilot-instructions.md +119 -80
- package/.github/skills/launchframe/SKILL.md +16 -0
- package/.gitignore +4 -0
- package/.opencode/commands/launchframe.md +16 -0
- package/.windsurf/workflows/launchframe.md +16 -0
- package/AGENTS.md +2 -2
- package/README.md +38 -165
- package/bin/launchframe.mjs +380 -380
- package/docs/research/INSPECTION_GUIDE.md +117 -78
- package/docs/research/example.com/page-inspection/example.com-2026-05-15T21-24-43-488Z/README.txt +16 -0
- package/docs/research/example.com/page-inspection/example.com-2026-05-15T21-24-43-488Z/body-outer.html +2 -0
- package/docs/research/example.com/page-inspection/example.com-2026-05-15T21-24-43-488Z/capture-meta.json +19 -0
- package/docs/research/example.com/page-inspection/example.com-2026-05-15T21-24-43-488Z/document.html +2 -0
- package/docs/research/example.com/page-inspection/example.com-2026-05-15T21-24-43-488Z/inline-styles.json +7 -0
- package/docs/research/example.com/page-inspection/example.com-2026-05-15T21-24-43-488Z/motion-summary.json +18 -0
- package/docs/research/page-captures/example.com-2026-05-15T21-21-31-863Z/README.txt +16 -0
- package/docs/research/page-captures/example.com-2026-05-15T21-21-31-863Z/body-outer.html +2 -0
- package/docs/research/page-captures/example.com-2026-05-15T21-21-31-863Z/capture-meta.json +19 -0
- package/docs/research/page-captures/example.com-2026-05-15T21-21-31-863Z/document.html +2 -0
- package/docs/research/page-captures/example.com-2026-05-15T21-21-31-863Z/inline-styles.json +7 -0
- package/docs/research/page-captures/example.com-2026-05-15T21-21-31-863Z/motion-summary.json +18 -0
- package/package.json +5 -3
- package/scripts/page-inspection-dump.mjs +386 -0
- package/scripts/sync-agent-rules.sh +88 -88
- package/tsconfig.json +34 -34
|
@@ -10,7 +10,7 @@ This version has breaking changes — APIs, conventions, and file structure may
|
|
|
10
10
|
# Website Reverse-Engineer Template
|
|
11
11
|
|
|
12
12
|
## What This Is
|
|
13
|
-
A reusable template for reverse-engineering any website into a clean, modern Next.js codebase using AI coding agents. The Next.js + shadcn/ui + Tailwind v4 base is pre-scaffolded — use **`/launchframe <url> "saas idea"`** for the full pixel-perfect clone plus SaaS landing copy (`src/lib/launchframe-config.ts`, `launchframe.context.json`, `docs/research/LAUNCHFRAME.md`). For a **new empty folder** only, **`npx launchframe@latest`** unpacks this template; then run **`/launchframe`** in that project with your URL and pitch.
|
|
13
|
+
A reusable template for reverse-engineering any website into a clean, modern Next.js codebase using AI coding agents. The Next.js + shadcn/ui + Tailwind v4 base is pre-scaffolded — use **`/launchframe <url> "saas idea"`** for the full pixel-perfect clone plus SaaS landing copy (`src/lib/launchframe-config.ts`, `launchframe.context.json`, `docs/research/LAUNCHFRAME.md`). The agent executing **`/launchframe`** must follow **Step 0a** in that command: run **`npm run inspect:page`** once per reference URL (Playwright: `document.html`, network CSS, `motion-summary.json`) before Phase 1. For a **new empty folder** only, **`npx launchframe@latest`** unpacks this template; then run **`/launchframe`** in that project with your URL and pitch.
|
|
14
14
|
|
|
15
15
|
## Tech Stack
|
|
16
16
|
- **Framework:** Next.js 16 (App Router, React 19, TypeScript strict)
|
|
@@ -38,7 +38,7 @@ A reusable template for reverse-engineering any website into a clean, modern Nex
|
|
|
38
38
|
- **No personal aesthetic changes during emulation phase** — match 1:1 first, customize later
|
|
39
39
|
- **Real content** — use actual text and assets from the target site where they are interchangeable chrome; **`/launchframe`** overlays your SaaS pitch on headings and CTAs. **Marketing photographs and illustrative hero/feature imagery are not photocopied**: you **must** ship **committed files** under `public/images/` (etc.) for every such slot — **generate them yourself** with your host **image-generation** tool (prompts tied to the SaaS idea), wire into components, supplement with UI mock composites only if helpful. Blank placeholders count as unfinished. Record paths in `docs/research/LAUNCHFRAME.md`
|
|
40
40
|
- **Beauty-first** — every pixel matters
|
|
41
|
-
- **DOM
|
|
41
|
+
- **Inspection workflow (canonical)** — Follow the ordered **five steps** in `docs/research/INSPECTION_GUIDE.md`: (1) **Structure** — DOM as hierarchy reference, not pasted production HTML; (2) **Styles** — Computed/stylesheets and tokens; (3) **Motion** — `@keyframes`, transitions, timings, triggers; (4) **Assets** — rasters/SVGs with brand-safe originals for marketing slots when required; (5) **Implementation** — Next.js components rebuild. Within crawls (Chrome MCP / DevTools), still emphasize **images** (raster, responsive sources, CSS backgrounds), **SVGs** (inline, sprites, masks — **exact geometry**, not unrelated Lucide stand-ins), then **motion fidelity**. **Measure and mirror** from the DOM; scrape **permission-neutral** bytes when appropriate — **SVG and animation fidelity are not waived** when rasters are replaced
|
|
42
42
|
|
|
43
43
|
## Project Structure
|
|
44
44
|
```
|
|
@@ -71,89 +71,128 @@ scripts/ # Asset download scripts
|
|
|
71
71
|
|
|
72
72
|
## How to Reverse-Engineer Any Website
|
|
73
73
|
|
|
74
|
-
This guide
|
|
74
|
+
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.
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
---
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
## Step 1 — Structure (DOM hierarchy only)
|
|
79
79
|
|
|
80
|
-
|
|
81
|
-
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.
|
|
82
|
-
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.
|
|
80
|
+
Treat HTML as a **map of hierarchy**, not as shippable source code.
|
|
83
81
|
|
|
84
|
-
|
|
82
|
+
- **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.
|
|
83
|
+
- **What to extract anyway:** Landmark regions, heading levels, nesting (sections → rows → cards), repeated patterns, form fields, navigation trees, semantic roles.
|
|
84
|
+
- **What not to do:** Do not paste a single giant HTML file into production or assume it reproduces routing, hydration, or data fetching.
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
### Component & layout checklist (supports Step 1)
|
|
87
|
+
|
|
88
|
+
**Component inventory** — For each distinct UI block, capture:
|
|
87
89
|
|
|
88
|
-
### Screenshots to Capture
|
|
89
|
-
- [ ] Every distinct page — desktop, tablet, mobile
|
|
90
|
-
- [ ] Dark mode variants (if applicable)
|
|
91
|
-
- [ ] Light mode variants (if applicable)
|
|
92
|
-
- [ ] Key interaction states (hover, active, open menus, modals)
|
|
93
|
-
- [ ] Loading/skeleton states
|
|
94
|
-
- [ ] Empty states
|
|
95
|
-
- [ ] Error states
|
|
96
|
-
|
|
97
|
-
### Design Tokens to Extract
|
|
98
|
-
- [ ] **Colors** — background, text (primary/secondary/muted), accent, border, hover, error, success, warning
|
|
99
|
-
- [ ] **Typography** — font family, sizes (h1-h6, body, caption, label), weights, line heights, letter spacing
|
|
100
|
-
- [ ] **Spacing** — padding/margin patterns (look for a scale: 4px, 8px, 12px, 16px, 24px, 32px, etc.)
|
|
101
|
-
- [ ] **Border radius** — buttons, cards, avatars, inputs
|
|
102
|
-
- [ ] **Shadows/elevation** — card shadows, dropdown shadows, modal overlay
|
|
103
|
-
- [ ] **Breakpoints** — when does the layout shift? (inspect with DevTools responsive mode)
|
|
104
|
-
- [ ] **Icons** — which icon library? custom SVGs? sizes?
|
|
105
|
-
- [ ] **Avatars** — sizes, shapes, fallback behavior
|
|
106
|
-
- [ ] **Buttons** — all variants (primary, secondary, ghost, icon-only, danger)
|
|
107
|
-
- [ ] **Inputs** — text fields, textareas, selects, checkboxes, toggles
|
|
108
|
-
|
|
109
|
-
## Phase 2: Component Inventory
|
|
110
|
-
|
|
111
|
-
For each distinct UI component, document:
|
|
112
90
|
1. **Name** — what would you call this component?
|
|
113
|
-
2. **Structure** —
|
|
114
|
-
3. **Variants** —
|
|
91
|
+
2. **Structure** — HTML elements / child components and order
|
|
92
|
+
3. **Variants** — sizes, tones, densities
|
|
115
93
|
4. **States** — default, hover, active, disabled, loading, error, empty
|
|
116
|
-
5. **Responsive behavior** —
|
|
117
|
-
6. **Interactions** — click, hover, focus, keyboard
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
-
|
|
122
|
-
-
|
|
123
|
-
-
|
|
124
|
-
-
|
|
125
|
-
-
|
|
126
|
-
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
-
|
|
131
|
-
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
- [ ] **
|
|
146
|
-
- [ ] **
|
|
147
|
-
- [ ] **
|
|
148
|
-
- [ ] **
|
|
149
|
-
- [ ] **
|
|
150
|
-
- [ ] **
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
94
|
+
5. **Responsive behavior** — changes per breakpoint
|
|
95
|
+
6. **Interactions** — click, hover, focus, keyboard
|
|
96
|
+
|
|
97
|
+
**Layout architecture**
|
|
98
|
+
|
|
99
|
+
- [ ] **Grid vs flex** — primary layout mechanism
|
|
100
|
+
- [ ] **Columns** — count per breakpoint
|
|
101
|
+
- [ ] **Max-width** — content well width
|
|
102
|
+
- [ ] **Sticky / fixed** — header, sidebars, floating CTAs
|
|
103
|
+
- [ ] **Z-index layers** — nav, overlays, tooltips
|
|
104
|
+
- [ ] **Scroll model** — normal, infinite, virtual lists, snap
|
|
105
|
+
|
|
106
|
+
**Screenshots** (tie each shot to a section in the hierarchy)
|
|
107
|
+
|
|
108
|
+
- [ ] Every distinct page — desktop, tablet, mobile
|
|
109
|
+
- [ ] Theme variants (light / dark if applicable)
|
|
110
|
+
- [ ] Hover, active, menus open, modals
|
|
111
|
+
- [ ] Loading / skeleton / empty / error states
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Step 2 — Styles (computed appearance + real CSS)
|
|
116
|
+
|
|
117
|
+
Rendered look comes from **CSS** (linked files, injected `<style>` blocks, build output)—not from raw element copy alone.
|
|
118
|
+
|
|
119
|
+
- **Per-element:** In DevTools **Styles** / **Computed**, capture what matters for fidelity: typography, spacing, colors, borders, shadows, breakpoints where rules change.
|
|
120
|
+
- **Global:** From **Sources** or **Network**, identify main stylesheets / CSS chunks; note filenames or URLs for the agents or scripts that will mirror tokens.
|
|
121
|
+
- **Design tokens to extract**
|
|
122
|
+
|
|
123
|
+
- [ ] **Colors** — background, text (primary / secondary / muted), accent, border, hover / focus, semantic (error, success, warning)
|
|
124
|
+
- [ ] **Typography** — families, scale (h1–h6, body, captions), weights, line-height, letter-spacing
|
|
125
|
+
- [ ] **Spacing** — padding/margin rhythm (e.g. 4/8/12/16…)
|
|
126
|
+
- [ ] **Radius & elevation** — cards, buttons, inputs, overlays
|
|
127
|
+
- [ ] **Breakpoints** — layout shifts (responsive mode)
|
|
128
|
+
- [ ] **Icons & avatars** — sizes, masks, fallbacks
|
|
129
|
+
|
|
130
|
+
**Technical CSS context** (informs Tailwind mapping)
|
|
131
|
+
|
|
132
|
+
- [ ] **CSS approach** — utilities vs modules vs styled components vs vanilla
|
|
133
|
+
- [ ] **Fonts** — Google, self-hosted, system stacks
|
|
134
|
+
- [ ] **Image CSS** — `object-fit`, `aspect-ratio`, background layers
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## Step 3 — Motion (what moves and how)
|
|
139
|
+
|
|
140
|
+
Motion is rarely recoverable from HTML copy; it lives in **CSS animations/transitions** and often **JavaScript** (scroll, gestures, carousel timing).
|
|
141
|
+
|
|
142
|
+
- **Catalog behaviors:** Entrance, hover, focus, drag, scroll-linked, carousel stagger, modal open/close, page transitions.
|
|
143
|
+
- **From Styles / Sources:** `animation-*`, `@keyframes`, `transition`, `transform`, `will-change`; note **duration, easing, delay, fill-mode**.
|
|
144
|
+
- **Libraries:** Identify Framer Motion, GSAP, Lottie, Lenis, CSS-only, etc.
|
|
145
|
+
- **Accessibility:** Note `prefers-reduced-motion` behavior if present.
|
|
146
|
+
|
|
147
|
+
**Priority reminder:** Capture **motion early** alongside media—perceived polish depends on it; do not leave it until the end.
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## Step 4 — Assets (permission-neutral bytes + originals where required)
|
|
152
|
+
|
|
153
|
+
**Early capture**
|
|
154
|
+
|
|
155
|
+
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.
|
|
156
|
+
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.
|
|
157
|
+
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.
|
|
158
|
+
4. **Fallbacks** — If URLs are gated, export a crisp screenshot of the element’s box (note DPR) and record the substitution in research notes.
|
|
159
|
+
|
|
160
|
+
**Technical**
|
|
161
|
+
|
|
162
|
+
- [ ] CDN vs origin paths
|
|
163
|
+
- [ ] Lazy loading and responsive image strategy
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## Step 5 — Implementation (Next.js + components)
|
|
168
|
+
|
|
169
|
+
Rebuild deliberately in **this template’s stack** (Next.js App Router, React, TypeScript strict, shadcn/ui, Tailwind v4).
|
|
170
|
+
|
|
171
|
+
- **Do:** Small composable components, shared tokens, `cn()`, extracted icons in `src/components/icons.tsx` (or adjacent), routes under `src/app/`.
|
|
172
|
+
- **Don’t:** Ship one monolithic HTML string as the app or skip TypeScript/component boundaries.
|
|
173
|
+
|
|
174
|
+
### Stack parity (helps choose libraries)
|
|
175
|
+
|
|
176
|
+
- [ ] **Framework signals** — e.g. `__NEXT_DATA__`, `__NUXT__`, `ng-version`
|
|
177
|
+
- [ ] **State / data** — REST, GraphQL, client stores (infer from Network)
|
|
178
|
+
- [ ] **Animation stack** — match or approximate with CSS or an approved motion library
|
|
179
|
+
|
|
180
|
+
### Documentation output (`docs/research/`)
|
|
181
|
+
|
|
182
|
+
After inspection, produce durable notes:
|
|
183
|
+
|
|
184
|
+
1. `DESIGN_TOKENS.md` — colors, typography, spacing, radius, shadows
|
|
185
|
+
2. `COMPONENT_INVENTORY.md` — components with structure and states
|
|
186
|
+
3. `LAYOUT_ARCHITECTURE.md` — grids, breakpoints, sticky layers
|
|
187
|
+
4. `INTERACTION_PATTERNS.md` — motion, transitions, hover/focus
|
|
188
|
+
5. `TECH_STACK_ANALYSIS.md` — source stack vs chosen equivalents
|
|
189
|
+
|
|
190
|
+
### Common components to hunt for
|
|
191
|
+
|
|
192
|
+
Navigation (top/side/bottom), cards, buttons, links, forms, modals, menus, tabs, avatars/badges, skeletons, toasts, tooltips/popovers.
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
## Reference: Chrome MCP / agent crawl habits
|
|
197
|
+
|
|
198
|
+
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.
|
|
@@ -24,6 +24,22 @@ Before reconnaissance, write or update:
|
|
|
24
24
|
- `docs/research/LAUNCHFRAME.md` — URLs and SaaS idea
|
|
25
25
|
- **`docs/research/LAUNCHFRAME_SUBAGENTS.md`** — **before Phase 6**, ensure this runbook holds all four verifier prompts (**copy-ready**). When the bundled template differs from the latest SKILL rubrics (after skill edits), re-sync Section **Phase 6** rubrics **into this file**. Subagents receive prompts **only** from here.
|
|
26
26
|
|
|
27
|
+
### Step 0a — Automated page inspection dump (mandatory)
|
|
28
|
+
|
|
29
|
+
Right after Step 0 files are written, **from the repository root**, run the bundled **Playwright** capture **once per parsed reference URL** (before Phase 1 Chrome MCP). This produces `document.html`, network `*.css` bodies, `inline-styles.json`, and `motion-summary.json` — a frozen DOM/CSS/motion bundle to attach or diff alongside live `getComputedStyle` / WAAPI work (**this does not replace** Chrome MCP for numeric motion and interaction sweeps).
|
|
30
|
+
|
|
31
|
+
1. **One-time per machine:** `npx playwright install chromium`
|
|
32
|
+
2. **Per URL** — use the URL’s hostname for the folder (example hostname `www.example.com`):
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm run inspect:page -- "https://www.example.com/" --scroll-full --wait-until networkidle --timeout 120000 --out-parent "docs/research/www.example.com/page-inspection"
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
That creates `docs/research/<hostname>/page-inspection/<hostname>-<iso-stamp>/` with all artifacts. Omit `--out-parent` to use the default `docs/research/page-captures/<host>-<stamp>/`.
|
|
39
|
+
3. Append an **`Automated captures`** subsection to `docs/research/LAUNCHFRAME.md` listing every URL and its output directory path. Use those files in Phase 1 when structuring specs (DOM outline, stylesheet text, `@keyframes` from `motion-summary.json`) while still measuring behavior in the live tab.
|
|
40
|
+
|
|
41
|
+
If the dump fails (missing browsers, navigation timeout, TLS, bot wall), increase `--timeout`, retry with `domcontentloaded` only when necessary, or document the failure in `LAUNCHFRAME.md` and unblock before treating Phase 1 as complete.
|
|
42
|
+
|
|
27
43
|
## SaaS copy overlay (Phase 4 assembly and final polish)
|
|
28
44
|
|
|
29
45
|
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 numbers** from extracted specs. **Icon shapes** and **animations** (`@keyframes`, transitions, staggers, scroll triggers) remain **parity goals** sourced from extraction — swapping narrative photos does **not** relax them. **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.
|
package/.gitignore
CHANGED
|
@@ -23,6 +23,22 @@ Before reconnaissance, write or update:
|
|
|
23
23
|
- `docs/research/LAUNCHFRAME.md` — URLs and SaaS idea
|
|
24
24
|
- **`docs/research/LAUNCHFRAME_SUBAGENTS.md`** — **before Phase 6**, ensure this runbook holds all four verifier prompts (**copy-ready**). When the bundled template differs from the latest SKILL rubrics (after skill edits), re-sync Section **Phase 6** rubrics **into this file**. Subagents receive prompts **only** from here.
|
|
25
25
|
|
|
26
|
+
### Step 0a — Automated page inspection dump (mandatory)
|
|
27
|
+
|
|
28
|
+
Right after Step 0 files are written, **from the repository root**, run the bundled **Playwright** capture **once per parsed reference URL** (before Phase 1 Chrome MCP). This produces `document.html`, network `*.css` bodies, `inline-styles.json`, and `motion-summary.json` — a frozen DOM/CSS/motion bundle to attach or diff alongside live `getComputedStyle` / WAAPI work (**this does not replace** Chrome MCP for numeric motion and interaction sweeps).
|
|
29
|
+
|
|
30
|
+
1. **One-time per machine:** `npx playwright install chromium`
|
|
31
|
+
2. **Per URL** — use the URL’s hostname for the folder (example hostname `www.example.com`):
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npm run inspect:page -- "https://www.example.com/" --scroll-full --wait-until networkidle --timeout 120000 --out-parent "docs/research/www.example.com/page-inspection"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
That creates `docs/research/<hostname>/page-inspection/<hostname>-<iso-stamp>/` with all artifacts. Omit `--out-parent` to use the default `docs/research/page-captures/<host>-<stamp>/`.
|
|
38
|
+
3. Append an **`Automated captures`** subsection to `docs/research/LAUNCHFRAME.md` listing every URL and its output directory path. Use those files in Phase 1 when structuring specs (DOM outline, stylesheet text, `@keyframes` from `motion-summary.json`) while still measuring behavior in the live tab.
|
|
39
|
+
|
|
40
|
+
If the dump fails (missing browsers, navigation timeout, TLS, bot wall), increase `--timeout`, retry with `domcontentloaded` only when necessary, or document the failure in `LAUNCHFRAME.md` and unblock before treating Phase 1 as complete.
|
|
41
|
+
|
|
26
42
|
## SaaS copy overlay (Phase 4 assembly and final polish)
|
|
27
43
|
|
|
28
44
|
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 numbers** from extracted specs. **Icon shapes** and **animations** (`@keyframes`, transitions, staggers, scroll triggers) remain **parity goals** sourced from extraction — swapping narrative photos does **not** relax them. **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.
|
|
@@ -20,6 +20,22 @@ Before reconnaissance, write or update:
|
|
|
20
20
|
- `docs/research/LAUNCHFRAME.md` — URLs and SaaS idea
|
|
21
21
|
- **`docs/research/LAUNCHFRAME_SUBAGENTS.md`** — **before Phase 6**, ensure this runbook holds all four verifier prompts (**copy-ready**). When the bundled template differs from the latest SKILL rubrics (after skill edits), re-sync Section **Phase 6** rubrics **into this file**. Subagents receive prompts **only** from here.
|
|
22
22
|
|
|
23
|
+
### Step 0a — Automated page inspection dump (mandatory)
|
|
24
|
+
|
|
25
|
+
Right after Step 0 files are written, **from the repository root**, run the bundled **Playwright** capture **once per parsed reference URL** (before Phase 1 Chrome MCP). This produces `document.html`, network `*.css` bodies, `inline-styles.json`, and `motion-summary.json` — a frozen DOM/CSS/motion bundle to attach or diff alongside live `getComputedStyle` / WAAPI work (**this does not replace** Chrome MCP for numeric motion and interaction sweeps).
|
|
26
|
+
|
|
27
|
+
1. **One-time per machine:** `npx playwright install chromium`
|
|
28
|
+
2. **Per URL** — use the URL’s hostname for the folder (example hostname `www.example.com`):
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npm run inspect:page -- "https://www.example.com/" --scroll-full --wait-until networkidle --timeout 120000 --out-parent "docs/research/www.example.com/page-inspection"
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
That creates `docs/research/<hostname>/page-inspection/<hostname>-<iso-stamp>/` with all artifacts. Omit `--out-parent` to use the default `docs/research/page-captures/<host>-<stamp>/`.
|
|
35
|
+
3. Append an **`Automated captures`** subsection to `docs/research/LAUNCHFRAME.md` listing every URL and its output directory path. Use those files in Phase 1 when structuring specs (DOM outline, stylesheet text, `@keyframes` from `motion-summary.json`) while still measuring behavior in the live tab.
|
|
36
|
+
|
|
37
|
+
If the dump fails (missing browsers, navigation timeout, TLS, bot wall), increase `--timeout`, retry with `domcontentloaded` only when necessary, or document the failure in `LAUNCHFRAME.md` and unblock before treating Phase 1 as complete.
|
|
38
|
+
|
|
23
39
|
## SaaS copy overlay (Phase 4 assembly and final polish)
|
|
24
40
|
|
|
25
41
|
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 numbers** from extracted specs. **Icon shapes** and **animations** (`@keyframes`, transitions, staggers, scroll triggers) remain **parity goals** sourced from extraction — swapping narrative photos does **not** relax them. **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.
|
package/AGENTS.md
CHANGED
|
@@ -7,7 +7,7 @@ This version has breaking changes — APIs, conventions, and file structure may
|
|
|
7
7
|
# Website Reverse-Engineer Template
|
|
8
8
|
|
|
9
9
|
## What This Is
|
|
10
|
-
A reusable template for reverse-engineering any website into a clean, modern Next.js codebase using AI coding agents. The Next.js + shadcn/ui + Tailwind v4 base is pre-scaffolded — use **`/launchframe <url> "saas idea"`** for the full pixel-perfect clone plus SaaS landing copy (`src/lib/launchframe-config.ts`, `launchframe.context.json`, `docs/research/LAUNCHFRAME.md`). For a **new empty folder** only, **`npx launchframe@latest`** unpacks this template; then run **`/launchframe`** in that project with your URL and pitch.
|
|
10
|
+
A reusable template for reverse-engineering any website into a clean, modern Next.js codebase using AI coding agents. The Next.js + shadcn/ui + Tailwind v4 base is pre-scaffolded — use **`/launchframe <url> "saas idea"`** for the full pixel-perfect clone plus SaaS landing copy (`src/lib/launchframe-config.ts`, `launchframe.context.json`, `docs/research/LAUNCHFRAME.md`). The agent executing **`/launchframe`** must follow **Step 0a** in that command: run **`npm run inspect:page`** once per reference URL (Playwright: `document.html`, network CSS, `motion-summary.json`) before Phase 1. For a **new empty folder** only, **`npx launchframe@latest`** unpacks this template; then run **`/launchframe`** in that project with your URL and pitch.
|
|
11
11
|
|
|
12
12
|
## Tech Stack
|
|
13
13
|
- **Framework:** Next.js 16 (App Router, React 19, TypeScript strict)
|
|
@@ -35,7 +35,7 @@ A reusable template for reverse-engineering any website into a clean, modern Nex
|
|
|
35
35
|
- **No personal aesthetic changes during emulation phase** — match 1:1 first, customize later
|
|
36
36
|
- **Real content** — use actual text and assets from the target site where they are interchangeable chrome; **`/launchframe`** overlays your SaaS pitch on headings and CTAs. **Marketing photographs and illustrative hero/feature imagery are not photocopied**: you **must** ship **committed files** under `public/images/` (etc.) for every such slot — **generate them yourself** with your host **image-generation** tool (prompts tied to the SaaS idea), wire into components, supplement with UI mock composites only if helpful. Blank placeholders count as unfinished. Record paths in `docs/research/LAUNCHFRAME.md`
|
|
37
37
|
- **Beauty-first** — every pixel matters
|
|
38
|
-
- **DOM
|
|
38
|
+
- **Inspection workflow (canonical)** — Follow the ordered **five steps** in `docs/research/INSPECTION_GUIDE.md`: (1) **Structure** — DOM as hierarchy reference, not pasted production HTML; (2) **Styles** — Computed/stylesheets and tokens; (3) **Motion** — `@keyframes`, transitions, timings, triggers; (4) **Assets** — rasters/SVGs with brand-safe originals for marketing slots when required; (5) **Implementation** — Next.js components rebuild. Within crawls (Chrome MCP / DevTools), still emphasize **images** (raster, responsive sources, CSS backgrounds), **SVGs** (inline, sprites, masks — **exact geometry**, not unrelated Lucide stand-ins), then **motion fidelity**. **Measure and mirror** from the DOM; scrape **permission-neutral** bytes when appropriate — **SVG and animation fidelity are not waived** when rasters are replaced
|
|
39
39
|
|
|
40
40
|
## Project Structure
|
|
41
41
|
```
|
package/README.md
CHANGED
|
@@ -1,165 +1,38 @@
|
|
|
1
|
-
# Launchframe
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
- `--dir path` / `-o path` — scaffold into another folder instead of the current directory (must be empty)
|
|
40
|
-
- `--skip-install` — skip `npm install`
|
|
41
|
-
|
|
42
|
-
### Git template (advanced)
|
|
43
|
-
|
|
44
|
-
1. Clone this repository and `npm install`
|
|
45
|
-
2. Point `src/lib/launchframe-config.ts` at your site, or create a sibling folder and run **`npx launchframe@latest`** there
|
|
46
|
-
3. Run **`/launchframe <url> "saas idea"`** from your agent
|
|
47
|
-
|
|
48
|
-
> Using a different agent? Open `AGENTS.md` for project instructions — most agents pick it up automatically.
|
|
49
|
-
|
|
50
|
-
## Supported Platforms
|
|
51
|
-
|
|
52
|
-
| Agent | Status |
|
|
53
|
-
| ------------------------------------------------------------- | -------------------------- |
|
|
54
|
-
| [Claude Code](https://docs.anthropic.com/en/docs/claude-code) | **Recommended** — Opus 4.7 |
|
|
55
|
-
| [Codex CLI](https://github.com/openai/codex) | Supported |
|
|
56
|
-
| [OpenCode](https://opencode.ai/) | Supported |
|
|
57
|
-
| [GitHub Copilot](https://github.com/features/copilot) | Supported |
|
|
58
|
-
| [Cursor](https://cursor.com/) | Supported |
|
|
59
|
-
| [Windsurf](https://codeium.com/windsurf) | Supported |
|
|
60
|
-
| [Gemini CLI](https://github.com/google-gemini/gemini-cli) | Supported |
|
|
61
|
-
| [Cline](https://github.com/cline/cline) | Supported |
|
|
62
|
-
| [Roo Code](https://github.com/RooCodeInc/Roo-Code) | Supported |
|
|
63
|
-
| [Continue](https://continue.dev/) | Supported |
|
|
64
|
-
| [Amazon Q](https://aws.amazon.com/q/developer/) | Supported |
|
|
65
|
-
| [Augment Code](https://www.augmentcode.com/) | Supported |
|
|
66
|
-
| [Aider](https://aider.chat/) | Supported |
|
|
67
|
-
|
|
68
|
-
## Prerequisites
|
|
69
|
-
|
|
70
|
-
- [Node.js](https://nodejs.org/) 24+
|
|
71
|
-
- An AI coding agent (see [Supported Platforms](#supported-platforms))
|
|
72
|
-
|
|
73
|
-
## Tech Stack
|
|
74
|
-
|
|
75
|
-
- **Next.js 16** — App Router, React 19, TypeScript strict
|
|
76
|
-
- **shadcn/ui** — Radix primitives + Tailwind CSS v4
|
|
77
|
-
- **Tailwind CSS v4** — oklch design tokens
|
|
78
|
-
- **Lucide React** — default icons (replaced by extracted SVGs during cloning)
|
|
79
|
-
|
|
80
|
-
## How It Works
|
|
81
|
-
|
|
82
|
-
The **`/launchframe`** skill runs a multi-phase pipeline:
|
|
83
|
-
|
|
84
|
-
1. **Reconnaissance** — screenshots, design token extraction, interaction sweep (scroll, click, hover, responsive)
|
|
85
|
-
2. **Foundation** — updates fonts, colors, globals, downloads all assets
|
|
86
|
-
3. **Component Specs** — writes detailed spec files (`docs/research/components/`) with exact computed CSS values, states, behaviors, and content
|
|
87
|
-
4. **Parallel Build** — dispatches builder agents in git worktrees, one per section/component
|
|
88
|
-
5. **Assembly & QA** — merges worktrees, wires up the page, runs visual diff against the original
|
|
89
|
-
|
|
90
|
-
Each builder agent receives the full component specification inline — exact `getComputedStyle()` values, interaction models, multi-state content, responsive breakpoints, and asset paths. No guessing.
|
|
91
|
-
|
|
92
|
-
## Use Cases
|
|
93
|
-
|
|
94
|
-
- **Platform migration** — rebuild a site you own from WordPress/Webflow/Squarespace into a modern Next.js codebase
|
|
95
|
-
- **Lost source code** — your site is live but the repo is gone, the developer left, or the stack is legacy. Get the code back in a modern format
|
|
96
|
-
- **Learning** — deconstruct how production sites achieve specific layouts, animations, and responsive behavior by working with real code
|
|
97
|
-
|
|
98
|
-
## Not Intended For
|
|
99
|
-
|
|
100
|
-
- **Phishing or impersonation** — this project must not be used for deceptive purposes, impersonation, or any activity that breaks the law.
|
|
101
|
-
- **Passing off someone's design as your own** — logos, brand assets, and original copy belong to their owners.
|
|
102
|
-
- **Violating terms of service** — some sites explicitly prohibit scraping or reproduction. Check first.
|
|
103
|
-
|
|
104
|
-
## Project Structure
|
|
105
|
-
|
|
106
|
-
```
|
|
107
|
-
src/
|
|
108
|
-
app/ # Next.js routes
|
|
109
|
-
components/ # React components
|
|
110
|
-
ui/ # shadcn/ui primitives
|
|
111
|
-
icons.tsx # Extracted SVG icons
|
|
112
|
-
lib/utils.ts # cn() utility
|
|
113
|
-
types/ # TypeScript interfaces
|
|
114
|
-
hooks/ # Custom React hooks
|
|
115
|
-
public/
|
|
116
|
-
images/ # Downloaded images from target
|
|
117
|
-
videos/ # Downloaded videos from target
|
|
118
|
-
seo/ # Favicons, OG images
|
|
119
|
-
docs/
|
|
120
|
-
research/ # Extraction output & component specs
|
|
121
|
-
design-references/ # Screenshots
|
|
122
|
-
scripts/
|
|
123
|
-
sync-agent-rules.sh # Regenerate agent instruction files
|
|
124
|
-
sync-skills.mjs # Regenerate /launchframe for all platforms
|
|
125
|
-
AGENTS.md # Agent instructions (single source of truth)
|
|
126
|
-
CLAUDE.md # Claude Code config (imports AGENTS.md)
|
|
127
|
-
GEMINI.md # Gemini CLI config (imports AGENTS.md)
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
## Commands
|
|
131
|
-
|
|
132
|
-
```bash
|
|
133
|
-
npm run dev # Start dev server
|
|
134
|
-
npm run build # Production build
|
|
135
|
-
npm run lint # ESLint check
|
|
136
|
-
npm run typecheck # TypeScript check
|
|
137
|
-
npm run check # Run lint + typecheck + build
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
### If using docker
|
|
141
|
-
|
|
142
|
-
```bash
|
|
143
|
-
docker compose up app --build # build and run the app
|
|
144
|
-
docker compose up dev --build # run the app in dev mode on port 3001
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
## Updating for Other Platforms
|
|
148
|
-
|
|
149
|
-
Two source-of-truth files power all platform support. Edit the source, then run the sync script:
|
|
150
|
-
|
|
151
|
-
| What | Source of truth | Sync command |
|
|
152
|
-
| ---------------------- | --------------------------------------- | ---------------------------------- |
|
|
153
|
-
| Project instructions | `AGENTS.md` | `bash scripts/sync-agent-rules.sh` |
|
|
154
|
-
| `/launchframe` skill | `.claude/skills/launchframe/SKILL.md` | `node scripts/sync-skills.mjs` |
|
|
155
|
-
|
|
156
|
-
Each script regenerates the platform-specific copies automatically. Agents that read the source files natively need no regeneration.
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
## Star History
|
|
160
|
-
|
|
161
|
-
[](https://star-history.com/#JCodesMore/ai-website-cloner-template&Date)
|
|
162
|
-
|
|
163
|
-
## License
|
|
164
|
-
|
|
165
|
-
MIT
|
|
1
|
+
# Launchframe
|
|
2
|
+
|
|
3
|
+
Next.js + shadcn/ui + Tailwind v4 template for cloning a reference site and layering your SaaS pitch—wired for AI agents. Project rules for agents: **`AGENTS.md`**. In Cursor (and similar), use the **`/launchframe`** command with a URL and your pitch in quotes.
|
|
4
|
+
|
|
5
|
+
Requires **Node.js 24+**.
|
|
6
|
+
|
|
7
|
+
## Quick start
|
|
8
|
+
|
|
9
|
+
**You already have this repo**
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install
|
|
13
|
+
npm run dev
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
**New folder**
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
mkdir my-app && cd my-app
|
|
20
|
+
npx launchframe@latest
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
That unpacks the template and runs `npm install` unless you pass `--skip-install`. Defaults live in **`src/lib/launchframe-config.ts`** (optional: `LAUNCHFRAME_SOURCE_URL` and `LAUNCHFRAME_SAAS_IDEA` in the environment when you scaffold).
|
|
24
|
+
|
|
25
|
+
## Scripts
|
|
26
|
+
|
|
27
|
+
| Command | What it does |
|
|
28
|
+
| -------- | ------------- |
|
|
29
|
+
| `npm run dev` | Dev server |
|
|
30
|
+
| `npm run build` | Production build |
|
|
31
|
+
| `npm run start` | Run production build |
|
|
32
|
+
| `npm run lint` | ESLint |
|
|
33
|
+
| `npm run typecheck` | TypeScript |
|
|
34
|
+
| `npm run check` | Lint, typecheck, then build |
|
|
35
|
+
|
|
36
|
+
Took inspiration from [JCodesMore/ai-website-cloner-template](https://github.com/JCodesMore/ai-website-cloner-template).
|
|
37
|
+
|
|
38
|
+
MIT
|