@typeroll/mcp-server 0.45.168 → 0.45.170

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 (42) hide show
  1. package/AGENTS.md +2 -1
  2. package/dist/bundled-content.js +26 -13
  3. package/dist/server.js +4 -0
  4. package/dist/tools/apps.js +33 -0
  5. package/dist/tools/fonts.js +1 -1
  6. package/dist/tools/forms.js +4 -3
  7. package/dist/tools/media.js +2 -2
  8. package/dist/tools/migration.js +1 -1
  9. package/dist/tools/pages.js +4 -0
  10. package/dist/tools/preview.js +4 -0
  11. package/dist/tools/settings.js +1 -1
  12. package/dist/tools/styles.js +1 -1
  13. package/dist/version.d.ts +1 -1
  14. package/dist/version.js +1 -1
  15. package/dist/workspace.d.ts +1 -1
  16. package/dist/workspace.js +17 -8
  17. package/package.json +1 -1
  18. package/skills/tr-brand.md +1 -1
  19. package/skills/tr-migrate-astro.md +4 -13
  20. package/skills/tr-migrate-multisite.md +10 -31
  21. package/skills/tr-migrate-wp.md +73 -384
  22. package/skills/tr-responsive.md +14 -0
  23. package/workspace-templates/scripts/README.md +18 -0
  24. package/workspace-templates/scripts/typeroll/browser.cjs +6 -1
  25. package/workspace-templates/scripts/typeroll/call.py +5 -2
  26. package/workspace-templates/scripts/typeroll/css_report.py +45 -0
  27. package/workspace-templates/scripts/typeroll/inventory.py +264 -0
  28. package/workspace-templates/scripts/typeroll/media_fit.py +112 -0
  29. package/workspace-templates/scripts/typeroll/migration.py +254 -0
  30. package/workspace-templates/scripts/typeroll/page_part.cjs +34 -0
  31. package/workspace-templates/scripts/typeroll/page_source.py +148 -0
  32. package/workspace-templates/scripts/typeroll/pages.py +156 -0
  33. package/workspace-templates/scripts/typeroll/read_pages.cjs +169 -0
  34. package/workspace-templates/scripts/typeroll/shoot_hosted.cjs +13 -6
  35. package/workspace-templates/scripts/typeroll/trlib.py +45 -7
  36. package/workspace-templates/scripts/typeroll/verify_migration.cjs +47 -0
  37. package/workspace-templates/scripts/typeroll/verify_migration.py +274 -0
  38. package/workspace-templates/scripts/typeroll/write_pages.py +542 -0
  39. package/workspace-templates/skills/typeroll-migrate-sources.md +36 -0
  40. package/workspace-templates/skills/typeroll-migrate.md +109 -0
  41. package/workspace-templates/workflows/design.md +1 -1
  42. package/workspace-templates/workflows/migration.md +12 -5
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: tr-migrate-wp
3
- description: Use when the user asks to migrate a WordPress site to Typeroll, mentions wp-json, or names a WP source URL. Walks the WP REST API, preserves cleaned HTML and shared references, transfers media, sets redirects, and leaves everything as drafts for human review. Typeroll does not convert HTML into blocks.
3
+ description: Use when the user asks to migrate a WordPress site to Typeroll, mentions wp-json, or names a WP source URL. The rules of the platform for addresses, media, redirects and launch; the steps are in the starter skill typeroll-migrate. Everything is imported as drafts. Typeroll does not convert HTML into blocks.
4
4
  ---
5
5
 
6
6
  # Migrate from WordPress to Typeroll
@@ -16,6 +16,15 @@ Use standard blocks first, reviewed custom types next, rare documented HTML last
16
16
  All four combinations must preserve or meaningfully redirect every old public URL. That
17
17
  shared contract defines acceptance; this recipe only adds source-specific steps.
18
18
 
19
+ **How to do it:** the starter workspace has the recipe. Its skill
20
+ `typeroll-migrate` runs six steps with saved results and two owner approvals,
21
+ working from what visitors see, whatever the site is built with, and
22
+ `typeroll-migrate-sources` covers public lists and exports. Create or update the
23
+ workspace with `npx @typeroll/mcp-server init . --update`. Without a workspace,
24
+ follow the same order by hand: inventory, a content type and template decided for every page, content model the owner approves,
25
+ prototype the owner approves, import as drafts, compare, hand over. This
26
+ recipe holds what the platform requires either way.
27
+
19
28
  > **The buffer model (draft writes).** Every content write in this recipe
20
29
  > (pages, blocks and partials) lands in an unsaved per-doc
21
30
  > DRAFT — deploys and plain previews only see SAVED content. For recipe-style
@@ -23,132 +32,25 @@ shared contract defines acceptance; this recipe only adds source-specific steps.
23
32
  > the task itself), or run `commit_working_copy` per doc before any
