fimo 0.15.0 → 0.16.0-experimental.2

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 (183) hide show
  1. package/assets/astro/components/DateTime.astro +22 -0
  2. package/assets/astro/components/index.d.ts +1 -0
  3. package/assets/astro/components/index.js +1 -0
  4. package/assets/content-templates/forms/react.eta +3 -3
  5. package/assets/content-templates/shared/types.eta +2 -0
  6. package/assets/skills/fimo-cli/SKILL.md +20 -14
  7. package/assets/skills/fimo-cli/references/account.md +1 -1
  8. package/assets/skills/fimo-cli/references/agents.md +13 -10
  9. package/assets/skills/fimo-cli/references/branches.md +39 -38
  10. package/assets/skills/fimo-cli/references/content.md +2 -2
  11. package/assets/skills/fimo-cli/references/credits.md +1 -1
  12. package/assets/skills/fimo-cli/references/deploy.md +30 -14
  13. package/assets/skills/fimo-cli/references/history.md +13 -6
  14. package/assets/skills/fimo-cli/references/hosting.md +114 -0
  15. package/assets/skills/fimo-cli/references/init.md +19 -8
  16. package/assets/skills/fimo-cli/references/integrations/firecrawl.md +2 -0
  17. package/assets/skills/fimo-cli/references/locales.md +39 -15
  18. package/assets/skills/fimo-cli/references/mcp.md +8 -8
  19. package/assets/skills/fimo-cli/references/pages.md +70 -0
  20. package/assets/skills/fimo-cli/references/preview.md +29 -20
  21. package/assets/skills/fimo-cli/references/project-vars-and-secrets.md +1 -1
  22. package/assets/skills/fimo-cli/references/projects.md +3 -3
  23. package/assets/skills/fimo-cli/references/schedules.md +8 -5
  24. package/assets/skills/fimo-cli/references/support.md +1 -1
  25. package/assets/skills/fimo-cli/references/webhooks.md +9 -5
  26. package/assets/skills/fimo-code/SKILL.md +12 -0
  27. package/assets/skills/fimo-code/assets/react-router-locales/LocaleLayout.tsx +12 -0
  28. package/assets/skills/fimo-code/assets/react-router-locales/routes.ts +7 -6
  29. package/assets/skills/fimo-code/references/best-practices/astro.md +47 -0
  30. package/assets/skills/fimo-code/references/best-practices/next.md +42 -0
  31. package/assets/skills/fimo-code/references/best-practices/sveltekit.md +17 -0
  32. package/assets/skills/fimo-code/references/content/richtext.md +5 -0
  33. package/assets/skills/fimo-code/references/content/schema.md +4 -1
  34. package/assets/skills/fimo-code/references/frameworks/astro.md +5 -3
  35. package/assets/skills/fimo-code/references/frameworks/compatibility.md +13 -8
  36. package/assets/skills/fimo-code/references/frameworks/hosting.md +28 -20
  37. package/assets/skills/fimo-code/references/frameworks/next/app-router.md +6 -0
  38. package/assets/skills/fimo-code/references/frameworks/next/locales.md +12 -2
  39. package/assets/skills/fimo-code/references/frameworks/next.md +7 -0
  40. package/assets/skills/fimo-code/references/frameworks/react-router.md +15 -7
  41. package/assets/skills/fimo-code/references/frameworks/sveltekit.md +15 -8
  42. package/assets/skills/fimo-code/references/labels.md +9 -1
  43. package/assets/skills/fimo-code/references/locales.md +8 -2
  44. package/assets/skills/fimo-code/references/migrations/react-router-route-ownership.md +93 -0
  45. package/assets/skills/fimo-code/references/ui.md +21 -2
  46. package/assets/skills/fimo-migration/SKILL.md +297 -53
  47. package/assets/skills/fimo-migration/agents/openai.yaml +2 -2
  48. package/assets/skills/fimo-migration/references/content.md +119 -35
  49. package/assets/skills/fimo-migration/references/decision.md +72 -0
  50. package/assets/skills/fimo-migration/references/forms.md +38 -6
  51. package/assets/skills/fimo-migration/references/frameworks/nextjs.md +179 -23
  52. package/assets/skills/fimo-migration/references/import-contract.md +71 -19
  53. package/assets/skills/fimo-migration/references/manifest.md +11 -161
  54. package/assets/skills/fimo-migration/references/media.md +33 -1
  55. package/assets/skills/fimo-migration/references/platforms.md +26 -2
  56. package/assets/skills/fimo-migration/references/qa.md +185 -13
  57. package/assets/skills/fimo-migration/references/url-evidence.md +242 -0
  58. package/assets/skills/fimo-migration/references/workers/content-execution.md +39 -0
  59. package/assets/skills/fimo-migration/references/workers/content-planner.md +64 -0
  60. package/assets/skills/fimo-migration/references/workers/framework.md +37 -0
  61. package/assets/skills/fimo-migration/references/workers/url-observer.md +71 -0
  62. package/assets/skills/fimo-migration/references/workers/validator.md +31 -0
  63. package/assets/skills/fimo-migration/references/workers.md +104 -0
  64. package/assets/skills/fimo-migration/references/workflow.md +152 -192
  65. package/assets/skills/fimo-migration/scripts/apply-decision.mjs +534 -0
  66. package/assets/skills/fimo-migration/scripts/build-canonical-manifest.mjs +7 -4
  67. package/assets/skills/fimo-migration/scripts/write-migration-report.mjs +191 -4
  68. package/assets/skills/fimo-studio/references/ai-chat.md +1 -1
  69. package/assets/skills/fimo-studio/references/cms.md +25 -7
  70. package/assets/skills/fimo-studio/references/webhooks.md +3 -3
  71. package/assets/sveltekit/components/DateTime.svelte +35 -0
  72. package/assets/sveltekit/components/FimoProvider.svelte +2 -2
  73. package/assets/sveltekit/components/index.d.ts +1 -0
  74. package/assets/sveltekit/components/index.js +1 -0
  75. package/dist/build/next/config.d.ts +4 -1
  76. package/dist/build/next/config.js +21 -5
  77. package/dist/build/sveltekit/vite.d.ts +3 -4
  78. package/dist/build/sveltekit/vite.js +3 -4
  79. package/dist/build/vite/plugins/runtime-env.d.ts +2 -1
  80. package/dist/build/vite/plugins/runtime-env.js +14 -10
  81. package/dist/cli/bundle.json +1 -1
  82. package/dist/cli/index.js +145 -124
  83. package/dist/runtime/app/FimoProviders.js +25 -14
  84. package/dist/runtime/app/prefetch.d.ts +3 -1
  85. package/dist/runtime/app/prefetch.js +11 -55
  86. package/dist/runtime/astro/preview.js +7 -9
  87. package/dist/runtime/content/client/internal.js +1 -0
  88. package/dist/runtime/i18n/locale.d.ts +6 -3
  89. package/dist/runtime/i18n/locale.js +16 -41
  90. package/dist/runtime/next/client-runtime.js +5 -1
  91. package/dist/runtime/next/client.d.ts +3 -2
  92. package/dist/runtime/next/client.js +2 -1
  93. package/dist/runtime/next/labels.d.ts +2 -2
  94. package/dist/runtime/next/labels.js +2 -2
  95. package/dist/runtime/next/preview.d.ts +13 -0
  96. package/dist/runtime/next/preview.js +34 -0
  97. package/dist/runtime/next/primitives/server.d.ts +2 -0
  98. package/dist/runtime/next/primitives/server.js +8 -0
  99. package/dist/runtime/next/provider.d.ts +5 -0
  100. package/dist/runtime/next/provider.js +17 -3
  101. package/dist/runtime/next/server-runtime.js +4 -1
  102. package/dist/runtime/next/server.d.ts +1 -1
  103. package/dist/runtime/next/server.js +1 -1
  104. package/dist/runtime/paths/get-fimo-paths.d.ts +6 -5
  105. package/dist/runtime/paths/get-fimo-paths.js +43 -42
  106. package/dist/runtime/preview/location.d.ts +19 -2
  107. package/dist/runtime/preview/location.js +16 -2
  108. package/dist/runtime/primitives/index.d.ts +1 -0
  109. package/dist/runtime/primitives/index.js +1 -0
  110. package/dist/runtime/react/primitives/editable/DateTime.d.ts +4 -0
  111. package/dist/runtime/react/primitives/editable/DateTime.js +13 -0
  112. package/dist/runtime/react/primitives/renderers/DateRenderer.d.ts +7 -1
  113. package/dist/runtime/react/primitives/renderers/DateRenderer.js +11 -8
  114. package/dist/runtime/react-router/{routes.d.ts → legacy/routes.d.ts} +6 -1
  115. package/dist/runtime/react-router/{routes.js → legacy/routes.js} +22 -7
  116. package/dist/runtime/routes/index.d.ts +162 -0
  117. package/dist/runtime/routes/index.js +335 -0
  118. package/dist/runtime/routing/AppRoutesProvider.js +4 -3
  119. package/dist/runtime/seo/resolver.d.ts +5 -0
  120. package/dist/runtime/seo/resolver.js +10 -42
  121. package/dist/runtime/shared/fimo-config.types.d.ts +14 -13
  122. package/dist/runtime/shared/preview-location.d.ts +1 -22
  123. package/dist/runtime/shared/preview-location.js +5 -93
  124. package/dist/runtime/sveltekit/preview.d.ts +12 -3
  125. package/dist/runtime/sveltekit/preview.js +13 -8
  126. package/dist/runtime/sveltekit/runtime.js +4 -1
  127. package/dist/runtime/templates.d.ts +19 -0
  128. package/dist/runtime/templates.js +33 -0
  129. package/dist/scripts/sync-forms.js +1 -1
  130. package/dist/scripts/sync-schemas.js +1 -4
  131. package/dist/scripts/validate-fimo-config.js +5 -1
  132. package/dist/scripts/validate-page-registry.d.ts +2 -0
  133. package/dist/scripts/validate-page-registry.js +167 -0
  134. package/dist/scripts/validate-route-metadata.js +132 -41
  135. package/package.json +10 -5
  136. package/release.json +2 -2
  137. package/templates/astro/.fimo/config.json +13 -5
  138. package/templates/astro/AGENTS.md +6 -1
  139. package/templates/astro/astro.config.mjs +7 -0
  140. package/templates/astro/package.json +1 -1
  141. package/templates/astro/pnpm-workspace.yaml +0 -3
  142. package/templates/astro/src/components/ProjectOverview.astro +9 -6
  143. package/templates/astro/src/layouts/Base.astro +1 -1
  144. package/templates/astro/src/locales.ts +4 -0
  145. package/templates/astro/src/pages/[locale]/index.astro +19 -0
  146. package/templates/astro/src/pages/[locale]/projects/[slug].astro +35 -0
  147. package/templates/astro/src/pages/[locale]/projects/index.astro +19 -0
  148. package/templates/astro/src/pages/index.astro +5 -2
  149. package/templates/astro/src/pages/projects/[slug].astro +4 -2
  150. package/templates/astro/src/pages/projects/index.astro +5 -2
  151. package/templates/nextjs/.fimo/config.json +2 -1
  152. package/templates/nextjs/AGENTS.md +6 -0
  153. package/templates/nextjs/package.json +1 -1
  154. package/templates/nextjs/src/app/(default)/layout.tsx +10 -0
  155. package/templates/nextjs/src/app/[locale]/layout.tsx +22 -0
  156. package/templates/nextjs/src/app/[locale]/page.tsx +1 -0
  157. package/templates/nextjs/src/components/Document.tsx +26 -0
  158. package/templates/nextjs/src/components/FimoPreviewBridge.tsx +13 -0
  159. package/templates/nextjs/src/locales.ts +13 -0
  160. package/templates/react-router/.fimo/config.json +3 -6
  161. package/templates/react-router/AGENTS.md +5 -0
  162. package/templates/react-router/package.json +2 -2
  163. package/templates/react-router/pnpm-workspace.yaml +1 -3
  164. package/templates/react-router/react-router.config.ts +4 -10
  165. package/templates/react-router/src/pages/LocaleLayout.tsx +12 -0
  166. package/templates/react-router/src/root.tsx +2 -4
  167. package/templates/react-router/src/routes.ts +5 -3
  168. package/templates/sveltekit/.fimo/config.json +2 -1
  169. package/templates/sveltekit/AGENTS.md +6 -0
  170. package/templates/sveltekit/package.json +1 -1
  171. package/templates/sveltekit/src/app.html +1 -1
  172. package/templates/sveltekit/src/hooks.server.ts +11 -0
  173. package/templates/sveltekit/src/locales.ts +8 -0
  174. package/templates/sveltekit/src/params/locale.ts +5 -0
  175. package/templates/sveltekit/src/routes/+layout.server.ts +6 -1
  176. package/templates/sveltekit/src/routes/+layout.svelte +5 -0
  177. package/assets/skills/fimo-migration/references/inventory/coordinator.md +0 -40
  178. package/assets/skills/fimo-migration/references/inventory/locales/next-intl.md +0 -39
  179. package/assets/skills/fimo-migration/references/inventory/locales.md +0 -41
  180. package/assets/skills/fimo-migration/scripts/inventory/locales/next-intl.mjs +0 -459
  181. package/templates/nextjs/src/app/layout.tsx +0 -17
  182. /package/templates/nextjs/src/app/{page.tsx → (default)/page.tsx} +0 -0
  183. /package/templates/sveltekit/src/routes/{+page.svelte → [[locale=locale]]/+page.svelte} +0 -0
