multiclone 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/README.md +4 -4
  2. package/agents/section-builder.md +5 -3
  3. package/commands/multiclone.md +2 -2
  4. package/dist/contracts/tools/session.js +9 -8
  5. package/dist/contracts/tools/session.js.map +1 -1
  6. package/dist/project/assets.js +15 -13
  7. package/dist/project/assets.js.map +1 -1
  8. package/dist/project/convert/attrs.js +318 -0
  9. package/dist/project/convert/attrs.js.map +1 -0
  10. package/dist/project/convert/convert.js +304 -0
  11. package/dist/project/convert/convert.js.map +1 -0
  12. package/dist/project/convert/css.js +299 -0
  13. package/dist/project/convert/css.js.map +1 -0
  14. package/dist/project/convert/html.js +425 -0
  15. package/dist/project/convert/html.js.map +1 -0
  16. package/dist/project/convert/jsx.js +335 -0
  17. package/dist/project/convert/jsx.js.map +1 -0
  18. package/dist/project/convert/locate.js +180 -0
  19. package/dist/project/convert/locate.js.map +1 -0
  20. package/dist/project/convert/scripts.js +214 -0
  21. package/dist/project/convert/scripts.js.map +1 -0
  22. package/dist/project/convert/styles.js +228 -0
  23. package/dist/project/convert/styles.js.map +1 -0
  24. package/dist/project/convert/write.js +142 -0
  25. package/dist/project/convert/write.js.map +1 -0
  26. package/dist/project/fonts.js +131 -0
  27. package/dist/project/fonts.js.map +1 -0
  28. package/dist/project/libraries.js +28 -0
  29. package/dist/project/libraries.js.map +1 -0
  30. package/dist/project/method.js +1 -1
  31. package/dist/project/method.js.map +1 -1
  32. package/dist/project/scaffold.js +33 -6
  33. package/dist/project/scaffold.js.map +1 -1
  34. package/dist/session/proc.js +29 -1
  35. package/dist/session/proc.js.map +1 -1
  36. package/dist/session/session.js +47 -4
  37. package/dist/session/session.js.map +1 -1
  38. package/dist/version.js +1 -1
  39. package/package.json +1 -1
  40. package/skills/multiclone/SKILL.md +15 -5
  41. package/templates/react-vite/index.html +1 -1
  42. package/templates/react-vite/src/main.tsx +2 -2
  43. package/templates/react-vite/src/styles/index.css +0 -1
  44. package/dist/project/draft.js +0 -860
  45. package/dist/project/draft.js.map +0 -1
  46. package/templates/react-vite/src/styles/draft.css +0 -1
@@ -13,12 +13,22 @@ The goal is a rebuild that a visitor can't tell apart from the original at any s
13
13
 
14
14
  1. **Ask the scope first**, in one short question: just the landing page, specific pages (which ones), or the whole site. Don't start before the user answers.
15
15
  2. **Start:** `multiclone start <url> --scope landing|pages|site [--pages /pricing,/about]`. It returns in seconds with a **progress link** (for example `http://127.0.0.1:4300/`). Give that link to the user straight away: it shows live progress and then the clone itself.
16
- 3. **Wait for the draft:** `multiclone status --wait draft`. In about 2–3 minutes the session has a quick capture (desktop and mobile in parallel), a React project with the captured fonts, tokens and media, a **first draft** (one component and CSS module per section with the real text, links, images and video), the clone running on localhost and an offline copy of the original. Status lists all the links.
17
- 4. **Polish, don't rewrite.** The draft is in `<workspace>/clone/src/sections/<page>/`. Compare each section with its crop in `captures/<page>/sections/<id>/`, fix layout, make it responsive and clean, add the motion and hovers. Keep the dev server running; it hot-reloads.
16
+ 3. **Wait for the draft:** `multiclone status --wait draft`. In about 2–3 minutes the session has a quick capture (desktop and mobile in parallel), a React project with the captured fonts and media, the **converted page** (below), the clone running on localhost and an offline copy of the original. Status lists all the links.
17
+ 4. **Polish the converted page; never delete or redraw it.** The first draft is the original page converted to React: same markup, same class names, the site's real CSS and its own animation scripts. It already looks and moves like the original, so check it against the original with `compare` before changing anything, then improve it section by section (layout, `@media` fixes, missing hovers). Deleting a section and writing it again from screenshots throws that fidelity away and costs half an hour; don't. Keep the dev server running; it hot-reloads.
18
18
  5. **Deep data arrives in the background.** Other pages (scope pages/site) and the deep pass (motion map, hovers, clicks, coverage, source maps, in `captures/<page>-full`) finish while you work. Check with `multiclone status`. Use the deep capture for motion and hovers when it's done.
19
19
  6. **Compare and fix** (stage 5 below), then hand over. `multiclone stop` ends the servers; the files stay.
20
20
 