24
33
  > `trigger_deploy`. Preview your drafts with `include_working_copy: true`.
25
34
 
26
- The platform's migration workflow is the "managed" path for customers who
27
- want one-click. It runs on the server and is also available to you:
28
- `start_workflow type="migration" config={ wp_url }` on an existing site, or
29
- `create_site_and_migrate` (organization key) for a new one; poll `get_workflow`
30
- and approve its review gate only with the user's consent. This skill is the
31
- "power-user" path: you do it locally, mix data sources freely, and the user
32
- reviews each step in their terminal.
33
-
34
- ## Site tokens before block overrides
35
-
36
- Core 0.2.106 / template capabilities 0.54.0 adds palette names in all colour
37
- fields and named typography/spacing steps. Check the connected capability
38
- version; on older renderers use `var(--color-surface)` rather than a bare name.
39
-
40
- Set colours and font families in site settings, then use named styles and
41
- palette names in blocks. Do not write hex, rgb or font-family literals in block
42
- content. Prefer `primary`, `secondary`, `accent`, `background`, `surface`, `text`,
43
- `text_light`, and `on_primary`/`on_secondary`/`on_accent` for text on brand colours.
44
- Use `surface_hover` for a darker interactive surface (derived automatically
45
- unless explicitly configured). Existing semantic roles should be reused; a
46
- new visual shade is not automatically a new semantic role. For a derived shade
47
- use `color-mix(in srgb, var(--color-surface) 92%, var(--color-primary))`.
48
- For an additional role not in the native palette, define a named site style
49
- or a site CSS variable derived from existing palette variables, and document it.
50
-
51
- Choose `heading`, `body` or `mono` for fonts. Font families belong only in the
52
- site's `fonts` settings. Use type-size steps `xs`, `sm`, `md`, `lg`, `xl`, `2xl`,
53
- `3xl`; spacing `none`, `xs`, `sm`, `md`, `lg`, `xl`; line height `tight`, `snug`,
54
- `normal`, `relaxed`, `loose`. Presentation fields accept responsive maps of these
55
- names, for example `font_size_px: {mobile: "md", desktop: "lg"}`. Read the field
56
- schema: counts, widths and breakpoints are not spacing steps. Pixel values are
57
- explicit exceptions, not the default authoring method. Configure scales in
58
- `design_scales`, then reuse them in role styles and blocks.
59
-
60
- Record deliberate exceptions in `decisions.md`, with source/block, reason and
61
- review criteria (for example white text on a photograph). Run `lint_design_tokens`
62
- before launch and after major design changes. It warns, never blocks launch.
63
- Use the starter's `scripts/typeroll/color_tokens.py` for an exact-match dry run;
64
- review the plan before applying it in a dedicated Version. Equal hex values can
65
- mean different roles: never automatically choose between background and text.
66
- Verify a primary/surface change in a test Version across header, footer, cards,
67
- menus and buttons, then restore the test settings. Do not republish automatically.
68
-
69
-
70
- ## Preconditions
71
-
72
- **Run the readiness check FIRST — before touching any content:**
73
-
74
- ```
75
- get_migration_readiness source_url="https://oldsite.com"
76
- ```
35
+ **Managed import:** `start_workflow type="migration" config={ wp_url }` on an
36
+ existing site, or `create_site_and_migrate` (organization key) for a new one; poll
37
+ `get_workflow` and approve its review gate only with the user's consent. It stores
38
+ cleaned HTML. Typeroll does not convert HTML into blocks, and `set_page_mode` never
39
+ rewrites HTML: you rebuild the pages with block tools. Keep the complete source
40
+ before switching modes and never publish the empty page in between.
77
41
 
