fimo 0.17.0 → 0.18.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 (159) 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/shared/types.eta +2 -0
  5. package/assets/skills/fimo-cli/SKILL.md +3 -2
  6. package/assets/skills/fimo-cli/references/content.md +2 -2
  7. package/assets/skills/fimo-cli/references/deploy.md +2 -0
  8. package/assets/skills/fimo-cli/references/init.md +11 -4
  9. package/assets/skills/fimo-cli/references/locales.md +38 -14
  10. package/assets/skills/fimo-cli/references/pages.md +70 -0
  11. package/assets/skills/fimo-cli/references/webhooks.md +1 -1
  12. package/assets/skills/fimo-code/SKILL.md +11 -0
  13. package/assets/skills/fimo-code/assets/react-router-locales/LocaleLayout.tsx +12 -0
  14. package/assets/skills/fimo-code/assets/react-router-locales/routes.ts +7 -6
  15. package/assets/skills/fimo-code/references/best-practices/astro.md +47 -0
  16. package/assets/skills/fimo-code/references/best-practices/next.md +42 -0
  17. package/assets/skills/fimo-code/references/best-practices/sveltekit.md +17 -0
  18. package/assets/skills/fimo-code/references/content/richtext.md +5 -0
  19. package/assets/skills/fimo-code/references/content/schema.md +4 -1
  20. package/assets/skills/fimo-code/references/frameworks/astro.md +5 -3
  21. package/assets/skills/fimo-code/references/frameworks/hosting.md +5 -2
  22. package/assets/skills/fimo-code/references/frameworks/next/app-router.md +6 -0
  23. package/assets/skills/fimo-code/references/frameworks/next/locales.md +12 -2
  24. package/assets/skills/fimo-code/references/frameworks/next.md +7 -0
  25. package/assets/skills/fimo-code/references/frameworks/react-router.md +15 -7
  26. package/assets/skills/fimo-code/references/frameworks/sveltekit.md +15 -8
  27. package/assets/skills/fimo-code/references/labels.md +9 -1
  28. package/assets/skills/fimo-code/references/locales.md +8 -2
  29. package/assets/skills/fimo-code/references/migrations/react-router-route-ownership.md +93 -0
  30. package/assets/skills/fimo-code/references/ui.md +21 -2
  31. package/assets/skills/fimo-migration/SKILL.md +276 -51
  32. package/assets/skills/fimo-migration/references/content.md +119 -35
  33. package/assets/skills/fimo-migration/references/decision.md +72 -0
  34. package/assets/skills/fimo-migration/references/forms.md +38 -6
  35. package/assets/skills/fimo-migration/references/frameworks/nextjs.md +179 -23
  36. package/assets/skills/fimo-migration/references/import-contract.md +71 -19
  37. package/assets/skills/fimo-migration/references/manifest.md +11 -161
  38. package/assets/skills/fimo-migration/references/media.md +33 -1
  39. package/assets/skills/fimo-migration/references/platforms.md +26 -2
  40. package/assets/skills/fimo-migration/references/qa.md +167 -13
  41. package/assets/skills/fimo-migration/references/workers/content-execution.md +39 -0
  42. package/assets/skills/fimo-migration/references/workers/content-planner.md +64 -0
  43. package/assets/skills/fimo-migration/references/workers/framework.md +37 -0
  44. package/assets/skills/fimo-migration/references/workers/validator.md +25 -0
  45. package/assets/skills/fimo-migration/references/workers.md +82 -0
  46. package/assets/skills/fimo-migration/references/workflow.md +140 -192
  47. package/assets/skills/fimo-migration/scripts/apply-decision.mjs +534 -0
  48. package/assets/skills/fimo-migration/scripts/build-canonical-manifest.mjs +7 -4
  49. package/assets/skills/fimo-migration/scripts/write-migration-report.mjs +191 -4
  50. package/assets/skills/fimo-studio/references/cms.md +25 -7
  51. package/assets/skills/fimo-studio/references/webhooks.md +1 -1
  52. package/assets/sveltekit/components/DateTime.svelte +35 -0
  53. package/assets/sveltekit/components/FimoProvider.svelte +2 -2
  54. package/assets/sveltekit/components/index.d.ts +1 -0
  55. package/assets/sveltekit/components/index.js +1 -0
  56. package/dist/build/next/config.d.ts +4 -1
  57. package/dist/build/next/config.js +21 -5
  58. package/dist/build/sveltekit/vite.d.ts +3 -4
  59. package/dist/build/sveltekit/vite.js +3 -4
  60. package/dist/build/vite/plugins/runtime-env.d.ts +2 -1
  61. package/dist/build/vite/plugins/runtime-env.js +14 -10
  62. package/dist/cli/bundle.json +2 -2
  63. package/dist/cli/index.js +76 -78
  64. package/dist/runtime/app/FimoProviders.js +25 -14
  65. package/dist/runtime/app/prefetch.d.ts +3 -1
  66. package/dist/runtime/app/prefetch.js +11 -55
  67. package/dist/runtime/astro/preview.js +7 -9
  68. package/dist/runtime/content/client/internal.js +1 -0
  69. package/dist/runtime/i18n/locale.d.ts +4 -0
  70. package/dist/runtime/i18n/locale.js +14 -14
  71. package/dist/runtime/next/client-runtime.js +5 -1
  72. package/dist/runtime/next/client.d.ts +3 -2
  73. package/dist/runtime/next/client.js +2 -1
  74. package/dist/runtime/next/labels.d.ts +2 -2
  75. package/dist/runtime/next/labels.js +2 -2
  76. package/dist/runtime/next/preview.d.ts +13 -0
  77. package/dist/runtime/next/preview.js +34 -0
  78. package/dist/runtime/next/primitives/server.d.ts +2 -0
  79. package/dist/runtime/next/primitives/server.js +8 -0
  80. package/dist/runtime/next/provider.d.ts +5 -0
  81. package/dist/runtime/next/provider.js +17 -3
  82. package/dist/runtime/next/server-runtime.js +4 -1
  83. package/dist/runtime/next/server.d.ts +1 -1
  84. package/dist/runtime/next/server.js +1 -1
  85. package/dist/runtime/paths/get-fimo-paths.d.ts +6 -5
  86. package/dist/runtime/paths/get-fimo-paths.js +43 -42
  87. package/dist/runtime/preview/location.d.ts +19 -2
  88. package/dist/runtime/preview/location.js +16 -2
  89. package/dist/runtime/primitives/index.d.ts +1 -0
  90. package/dist/runtime/primitives/index.js +1 -0
  91. package/dist/runtime/react/primitives/editable/DateTime.d.ts +4 -0
  92. package/dist/runtime/react/primitives/editable/DateTime.js +13 -0
  93. package/dist/runtime/react/primitives/renderers/DateRenderer.d.ts +7 -1
  94. package/dist/runtime/react/primitives/renderers/DateRenderer.js +11 -8
  95. package/dist/runtime/react-router/{routes.d.ts → legacy/routes.d.ts} +6 -1
  96. package/dist/runtime/react-router/{routes.js → legacy/routes.js} +22 -7
  97. package/dist/runtime/routes/contract.d.ts +116 -0
  98. package/dist/runtime/routes/contract.js +377 -0
  99. package/dist/runtime/routes/index.d.ts +3 -0
  100. package/dist/runtime/routes/index.js +3 -0
  101. package/dist/runtime/routing/AppRoutesProvider.js +4 -3
  102. package/dist/runtime/seo/resolver.d.ts +5 -0
  103. package/dist/runtime/seo/resolver.js +10 -42
  104. package/dist/runtime/shared/fimo-config.types.d.ts +34 -8
  105. package/dist/runtime/shared/preview-location.d.ts +1 -22
  106. package/dist/runtime/shared/preview-location.js +5 -93
  107. package/dist/runtime/sveltekit/preview.d.ts +12 -3
  108. package/dist/runtime/sveltekit/preview.js +13 -8
  109. package/dist/scripts/sync-forms.js +1 -1
  110. package/dist/scripts/sync-schemas.js +1 -4
  111. package/dist/scripts/validate-fimo-config.js +5 -1
  112. package/dist/scripts/validate-page-registry.d.ts +2 -0
  113. package/dist/scripts/validate-page-registry.js +167 -0
  114. package/dist/scripts/validate-route-metadata.js +132 -41
  115. package/package.json +7 -3
  116. package/templates/astro/.fimo/config.json +13 -5
  117. package/templates/astro/AGENTS.md +5 -1
  118. package/templates/astro/astro.config.mjs +7 -0
  119. package/templates/astro/pnpm-workspace.yaml +0 -3
  120. package/templates/astro/src/components/ProjectOverview.astro +9 -6
  121. package/templates/astro/src/layouts/Base.astro +1 -1
  122. package/templates/astro/src/locales.ts +4 -0
  123. package/templates/astro/src/pages/[locale]/index.astro +19 -0
  124. package/templates/astro/src/pages/[locale]/projects/[slug].astro +35 -0
  125. package/templates/astro/src/pages/[locale]/projects/index.astro +19 -0
  126. package/templates/astro/src/pages/index.astro +5 -2
  127. package/templates/astro/src/pages/projects/[slug].astro +4 -2
  128. package/templates/astro/src/pages/projects/index.astro +5 -2
  129. package/templates/nextjs/.fimo/config.json +2 -1
  130. package/templates/nextjs/AGENTS.md +5 -0
  131. package/templates/nextjs/src/app/(default)/layout.tsx +10 -0
  132. package/templates/nextjs/src/app/[locale]/layout.tsx +22 -0
  133. package/templates/nextjs/src/app/[locale]/page.tsx +1 -0
  134. package/templates/nextjs/src/components/Document.tsx +26 -0
  135. package/templates/nextjs/src/components/FimoPreviewBridge.tsx +13 -0
  136. package/templates/nextjs/src/locales.ts +13 -0
  137. package/templates/react-router/.fimo/config.json +3 -6
  138. package/templates/react-router/AGENTS.md +4 -0
  139. package/templates/react-router/package.json +1 -1
  140. package/templates/react-router/pnpm-workspace.yaml +1 -3
  141. package/templates/react-router/react-router.config.ts +4 -10
  142. package/templates/react-router/src/pages/LocaleLayout.tsx +12 -0
  143. package/templates/react-router/src/root.tsx +2 -4
  144. package/templates/react-router/src/routes.ts +5 -3
  145. package/templates/sveltekit/.fimo/config.json +2 -1
  146. package/templates/sveltekit/AGENTS.md +5 -0
  147. package/templates/sveltekit/src/app.html +1 -1
  148. package/templates/sveltekit/src/hooks.server.ts +11 -0
  149. package/templates/sveltekit/src/locales.ts +8 -0
  150. package/templates/sveltekit/src/params/locale.ts +5 -0
  151. package/templates/sveltekit/src/routes/+layout.server.ts +6 -1
  152. package/templates/sveltekit/src/routes/+layout.svelte +5 -0
  153. package/assets/skills/fimo-migration/references/inventory/coordinator.md +0 -40
  154. package/assets/skills/fimo-migration/references/inventory/locales/next-intl.md +0 -39
  155. package/assets/skills/fimo-migration/references/inventory/locales.md +0 -41
  156. package/assets/skills/fimo-migration/scripts/inventory/locales/next-intl.mjs +0 -459
  157. package/templates/nextjs/src/app/layout.tsx +0 -17
  158. /package/templates/nextjs/src/app/{page.tsx → (default)/page.tsx} +0 -0
  159. /package/templates/sveltekit/src/routes/{+page.svelte → [[locale=locale]]/+page.svelte} +0 -0