21
- Run `start` again to resume after a crash or restart: finished captures are reused and drafted pages are never overwritten.
21
+ Run `start` again to resume after a crash or restart (also from inside the workspace): finished captures are reused and converted pages are never overwritten.
22
+
23
+ ### What the converted page looks like
24
+
25
+ - `src/pages/<Page>.tsx`: the page wrappers around the section components; on mount it runs the original scripts.
26
+ - `src/sections/<page>/<Name>/<Name>.tsx` + `<Name>.css`: one component per section, original markup as JSX, with the CSS rules only that section uses.
27
+ - `src/styles/original/<page>/base.css`: the rest of the site's real stylesheets (shared rules), URLs pointed at `public/media`.
28
+ - `public/original/<page>/*.js`: the site's own scripts (GSAP setups, Lottie, Webflow, sliders), unchanged; the list and order live in `src/original/<page>.ts`, run by `src/lib/original.ts`. Tracking, consent and app-runtime bundles are left out.
29
+ - `src/original/elements.d.ts`: types for custom tags such as `dotlottie-player`.
30
+
31
+ Trade-off: the original class names stay (for example Webflow's `hero_title is-large`), because the real CSS and scripts depend on them. Rename a class only together with its CSS rules and any script that queries it. To port a script to React, rewrite that behaviour in the section (the libraries are installed from npm, e.g. `gsap`), remove its entry from `src/original/<page>.ts`, then compare; one script at a time. `public/original` and `src/styles/original` are excluded from Prettier on purpose.
22
32
 
23
33
  Every command prints a short summary; details live in files. Read big things with `inspect` instead of opening whole files.
24
34
 
@@ -43,7 +53,7 @@ Run them from the terminal: `multiclone <command>`, and `multiclone <command> --
43
53
  | `start` | The fast path above: background session with quick capture, project, first draft, live clone, offline original, other pages and the deep pass. Returns the progress link. |
44
54
  | `status` | Where the session is, with all links. `--wait draft`, `--wait pages` or `--wait deep` blocks until that point. |
45
55
  | `stop` | Stops the session's servers. Files stay. |
46
- | `draft` | Turns a capture into section components inside a scaffolded project (`start` runs it for you). |
56
+ | `draft` | Converts a capture into the React project: original markup as section components, real CSS split per section, original scripts kept (`start` runs it for you). |
47
57
  | `capture` | Real Chrome loads the page per viewport, dismisses consent banners, scrolls like a visitor and records the network, every script and its source maps, the computed-style DOM snapshot, fonts, storage, the intro filmstrip, the scroll motion map, runtime animation libraries, WebGL shaders, event listeners, hover/focus/click states and CSS breakpoints. `--depth quick` keeps only what a draft needs (1–2 minutes). Then it runs `analyze`. |
48
58
  | `analyze` | Rebuilds the derived files from a capture in an isolated worker: section bundles, design tokens, prettified code split into app and vendor, animation calls found in the code, and `REPORT.md`. |
49
59
  | `inspect` | Pages through anything in a capture by facet: `summary`, `section`, `dom`, `styles`, `network`, `motion`, `animations`, `runtime`, `interactions`, `code`, `fonts`, `tokens`. Use `selector`, `viewport`, `query`, `offset` and `limit` to keep pages small. |
@@ -90,7 +100,7 @@ Before coding, write a short plan: the sections and their components, the techni
90
100
  Work top to bottom, one section bundle at a time. For pages with many sections, hand independent sections to a sub-agent using the `section-builder` brief ([agents/section-builder.md](../../agents/section-builder.md)), one section each, after the shell is in place.
91
101
 
92
102
  1. **Shell first:** fonts, tokens, header, footer, smooth scroll and any global background.
93
- 2. **Then each section:** read its `section.md`. If a draft exists (`src/sections/<page>/<Name>/`), polish it in place: turn repeated markup into data plus a map, rename classes to meaningful names, replace fixed widths with responsive layout, and delete wrappers that only existed for the original's framework. Otherwise rebuild it as one component under `src/sections/<page>/`. Look at it next to its crop before moving on.
103
+ 2. **Then each section:** read its `section.md`. If a converted section exists (`src/sections/<page>/<Name>/`), polish it in place: fix what compare flags, turn repeated markup into data plus a map where it helps, and port its script to React only when you can match the motion. Never delete it to start over. Otherwise rebuild it as one component under `src/sections/<page>/`. Look at it next to its crop before moving on.
94
104
  3. **Tag for compare** with the helpers in `@/lib/mc`:
95
105
  - `<section {...mcSection('03-pricing')}>` with the section id;
96
106
  - `{...mcTrack(id)}` on every element listed in the section's `motion.json`;
@@ -6,7 +6,7 @@
6
6
  <title>{{title}}</title>
7
7
  </head>
8
8
  <body>
9
- <div id="root"></div>
9
+ <div id="mc-root"></div>
10
10
  <script type="module" src="/src/main.tsx"></script>
11
11
  </body>
12
12
  </html>
@@ -3,8 +3,8 @@ import { createRoot } from 'react-dom/client';
3
3
  import { App } from '@/app/App';
4
4
  import '@/styles/index.css';
5
5
 
6
- const container = document.getElementById('root');
7
- if (!container) throw new Error('Missing #root container');
6
+ const container = document.getElementById('mc-root');
7
+ if (!container) throw new Error('Missing #mc-root container');
8
8
 
9
9
  createRoot(container).render(
10
10
  <StrictMode>
@@ -1,4 +1,3 @@
1
1
  @import './fonts.css';
2
2
  @import './tokens.css';
3
3
  @import './base.css';
4
- @import './draft.css';