78
- When the migration includes reusable page/item layouts, include each proposed
79
- block composition and its content type fields in this same call. A
80
- `waiting_for_native_support` result means inspect the actual blocker. Review
81
- intentional custom types and rare HTML exceptions using `tr-migration-evidence`;
82
- fix missing types/fields and report renderer defects rather than masking them. Independent content and SEO work may continue. Rerun the review after the
83
- required Core version is deployed, then verify preview and a fresh hosted
84
- build.
85
-
86
- Pass `source_url` — that adds the checks on the site you're migrating FROM.
87
- An old host that answers 403/429 to server-side requests is a **blocker**: the
88
- import would produce empty pages, or pages containing the host's block page,
89
- which reads as real content and is worse. Whether `/wp-json` answers is a
90
- warning, since scraping is a real fallback (it just loses ACF/custom fields).
91
-
92
- If `ready` is false, STOP and report the blockers to the user. Do not start
93
- the import "and fix it after": every blocker is one whose failure is invisible
94
- once the work is done, so discovering it late means redoing the expensive part.
95
-
96
- - **Media storage** — without it, every `<img>` keeps its WordPress URL. The
97
- new site looks perfect and is still served images by the old host. It breaks
98
- the day the customer cancels that hosting, months later, all at once.
99
- - **Publishing** — with verified Organization storage, customer publishing can
100
- import and preview before GitHub, builds or website domains are connected.
101
- Publishing readiness is a separate gate before a hosted build/cutover. Legacy
102
- self-hosted configurations may report a missing hosting adapter; follow the
103
- returned blocker rather than assuming all installations have the same setup.
104
-
105
- Warnings are worth relaying but don't stop you: no verification origin (the
106
- pre-cutover parity check can't run), forms without a
107
- notification address, or a target site with no design to rebuild INTO.
108
-
109
- Then the ordinary preconditions:
110
-
111
- - MCP connected through personal OAuth or an appropriately scoped API key.
112
- Select and confirm the Site/Version before writes; do not request pasted secrets.
113
- - The source WP site has `/wp-json` reachable (Google for "wordpress
114
- REST API disabled" if not — common for hardened hosts).
115
- - The target exists. Establish the source design baseline first, then prove
116
- representative target templates using `tr-migration-evidence`. Preserve
117
- appearance when design_intent is preserve; use the approved design brief when it is renew. Review text against its separate choice.
118
- - If the target already has content, you must NOT clobber it — always
119
- `list_pages` first and only write to slugs that don't already exist.
120
- Pass the slug explicitly: `create_page` then refuses an address that is
121
- already in use (409 `slug_in_use` naming the existing page) instead of
122
- numbering it.
123
-
124
- ## Recipe
125
-
126
- ### 1. Probe and inventory
127
-
128
- ```
129
- fetch <wp-url>/wp-json # confirm REST is on
130
- fetch <wp-url>/wp-sitemap.xml or /sitemap.xml # URL inventory
131
- ```
42
+ ## Before you import
132
43
 
133
- Build a list of every URL you intend to migrate. WP custom post types
134
- need their REST endpoint (e.g. `/wp-json/wp/v2/news?per_page=100`),
135
- walking `X-WP-TotalPages` to paginate.
44
+ - `get_migration_readiness source_url="https://oldsite.com"` with the proposed block
45
+ compositions and content type fields. If `ready` is false, stop and report. A
46
+ 403/429 from the old host is a blocker; a closed `/wp-json` is a warning.
47
+ - `get_import_readiness` for storage (last section).
48
+ - If the target has content, `list_pages` first and pass every slug explicitly:
49
+ `create_page` then refuses an address in use (409 `slug_in_use`) instead of numbering it.
50
+ - Set colours, fonts and scales in site settings first, then use palette names and
51
+ steps in blocks. Run `lint_design_tokens` before launch. `tr-brand` has the rules.
136
52
 
137
- ### 2. Measure the source and protect existing target work
138
-
139
- ```
140
- get_site
141
- read_site_settings # colors, fonts, voice cues
142
- list_partials # header / footer / shared
143
- read_partial partial_id="header" # nav structure
144
- list_pages limit=5
145
- batch_read_pages page_ids=[<2-3 representative ids>] # see actual conventions
146
- ```
147
-
148
- Don't skip this. Imposing a stranger's design on a customer's site is
149
- the biggest avoidable mistake.
150
-
151
- ### 2b. Launch basics (ask early)
53
+ ## Launch basics (ask early)
152
54
 
153
55
  Ask the user for these once, early in the project. Read `read_site_settings` first and ask only for
154
56
  what is missing. Each item is optional. Record a skipped item in
@@ -164,147 +66,32 @@ what is missing. Each item is optional. Record a skipped item in
164
66
  (LinkedIn, Instagram, GitHub and similar). Set `organization` with `same_as`;
165
67
  it becomes the home page's Organization schema.
166
68
 
167
- ### 3. Normalize shared data before importing page bodies
168
-
169
- Read taxonomy definitions and paginated terms from the helper's `/taxonomies`
170
- and `/terms/{taxonomy}` (Helper 0.3.2), or WordPress REST. Create a Content type
171
- for each taxonomy and one Page per term. Preserve term IDs in a stable source
172
- mapping, archive URLs, parents and custom fields such as icons/emoji.
173
-
174
- Add `page_ref_list` fields to article Content types. Store term Page IDs, never
175
- copied category names, emojis, slugs or sort values on every article. Category
176
- archives can list articles using `core/repeater` with `source_type: backlinks`.
177
- Use an explicit primary category for breadcrumbs when available; do not guess
178
- among multiple categories. A table of contents is a derived template block,
179
- not a `toc_html` field.
180
-
181
- Category and tag Pages have editable block bodies. Scaffold the source term
182
- description plus a reverse-reference listing, leaving room for unique editorial
183
- content. Multiple tag/category references do not give a Page multiple parents:
184
- preserve its source page parent, or use an unambiguous primary category. Tags do
185
- not set its parent. `parent` controls breadcrumb ancestry, not URL generation;
186
- preserve the source `path` even when it differs from the chosen hierarchy.
187
-
188
- The managed importer preserves existing imported Pages on retry and refuses
189
- URL/identity conflicts or dangling term references. An older flattened import
190
- requires a separately reviewed mapping repair; do not re-import over edits.
191
-
192
- **Styles.** Recurring source treatments (theme classes for eyebrows, leads,
193
- button variants, highlighted sections) become named site styles
194
- (`create_style`) applied with `style_id`, so editors can change them in one
195
- place. Do not preserve them as classed raw HTML in text blocks.
196
-
197
- ### 4. Import one page at a time, draft status
198
-
199
- For each source URL:
200
-
201
- a. Choose access based on missing evidence, not a mandatory plugin install:
202
-
203
- | Source requirement | Access path |
204
- | --- | --- |
205
- | Public Pages, posts, media and rendered builder content exposed in REST | Public paginated `/wp-json/wp/v2/pages`, `/posts`, `/media` and rendered HTML can suffice |
206
- | SEO exposed in `yoast_head_json`, visible menus/backgrounds | Public REST + rendered HTML/CSS; verify actual coverage |
207
- | Private/draft content, REST-hidden types, ACF/custom fields, exact menus | Authenticated helper/export when available and authorized |
208
- | REST blocked by security policy | Owner-approved helper/export; do not bypass access controls |
209
- | Authoritative old slugs or plugin redirects | Owner export/helper **if supported**; a public crawl only approximates them |
210
-
211
- Do not ask the owner to install the helper when public sources cover the scope.
212
- Inventory both Pages and posts (including sitemap-excluded public records),
213
- crawl internal links and inspect redirects, menus and CSS background images.
214
- On the user's own computer, crawl and download slowly (one or two requests
215
- at a time, back off on 429/503): an ISP, router or DNS resolver can throttle
216
- or block rapid requests. Prefer a cloud session for large sites.
217
- Do not claim the helper exports a field without reading its current contract.
218
- The helper is distributed through Typeroll's documented package; do not claim
219
- WordPress.org availability. Listing it there is separate publication work.
220
-
221
- b. Clean the HTML. Parse HTML and discard comments before extracting text or
222
- constructing blocks (comments may contain old phone-plugin metadata). Do not
223
- use regex tag removal as a text parser. Resolve relative `../` links against
224
- the source URL; preserve query strings and fragments. Report missing targets
225
- instead of pointing everything at the home page. Strip Elementor / Gutenberg / Breakdance class
226
- soup. Drop empty `<div>` and `<span>` wrappers. Keep semantic tags,
227
- tables, iframes from known hosts (YouTube / Vimeo / Calendly).
228
- Remove every `<script>`: plugin and theme JavaScript is never copied.
229
- Analytics and advertising tags move to the Integrations app behind the
230
- cookie banner (tr-migration-evidence, "Scripts, tracking and consent").
231
-
232
- c. Migrate referenced images with `upload_media_from_url`. The customer's
233
- transfer Worker copies and verifies them directly in R2. Use the returned
234
- media reference only after verification. Stop and report a failed required
235
- transfer; do not silently hotlink the WordPress source.
236
-
237
- Preserve the old public image addresses separately from rewriting the new
238
- HTML. Prefer a safe existing address or `public_path` when appropriate;
239
- changing the host still needs compatible routing. Use a prefix redirect only
240
- for a complete, established namespace whose remaining paths and filenames are
241
- unchanged. Use exact mappings for different filenames or statuses, with Bulk
242
- overflow when needed. Do not generate a redirect for each private or
243
- never-public variant, infer a wildcard from a partial image inventory, or
244
- delete existing rules after rewriting HTML. Core 0.3.48 omits redundant
245
- per-file lines covered by an equivalent existing rule in the frozen output,
246
- without changing stored rules. See https://typeroll.com/docs/tools/redirects/.
247
-
248
- From Core 0.3.49, new uploads default to the media root (`photo.jpg`), without
249
- automatic year/month folders. Explicit folders and WordPress upload-relative
250
- folders are preserved; `wp-content/uploads` and multisite prefixes are removed
251
- from new addresses. Different bytes receive permanent numeric names (`photo-2.jpg`);
252
- safe old aliases for included media stay available without a redirect per replacement.
253
- Managed WordPress imports declare their uploads namespace so publication can
254
- use one prefix with exact collision exceptions. A borrowed image alone does
255
- not declare a namespace. Check the returned public paths and the complete old
256
- URL inventory; Cloud requires the corresponding platform release. A reserved name
257
- does not retain a deleted or unused file in every future build. Private object
258
- keys and responsive variants can still contain hashes; never construct URLs
259
- from those internal keys.
260
-
261
- The managed importer stores cleaned HTML. Typeroll does not convert HTML into blocks, and `set_page_mode` never rewrites HTML. You, the external agent, rebuild the imported content with ordinary block tools. The owner does not need to convert every Page manually. There is no editor conversion preview; it was removed in Core 0.2.58. Preserve the complete source before switching modes and never publish the empty intermediate Page.
262
-
263
- d. Rebuild into editable blocks according to the selected intent. Preserve exact
264
- wording when text_intent is preserve; track approved changes when it is renew, independently of design. Map headings,
265
- prose, images, buttons and layout to standard fields first, then create
266
- reviewed custom types where needed. Use raw HTML only for a documented,
267
- exceptional fragment. Preserve anchors and map every old URL in either mode.
268
-
269
- e. Write the page as a draft:
270
-
271
- ```
272
- create_page title="..." slug="<last-path-segment>"
273
- path="/<preserved-wordpress/path/>"
274
- blocks=[<native block tree>]
275
- status="draft" kind="article" author="..."
276
- seo_title="..." seo_description="..."
277
- ```
278
-
279
- **Preserve the source URL.** WP post URLs like
280
- `/2024/01/foo-bar/` uses `slug: "foo-bar"` and
281
- `path: "/2024/01/foo-bar/"`. Slug is one segment; `path` preserves the
282
- complete nested URL.
283
-
284
- ### 5. Redirects
285
-
286
- After migration, every URL the agent didn't preserve verbatim needs a
287
- redirect:
288
-
289
- ```
290
- create_redirect from_path="/old-services" to_path="/services"
291
- ```
292
-
293
- Walk the inventory; for each URL: did it become a page with the same
294
- path? If yes, no redirect. If renamed, `create_redirect`. If
295
- combined with another page, redirect to the relevant combined content. Do not
296
- mark a public page excluded just because the new design omits it. Public URL
297
- retirement requires a separately agreed exception; admin/session noise can be
298
- excluded with a recorded reason.
299
-
300
- Use a pattern only after verifying every affected source-to-destination mapping.
301
- For an explicitly approved prefix change, `/old-blog/:slug` → `/articles/:slug`
302
- can preserve intent if each destination contains the corresponding article.
303
- Do not blanket-redirect category/tag/author/feed/year families to a home or blog
304
- page. Date paths need actual route mappings; stripping a year is not enough.
305
- Review source 404s rather than automatically excluding them.
306
-
307
- Rules:
69
+ ## What the platform expects of imported content
70
+
71
+ - Everything is a `draft`, written with `write_mode: "import"`. Set the original
72
+ date with `batch_update_pages` (`date_published`).
73
+ - **Preserve the source URL.** `/2024/01/foo-bar/` is `slug: "foo-bar"` and
74
+ `path: "/2024/01/foo-bar/"`. Slug is one segment; `path` is the whole address.
75
+ - Taxonomies are content types with one Page per term. Articles refer to terms
76
+ with `page_ref_list` fields, never with copied names. Archives list them with
77
+ `core/repeater` `source_type: backlinks`. `parent` controls breadcrumbs, not the address.
78
+ - Recurring treatments become named styles (`create_style`), not classed HTML.
79
+ - Parse HTML and discard comments; never strip tags with a regular expression.
80
+ Resolve relative links against the source.
81
+ - Remove every `<script>`. Analytics and advertising move to the Integrations app
82
+ behind the cookie banner (tr-migration-evidence, "Scripts, tracking and consent").
83
+ - Copy media with `upload_media_from_url` and use the returned address only when it
84
+ is verified. Read the returned paths; never construct one. Old file addresses
85
+ need one prefix redirect or exact rules: https://typeroll.com/docs/tools/redirects/.
86
+ - Read block fields with `read_block_type`. Input banners and tabs have native
87
+ blocks (`core/navigation_form`, `core/tabs`).
88
+
89
+ ## Redirects
90
+
91
+ Every address that is not preserved gets a relevant redirect:
92
+ `create_redirect from_path="/old-services" to_path="/services"`. Use a pattern only
93
+ when every affected address is checked. Never blanket-redirect archives to the home
94
+ page, and review source 404s instead of excluding them.
308
95
 