@@ -1,194 +1,154 @@
1
1
  # Migration Workflow
2
2
 
3
- Use this as the phase contract for complete migrations.
4
-
5
- ## Phase 0: Target Safety
6
-
7
- 1. Confirm the target path.
8
- 2. If the target path is missing, create exactly one Fimo project there.
9
- 3. If it has `.fimo/project.json` or the legacy `.fimo.settings.json`, reuse it.
10
- 4. If it is non-empty and not a Fimo project, stop and ask for a target path.
11
- 5. Never overwrite user work outside generated migration folders without reading
12
- the existing files first.
13
-
14
- ## Phase 1: Source Intake
15
-
16
- Classify all available evidence:
17
-
18
- - published URLs and sitemap URLs
19
- - downloaded HTML, source repo, builder export, or static export
20
- - CMS CSV/XML/JSON exports
21
- - media folders and remote media URLs
22
- - forms and third-party form actions
23
- - redirects, locales, SEO metadata, robots/sitemap data
24
- - unsupported app behavior such as auth, commerce, search, members, custom JS
25
-
26
- For source-backed migrations, inspect the source/export directly with shell
27
- tools such as `rg`, `find`, `ls`, and targeted file reads. Treat CMS exports and
28
- media folders as source-of-truth evidence, then copy normalized facts into the
29
- canonical ledger.
30
-
31
- For URL-only migrations, run `fimo migrate <url> [dir]` and inspect
32
- `.fimo/migrations/current/`.
33
-
34
- Read these URL migration artifacts first when they exist:
35
-
36
- - `.fimo/migrations/current/brief.md`
37
- - `.fimo/migrations/current/manifest.json`
38
- - `.fimo/migrations/current/extracted/pages.json`
39
- - `.fimo/migrations/current/extracted/forms.json`
40
- - `.fimo/migrations/current/extracted/design-tokens.json`
41
- - `.fimo/migrations/current/refine/agent-prompt.md`
42
- - `.fimo/migrations/current/refine/pages/*.md`
43
-
44
- When default crawling misses client-rendered or lazy-loaded content, use the
45
- agent or harness browser tools to collect additional HTML, screenshots, and route
46
- notes, then merge that evidence into the migration artifacts. Import reviewed
47
- media, schemas, forms, and entries through the regular Fimo CLI commands.
48
-
49
- ## Phase 2: Canonical Ledger
50
-
51
- Create `.fimo/migration/manifest.json` using `references/manifest.md`.
52
-
53
- If an older ledger exists under `.fimo/migrations/current/` or
54
- `.fimo/source-migration/`, keep it as evidence and copy normalized facts into the
55
- canonical ledger instead of editing unrelated history.
56
-
57
- Use the bundled script when possible:
58
-
59
- ```bash
60
- node <this-skill>/scripts/build-canonical-manifest.mjs <project-root>
61
- ```
62
-
63
- Pass `--fresh` only when intentionally discarding previous canonical manifest
64
- progress such as verified statuses, uploaded asset IDs, or notes.
65
-
66
- Every item needs one of these statuses:
67
-
68
- - `discovered`
69
- - `planned`
70
- - `generated`
71
- - `imported`
72
- - `verified`
73
- - `ignored`
74
- - `unsupported`
75
- - `unresolved`
76
-
77
- ## Phase 3: Content Model First
78
-
79
- Before writing page code:
80
-
81
- 1. Detect dynamic collections from both repeated route groups AND repeated
82
- in-page blocks. A hardcoded array of 3+ structurally-identical items (cards,
83
- list rows, tiles) is a collection, not static markup. Ignore locale prefixes
84
- when naming collections.
85
- 2. Map each CMS export or inferred collection to a Fimo schema or unresolved item.
86
- 3. Preserve stable source IDs, slugs, dates, SEO, authors, categories, tags,
87
- locales, and publish status.
88
- 4. Decide which references are real. Do not invent references from vague text.
89
- 5. Build seed/import entries with source IDs and media references preserved.
90
- 6. Record source count and planned import count for each content type.
91
-
92
- Use `references/content.md`, including "Detecting Dynamic Collections".
93
-
94
- ## Phase 4: Media And Forms
95
-
96
- Before final page wiring:
97
-
98
- 1. Build a media map from local files and remote URLs.
99
- 2. Upload or plan uploads for media referenced by pages, CMS entries, SEO, and
100
- forms.
101
- 3. Replace source media references only after upload mapping is known.
102
- 4. Classify forms as Fimo-native, third-party integration, or unsupported.
103
- 5. Generate `src/forms/*.json` for accepted Fimo-native forms.
104
-
105
- Use `references/media.md` and `references/forms.md`.
106
-
107
- ## Phase 5: Import Payloads
108
-
109
- Before calling the migration complete, prepare the actual import path described
110
- in `references/import-contract.md`.
111
-
112
- Required order:
113
-
114
- 1. media files
115
- 2. schemas
116
- 3. CMS entries with media references resolved
117
- 4. forms
118
-
119
- Record target IDs, import counts, failures, and unresolved items in the
120
- canonical ledger. Generated JSON without import counts is still draft state.
121
-
122
- ## Phase 6: Fimo Implementation
123
-
124
- Implement routes, schemas, forms, entries, media, redirects, translations, and
125
- React pages with Fimo conventions.
126
-
127
- Rules:
128
-
129
- - If no target exists, create one Fimo project. Do not create a nested Fimo app
130
- inside a source repository unless the user explicitly chose that directory.
131
- - If a target Fimo project exists, inspect existing routes, schemas, forms, and
132
- components before writing.
133
- - Store migration analysis artifacts under `.fimo/migration/`.
134
- - Use source CSS/design files as visual evidence, not as a permanent global CSS
135
- dump.
136
- - Schema-driven media renders with Fimo media primitives, not raw source URLs.
137
- - CMS pages must have matching `src/schemas/*.json` before generated clients or
138
- queries are used.
139
- - Repeated dynamic items (games, locations, posts, testimonials, pricing) render
140
- from CMS collections, not hardcoded arrays. A page left with a hardcoded array
141
- of collection-shaped items is an incomplete migration, not a finished one.
142
- - Generated `.ts` schema/form clients are not edited manually.
143
- - Unsupported source behavior is replaced with a Fimo-native equivalent or shown
144
- as unresolved, never hidden behind broken UI.
145
-
146
- ## Phase 7: Import
147
-
148
- Import only reviewed artifacts:
149
-
150
- - media assets and media map updates
151
- - schemas
152
- - forms
153
- - entries
154
- - redirects/locales when supported by the current project tooling
155
-
156
- After import, update the ledger with created IDs, uploaded asset IDs, failures,
157
- and counts.
158
-
159
- ## Phase 8: QA Gate And Report
160
-
161
- Run `references/qa.md`. Write `.fimo/migration/migration-report.md` with:
162
-
163
- - source summary
164
- - route coverage
165
- - CMS source/import counts
166
- - media source/upload/reference counts
167
- - form coverage
168
- - build/runtime checks
169
- - visual checks
170
- - unresolved/unsupported items
171
- - exact next actions
172
-
173
- Use the bundled report script to make the QA state explicit:
174
-
175
- ```bash
176
- node <this-skill>/scripts/write-migration-report.mjs <project-root>
177
- ```
178
-
179
- The script exits non-zero when required coverage checks fail. That is a prompt
180
- to continue the migration or document the gaps, not a reason to hide the report.
181
-
182
- All checks in this phase are **local** (build, local dev, route render, visual
183
- comparison). Do not run `fimo deploy` / `fimo publish` to verify anything.
184
-
185
- ## Phase 9: Propose Deployment
186
-
187
- Deployment is not part of the migration loop and is never run to preview or
188
- verify. Once Phase 8 passes:
189
-
190
- 1. Do not run `fimo deploy` or `fimo publish` yourself.
191
- 2. End by proposing it: tell the owner the migration is ready, that one
192
- `fimo deploy` creates its hosted preview, and that going live requires a
193
- separate explicit publish.
194
- 3. Deploy only if the owner explicitly asks in this turn, and then only once.
3
+ Use this as the phase contract for a complete migration. The coordinator and
4
+ workers communicate in plain text. JSON is used only for Fimo schemas and the
5
+ content payloads that the data-plane commands import.
6
+
7
+ ## Phase 0: Initialize the target
8
+
9
+ 1. Confirm the target path. The target is a separate directory; the source
10
+ checkout remains read-only evidence.
11
+ 2. Initialize or reuse exactly one linked Fimo target before workers start:
12
+ - URL migration: `fimo migrate init <source-url> <target-dir> --framework <framework>`
13
+ - link an existing project: `fimo migrate init <target-dir> --project-id <projectId> --framework <framework>`
14
+ - create a project: `fimo migrate init <target-dir> --org <organizationId> --framework <framework>`
15
+ Use the detected source framework for source-backed migrations. A framework
16
+ conversion requires an explicit user choice; URL-only and rebuild
17
+ migrations ask the user which framework to use. Never choose a framework by
18
+ copying an arbitrary `--template-root`, invent a project ID, or hand-write
19
+ `.fimo/project.json`.
20
+ 3. Inspect the target's real `package.json`, `.fimo/config.json`, framework config, and route
21
+ directories. They are the authority for paths. Do not infer an app root
22
+ from a skill example and do not create a second `app/` or `src/app/` tree.
23
+ 4. If the target is non-empty and not a Fimo project, stop and ask for a target
24
+ path; do not overlay a template on top of it.
25
+ 5. Keep source material in `.fimo/migration/source` or another explicit source
26
+ location. Do not copy source files over the initialized target root.
27
+
28
+ Write a short `.fimo/migration/migration-plan.md` containing the source
29
+ location, selected framework, actual target directories, worker owners, and
30
+ known questions. Do not create `target.json`, a target manifest,
31
+ `worker-plan.json`, `decision.json`, or JSON worker receipts for a new run. A
32
+ URL-only Source Evidence Pack is the one exception: its versioned `index.json`
33
+ describes observed source evidence and raw-artifact pointers, never target work
34
+ or completion.
35
+
36
+ ## Phase 1: Source intake
37
+
38
+ Read the source directly with `rg`, `find`, `ls`, and targeted file reads.
39
+ Classify the available evidence:
40
+
41
+ - source repository, export, downloaded HTML, or media folder;
42
+ - CMS CSV/XML/JSON exports and public APIs;
43
+ - forms and third-party form actions;
44
+ - integrations and the environment-key names they need, never secret values;
45
+ - redirects, security headers, locales, SEO, robots, sitemap, and OG behavior;
46
+ - unsupported behavior such as auth, commerce, search, members, custom JS, or
47
+ provider-specific workers.
48
+
49
+ For private APIs or CMSs, ask for a user-provided export or a narrowly scoped
50
+ server-side credential. Never recover credentials from browser bundles or copy
51
+ them into migration artifacts. Missing access blocks only that lane and becomes
52
+ an unresolved item; never invent replacement content.
53
+
54
+ For URL-only migrations, inspect the `.fimo/migrations/current/` files written
55
+ by the URL form of `fimo migrate init` as a static seed. Do not run the legacy
56
+ apply/refine path before observation. Then load `references/url-evidence.md`
57
+ and run the observation crew from
58
+ `references/workers/url-observer.md`. The crew must render, scroll, interact,
59
+ sample motion from before navigation, normalize the observations, and write
60
+ `.fimo/migration/source-evidence/index.json` before reconstruction begins. Do
61
+ not copy the crawl manifest into the pack or treat fetched HTML as rendered
62
+ truth.
63
+
64
+ ## Phase 2: Fan out workers
65
+
66
+ For URL-only sources, the coordinator first launches the route scout,
67
+ shared-system observer, page observers, and evidence normalizer. Reconstruction
68
+ waits for their completeness gate. It then launches only the workers supported
69
+ by the normalized source evidence:
70
+
71
+ - **runtime**: preserve the detected framework, router, runtime, dependencies,
72
+ provider configuration, and environment wiring. A framework conversion needs
73
+ an explicit user choice.
74
+ - **routes/SEO**: preserve one target route per source route, redirects, 404,
75
+ metadata, OG/social output, sitemap, robots, and other observable behavior.
76
+ - **content planner**: discover content, labels, data sources, consumers, and
77
+ schemas; push schemas and prepare content payloads. It does not rewrite page
78
+ code or import every entry itself.
79
+ - **locales**: configure locales and migrate translated UI-visible copy when
80
+ the source has it.
81
+ - **assets/forms**: after content planning, upload every referenced media item
82
+ and preserve, replace, or report forms and integrations.
83
+
84
+ When the user explicitly chose a framework conversion, one framework
85
+ conversion worker replaces the runtime and routes lanes and owns all
86
+ structural target code (see `references/workers/framework.md`). The content
87
+ planner may read the source in parallel, but it must not convert the framework
88
+ or rewrite page code. Follow the asset, data, and code gates in
89
+ `references/workers.md`.
90
+
91
+ The coordinator gives each worker a plain-language prompt naming its ownership,
92
+ files, dependencies, and worker-specific reference from `references/workers/`.
93
+ Workers may write the application inside their ownership. They do not need a
94
+ JSON plan or receipt. If two workers need the same file, name one owner and run
95
+ the other after it.
96
+
97
+ ## Phase 3: Content planning
98
+
99
+ The planner follows `references/workers/content-planner.md`, plus
100
+ `references/content.md`, `references/decision.md`, and
101
+ `references/import-contract.md`. Its text plan and payloads must be complete
102
+ before Phase 4; data workers must not rediscover unrelated source files.
103
+
104
+ ## Phase 4: Media, forms, and integrations
105
+
106
+ 1. Account for every planner media obligation, including schema media fields
107
+ and richtext/Tiptap image nodes, plus route, SEO, and form media.
108
+ 2. Upload media through Fimo and replace references only after the upload is
109
+ confirmed. A local `public/` copy or source URL is not an imported asset.
110
+ 3. Preserve third-party integrations unless Fimo reproduces their exact
111
+ user-visible behavior. Record required environment-key names only.
112
+ 4. Use a Fimo-native form only when it matches the source behavior end to end;
113
+ otherwise preserve the integration or report it unresolved.
114
+
115
+ After every media obligation has a target mapping, patch the content payloads
116
+ and run one data worker per schema/locale. Verify each imported batch by
117
+ read-back before starting its content code worker. The code worker replaces
118
+ each planned consumer in place and proves at least one real imported item
119
+ crosses every Server-to-Client or plain-JSON boundary it uses. A build over an
120
+ empty result is not proof. Load the active `fimo-code` framework reference for
121
+ the exact serialization and hydration contract.
122
+
123
+ ## Phase 5: Framework implementation
124
+
125
+ Preserve the detected source framework, router, runtime, and configuration.
126
+ React Router/Vite stays React Router/Vite and Next.js stays Next.js. Convert to
127
+ Next.js only after the user explicitly chooses it. An explicit conversion is a
128
+ faithful first pass owned by the framework conversion worker: it ports the
129
+ source's APIs, loaders, hardcoded content, integrations, and visible behavior
130
+ into the new framework, and it must pass the framework gate in
131
+ `references/workers/framework.md` before content code work continues. A gate
132
+ failure is draft-only or unresolved; never fall back silently to a generic
133
+ shell or another framework. Load the matching `fimo-code` framework and
134
+ hosting references before integration work.
135
+
136
+ Preserve the source route surface and behavior. Do not replace many pages with
137
+ one generic static shell. Apply the matching framework reference before
138
+ disposing of provider-specific rules; redirects, headers, feeds, metadata,
139
+ forms, and freshness behavior are observable contracts.
140
+
141
+ ## Phase 6: Fan in, validate, and report
142
+
143
+ Workers return the plain-text receipt defined in `references/workers.md`.
144
+ The coordinator checks those claims against the diff, source, CLI read-back,
145
+ build, and rendered routes. Then an independent worker follows
146
+ `references/workers/validator.md`; a worker saying "done" is not evidence.
147
+
148
+ Write `.fimo/migration/migration-report.md` with route/content/media/form/SEO
149
+ coverage, import counts, worker timings, unresolved items, and next actions.
150
+ Use `complete` only when required checks pass, `complete-with-unresolved` when
151
+ the app works and every gap is explicit, and `draft-only` when import or
152
+ verification is incomplete.
153
+
154
+ All checks are local. Do not deploy or publish to verify a migration.