@@ -1,194 +1,142 @@
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`, `manifest.json`,
31
+ `worker-plan.json`, `decision.json`, or JSON worker receipts for a new run.
32
+
33
+ ## Phase 1: Source intake
34
+
35
+ Read the source directly with `rg`, `find`, `ls`, and targeted file reads.
36
+ Classify the available evidence:
37
+
38
+ - source repository, export, downloaded HTML, or media folder;
39
+ - CMS CSV/XML/JSON exports and public APIs;
40
+ - forms and third-party form actions;
41
+ - integrations and the environment-key names they need, never secret values;
42
+ - redirects, security headers, locales, SEO, robots, sitemap, and OG behavior;
43
+ - unsupported behavior such as auth, commerce, search, members, custom JS, or
44
+ provider-specific workers.
45
+
46
+ For private APIs or CMSs, ask for a user-provided export or a narrowly scoped
47
+ server-side credential. Never recover credentials from browser bundles or copy
48
+ them into migration artifacts. Missing access blocks only that lane and becomes
49
+ an unresolved item; never invent replacement content.
50
+
51
+ For URL-only migrations, run `fimo migrate <url> [dir]` and inspect the
52
+ generated `.fimo/migrations/current/` files as source evidence. Do not copy
53
+ that crawl manifest into another canonical JSON registry.
54
+
55
+ ## Phase 2: Fan out workers
56
+
57
+ The coordinator launches only the workers supported by the source:
58
+
59
+ - **runtime**: preserve the detected framework, router, runtime, dependencies,
60
+ provider configuration, and environment wiring. A framework conversion needs
61
+ an explicit user choice.
62
+ - **routes/SEO**: preserve one target route per source route, redirects, 404,
63
+ metadata, OG/social output, sitemap, robots, and other observable behavior.
64
+ - **content planner**: discover content, labels, data sources, consumers, and
65
+ schemas; push schemas and prepare content payloads. It does not rewrite page
66
+ code or import every entry itself.
67
+ - **locales**: configure locales and migrate translated UI-visible copy when
68
+ the source has it.
69
+ - **assets/forms**: after content planning, upload every referenced media item
70
+ and preserve, replace, or report forms and integrations.
71
+
72
+ When the user explicitly chose a framework conversion, one framework
73
+ conversion worker replaces the runtime and routes lanes and owns all
74
+ structural target code (see `references/workers/framework.md`). The content
75
+ planner may read the source in parallel, but it must not convert the framework
76
+ or rewrite page code. Follow the asset, data, and code gates in
77
+ `references/workers.md`.
78
+
79
+ The coordinator gives each worker a plain-language prompt naming its ownership,
80
+ files, dependencies, and worker-specific reference from `references/workers/`.
81
+ Workers may write the application inside their ownership. They do not need a
82
+ JSON plan or receipt. If two workers need the same file, name one owner and run
83
+ the other after it.
84
+
85
+ ## Phase 3: Content planning
86
+
87
+ The planner follows `references/workers/content-planner.md`, plus
88
+ `references/content.md`, `references/decision.md`, and
89
+ `references/import-contract.md`. Its text plan and payloads must be complete
90
+ before Phase 4; data workers must not rediscover unrelated source files.
91
+
92
+ ## Phase 4: Media, forms, and integrations
93
+
94
+ 1. Account for every planner media obligation, including schema media fields
95
+ and richtext/Tiptap image nodes, plus route, SEO, and form media.
96
+ 2. Upload media through Fimo and replace references only after the upload is
97
+ confirmed. A local `public/` copy or source URL is not an imported asset.
98
+ 3. Preserve third-party integrations unless Fimo reproduces their exact
99
+ user-visible behavior. Record required environment-key names only.
100
+ 4. Use a Fimo-native form only when it matches the source behavior end to end;
101
+ otherwise preserve the integration or report it unresolved.
102
+
103
+ After every media obligation has a target mapping, patch the content payloads
104
+ and run one data worker per schema/locale. Verify each imported batch by
105
+ read-back before starting its content code worker. The code worker replaces
106
+ each planned consumer in place and proves at least one real imported item
107
+ crosses every Server-to-Client or plain-JSON boundary it uses. A build over an
108
+ empty result is not proof. Load the active `fimo-code` framework reference for
109
+ the exact serialization and hydration contract.
110
+
111
+ ## Phase 5: Framework implementation
112
+
113
+ Preserve the detected source framework, router, runtime, and configuration.
114
+ React Router/Vite stays React Router/Vite and Next.js stays Next.js. Convert to
115
+ Next.js only after the user explicitly chooses it. An explicit conversion is a
116
+ faithful first pass owned by the framework conversion worker: it ports the
117
+ source's APIs, loaders, hardcoded content, integrations, and visible behavior
118
+ into the new framework, and it must pass the framework gate in
119
+ `references/workers/framework.md` before content code work continues. A gate
120
+ failure is draft-only or unresolved; never fall back silently to a generic
121
+ shell or another framework. Load the matching `fimo-code` framework and
122
+ hosting references before integration work.
123
+
124
+ Preserve the source route surface and behavior. Do not replace many pages with
125
+ one generic static shell. Apply the matching framework reference before
126
+ disposing of provider-specific rules; redirects, headers, feeds, metadata,
127
+ forms, and freshness behavior are observable contracts.
128
+
129
+ ## Phase 6: Fan in, validate, and report
130
+
131
+ Workers return the plain-text receipt defined in `references/workers.md`.
132
+ The coordinator checks those claims against the diff, source, CLI read-back,
133
+ build, and rendered routes. Then an independent worker follows
134
+ `references/workers/validator.md`; a worker saying "done" is not evidence.
135
+
136
+ Write `.fimo/migration/migration-report.md` with route/content/media/form/SEO
137
+ coverage, import counts, worker timings, unresolved items, and next actions.
138
+ Use `complete` only when required checks pass, `complete-with-unresolved` when
139
+ the app works and every gap is explicit, and `draft-only` when import or
140
+ verification is incomplete.
141
+
142
+ All checks are local. Do not deploy or publish to verify a migration.