309
96
  - **Trailing `*` only.** A mid-path splat (`/blog/*/comments`) is dropped
310
97
  silently by Cloudflare — the platform refuses it at write time.
@@ -332,23 +119,22 @@ Rules:
332
119
  point to the media record's `published_url` after the first publication,
333
120
  not to an address you construct.
334
121
 
335
- Then verify against reality before anything is cut over:
122
+ ## Checks before cutover
336
123
 
337
124
  ```
338
125
  import_sitemap url="https://old.example.com/sitemap.xml"
339
- # Optional: direct Search Console query (platform service account must have property access)
340
- import_gsc_performance property="https://old.example.com/" months=6
341
- # Or paste a Search Console Pages CSV via csv="..." and source_origin.
342
- check_internal_links # database preflight before deploy, incl. #fragment targets
343
- verify_migration_urls # after trigger_deploy; compact exceptions by default
126
+ import_gsc_performance property="https://old.example.com/" months=6 # optional
127
+ check_internal_links
128
+ verify_migration_urls # after trigger_deploy
344
129
  record_migration_seo_acceptance # after reviewing this exact deployment
345
- get_migration_launch_report # final fail-closed launch gate
130
+ get_migration_launch_report # final launch gate
346
131
  ```
347
132
 
348
- The inventory merges slash-equivalent URLs into one work item but preserves
349
- their source spellings in `observed_paths`. Verification requests every one of
350
- those spellings; treat a failing variant as a real gap even when coverage is
351
- otherwise complete. Fresh builds expand redirect sources to both slash forms.
133
+ The inventory merges slash-equivalent addresses and keeps every spelling in
134
+ `observed_paths`; a failing spelling is a real gap. Record
135
+ `fidelity: { desktop, mobile, shared_data, integrations, evidence }` with
136
+ `record_migration_seo_acceptance`, from real checks of the exact deployment. HTTP 200
137
+ and text presence do not prove visual fidelity.
352
138
 
