launchframe 0.1.10 → 0.1.13

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/README.md CHANGED
@@ -1,158 +1,140 @@
1
- # launchframe
1
+ # Launchframe
2
2
 
3
- > Point Launchframe at SaaS sites you admire. Get back a drop-in
4
- > shadcn/ui design system you can build your own UI on top of —
5
- > with a ready-made handoff for Cursor or Claude Code.
3
+ A reusable workflow for reverse-engineering live marketing sites into a **shadcn-style token theme**, **reference dumps** (DOM, copy index, media index), and a **layout-mirror** React scaffold — optimized for AI coding agents.
6
4
 
7
- `launchframe` opens each URL in headless Chromium, harvests the
8
- **computed appearance** of the rendered page (colors, type, spacing,
9
- radii, shadows), and synthesizes an original design system as
10
- `tailwind.config.ts` + `globals.css` + `tokens.json` + a Markdown
11
- report and an AI-handoff file.
5
+ **Recommended:** [Claude Code](https://docs.anthropic.com/en/docs/claude-code) or **Cursor** for multi-phase builds — but Launchframe output works with any agent that can read Markdown and TypeScript.
12
6
 
13
- It also crawls the rendered DOM into a typed `SiteLayout` and emits a
14
- **layout-mirror page** per source: a Next.js component that reconstructs
15
- the source's section tree, grid, and density from typed primitives, with
16
- `<TextSlot>` / `<MediaSlot>` placeholders where the source had copy,
17
- logos, illustrations, or product imagery. The mirror does **not** embed
18
- the source's copy text, brand assets, or product screenshots — fill those
19
- slots with your own content before shipping. Proprietary type families
20
- are substituted with open-source equivalents.
21
-
22
- ---
7
+ Point the CLI at a URL, run **`npx launchframe@latest`**, then drive the same **spec parallel builders → merge → QA** rhythm popularized by [JCodesMore/ai-website-cloner-template](https://github.com/JCodesMore/ai-website-cloner-template). In Cursor, use the **Clone Website** command (`.cursor/commands/clone-website.md`), which matches that template’s pipeline with Launchframe handling automated recon.
23
8
 
24
9
  ## Quick start (any folder)
25
10
 
26
- The design system is written to **`./output/<runId>/`** in whatever
27
- directory you run the command from — not inside the package.
28
-
29
11
  **One time per machine** (Chromium for Playwright):
30
12
 
31
13
  ```bash
32
14
  npx playwright install chromium
33
15
  ```
34
16
 
35
- **Every time you want a new theme:**
17
+ **Every extraction** (writes to **`./output/<runId>/`** in the current working directory):
36
18
 
37
19
  ```bash
38
20
  cd path/to/your-app-or-empty-folder
39
- npx launchframe@latest https://site-a.example https://site-b.example
21
+ npx launchframe@latest https://example.com "Your SaaS idea"
40
22
  ```
41
23
 
42
- When it finishes, every source URL has produced a **layout-mirror
43
- page** under `output/<runId>/mirror/<host>/page.tsx`, plus a synthesized
44
- design system at the run root.
24
+ Pass multiple URLs for a combined token synthesis (see CLI reference below). Your **SaaS idea** string is stored in `run.json`, `FOR_AI.md`, and `docs/research/`.
25
+
26
+ **Then hand output to your agent:** attach **`FOR_AI.md`**, **`reference/<host>/`** (especially **`dom-structure.json`**), **`mirror/<host>/`**, **`tokens.json`**, and **`docs/design-references/<host-slug>/`**. For the full builder orchestration checklist, open **`AGENTS.md`** or run the **Clone Website** Cursor command.
27
+
28
+ ## Supported platforms
29
+
30
+ | Agent | Status |
31
+ | ----- | ------ |
32
+ | [Claude Code](https://docs.anthropic.com/en/docs/claude-code) | Recommended |
33
+ | [Cursor](https://cursor.com/) | Supported — `.cursor/commands/clone-website.md` |
34
+ | [GitHub Copilot](https://github.com/features/copilot) | Supported — `AGENTS.md` → `npm run sync:agents` |
35
+ | [Gemini CLI](https://github.com/google-gemini/gemini-cli) | Supported (`GEMINI.md`) |
36
+ | [Cline](https://github.com/cline/cline) | Supported |
37
+ | [Continue](https://continue.dev/) | Supported |
38
+ | [Amazon Q](https://aws.amazon.com/q/developer/) | Supported |
39
+ | … | Any agent that reads `AGENTS.md` |
40
+
41
+ ## Prerequisites
42
+
43
+ - [Node.js](https://nodejs.org/) **20+**
44
+ - Chromium via Playwright (`npx playwright install chromium`)
45
+
46
+ ## Tech stack
47
+
48
+ - **Extract:** Node.js, Playwright, TypeScript
49
+ - **Published CLI:** `npx launchframe` → `packages/extract/`
50
+ - **Studio (optional):** Next.js App Router in `apps/studio/` (**Next.js 16**, **React 19**, Tailwind CSS, **Lucide** via `@framework/blocks` / direct imports — aligned with [ai-website-cloner-template](https://github.com/JCodesMore/ai-website-cloner-template); studio Tailwind is v3 today while their README cites **v4**; emitted run artifacts remain drop-in CSS/token bundles.)
51
+ - **Mirror output:** React, Framer Motion, Phosphor (generated `page.tsx`)
52
+ - **Tokens:** `tailwind.config.ts`, `globals.css`, `tokens.json`, `REPORT.md`
53
+
54
+ ## Parity with [ai-website-cloner-template](https://github.com/JCodesMore/ai-website-cloner-template)
55
+
56
+ Launchframe mirrors that template’s **phases and artifact roles**, not its single-repo layout:
57
+
58
+ | Aspect | What they do | What Launchframe does (same intent) |
59
+ | -------- | ------------------ | ------------------------------------- |
60
+ | **Phase 1 recon** | `/clone-website` drives screenshots, tokens, interaction sweep | **`npx launchframe`** performs automated recon (Playwright) into a run folder; optional Browser MCP passes match their sweep discipline (**Clone Website** in Cursor ≈ orchestration checklist) |
61
+ | **Repo shape** | One Next.js app (`src/app`, `components`, …) | **Monorepo:** CLI (`packages/extract`) + optional **`apps/studio`** + **`packages/blocks`**; published CLI ships separately |
62
+ | **Where artifacts live** | `docs/research/`, `docs/design-references/`, `public/` | Same tree **inside** `./output/<runId>/` (gitignored by default). To match their repo layout, run with **`--out path/to/your-next-app/extraction-<slug>`** or merge **`docs/`** + **`downloaded_assets/`** into your app’s **`docs/`** and **`public/images`** (and **`public/videos`**, **`public/seo`**) when integrating |
63
+ | **Stack** | Next 16, React 19, Tailwind v4, Lucide | **Next 16 + React 19 + Lucide** in studio/blocks; Tailwind **v3** in-studio until upgraded to v4 |
64
+
65
+ ## How it works
66
+
67
+ This repo combines **Launchframe automated extraction** with the **AI Website Cloner**-style agent workflow:
68
+
69
+ 1. **Automated recon** — headless Chromium capture, computed-style aggregation, reference dump (`dom-structure.json`, `visible-text.*`, `media.json`), design-reference PNGs and probes under `docs/design-references/`, and starter topology/spec files under `docs/research/`.
70
+ 2. **Foundation** — synthesized shadcn-compatible theme files at the run root; merge into your Next app.
71
+ 3. **Component specs** — per-section `.spec.md` files (extend Launchframe’s emitted stubs) with behaviors, states, and assets.
72
+ 4. **Parallel build** — agents in worktrees/branches per section or subcomponent.
73
+ 5. **Assembly & QA** — wire the target route (from mirror structure), visual diff against references.
74
+
75
+ Each builder should receive **inline** spec content, not “go read the repo.” Authority order for structure is in **`FOR_AI.md`** and **`AGENTS.md`**.
76
+
77
+ ## Use cases
78
+
79
+ - Seeding a **design system** from sites you’re allowed to analyze
80
+ - **Layout research** with a typed mirror and DOM reference
81
+ - **Rebuilding** properties you own when only the public site remains
82
+
83
+ ## Not intended for
84
+
85
+ - **Impersonation or phishing**
86
+ - **Passing off** another brand’s identity, trademarks, or licensed media
87
+ - **Violating robots.txt or site terms** — Launchframe checks robots by default (`--no-robots` is discouraged)
88
+
89
+ ## Output layout
45
90
 
46
91
  ```txt
47
92
  output/<runId>/
48
- ├── FOR_AI.md ← paste / @-attach this for your AI (handoff instructions)
49
- ├── tokens.json ← every aggregated value, machine-readable
50
- ├── tailwind.config.ts ← drop-in Tailwind theme
51
- ├── globals.css ← drop-in shadcn-compatible CSS variables
52
- ├── theme-preview.tsx ← render this to eyeball the system
53
- ├── REPORT.md ← what was extracted, from where, why
54
- ├── run.json ← full run metadata (sources, timing, status)
55
- ├── screenshots/ ← captured PNGs
56
- ├── raw/ ← per-site raw token + SiteLayout JSON
57
- ├── reference/ ← verbatim DOM + **exact structure JSON** + copy for AI
93
+ ├── FOR_AI.md
94
+ ├── tokens.json
95
+ ├── tailwind.config.ts
96
+ ├── globals.css
97
+ ├── theme-preview.tsx
98
+ ├── REPORT.md
99
+ ├── run.json
100
+ ├── screenshots/
101
+ ├── raw/
102
+ ├── reference/
58
103
  │ └── <host>/
104
+ │ ├── dom-structure.json
59
105
  │ ├── page.html
60
- │ ├── dom-structure.json ← canonical body tree (tags, attrs, text nodes)
61
- │ ├── structure-outline.txt ← tag skeleton for quick scanning
62
- │ ├── visible-text.txt
63
- │ ├── visible-text.json
106
+ │ ├── visible-text.txt / .json
64
107
  │ ├── media.json
65
- │ ├── meta.json
66
108
  │ └── FOR_AI_REFERENCE.md
67
- └── mirror/
68
- └── <host>/
69
- ├── page.tsx ← Next.js: Motion + Phosphor + image/video patterns
70
- ├── layout.json
71
- └── MIRROR_NOTES.md
109
+ ├── mirror/
110
+ └── <host>/
111
+ ├── page.tsx
112
+ │ └── MIRROR_NOTES.md
113
+ ├── docs/
114
+ │ ├── design-references/<host-slug>/ # PNGs, probes, hints
115
+ │ └── research/<host-slug>/ # PAGE_TOPOLOGY, BEHAVIORS, components/*.spec.md
116
+ └── downloaded_assets/<host-slug>/ # when enabled
72
117
  ```
73
118
 
74
- ---
75
-
76
- ## Hand the output to your AI
77
-
78
- 1. Run the command above so `output/<runId>/` exists.
79
- 2. Attach **`reference/<host>/`**, especially **`dom-structure.json`** (exact tree) and **`visible-text.*`**, plus **`page.html`** and **`media.json`** so the model sees **exact structure and copy** from the crawl.
80
- 3. Pick the mirror folder: `output/<runId>/mirror/<host>/`.
81
- 4. Either:
82
- - **Cursor:** `@`-attach `reference/<host>/`, `mirror/<host>/`, `FOR_AI.md`, and
83
- `tokens.json`, then ask the agent to port copy from `visible-text.txt` into
84
- `page.tsx` and wire media from `media.json`.
85
- - **Claude Code:** copy both folders into your project, then ask the same.
86
- 5. The AI's authority order is **`dom-structure.json` (nesting) → `structure-outline.txt` / `page.html` → `visible-text.*` →
87
- MIRROR_NOTES.md → mirror `page.tsx` → tokens.json → tailwind.config.ts + globals.css**. It must:
88
- - Keep the section tree, grid composition, density, Motion, and Phosphor usage in `page.tsx`.
89
- - Map strings from `visible-text.txt` into the right `<TextSlot>` slots (or replace slots with plain JSX).
90
- - Use `media.json` for image/video `src` / `poster` (respect licensing; prefer your own assets).
91
-
92
- ---
93
-
94
119
  ## CLI reference
95
120
 
96
121
  ```bash
97
- npx launchframe <url> [<url> ...] [options]
122
+ npx launchframe@latest <url> [<url> ...] ["Your SaaS idea"] [options]
98
123
  ```
99
124
 
100
- | Flag | Default | Notes |
101
- | -------------- | -------------------- | -------------------------------------------------------- |
102
- | `--out <dir>` | `./output/<runId>` (under **current working directory**) | Absolute or relative path for the run folder |
103
- | `--name <slug>`| _(unset)_ | Append a slug to the runId for findability |
104
- | `--no-robots` | _(off)_ | Skip robots.txt check (not recommended) |
105
- | `--rate <n>` | `15` | Per-domain requests per minute |
106
- | `--width <px>` | `1440` | Viewport width |
107
- | `--height <px>`| `900` | Viewport height |
125
+ | Flag | Default | Notes |
126
+ | ---- | ------- | ----- |
127
+ | `--out <dir>` | `./output/<runId>` | Run directory |
128
+ | `--name <slug>` | _(unset)_ | Appends slug to run id |
129
+ | `--no-robots` | off | Skip robots.txt check |
130
+ | `--rate <n>` | `15` | Per-domain requests per minute |
131
+ | `--width <px>` | `1440` | Viewport width |
132
+ | `--height <px>` | `900` | Viewport height |
108
133
 
109
134
  ```bash
110
- npx launchframe https://example.com --name my-brand
111
- npx launchframe https://a.example https://b.example https://c.example --width 1280
112
- ```
113
-
114
- ---
115
-
116
- ## What the extractor actually does
117
-
118
- For each URL:
119
-
120
- 1. Open the page in headless Chromium at a 1440 × 900 desktop viewport.
121
- 2. Take a full-page screenshot.
122
- 3. Walk the rendered DOM and harvest **computed styles** for every
123
- visible element:
124
- - Text and background colors, weighted by area
125
- - Font families, sizes, weights, line-heights, letter-spacing
126
- - Padding, gap, and margin values (snapped to a 4 px grid)
127
- - Border radii (mode-picked across the page)
128
- - Box-shadow stacks
129
- - Dominant container width (the layout signal)
130
- 4. Save the raw observations as JSON.
131
-
132
- After every site is captured, the synthesizer:
133
-
134
- 1. Clusters all colors into a representative palette and derives a full
135
- shadcn-compatible ramp (`--background`, `--foreground`, `--primary`,
136
- …) for both light and dark themes.
137
- 2. Picks a body base size from the count-weighted mode of body-range
138
- font sizes, then fits a single scale ratio that lands the largest
139
- observed heading at the `6xl` step. Substitutes proprietary type
140
- families (e.g. SF Pro, Söhne, Circular, Graphik) with open-source
141
- equivalents.
142
- 3. Snaps spacing values to a 4 px scale, takes the most-used buckets,
143
- and computes a recommended container width from the median dominant
144
- block width across the corpus.
145
- 4. Picks a representative radius and emits a tasteful three-stop shadow
146
- scale.
147
- 5. Writes drop-in files plus a Markdown report attributing every source.
148
-
149
- ```
150
- URLs ──▶ Playwright ──▶ raw tokens.json ──▶ synthesize ──▶ DesignSystem ──▶ emit
151
- (per site) (one corpus)
135
+ npx launchframe@latest https://example.com "AI billing copilot" --name acme
152
136
  ```
153
137
 
154
- ---
155
-
156
138
  ## Run inside this repo (contributors)
157
139
 
158
140
  ```bash
@@ -160,78 +142,33 @@ git clone https://github.com/evangruhlkey/launchframe
160
142
  cd launchframe
161
143
  npm install
162
144
  npx playwright install chromium
163
- npm run extract -- https://site-a.example https://site-b.example
145
+ npm run extract -- https://example.com "Your SaaS idea"
164
146
  ```
165
147
 
166
- The repo is a monorepo that also contains a research framework for
167
- classifying SaaS UI patterns and generating original shadcn blocks:
168
-
169
- ```txt
170
- launchframe/
171
- ├── apps/
172
- │ └── studio/ # Next.js dashboard for browsing patterns/blocks
173
- ├── packages/
174
- │ ├── extract/ # ← the published CLI
175
- │ ├── capture/ # Playwright screenshot capture (lower level)
176
- │ ├── analysis/ # Layout-tree extraction & section classifier
177
- │ ├── patterns/ # Typed pattern schemas + atlas registry loader
178
- │ ├── blocks/ # Shadcn/ui blocks + TextSlot / MediaSlot primitives
179
- │ └── evaluation/ # Coherence + responsiveness/a11y evaluator
180
- ├── pattern-atlas/ # Pattern catalog per category (block-composition mode)
181
- ├── prompts/ # Markdown prompts for AI agents
182
- ├── rules/ # Design / copy / a11y rules
183
- ├── registry/ # shadcn-compatible custom registry manifest
184
- └── output/ # ← every `extract` run lands here
185
- ```
186
-
187
- Other commands (repo-only):
188
-
189
148
  ```bash
190
- npm run studio # Next.js dashboard at localhost:3000
191
- npm run capture # Lower-level Playwright capture pipeline
192
- npm run analyze # Run section classifier on captured screenshots
193
- npm run formalize # Validate the pattern-atlas/*.json files
194
- npm run evaluate # Grade a generated page (coherence + a11y)
195
- npm run typecheck # Project-wide TypeScript check
196
- npm run sync:agents # Regenerate Copilot / Cline / Continue / Amazon Q stubs from AGENTS.md
149
+ npm run studio # Next.js studio
150
+ npm run studio:build # Production build
151
+ npm run typecheck
152
+ npm run sync:agents # Regenerate Copilot / Cline / Continue / Amazon Q stubs from AGENTS.md
197
153
  ```
198
154
 
199
155
  ### AI agents in this repo
200
156
 
201
- - **`AGENTS.md`** (root) is the **single source of truth** for how agents should work here (extract handoff, structure fidelity, compliance). **`docs/research/INSPECTION_GUIDE.md`** is inlined into derived configs when you run `npm run sync:agents`.
202
- - **Cursor:** `.cursor/rules/project.mdc` points at `AGENTS.md`.
203
- - **Claude Code / Gemini CLI:** `CLAUDE.md` and `GEMINI.md` import `AGENTS.md`.
204
- - Edit `AGENTS.md`, then run `npm run sync:agents` (or `bash scripts/sync-agent-rules.sh`) to refresh `.github/copilot-instructions.md`, `.clinerules`, `.continue/rules/project.md`, and `.amazonq/rules/project.md`.
157
+ - **`AGENTS.md`** is the **single source of truth** for agent instructions; **`docs/research/INSPECTION_GUIDE.md`** is inlined when you run **`npm run sync:agents`**.
158
+ - **Cursor:** `.cursor/rules/project.mdc` points at `AGENTS.md`; use **Clone Website** for the full cloner-template-style checklist.
159
+ - Edit **`AGENTS.md`**, then run **`npm run sync:agents`**.
160
+
161
+ ### Updating agent copies from one file
205
162
 
206
- ---
163
+ | What | Source of truth | Sync command |
164
+ | ---- | ----------------- | ------------ |
165
+ | Project instructions | `AGENTS.md` | `npm run sync:agents` |
166
+ | Cursor multi-phase pipeline | `.cursor/commands/clone-website.md` | (edit in repo — no codegen) |
207
167
 
208
168
  ## What this is not
209
169
 
210
- - **Not the source site's frontend bundle.** The **layout mirror** is React
211
- code emitted from a typed `SiteLayout` (section tree, composition,
212
- density) — not a dump of the origin's original components or stylesheets.
213
- - **Not a substitute for legal clearance.** `reference/<host>/` may contain
214
- serialized DOM and visible text for tooling **you** run on pages you are
215
- allowed to analyze. You are responsible for trademarks, copy licenses, and
216
- `robots.txt`/ToS compliance when using those artifacts.
217
- - **Not a component library replacement.** Launchframe sits *alongside*
218
- shadcn/ui: theme files, reference dumps, and slot-driven mirror pages —
219
- you integrate into your own app.
220
-
221
- ---
222
-
223
- ## Responsible use in one paragraph
224
-
225
- Launchframe is intended for layout research and design-system seeding
226
- against pages you have permission to analyze (your own products, sites
227
- where the operator has permission, or pages where structural analysis is
228
- permitted by `robots.txt`). The crawler respects `robots.txt` by default
229
- and rate-limits per domain. Output includes synthesized theme files, a
230
- typed **mirror** page scaffold, and (per capture) a **reference** bundle
231
- (DOM snapshot, visible text, media URLs) for AI-assisted reconstruction.
232
- Operators remain responsible for how they use copy, media, and branding.
233
-
234
- ---
170
+ - **Not the origin sites bundle** output is synthesized tokens, reference artifacts, and a **slot-based mirror**, not a dump of proprietary components.
171
+ - **Not legal clearance** you are responsible for compliance; see **`FOR_AI.md`** and **`AGENTS.md`**.
235
172
 
236
173
  ## License
237
174
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "launchframe",
3
- "version": "0.1.10",
3
+ "version": "0.1.13",
4
4
  "description": "Point Launchframe at SaaS sites you admire and get back a drop-in shadcn/ui design system (tokens, Tailwind theme, CSS variables, AI handoff) you can build your own UI on top of.",
5
5
  "license": "MIT",
6
6
  "author": "Evan Gruhlkey",