launchframe 0.4.11 → 0.4.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/.amazonq/cli-agents/launchframe.json +1 -1
- package/.amazonq/cli-agents/snapshot.json +9 -0
- package/.augment/commands/launchframe.md +1 -1
- package/.augment/commands/snapshot.md +83 -0
- package/.claude/skills/launchframe/SKILL.md +1 -1
- package/.claude/skills/snapshot/SKILL.md +83 -0
- package/.codex/skills/launchframe/SKILL.md +1 -1
- package/.codex/skills/snapshot/SKILL.md +83 -0
- package/.continue/commands/launchframe.md +1 -1
- package/.continue/commands/snapshot.md +84 -0
- package/.cursor/commands/launchframe.md +1 -1
- package/.cursor/commands/snapshot.md +79 -0
- package/.gemini/commands/launchframe.toml +1 -1
- package/.gemini/commands/snapshot.toml +85 -0
- package/.github/skills/launchframe/SKILL.md +1 -1
- package/.github/skills/snapshot/SKILL.md +83 -0
- package/.opencode/commands/launchframe.md +1 -1
- package/.opencode/commands/snapshot.md +82 -0
- package/.windsurf/workflows/launchframe.md +1 -1
- package/.windsurf/workflows/snapshot.md +79 -0
- package/AGENTS.md +1 -1
- package/docs/research/example.com/page-inspection/example.com-2026-05-15T21-49-07-887Z/README.txt +17 -0
- package/docs/research/example.com/page-inspection/example.com-2026-05-15T21-49-07-887Z/ai-page-bundle.txt +29 -0
- package/docs/research/example.com/page-inspection/example.com-2026-05-15T21-49-07-887Z/body-outer.html +2 -0
- package/docs/research/example.com/page-inspection/example.com-2026-05-15T21-49-07-887Z/capture-meta.json +21 -0
- package/docs/research/example.com/page-inspection/example.com-2026-05-15T21-49-07-887Z/document.html +2 -0
- package/docs/research/example.com/page-inspection/example.com-2026-05-15T21-49-07-887Z/inline-styles.json +7 -0
- package/docs/research/example.com/page-inspection/example.com-2026-05-15T21-49-07-887Z/motion-summary.json +18 -0
- package/package.json +1 -1
- package/scripts/page-inspection-dump.mjs +34 -2
- package/src/app/page.tsx +5 -36
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: snapshot
|
|
3
|
+
description: "Verbatim page snapshot — run inspect:page, copy document.html to public/captured/, and show it on the home route via a full-viewport iframe (not a React rebuild)."
|
|
4
|
+
invokable: true
|
|
5
|
+
---
|
|
6
|
+
<!-- AUTO-GENERATED from .claude/skills/snapshot/SKILL.md — do not edit directly.
|
|
7
|
+
Run `node scripts/sync-skills.mjs` to regenerate. -->
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# Snapshot (`/snapshot`)
|
|
11
|
+
|
|
12
|
+
**`/snapshot`** serves a **frozen copy** of a live URL: the captured **`document.html`** from Playwright lives under **`public/captured/`** and **`src/app/page.tsx`** embeds it in a **full-viewport iframe**. This is **verbatim hosting**, not **`/launchframe`** (no component rebuild, no SaaS overlay, no Phase 6 verification).
|
|
13
|
+
|
|
14
|
+
Parse **$ARGUMENTS**:
|
|
15
|
+
|
|
16
|
+
1. **URL** — Exactly one `http://` or `https://` URL. If the user omitted it, ask once. If multiple URLs appear, use the **first** only and say you are snapshotting that one.
|
|
17
|
+
|
|
18
|
+
## Step 1 — Persist the source URL
|
|
19
|
+
|
|
20
|
+
Update **`src/lib/launchframe-config.ts`**:
|
|
21
|
+
|
|
22
|
+
- Set **`LAUNCHFRAME_SOURCE_URL`** to the parsed URL (string, `as const`).
|
|
23
|
+
|
|
24
|
+
## Step 2 — Capture (mandatory)
|
|
25
|
+
|
|
26
|
+
From the repository root, run **once** for that URL (same inspector as Launchframe Step 0a). Use the URL’s **hostname** for the output parent (example: `https://www.example.com/path` → `www.example.com`):
|
|
27
|
+
|
|
28
|
+
1. **One-time per machine:** `npx playwright install chromium` if captures fail for missing browsers.
|
|
29
|
+
2. **Capture:**
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm run inspect:page -- "<URL>" --scroll-full --wait-until networkidle --timeout 120000 --out-parent "docs/research/<hostname>/page-inspection"
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
This creates `docs/research/<hostname>/page-inspection/<hostname>-<iso-stamp>/` with **`document.html`** and related artifacts.
|
|
36
|
+
|
|
37
|
+
If navigation times out, retry with `--wait-until domcontentloaded` or a higher `--timeout`, and record what worked.
|
|
38
|
+
|
|
39
|
+
## Step 3 — Verbatim copy to `public`
|
|
40
|
+
|
|
41
|
+
1. Ensure **`public/captured/`** exists.
|
|
42
|
+
2. Pick the **latest** inspection folder under that hostname (sort by the ISO stamp in the folder name).
|
|
43
|
+
3. **Copy** (do not prettify or edit) **`document.html`** from that folder to:
|
|
44
|
+
|
|
45
|
+
**`public/captured/<host-slug>-document.html`**
|
|
46
|
+
|
|
47
|
+
where **`<host-slug>`** is the URL hostname with each **`.`** replaced by **`-`** (e.g. `www.example.com` → `www-example-com`).
|
|
48
|
+
|
|
49
|
+
Same-origin scripts and inline styles stay inside the file; external URLs (CDNs) remain as in the capture.
|
|
50
|
+
|
|
51
|
+
## Step 4 — Home page iframe
|
|
52
|
+
|
|
53
|
+
Replace **`src/app/page.tsx`** with a single full-viewport iframe **only** (no `sandbox` — it breaks many real pages):
|
|
54
|
+
|
|
55
|
+
```tsx
|
|
56
|
+
export default function Home() {
|
|
57
|
+
return (
|
|
58
|
+
<iframe
|
|
59
|
+
src="/captured/<host-slug>-document.html"
|
|
60
|
+
title="Captured snapshot"
|
|
61
|
+
className="fixed inset-0 h-dvh w-dvw border-0"
|
|
62
|
+
/>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Use the same **`<host-slug>`** as in Step 3.
|
|
68
|
+
|
|
69
|
+
## Step 5 — Verify
|
|
70
|
+
|
|
71
|
+
Run **`npm run build`** and fix any errors.
|
|
72
|
+
|
|
73
|
+
## What to tell the user
|
|
74
|
+
|
|
75
|
+
After **`npm run dev`**:
|
|
76
|
+
|
|
77
|
+
- **Iframe:** `http://localhost:3000/`
|
|
78
|
+
- **Direct static file:** `http://localhost:3000/captured/<host-slug>-document.html`
|
|
79
|
+
|
|
80
|
+
## What not to do
|
|
81
|
+
|
|
82
|
+
- Do **not** treat this as **`/launchframe`** (no parallel component specs, no `docs/research/LAUNCHFRAME_SUBAGENTS.md` runs for snapshot).
|
|
83
|
+
- Do **not** hand-rebuild the page in React for this command.
|
|
84
|
+
- Do **not** add `sandbox` on the iframe unless the user explicitly asks and accepts broken script behavior.
|
|
@@ -22,7 +22,7 @@ Before reconnaissance, write or update:
|
|
|
22
22
|
|
|
23
23
|
### Step 0a — Automated page inspection dump (mandatory)
|
|
24
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
|
|
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 **`ai-page-bundle.txt`** (one plain-text file: full post-JS HTML + all captured CSS), plus `document.html`, network `*.css` bodies, `inline-styles.json`, and `motion-summary.json` — attach **`ai-page-bundle.txt`** to the agent when a single pasteable artifact is enough; the frozen bundle complements live `getComputedStyle` / WAAPI work (**it does not replace** Chrome MCP for numeric motion and interaction sweeps).
|
|
26
26
|
|
|
27
27
|
1. **One-time per machine:** `npx playwright install chromium`
|
|
28
28
|
2. **Per URL** — use the URL’s hostname for the folder (example hostname `www.example.com`):
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<!-- AUTO-GENERATED from .claude/skills/snapshot/SKILL.md — do not edit directly.
|
|
2
|
+
Run `node scripts/sync-skills.mjs` to regenerate. -->
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
# Snapshot (`/snapshot`)
|
|
6
|
+
|
|
7
|
+
**`/snapshot`** serves a **frozen copy** of a live URL: the captured **`document.html`** from Playwright lives under **`public/captured/`** and **`src/app/page.tsx`** embeds it in a **full-viewport iframe**. This is **verbatim hosting**, not **`/launchframe`** (no component rebuild, no SaaS overlay, no Phase 6 verification).
|
|
8
|
+
|
|
9
|
+
Parse **the reference URL the user passed with /snapshot**:
|
|
10
|
+
|
|
11
|
+
1. **URL** — Exactly one `http://` or `https://` URL. If the user omitted it, ask once. If multiple URLs appear, use the **first** only and say you are snapshotting that one.
|
|
12
|
+
|
|
13
|
+
## Step 1 — Persist the source URL
|
|
14
|
+
|
|
15
|
+
Update **`src/lib/launchframe-config.ts`**:
|
|
16
|
+
|
|
17
|
+
- Set **`LAUNCHFRAME_SOURCE_URL`** to the parsed URL (string, `as const`).
|
|
18
|
+
|
|
19
|
+
## Step 2 — Capture (mandatory)
|
|
20
|
+
|
|
21
|
+
From the repository root, run **once** for that URL (same inspector as Launchframe Step 0a). Use the URL’s **hostname** for the output parent (example: `https://www.example.com/path` → `www.example.com`):
|
|
22
|
+
|
|
23
|
+
1. **One-time per machine:** `npx playwright install chromium` if captures fail for missing browsers.
|
|
24
|
+
2. **Capture:**
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm run inspect:page -- "<URL>" --scroll-full --wait-until networkidle --timeout 120000 --out-parent "docs/research/<hostname>/page-inspection"
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
This creates `docs/research/<hostname>/page-inspection/<hostname>-<iso-stamp>/` with **`document.html`** and related artifacts.
|
|
31
|
+
|
|
32
|
+
If navigation times out, retry with `--wait-until domcontentloaded` or a higher `--timeout`, and record what worked.
|
|
33
|
+
|
|
34
|
+
## Step 3 — Verbatim copy to `public`
|
|
35
|
+
|
|
36
|
+
1. Ensure **`public/captured/`** exists.
|
|
37
|
+
2. Pick the **latest** inspection folder under that hostname (sort by the ISO stamp in the folder name).
|
|
38
|
+
3. **Copy** (do not prettify or edit) **`document.html`** from that folder to:
|
|
39
|
+
|
|
40
|
+
**`public/captured/<host-slug>-document.html`**
|
|
41
|
+
|
|
42
|
+
where **`<host-slug>`** is the URL hostname with each **`.`** replaced by **`-`** (e.g. `www.example.com` → `www-example-com`).
|
|
43
|
+
|
|
44
|
+
Same-origin scripts and inline styles stay inside the file; external URLs (CDNs) remain as in the capture.
|
|
45
|
+
|
|
46
|
+
## Step 4 — Home page iframe
|
|
47
|
+
|
|
48
|
+
Replace **`src/app/page.tsx`** with a single full-viewport iframe **only** (no `sandbox` — it breaks many real pages):
|
|
49
|
+
|
|
50
|
+
```tsx
|
|
51
|
+
export default function Home() {
|
|
52
|
+
return (
|
|
53
|
+
<iframe
|
|
54
|
+
src="/captured/<host-slug>-document.html"
|
|
55
|
+
title="Captured snapshot"
|
|
56
|
+
className="fixed inset-0 h-dvh w-dvw border-0"
|
|
57
|
+
/>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Use the same **`<host-slug>`** as in Step 3.
|
|
63
|
+
|
|
64
|
+
## Step 5 — Verify
|
|
65
|
+
|
|
66
|
+
Run **`npm run build`** and fix any errors.
|
|
67
|
+
|
|
68
|
+
## What to tell the user
|
|
69
|
+
|
|
70
|
+
After **`npm run dev`**:
|
|
71
|
+
|
|
72
|
+
- **Iframe:** `http://localhost:3000/`
|
|
73
|
+
- **Direct static file:** `http://localhost:3000/captured/<host-slug>-document.html`
|
|
74
|
+
|
|
75
|
+
## What not to do
|
|
76
|
+
|
|
77
|
+
- Do **not** treat this as **`/launchframe`** (no parallel component specs, no `docs/research/LAUNCHFRAME_SUBAGENTS.md` runs for snapshot).
|
|
78
|
+
- Do **not** hand-rebuild the page in React for this command.
|
|
79
|
+
- Do **not** add `sandbox` on the iframe unless the user explicitly asks and accepts broken script behavior.
|
|
@@ -26,7 +26,7 @@ Before reconnaissance, write or update:
|
|
|
26
26
|
|
|
27
27
|
### Step 0a — Automated page inspection dump (mandatory)
|
|
28
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
|
|
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 **`ai-page-bundle.txt`** (one plain-text file: full post-JS HTML + all captured CSS), plus `document.html`, network `*.css` bodies, `inline-styles.json`, and `motion-summary.json` — attach **`ai-page-bundle.txt`** to the agent when a single pasteable artifact is enough; the frozen bundle complements live `getComputedStyle` / WAAPI work (**it does not replace** Chrome MCP for numeric motion and interaction sweeps).
|
|
30
30
|
|
|
31
31
|
1. **One-time per machine:** `npx playwright install chromium`
|
|
32
32
|
2. **Per URL** — use the URL’s hostname for the folder (example hostname `www.example.com`):
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# AUTO-GENERATED from .claude/skills/snapshot/SKILL.md
|
|
2
|
+
# Run `node scripts/sync-skills.mjs` to regenerate.
|
|
3
|
+
|
|
4
|
+
description = "Verbatim page snapshot — run inspect:page, copy document.html to public/captured/, and show it on the home route via a full-viewport iframe (not a React rebuild)."
|
|
5
|
+
|
|
6
|
+
[prompt]
|
|
7
|
+
text = '''
|
|
8
|
+
|
|
9
|
+
# Snapshot (`/snapshot`)
|
|
10
|
+
|
|
11
|
+
**`/snapshot`** serves a **frozen copy** of a live URL: the captured **`document.html`** from Playwright lives under **`public/captured/`** and **`src/app/page.tsx`** embeds it in a **full-viewport iframe**. This is **verbatim hosting**, not **`/launchframe`** (no component rebuild, no SaaS overlay, no Phase 6 verification).
|
|
12
|
+
|
|
13
|
+
Parse **{{args}}**:
|
|
14
|
+
|
|
15
|
+
1. **URL** — Exactly one `http://` or `https://` URL. If the user omitted it, ask once. If multiple URLs appear, use the **first** only and say you are snapshotting that one.
|
|
16
|
+
|
|
17
|
+
## Step 1 — Persist the source URL
|
|
18
|
+
|
|
19
|
+
Update **`src/lib/launchframe-config.ts`**:
|
|
20
|
+
|
|
21
|
+
- Set **`LAUNCHFRAME_SOURCE_URL`** to the parsed URL (string, `as const`).
|
|
22
|
+
|
|
23
|
+
## Step 2 — Capture (mandatory)
|
|
24
|
+
|
|
25
|
+
From the repository root, run **once** for that URL (same inspector as Launchframe Step 0a). Use the URL’s **hostname** for the output parent (example: `https://www.example.com/path` → `www.example.com`):
|
|
26
|
+
|
|
27
|
+
1. **One-time per machine:** `npx playwright install chromium` if captures fail for missing browsers.
|
|
28
|
+
2. **Capture:**
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npm run inspect:page -- "<URL>" --scroll-full --wait-until networkidle --timeout 120000 --out-parent "docs/research/<hostname>/page-inspection"
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
This creates `docs/research/<hostname>/page-inspection/<hostname>-<iso-stamp>/` with **`document.html`** and related artifacts.
|
|
35
|
+
|
|
36
|
+
If navigation times out, retry with `--wait-until domcontentloaded` or a higher `--timeout`, and record what worked.
|
|
37
|
+
|
|
38
|
+
## Step 3 — Verbatim copy to `public`
|
|
39
|
+
|
|
40
|
+
1. Ensure **`public/captured/`** exists.
|
|
41
|
+
2. Pick the **latest** inspection folder under that hostname (sort by the ISO stamp in the folder name).
|
|
42
|
+
3. **Copy** (do not prettify or edit) **`document.html`** from that folder to:
|
|
43
|
+
|
|
44
|
+
**`public/captured/<host-slug>-document.html`**
|
|
45
|
+
|
|
46
|
+
where **`<host-slug>`** is the URL hostname with each **`.`** replaced by **`-`** (e.g. `www.example.com` → `www-example-com`).
|
|
47
|
+
|
|
48
|
+
Same-origin scripts and inline styles stay inside the file; external URLs (CDNs) remain as in the capture.
|
|
49
|
+
|
|
50
|
+
## Step 4 — Home page iframe
|
|
51
|
+
|
|
52
|
+
Replace **`src/app/page.tsx`** with a single full-viewport iframe **only** (no `sandbox` — it breaks many real pages):
|
|
53
|
+
|
|
54
|
+
```tsx
|
|
55
|
+
export default function Home() {
|
|
56
|
+
return (
|
|
57
|
+
<iframe
|
|
58
|
+
src="/captured/<host-slug>-document.html"
|
|
59
|
+
title="Captured snapshot"
|
|
60
|
+
className="fixed inset-0 h-dvh w-dvw border-0"
|
|
61
|
+
/>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Use the same **`<host-slug>`** as in Step 3.
|
|
67
|
+
|
|
68
|
+
## Step 5 — Verify
|
|
69
|
+
|
|
70
|
+
Run **`npm run build`** and fix any errors.
|
|
71
|
+
|
|
72
|
+
## What to tell the user
|
|
73
|
+
|
|
74
|
+
After **`npm run dev`**:
|
|
75
|
+
|
|
76
|
+
- **Iframe:** `http://localhost:3000/`
|
|
77
|
+
- **Direct static file:** `http://localhost:3000/captured/<host-slug>-document.html`
|
|
78
|
+
|
|
79
|
+
## What not to do
|
|
80
|
+
|
|
81
|
+
- Do **not** treat this as **`/launchframe`** (no parallel component specs, no `docs/research/LAUNCHFRAME_SUBAGENTS.md` runs for snapshot).
|
|
82
|
+
- Do **not** hand-rebuild the page in React for this command.
|
|
83
|
+
- Do **not** add `sandbox` on the iframe unless the user explicitly asks and accepts broken script behavior.
|
|
84
|
+
|
|
85
|
+
'''
|
|
@@ -26,7 +26,7 @@ Before reconnaissance, write or update:
|
|
|
26
26
|
|
|
27
27
|
### Step 0a — Automated page inspection dump (mandatory)
|
|
28
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
|
|
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 **`ai-page-bundle.txt`** (one plain-text file: full post-JS HTML + all captured CSS), plus `document.html`, network `*.css` bodies, `inline-styles.json`, and `motion-summary.json` — attach **`ai-page-bundle.txt`** to the agent when a single pasteable artifact is enough; the frozen bundle complements live `getComputedStyle` / WAAPI work (**it does not replace** Chrome MCP for numeric motion and interaction sweeps).
|
|
30
30
|
|
|
31
31
|
1. **One-time per machine:** `npx playwright install chromium`
|
|
32
32
|
2. **Per URL** — use the URL’s hostname for the folder (example hostname `www.example.com`):
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: snapshot
|
|
3
|
+
description: Verbatim page snapshot — run inspect:page, copy document.html to public/captured/, and show it on the home route via a full-viewport iframe (not a React rebuild).
|
|
4
|
+
argument-hint: "<url>"
|
|
5
|
+
argument-substitution: the reference URL the user passed with /snapshot
|
|
6
|
+
user-invocable: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Snapshot (`/snapshot`)
|
|
10
|
+
|
|
11
|
+
**`/snapshot`** serves a **frozen copy** of a live URL: the captured **`document.html`** from Playwright lives under **`public/captured/`** and **`src/app/page.tsx`** embeds it in a **full-viewport iframe**. This is **verbatim hosting**, not **`/launchframe`** (no component rebuild, no SaaS overlay, no Phase 6 verification).
|
|
12
|
+
|
|
13
|
+
Parse **$ARGUMENTS**:
|
|
14
|
+
|
|
15
|
+
1. **URL** — Exactly one `http://` or `https://` URL. If the user omitted it, ask once. If multiple URLs appear, use the **first** only and say you are snapshotting that one.
|
|
16
|
+
|
|
17
|
+
## Step 1 — Persist the source URL
|
|
18
|
+
|
|
19
|
+
Update **`src/lib/launchframe-config.ts`**:
|
|
20
|
+
|
|
21
|
+
- Set **`LAUNCHFRAME_SOURCE_URL`** to the parsed URL (string, `as const`).
|
|
22
|
+
|
|
23
|
+
## Step 2 — Capture (mandatory)
|
|
24
|
+
|
|
25
|
+
From the repository root, run **once** for that URL (same inspector as Launchframe Step 0a). Use the URL’s **hostname** for the output parent (example: `https://www.example.com/path` → `www.example.com`):
|
|
26
|
+
|
|
27
|
+
1. **One-time per machine:** `npx playwright install chromium` if captures fail for missing browsers.
|
|
28
|
+
2. **Capture:**
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npm run inspect:page -- "<URL>" --scroll-full --wait-until networkidle --timeout 120000 --out-parent "docs/research/<hostname>/page-inspection"
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
This creates `docs/research/<hostname>/page-inspection/<hostname>-<iso-stamp>/` with **`document.html`** and related artifacts.
|
|
35
|
+
|
|
36
|
+
If navigation times out, retry with `--wait-until domcontentloaded` or a higher `--timeout`, and record what worked.
|
|
37
|
+
|
|
38
|
+
## Step 3 — Verbatim copy to `public`
|
|
39
|
+
|
|
40
|
+
1. Ensure **`public/captured/`** exists.
|
|
41
|
+
2. Pick the **latest** inspection folder under that hostname (sort by the ISO stamp in the folder name).
|
|
42
|
+
3. **Copy** (do not prettify or edit) **`document.html`** from that folder to:
|
|
43
|
+
|
|
44
|
+
**`public/captured/<host-slug>-document.html`**
|
|
45
|
+
|
|
46
|
+
where **`<host-slug>`** is the URL hostname with each **`.`** replaced by **`-`** (e.g. `www.example.com` → `www-example-com`).
|
|
47
|
+
|
|
48
|
+
Same-origin scripts and inline styles stay inside the file; external URLs (CDNs) remain as in the capture.
|
|
49
|
+
|
|
50
|
+
## Step 4 — Home page iframe
|
|
51
|
+
|
|
52
|
+
Replace **`src/app/page.tsx`** with a single full-viewport iframe **only** (no `sandbox` — it breaks many real pages):
|
|
53
|
+
|
|
54
|
+
```tsx
|
|
55
|
+
export default function Home() {
|
|
56
|
+
return (
|
|
57
|
+
<iframe
|
|
58
|
+
src="/captured/<host-slug>-document.html"
|
|
59
|
+
title="Captured snapshot"
|
|
60
|
+
className="fixed inset-0 h-dvh w-dvw border-0"
|
|
61
|
+
/>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Use the same **`<host-slug>`** as in Step 3.
|
|
67
|
+
|
|
68
|
+
## Step 5 — Verify
|
|
69
|
+
|
|
70
|
+
Run **`npm run build`** and fix any errors.
|
|
71
|
+
|
|
72
|
+
## What to tell the user
|
|
73
|
+
|
|
74
|
+
After **`npm run dev`**:
|
|
75
|
+
|
|
76
|
+
- **Iframe:** `http://localhost:3000/`
|
|
77
|
+
- **Direct static file:** `http://localhost:3000/captured/<host-slug>-document.html`
|
|
78
|
+
|
|
79
|
+
## What not to do
|
|
80
|
+
|
|
81
|
+
- Do **not** treat this as **`/launchframe`** (no parallel component specs, no `docs/research/LAUNCHFRAME_SUBAGENTS.md` runs for snapshot).
|
|
82
|
+
- Do **not** hand-rebuild the page in React for this command.
|
|
83
|
+
- Do **not** add `sandbox` on the iframe unless the user explicitly asks and accepts broken script behavior.
|
|
@@ -25,7 +25,7 @@ Before reconnaissance, write or update:
|
|
|
25
25
|
|
|
26
26
|
### Step 0a — Automated page inspection dump (mandatory)
|
|
27
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
|
|
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 **`ai-page-bundle.txt`** (one plain-text file: full post-JS HTML + all captured CSS), plus `document.html`, network `*.css` bodies, `inline-styles.json`, and `motion-summary.json` — attach **`ai-page-bundle.txt`** to the agent when a single pasteable artifact is enough; the frozen bundle complements live `getComputedStyle` / WAAPI work (**it does not replace** Chrome MCP for numeric motion and interaction sweeps).
|
|
29
29
|
|
|
30
30
|
1. **One-time per machine:** `npx playwright install chromium`
|
|
31
31
|
2. **Per URL** — use the URL’s hostname for the folder (example hostname `www.example.com`):
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Verbatim page snapshot — run inspect:page, copy document.html to public/captured/, and show it on the home route via a full-viewport iframe (not a React rebuild)."
|
|
3
|
+
---
|
|
4
|
+
<!-- AUTO-GENERATED from .claude/skills/snapshot/SKILL.md — do not edit directly.
|
|
5
|
+
Run `node scripts/sync-skills.mjs` to regenerate. -->
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
# Snapshot (`/snapshot`)
|
|
9
|
+
|
|
10
|
+
**`/snapshot`** serves a **frozen copy** of a live URL: the captured **`document.html`** from Playwright lives under **`public/captured/`** and **`src/app/page.tsx`** embeds it in a **full-viewport iframe**. This is **verbatim hosting**, not **`/launchframe`** (no component rebuild, no SaaS overlay, no Phase 6 verification).
|
|
11
|
+
|
|
12
|
+
Parse **$ARGUMENTS**:
|
|
13
|
+
|
|
14
|
+
1. **URL** — Exactly one `http://` or `https://` URL. If the user omitted it, ask once. If multiple URLs appear, use the **first** only and say you are snapshotting that one.
|
|
15
|
+
|
|
16
|
+
## Step 1 — Persist the source URL
|
|
17
|
+
|
|
18
|
+
Update **`src/lib/launchframe-config.ts`**:
|
|
19
|
+
|
|
20
|
+
- Set **`LAUNCHFRAME_SOURCE_URL`** to the parsed URL (string, `as const`).
|
|
21
|
+
|
|
22
|
+
## Step 2 — Capture (mandatory)
|
|
23
|
+
|
|
24
|
+
From the repository root, run **once** for that URL (same inspector as Launchframe Step 0a). Use the URL’s **hostname** for the output parent (example: `https://www.example.com/path` → `www.example.com`):
|
|
25
|
+
|
|
26
|
+
1. **One-time per machine:** `npx playwright install chromium` if captures fail for missing browsers.
|
|
27
|
+
2. **Capture:**
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm run inspect:page -- "<URL>" --scroll-full --wait-until networkidle --timeout 120000 --out-parent "docs/research/<hostname>/page-inspection"
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
This creates `docs/research/<hostname>/page-inspection/<hostname>-<iso-stamp>/` with **`document.html`** and related artifacts.
|
|
34
|
+
|
|
35
|
+
If navigation times out, retry with `--wait-until domcontentloaded` or a higher `--timeout`, and record what worked.
|
|
36
|
+
|
|
37
|
+
## Step 3 — Verbatim copy to `public`
|
|
38
|
+
|
|
39
|
+
1. Ensure **`public/captured/`** exists.
|
|
40
|
+
2. Pick the **latest** inspection folder under that hostname (sort by the ISO stamp in the folder name).
|
|
41
|
+
3. **Copy** (do not prettify or edit) **`document.html`** from that folder to:
|
|
42
|
+
|
|
43
|
+
**`public/captured/<host-slug>-document.html`**
|
|
44
|
+
|
|
45
|
+
where **`<host-slug>`** is the URL hostname with each **`.`** replaced by **`-`** (e.g. `www.example.com` → `www-example-com`).
|
|
46
|
+
|
|
47
|
+
Same-origin scripts and inline styles stay inside the file; external URLs (CDNs) remain as in the capture.
|
|
48
|
+
|
|
49
|
+
## Step 4 — Home page iframe
|
|
50
|
+
|
|
51
|
+
Replace **`src/app/page.tsx`** with a single full-viewport iframe **only** (no `sandbox` — it breaks many real pages):
|
|
52
|
+
|
|
53
|
+
```tsx
|
|
54
|
+
export default function Home() {
|
|
55
|
+
return (
|
|
56
|
+
<iframe
|
|
57
|
+
src="/captured/<host-slug>-document.html"
|
|
58
|
+
title="Captured snapshot"
|
|
59
|
+
className="fixed inset-0 h-dvh w-dvw border-0"
|
|
60
|
+
/>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Use the same **`<host-slug>`** as in Step 3.
|
|
66
|
+
|
|
67
|
+
## Step 5 — Verify
|
|
68
|
+
|
|
69
|
+
Run **`npm run build`** and fix any errors.
|
|
70
|
+
|
|
71
|
+
## What to tell the user
|
|
72
|
+
|
|
73
|
+
After **`npm run dev`**:
|
|
74
|
+
|
|
75
|
+
- **Iframe:** `http://localhost:3000/`
|
|
76
|
+
- **Direct static file:** `http://localhost:3000/captured/<host-slug>-document.html`
|
|
77
|
+
|
|
78
|
+
## What not to do
|
|
79
|
+
|
|
80
|
+
- Do **not** treat this as **`/launchframe`** (no parallel component specs, no `docs/research/LAUNCHFRAME_SUBAGENTS.md` runs for snapshot).
|
|
81
|
+
- Do **not** hand-rebuild the page in React for this command.
|
|
82
|
+
- Do **not** add `sandbox` on the iframe unless the user explicitly asks and accepts broken script behavior.
|
|
@@ -22,7 +22,7 @@ Before reconnaissance, write or update:
|
|
|
22
22
|
|
|
23
23
|
### Step 0a — Automated page inspection dump (mandatory)
|
|
24
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
|
|
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 **`ai-page-bundle.txt`** (one plain-text file: full post-JS HTML + all captured CSS), plus `document.html`, network `*.css` bodies, `inline-styles.json`, and `motion-summary.json` — attach **`ai-page-bundle.txt`** to the agent when a single pasteable artifact is enough; the frozen bundle complements live `getComputedStyle` / WAAPI work (**it does not replace** Chrome MCP for numeric motion and interaction sweeps).
|
|
26
26
|
|
|
27
27
|
1. **One-time per machine:** `npx playwright install chromium`
|
|
28
28
|
2. **Per URL** — use the URL’s hostname for the folder (example hostname `www.example.com`):
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<!-- AUTO-GENERATED from .claude/skills/snapshot/SKILL.md — do not edit directly.
|
|
2
|
+
Run `node scripts/sync-skills.mjs` to regenerate. -->
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
# Snapshot (`/snapshot`)
|
|
6
|
+
|
|
7
|
+
**`/snapshot`** serves a **frozen copy** of a live URL: the captured **`document.html`** from Playwright lives under **`public/captured/`** and **`src/app/page.tsx`** embeds it in a **full-viewport iframe**. This is **verbatim hosting**, not **`/launchframe`** (no component rebuild, no SaaS overlay, no Phase 6 verification).
|
|
8
|
+
|
|
9
|
+
Parse **the reference URL the user passed with /snapshot**:
|
|
10
|
+
|
|
11
|
+
1. **URL** — Exactly one `http://` or `https://` URL. If the user omitted it, ask once. If multiple URLs appear, use the **first** only and say you are snapshotting that one.
|
|
12
|
+
|
|
13
|
+
## Step 1 — Persist the source URL
|
|
14
|
+
|
|
15
|
+
Update **`src/lib/launchframe-config.ts`**:
|
|
16
|
+
|
|
17
|
+
- Set **`LAUNCHFRAME_SOURCE_URL`** to the parsed URL (string, `as const`).
|
|
18
|
+
|
|
19
|
+
## Step 2 — Capture (mandatory)
|
|
20
|
+
|
|
21
|
+
From the repository root, run **once** for that URL (same inspector as Launchframe Step 0a). Use the URL’s **hostname** for the output parent (example: `https://www.example.com/path` → `www.example.com`):
|
|
22
|
+
|
|
23
|
+
1. **One-time per machine:** `npx playwright install chromium` if captures fail for missing browsers.
|
|
24
|
+
2. **Capture:**
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm run inspect:page -- "<URL>" --scroll-full --wait-until networkidle --timeout 120000 --out-parent "docs/research/<hostname>/page-inspection"
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
This creates `docs/research/<hostname>/page-inspection/<hostname>-<iso-stamp>/` with **`document.html`** and related artifacts.
|
|
31
|
+
|
|
32
|
+
If navigation times out, retry with `--wait-until domcontentloaded` or a higher `--timeout`, and record what worked.
|
|
33
|
+
|
|
34
|
+
## Step 3 — Verbatim copy to `public`
|
|
35
|
+
|
|
36
|
+
1. Ensure **`public/captured/`** exists.
|
|
37
|
+
2. Pick the **latest** inspection folder under that hostname (sort by the ISO stamp in the folder name).
|
|
38
|
+
3. **Copy** (do not prettify or edit) **`document.html`** from that folder to:
|
|
39
|
+
|
|
40
|
+
**`public/captured/<host-slug>-document.html`**
|
|
41
|
+
|
|
42
|
+
where **`<host-slug>`** is the URL hostname with each **`.`** replaced by **`-`** (e.g. `www.example.com` → `www-example-com`).
|
|
43
|
+
|
|
44
|
+
Same-origin scripts and inline styles stay inside the file; external URLs (CDNs) remain as in the capture.
|
|
45
|
+
|
|
46
|
+
## Step 4 — Home page iframe
|
|
47
|
+
|
|
48
|
+
Replace **`src/app/page.tsx`** with a single full-viewport iframe **only** (no `sandbox` — it breaks many real pages):
|
|
49
|
+
|
|
50
|
+
```tsx
|
|
51
|
+
export default function Home() {
|
|
52
|
+
return (
|
|
53
|
+
<iframe
|
|
54
|
+
src="/captured/<host-slug>-document.html"
|
|
55
|
+
title="Captured snapshot"
|
|
56
|
+
className="fixed inset-0 h-dvh w-dvw border-0"
|
|
57
|
+
/>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Use the same **`<host-slug>`** as in Step 3.
|
|
63
|
+
|
|
64
|
+
## Step 5 — Verify
|
|
65
|
+
|
|
66
|
+
Run **`npm run build`** and fix any errors.
|
|
67
|
+
|
|
68
|
+
## What to tell the user
|
|
69
|
+
|
|
70
|
+
After **`npm run dev`**:
|
|
71
|
+
|
|
72
|
+
- **Iframe:** `http://localhost:3000/`
|
|
73
|
+
- **Direct static file:** `http://localhost:3000/captured/<host-slug>-document.html`
|
|
74
|
+
|
|
75
|
+
## What not to do
|
|
76
|
+
|
|
77
|
+
- Do **not** treat this as **`/launchframe`** (no parallel component specs, no `docs/research/LAUNCHFRAME_SUBAGENTS.md` runs for snapshot).
|
|
78
|
+
- Do **not** hand-rebuild the page in React for this command.
|
|
79
|
+
- Do **not** add `sandbox` on the iframe unless the user explicitly asks and accepts broken script behavior.
|
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`). 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.
|
|
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. Use **`/snapshot <url>`** for a **verbatim** local copy: Playwright capture → `public/captured/<host>-document.html` → full-viewport iframe on **`src/app/page.tsx`** (not a React rebuild). 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)
|
package/docs/research/example.com/page-inspection/example.com-2026-05-15T21-49-07-887Z/README.txt
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
LaunchFrame page inspection capture
|
|
2
|
+
====================================
|
|
3
|
+
Source: https://example.com/
|
|
4
|
+
|
|
5
|
+
Files:
|
|
6
|
+
ai-page-bundle.txt — **ALL-IN-ONE for LLMs:** HTML + inline/network CSS as plain text
|
|
7
|
+
document.html — Full <html> outerHTML after JS (same HTML as Part 1 of bundle)
|
|
8
|
+
body-outer.html — <body> outerHTML only (smaller)
|
|
9
|
+
inline-styles.json — All inline <style> tag contents
|
|
10
|
+
motion-summary.json— @keyframes + animation/transition-related lines
|
|
11
|
+
capture-meta.json — Viewport, stylesheet URLs, <script> inventory
|
|
12
|
+
*.css — Stylesheets observed on the network (unless --no-css-files)
|
|
13
|
+
|
|
14
|
+
Notes:
|
|
15
|
+
• Some sites lazy-load CSS; use --scroll-full to force more requests.
|
|
16
|
+
• Cross-origin styles you cannot access via JS are still captured here if the browser downloaded them.
|
|
17
|
+
• Motion inside bundled JS (not CSS) is not fully extracted—check script src in capture-meta.json.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
|
|
2
|
+
================================================================================
|
|
3
|
+
LAUNCHFRAME AI PAGE BUNDLE
|
|
4
|
+
================================================================================
|
|
5
|
+
|
|
6
|
+
Source URL: https://example.com/
|
|
7
|
+
Generated: 2026-05-15T21:49:16.186Z
|
|
8
|
+
Viewport: 1440x900
|
|
9
|
+
Wait until: domcontentloaded
|
|
10
|
+
|
|
11
|
+
Single plain-text file: POST-JS HTML plus all captured CSS (inline + network).
|
|
12
|
+
Use document.html / *.css separately if you hit tool context limits.
|
|
13
|
+
|
|
14
|
+
================================================================================
|
|
15
|
+
PART 1 — HTML (document.documentElement.outerHTML)
|
|
16
|
+
================================================================================
|
|
17
|
+
|
|
18
|
+
<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>
|
|
19
|
+
</body></html>
|
|
20
|
+
================================================================================
|
|
21
|
+
PART 2 — CSS (inline <style> tags, then network stylesheets)
|
|
22
|
+
================================================================================
|
|
23
|
+
|
|
24
|
+
/* inline style #0 media=all */
|
|
25
|
+
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}
|
|
26
|
+
================================================================================
|
|
27
|
+
END OF BUNDLE
|
|
28
|
+
================================================================================
|
|
29
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"sourceUrl": "https://example.com/",
|
|
3
|
+
"generatedAt": "2026-05-15T21:49:16.188Z",
|
|
4
|
+
"viewport": {
|
|
5
|
+
"width": 1440,
|
|
6
|
+
"height": 900
|
|
7
|
+
},
|
|
8
|
+
"waitUntil": "domcontentloaded",
|
|
9
|
+
"options": {
|
|
10
|
+
"scrollFull": false,
|
|
11
|
+
"wroteCssFiles": true,
|
|
12
|
+
"wroteAiBundle": true
|
|
13
|
+
},
|
|
14
|
+
"outputs": {
|
|
15
|
+
"documentHtmlBytes": 513,
|
|
16
|
+
"bodyOuterHtmlBytes": 220,
|
|
17
|
+
"aiPageBundleBytes": 1769,
|
|
18
|
+
"networkStylesheets": []
|
|
19
|
+
},
|
|
20
|
+
"scripts": []
|
|
21
|
+
}
|
package/docs/research/example.com/page-inspection/example.com-2026-05-15T21-49-07-887Z/document.html
ADDED
|
@@ -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>
|