353
139
  For a site imported before Typeroll normalized WordPress plain-text fields,
354
140
  audit and repair the legacy records before visual review:
@@ -366,28 +152,7 @@ selection or raise `diff_limit` and review the omitted diffs first. Never work
366
152
  around a `working_copy` conflict: that resource contains another edit which
367
153
  must be resolved separately.
368
154
 
369
- ### 6. Preview + review with the user
370
-
371
- ```
372
- get_preview_link page_id=<id> # one URL the user can click
373
- ```
374
-
375
- Compare the source and target at desktop and mobile widths. Review representative
376
- articles, an archive and the home page. Measure heading sizes, readable width,
377
- spacing, TOC placement and image/card proportions. Scroll below the fold: verify
378
- headings after media, the TOC below a sticky header, anchor landing positions
379
- and related articles inside the intended content column. In Core 0.2.7+, use
380
- `rhythm: "article"` on the Page content slot and `appearance: "card"` on Post
381
- Cards for these native presentation choices; no per-page corrective CSS. Check breadcrumbs and shared
382
- category references; test forms/Extensions. HTTP 200 and text presence do not
383
- prove visual fidelity. Document intentional improvements such as responsive video.
384
-
385
- Record `fidelity: { desktop, mobile, shared_data, integrations, evidence }` with
386
- `record_migration_seo_acceptance`, based on real checks of the exact deployment.
387
- The launch report requires this evidence in Core 0.2.5.
388
- Never mark an unavailable integration or uninspected screenshot as accepted.
389
-
390
- ### 7. Launch and ship (required)
155
+ ## Launch and ship (required)
391
156
 
392
157
  A site is not finished until this step has run. Call `read_site_readiness`
393
158
  before the production publication and again after it. For every item with the
@@ -444,68 +209,6 @@ live website.
444
209
  acknowledgement a deploy is refused with `live_domain_confirmation_required`,
445
210
  naming the live URLs. Show them to the owner; never add the flag on your own.
446
211
 
447
- ## Pitfalls
448
-
449
- - **Don't publish during migration.** Always import as `draft`. Even
450
- if the agent is confident, the customer needs the chance to spot-check.
451
- - **WP slugs sometimes drift.** A post saved with slug `foo-bar` may
452
- have been served at `/2024/01/foo-bar/` due to the permalink
453
- structure. The full URL is what users see in Google; preserve that,
454
- not the bare slug.
455
- - **Image bandwidth.** R2 upload is metered. Use `search_pages`
456
- contains="<old-domain>" on already-imported content to spot images
457
- that weren't transferred.
458
- - **Plugin JavaScript.** Never copy scripts from plugins, the theme or
459
- WordPress core into settings, pages, partials or block types, and never
460
- copy the cookie plugin. Carry analytics and advertising over by ID in the
461
- Integrations app with `cookie_consent.enabled: true`. The launch report
462
- fails on copied source scripts and on tracking outside consent.
463
- - **WP-specific JSON-LD** (Yoast, Rank Math) is usually wrong after a
464
- redesign because it references old URLs. Strip it; let Typeroll
465
- emit fresh Article/Page schemas via `kind: 'article'` + `author`.
466
-
467
- ## When the source isn't WordPress
468
-
469
- The same shape applies for any source — Squarespace export, custom
470
- CMS, scraped HTML, CSV. Replace step 1's "WP REST" probe with whatever
471
- discovery the source supports, and the rest of the recipe is unchanged.
472
-
473
- ## Storage prerequisite
474
-
475
- Before reading or importing source content, call `get_import_readiness` (Core
476
- 0.1.95 / MCP 0.44.68 or later). If `ready` is false, stop the import and show the
477
- returned message and Publishing settings link. The organization must connect
478
- and verify its own storage first. Do not fall back to draft storage, hotlink
479
- source images, or use ordinary page-write tools to bypass the import gate.
480
- Use `upload_media_from_url` for referenced source images; the customer’s
481
- Cloudflare transfer Worker copies and verifies them directly in R2, independently
482
- of the GitHub/Cloudflare build-provider choice.
483
-
484
- ### Raw-source media order (Core 0.2.35+)
485
-
486
- Pass raw body HTML into conversion before any parse/serialize round trip with
487
- another parser. Core applies browser tree construction before lazy-media cleanup.
488
- An image-only H2 becomes an image at that position, not a semantic heading.
489
- Compare ordered headings/text/media/CTAs, including malformed wrappers, lazy and
490
- noscript images and related-content boundaries. Existing Pages are not rewritten;
491
- repair confirmed placement errors against raw source without reimporting edits.
492
-
493
- ## Navigation and empty-media variants
494
-
495
- Inventory first-step input banners independently of final submission providers.
496
- Preserve their fields, required/minimum validation, service tabs and direct links,
497
- mobile collapsed/open states and navigation even when the final integration is
498
- deferred. Core 0.2.40 provides native `core/navigation_form` and mixed `core/tabs`.
499
- Read their schema instead of rebuilding them in HTML or reintroducing a provider
500
- block. Defaults are same-origin and tab-scoped; never place addresses in URLs or
501
- claim cross-origin prefill. The receiving form must explicitly accept the fields.
502
-
503
- Compare listing rows with both real and missing images. Use shared post-card
504
- placeholder settings for theme decoration, preserving real featured images and
505
- explicit `show_image: false`. Compare actual footer link height plus gap, wrapping,
506
- focus and column breakpoints; compact navigation density is an intentional option.
507
- Verify native preview and static output on the agreed viewport boundaries.
508
-
509
212
  ## Before retiring the source
510
213
 
511
214
  Follow the starter's workflows/source-media.md. Archive unused and print originals
@@ -526,27 +229,13 @@ the receipt; read the latest candidate_id before approval. No separate old site
526
229
  is kept at the temporary hostname. Older Core versions use the older branch flow. Respect preserve/renew choices for owner-supplied facts;
527
230
  "timeless" wording must not invent recurring events or erase preserved copy.
528
231
 
529
- ## Fluid typography and component rhythm
530
-
531
- Core 0.2.114 / MCP 0.45.85 / capabilities 0.55.0 adds responsive scales.
532
- Check the connected versions before using this contract. New sites use render
533
- version 10. For an existing site, test a Version first; upgrading rendering
534
- and replacing existing roles are separate, deliberate choices.
535
-
536
- Use `fonts.size_base` (default 16), `typography.ratio_mobile` (1.2),
537
- `typography.ratio_desktop` (1.25), `typography.rhythm` (1), and
538
- `typography.line_length` (65 ch). Set the controls once, then use named type,
539
- spacing and line-height steps. `apply_standard_styles` uses those steps;
540
- `overwrite: true` resets existing roles, so review their current values first.
541
- Explicit sizes and breakpoint overrides still win and are not silently migrated.
542
- A template that owns its text columns sets `typography.line_length` to `"none"`:
543
- prose then fills its column, with no `--measure-prose` custom CSS.
544
-
545
- Heading role margins belong to editorial flow. Component titles use their own
546
- padding/gap, and opening headings in containers/sections add no top margin.
547
- Use role-linked `core/heading` size `auto` or `theme`; explicit hero sizes remain
548
- deliberate exceptions. Do not compensate with per-card negative margins.
549
- Compare 375, 768 and 1280px in Site settings → Design and in a full site preview.
550
- After a rendering upgrade/rebuild, recheck cards, boxed headings, leading text
551
- and webfonts. Boxes should get their outer air from padding. Keep exceptions
552
- in decisions.md, and run lint_design_tokens before launch.
232
+ ## Storage prerequisite
233
+
234
+ Before reading or importing source content, call `get_import_readiness` (Core
235
+ 0.1.95 / MCP 0.44.68 or later). If `ready` is false, stop the import and show the
236
+ returned message and Publishing settings link. The organization must connect
237
+ and verify its own storage first. Do not fall back to draft storage, hotlink
238
+ source images, or use ordinary page-write tools to bypass the import gate.
239
+ Use `upload_media_from_url` for referenced source images; the customer’s
240
+ Cloudflare transfer Worker copies and verifies them directly in R2, independently
241
+ of the GitHub/Cloudflare build-provider choice.
@@ -231,6 +231,20 @@ Below 13, raise the version with `tr-upgrade-rendering` instead of adding site
231
231
  CSS such as `.intro > * { min-width: 0; max-width: 100% }`. Rows and
232
232
  fixed-width children are unchanged.
233
233
 
234
+ ## Section height and article heading space (render version 23)
235
+
236
+ From render version 23 (Core 0.3.84), `core/section.min_height` (auto, sm, md, lg, screen) is responsive:
237
+ `{ mobile: "auto", laptop: "screen" }` is full screen from laptop and content
238
+ height on phones. Below 23 a
239
+ breakpoint object renders as no minimum height, so set one value there.
240
+
241
+ In a container with `rhythm: "article"`, `heading_before_px`/`heading_after_px`
242
+ are the whole visible space before and after its Heading and Rich heading
243
+ blocks, in a flex column as in a flowing container (below 23 the container
244
+ gap and the heading's own margin came on top). A value set only from a larger
245
+ breakpoint, such as `{ desktop: 32 }`, applies from there; smaller screens keep
246
+ the spacing of a container without it. Measure at 390 and 1280 px.
247
+
234
248
  ## Native image framing and body heading scales (Core 0.2.35+)
235
249
 
236
250
  Use `core/image.scale_percent` (100–200, responsive) for deliberate horizontal
@@ -42,6 +42,24 @@ a few pages first. Run large crawls, media copies and full-site checks in a
42
42
  cloud session (Claude Code on the web, Codespaces, CI). Do the same for your
43
43
  own crawling or copying of the old site.
44
44
 
45
+ ## Migration
46
+
47
+ The migrating agent reads, decides and builds. These scripts fetch material, write
48
+ what the agent decided and check the result; none of them judges content. The skill
49
+ typeroll-migrate says how to use them. Each step saves `qa/migration/<step>.json`; page text stays in the ignored `sources/private/`.
50
+
51
+ | Script | What it does | Writes to the CMS |
52
+ | --- | --- | --- |
53
+ | `migration.py status` | what is done, what comes next, whether the files are old | no |
54
+ | `inventory.py` | saves every page of the old site as visitors see it (`read_pages.cjs`): pictures, texts, links, media, forms, videos and redirects | no |
55
+ | `pages.py` | the agent's worksheet: what each page is, and that each new page was looked at | no |
56
+ | `page_source.py` | shows one saved page, or hands out one exact part of it (`page_part.cjs`) | no |
57
+ | `migration.py approve` | records the owner's approval of the model or the prototype | no |
58
+ | `write_pages.py` | writes the page files the agent made; only with `--apply` | drafts |
59
+ | `verify_migration.py` | compares the published test site with the old one | no |
60
+ | `css_report.py` | site CSS and deviations from the design, each with a reason | no |
61
+ | `migration.py handover` | reads the launch report and writes handover.md | no |
62
+
45
63
  ## Before publication
46
64
 
47
65
  ```sh
@@ -45,7 +45,7 @@ function retryDelay(attempt, status, header, now) {
45
45
  let active = null;
46
46
  const nextStart = new Map();
47
47
  function requestProfile() {
48
- if (!active) { active = selectProfile(); console.error(describeProfile(active)); }
48
+ if (!active) { active = selectProfile(); if (!isSet(process.env.TYPEROLL_PROFILE_SHOWN)) console.error(describeProfile(active)); }
49
49
  return active;
50
50
  }
51
51
  const sleep = ms => new Promise(resolve => setTimeout(resolve, ms));
@@ -96,6 +96,11 @@ async function settle(page) {
96
96
  if (y + 900 >= await page.evaluate(() => document.documentElement.scrollHeight)) break;
97
97
  }
98
98
  await page.evaluate(() => scrollTo(0, 0));
99
+ // Fonts and pictures that the scrolling started, at most 5 seconds, so pictures show the finished page.
100
+ await page.evaluate(() => Promise.race([
101
+ Promise.all([document.fonts.ready, ...[...document.images].filter(image => !image.complete).map(image => new Promise(done => { image.onload = image.onerror = done; }))]),
102
+ new Promise(done => setTimeout(done, 5000)),
103
+ ])).catch(() => {});
99
104
  await page.waitForTimeout(300);
100
105
  }
101
106
  async function inspect(page) {
@@ -8,5 +8,8 @@ parser = argparse.ArgumentParser(description=__doc__)
8
8
  parser.add_argument('tool')
9
9
  parser.add_argument('arguments', nargs='?', default='{}', help='JSON or - for stdin')
10
10
  args = parser.parse_args()
11
- value = json.loads(sys.stdin.read() if args.arguments == '-' else args.arguments)
12
- print(json.dumps(trlib.call(args.tool, value), ensure_ascii=False, indent=2))
11
+ try:
12
+ value = json.loads(sys.stdin.read() if args.arguments == '-' else args.arguments)
13
+ print(json.dumps(trlib.call(args.tool, value), ensure_ascii=False, indent=2))
14
+ except (RuntimeError, ValueError) as error:
15
+ raise SystemExit(str(error))