fimo 0.14.0 → 0.15.0-staging.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 (199) hide show
  1. package/README.md +1 -0
  2. package/assets/astro/components/Boolean.astro +14 -0
  3. package/assets/astro/components/Date.astro +23 -0
  4. package/assets/astro/components/Image.astro +79 -0
  5. package/assets/astro/components/Json.astro +14 -0
  6. package/assets/astro/components/RichText.astro +17 -0
  7. package/assets/astro/components/StaticImage.astro +66 -0
  8. package/assets/astro/components/Text.astro +23 -0
  9. package/assets/astro/components/Video.astro +47 -0
  10. package/assets/astro/components/index.d.ts +8 -0
  11. package/assets/astro/components/index.js +8 -0
  12. package/assets/content-templates/shared/server.eta +56 -0
  13. package/assets/content-templates/sveltekit/content.eta +86 -0
  14. package/assets/skills/fimo/SKILL.md +13 -4
  15. package/assets/skills/fimo-cli/SKILL.md +28 -28
  16. package/assets/skills/fimo-cli/references/account.md +0 -2
  17. package/assets/skills/fimo-cli/references/agent-setup.md +7 -9
  18. package/assets/skills/fimo-cli/references/agents.md +0 -2
  19. package/assets/skills/fimo-cli/references/analytics.md +0 -2
  20. package/assets/skills/fimo-cli/references/assets.md +2 -4
  21. package/assets/skills/fimo-cli/references/branches.md +14 -15
  22. package/assets/skills/fimo-cli/references/content.md +9 -11
  23. package/assets/skills/fimo-cli/references/credits.md +0 -2
  24. package/assets/skills/fimo-cli/references/deploy.md +6 -7
  25. package/assets/skills/fimo-cli/references/describe.md +1 -3
  26. package/assets/skills/fimo-cli/references/domains.md +0 -2
  27. package/assets/skills/fimo-cli/references/forms.md +5 -7
  28. package/assets/skills/fimo-cli/references/history.md +0 -2
  29. package/assets/skills/fimo-cli/references/init.md +34 -26
  30. package/assets/skills/fimo-cli/references/integrations/firecrawl.md +0 -2
  31. package/assets/skills/fimo-cli/references/integrations.md +0 -2
  32. package/assets/skills/fimo-cli/references/invite.md +0 -2
  33. package/assets/skills/fimo-cli/references/labels.md +5 -7
  34. package/assets/skills/fimo-cli/references/locales.md +2 -4
  35. package/assets/skills/fimo-cli/references/mcp.md +2 -4
  36. package/assets/skills/fimo-cli/references/media.md +0 -2
  37. package/assets/skills/fimo-cli/references/preview.md +0 -2
  38. package/assets/skills/fimo-cli/references/project-vars-and-secrets.md +1 -3
  39. package/assets/skills/fimo-cli/references/projects.md +1 -3
  40. package/assets/skills/fimo-cli/references/schedules.md +0 -2
  41. package/assets/skills/fimo-cli/references/support.md +0 -2
  42. package/assets/skills/fimo-cli/references/webhooks.md +0 -2
  43. package/assets/skills/fimo-code/SKILL.md +11 -3
  44. package/assets/skills/fimo-code/references/assets.md +2 -2
  45. package/assets/skills/fimo-code/references/content/clients.md +5 -1
  46. package/assets/skills/fimo-code/references/content.md +3 -1
  47. package/assets/skills/fimo-code/references/frameworks/astro.md +127 -0
  48. package/assets/skills/fimo-code/references/frameworks/compatibility.md +19 -0
  49. package/assets/skills/fimo-code/references/frameworks/hosting.md +15 -3
  50. package/assets/skills/fimo-code/references/frameworks/react-router.md +37 -209
  51. package/assets/skills/fimo-code/references/frameworks/sveltekit.md +110 -0
  52. package/assets/skills/fimo-code/references/frameworks/vite-react.md +35 -166
  53. package/assets/skills/fimo-code/references/labels.md +16 -6
  54. package/assets/skills/fimo-code/references/locales.md +3 -1
  55. package/assets/skills/fimo-code/references/ui.md +19 -15
  56. package/assets/skills/fimo-migration/SKILL.md +99 -146
  57. package/assets/skills/fimo-migration/references/frameworks/nextjs.md +26 -0
  58. package/assets/skills/fimo-migration/references/inventory/coordinator.md +40 -0
  59. package/assets/skills/fimo-migration/references/inventory/locales/next-intl.md +39 -0
  60. package/assets/skills/fimo-migration/references/inventory/locales.md +41 -0
  61. package/assets/skills/fimo-migration/references/workflow.md +3 -2
  62. package/assets/skills/fimo-migration/scripts/inventory/locales/next-intl.mjs +459 -0
  63. package/assets/skills/fimo-studio/SKILL.md +1 -1
  64. package/assets/skills/fimo-studio/references/project-creation.md +10 -18
  65. package/assets/starters/fimo-site/template/.fimo/agents/content-guide/capabilities.yaml +0 -1
  66. package/assets/starters/fimo-site/template/.fimo/agents/site-review/capabilities.yaml +0 -1
  67. package/assets/sveltekit/components/Boolean.svelte +19 -0
  68. package/assets/sveltekit/components/Date.svelte +33 -0
  69. package/assets/sveltekit/components/FimoProvider.svelte +35 -0
  70. package/assets/sveltekit/components/Image.svelte +80 -0
  71. package/assets/sveltekit/components/Json.svelte +18 -0
  72. package/assets/sveltekit/components/Label.svelte +16 -0
  73. package/assets/sveltekit/components/Number.svelte +21 -0
  74. package/assets/sveltekit/components/RichText.svelte +19 -0
  75. package/assets/sveltekit/components/Text.svelte +30 -0
  76. package/assets/sveltekit/components/Video.svelte +37 -0
  77. package/assets/sveltekit/components/index.d.ts +10 -0
  78. package/assets/sveltekit/components/index.js +10 -0
  79. package/dist/build/astro/config.d.ts +4 -0
  80. package/dist/build/astro/config.js +64 -0
  81. package/dist/build/next/config.js +16 -0
  82. package/dist/build/sveltekit/config.d.ts +6 -0
  83. package/dist/build/sveltekit/config.js +8 -0
  84. package/dist/build/sveltekit/data-id.d.ts +3 -0
  85. package/dist/build/sveltekit/data-id.js +171 -0
  86. package/dist/build/sveltekit/vite.d.ts +13 -0
  87. package/dist/build/sveltekit/vite.js +15 -0
  88. package/dist/build/vite/index.js +2 -0
  89. package/dist/build/vite/plugins/data-id.d.ts +9 -0
  90. package/dist/build/vite/plugins/data-id.js +6 -1
  91. package/dist/build/vite/plugins/runtime-env.d.ts +21 -0
  92. package/dist/build/vite/plugins/runtime-env.js +68 -0
  93. package/dist/cli/bundle.json +1 -1
  94. package/dist/cli/index.js +108 -101
  95. package/dist/runtime/app/FimoProviders.d.ts +1 -1
  96. package/dist/runtime/app/FimoProviders.js +11 -5
  97. package/dist/runtime/astro/internal.d.ts +6 -0
  98. package/dist/runtime/astro/internal.js +16 -0
  99. package/dist/runtime/astro/preview.d.ts +14 -0
  100. package/dist/runtime/astro/preview.js +103 -0
  101. package/dist/runtime/astro/render-rich-text.d.ts +2 -0
  102. package/dist/runtime/astro/render-rich-text.js +1 -0
  103. package/dist/runtime/astro/server-runtime.d.ts +3 -0
  104. package/dist/runtime/astro/server-runtime.js +20 -0
  105. package/dist/runtime/astro/server.d.ts +15 -0
  106. package/dist/runtime/astro/server.js +14 -0
  107. package/dist/runtime/content/client/collection-core.d.ts +2 -17
  108. package/dist/runtime/content/client/collection-core.js +15 -8
  109. package/dist/runtime/content/client/core-types.d.ts +96 -0
  110. package/dist/runtime/content/client/core-types.js +1 -0
  111. package/dist/runtime/content/client/internal.d.ts +4 -4
  112. package/dist/runtime/content/client/internal.js +4 -3
  113. package/dist/runtime/content/client/runtime.d.ts +1 -1
  114. package/dist/runtime/content/client/server-content-client.d.ts +3 -3
  115. package/dist/runtime/content/client/server-content-client.js +2 -29
  116. package/dist/runtime/content/client/singleton-core.d.ts +2 -9
  117. package/dist/runtime/content/client/singleton-core.js +9 -4
  118. package/dist/runtime/content/client/types.d.ts +5 -115
  119. package/dist/runtime/content/index.d.ts +3 -3
  120. package/dist/runtime/labels/fetch.js +5 -3
  121. package/dist/runtime/next/client.d.ts +2 -1
  122. package/dist/runtime/next/facade.d.ts +1 -1
  123. package/dist/runtime/next/provider.js +1 -1
  124. package/dist/runtime/next/server-runtime.js +1 -1
  125. package/dist/runtime/next/server.d.ts +5 -4
  126. package/dist/runtime/paths/get-fimo-paths.js +8 -3
  127. package/dist/runtime/preview/bridge.d.ts +8 -0
  128. package/dist/runtime/preview/bridge.js +20 -0
  129. package/dist/runtime/preview/location.d.ts +23 -0
  130. package/dist/runtime/preview/location.js +93 -0
  131. package/dist/runtime/preview/routes.d.ts +10 -0
  132. package/dist/runtime/preview/routes.js +29 -0
  133. package/dist/runtime/primitives/index.d.ts +4 -1
  134. package/dist/runtime/primitives/index.js +1 -0
  135. package/dist/runtime/primitives/lib/image-optimization.d.ts +27 -2
  136. package/dist/runtime/primitives/lib/image-optimization.js +40 -0
  137. package/dist/runtime/primitives/lib/index.d.ts +1 -1
  138. package/dist/runtime/primitives/lib/primitives.d.ts +0 -54
  139. package/dist/runtime/primitives/lib/primitives.js +6 -0
  140. package/dist/runtime/primitives/lib/render-rich-text.d.ts +3 -0
  141. package/dist/runtime/primitives/lib/render-rich-text.js +112 -0
  142. package/dist/runtime/react/primitives/contracts.d.ts +40 -2
  143. package/dist/runtime/react/primitives/renderers/ImageRenderer.js +15 -34
  144. package/dist/runtime/react/primitives/renderers/RichTextRenderer.d.ts +2 -1
  145. package/dist/runtime/react/primitives/renderers/StaticImage.js +13 -30
  146. package/dist/runtime/routing/AppRoutesProvider.js +20 -8
  147. package/dist/runtime/shared/env-identity.d.ts +43 -0
  148. package/dist/runtime/shared/env-identity.js +88 -0
  149. package/dist/runtime/shared/local-runtime-env.d.ts +65 -0
  150. package/dist/runtime/shared/local-runtime-env.js +169 -0
  151. package/dist/runtime/{react-router → shared}/preview-location.d.ts +7 -13
  152. package/dist/runtime/{react-router → shared}/preview-location.js +26 -27
  153. package/dist/runtime/sveltekit/content.d.ts +25 -0
  154. package/dist/runtime/sveltekit/content.js +33 -0
  155. package/dist/runtime/sveltekit/context-contract.d.ts +5 -0
  156. package/dist/runtime/sveltekit/context-contract.js +2 -0
  157. package/dist/runtime/sveltekit/context.d.ts +8 -0
  158. package/dist/runtime/sveltekit/context.js +25 -0
  159. package/dist/runtime/sveltekit/index.d.ts +7 -0
  160. package/dist/runtime/sveltekit/index.js +4 -0
  161. package/dist/runtime/sveltekit/internal.d.ts +6 -0
  162. package/dist/runtime/sveltekit/internal.js +12 -0
  163. package/dist/runtime/sveltekit/labels.d.ts +16 -0
  164. package/dist/runtime/sveltekit/labels.js +13 -0
  165. package/dist/runtime/sveltekit/preview.d.ts +19 -0
  166. package/dist/runtime/sveltekit/preview.js +77 -0
  167. package/dist/runtime/sveltekit/runtime.d.ts +8 -0
  168. package/dist/runtime/sveltekit/runtime.js +17 -0
  169. package/dist/runtime/templates.d.ts +1 -1
  170. package/dist/runtime/templates.js +1 -1
  171. package/dist/runtime/vite/Label.d.ts +13 -0
  172. package/dist/runtime/vite/Label.js +16 -0
  173. package/dist/scripts/extract-translations.js +103 -43
  174. package/dist/scripts/sync-forms.js +1 -1
  175. package/dist/scripts/sync-schemas.js +83 -16
  176. package/package.json +57 -2
  177. package/release.json +2 -2
  178. package/templates/nextjs/AGENTS.md +10 -5
  179. package/templates/nextjs/_gitignore +1 -0
  180. package/templates/react-router/AGENTS.md +4 -3
  181. package/templates/react-router/package.json +1 -1
  182. package/templates/sveltekit/.fimo/config.json +15 -0
  183. package/templates/sveltekit/AGENTS.md +36 -0
  184. package/templates/sveltekit/CLAUDE.md +5 -0
  185. package/templates/sveltekit/_gitignore +16 -0
  186. package/templates/sveltekit/package.json +28 -0
  187. package/templates/sveltekit/pnpm-workspace.yaml +4 -0
  188. package/templates/sveltekit/src/app.html +11 -0
  189. package/templates/sveltekit/src/routes/+layout.server.ts +8 -0
  190. package/templates/sveltekit/src/routes/+layout.svelte +12 -0
  191. package/templates/sveltekit/src/routes/+page.svelte +48 -0
  192. package/templates/sveltekit/svelte.config.js +5 -0
  193. package/templates/sveltekit/tsconfig.json +14 -0
  194. package/templates/sveltekit/vite.config.ts +5 -0
  195. /package/assets/content-templates/{form-template.eta → forms/react.eta} +0 -0
  196. /package/assets/content-templates/{next-client-template.eta → next/client.eta} +0 -0
  197. /package/assets/content-templates/{next-server-template.eta → next/server.eta} +0 -0
  198. /package/assets/content-templates/{hooks-template.eta → react/client.eta} +0 -0
  199. /package/assets/content-templates/{types-template.eta → shared/types.eta} +0 -0
@@ -7,163 +7,116 @@ description: >-
7
7
  media, CMS schemas and entries, forms, SEO, redirects, locales, and unresolved
8
8
  gaps with a verifiable manifest and QA gate. This is the single canonical
9
9
  migration skill for URL-only, source-backed, and hybrid migrations.
10
- fimoVersion: 0.1.0
11
10
  ---
12
11
 
13
12
  # Fimo Migration
14
13
 
15
- This skill orchestrates migrations into Fimo from published URLs, builder
16
- exports, source repositories, CMS exports, media folders, or any hybrid of those.
17
- It owns intake, source inventory, URL crawl bootstrapping, ledger normalization,
18
- imports, and QA so any LLM can run the work without silently dropping content.
19
-
20
- > Run every `fimo` command as `npx fimo@latest <command>` — always the latest CLI, no global install.
21
-
22
- ## Non-Negotiables
23
-
24
- - No source data may disappear silently. Every route, CMS export, entry, media
25
- asset, form, locale, redirect, SEO field, or unsupported behavior is imported,
26
- deliberately ignored with a reason, or listed as unresolved.
27
- - Media files, CMS entries, and forms are the primary migration payload. The
28
- migration is not complete until each of those three areas has discovery counts,
29
- import counts, target IDs or files, and verification notes in the canonical
30
- ledger.
31
- - Source exports beat inferred crawls. If CSV/XML/JSON exports, media folders, or
32
- source code exist, treat the public URL as visual/SEO reference only.
33
- - Builder HTML is evidence, not the final runtime. Rebuild with Fimo conventions,
34
- schemas, forms, media primitives, translations, and routes.
35
- - Do not report completion until the QA gate passes or every failed check is
36
- recorded in the migration report.
37
- - Do not deploy or publish during the migration. Importing content is required
38
- and uses the data-plane commands (`fimo assets upload`, `fimo schemas push`,
39
- `fimo entries create`, `fimo forms push`); these do **not** rebuild the live
40
- site. `fimo deploy` / `fimo publish` rebuild and restart the site — never run
41
- them as part of the migration loop or to "check" rendering. Verify locally
42
- (build + local dev). Deployment is a single, final, owner-approved step:
43
- when the QA gate passes, **propose** it to the owner instead of running it.
44
-
45
- ## Intake Decision
46
-
47
- 1. Read the target project `AGENTS.md`.
48
- 2. If editing or creating a Fimo project, read the project `fimo` skill and the
49
- `fimo-cli` skill references needed for schemas, entries, forms, and assets.
50
- Do not run `fimo deploy` / `fimo publish` here — deployment is a final,
51
- owner-approved step (see Non-Negotiables and the Deployment rule below).
52
- 3. Classify the source:
53
- - **source-backed**: export folder, source repo, CMS CSV/XML/JSON, media
54
- folder, downloaded HTML, or platform export. Use source files as truth and
55
- inventory them directly with shell tools such as `rg`, `find`, and targeted
56
- file reads.
57
- - **url-only**: only a published URL exists. Follow `references/workflow.md`
58
- and start with `fimo migrate <url> [dir]` to create the draft evidence
59
- pack.
60
- - **hybrid**: source files plus public URL. Use source-backed as truth and URL
61
- for route, SEO, visual, and behavior comparison.
62
- 4. Create or update the canonical ledger described in
63
- `references/manifest.md`.
64
-
65
- ## Workflow
66
-
67
- Read `references/workflow.md` before starting implementation. The short version:
68
-
69
- 1. Inventory source artifacts. For URL-only work, run
70
- `fimo migrate <url> [dir]`; for source-backed work, inspect the export or
71
- repository directly with shell tools and targeted file reads.
72
- 2. Normalize CMS, media, forms, routes, redirects, locales, and unsupported
73
- behavior into the canonical ledger.
74
- 3. Model content before page code.
75
- 4. Generate or update Fimo schemas, entries, media mappings, forms, routes, and
76
- React pages.
77
- 5. Import reviewed media files, CMS schemas/entries, and forms through Fimo
78
- APIs/CLI. Do not treat generated JSON as imported content.
79
- 6. Run the QA gate in `references/qa.md`.
80
- 7. Write `.fimo/migration/migration-report.md` with coverage, counts, mappings,
81
- unresolved items, and next actions.
82
-
83
- To bootstrap or refresh the canonical ledger from existing URL/source migration
84
- artifacts, run:
14
+ Move published URLs, exports, source repositories, CMS data, media, and forms
15
+ into a real Fimo project without silently dropping source material.
85
16
 
86
- ```bash
87
- node <this-skill>/scripts/build-canonical-manifest.mjs <project-root>
88
- ```
17
+ > **Experimental:** migration support is limited. Assess what can be preserved, explain unsupported parts, and never promise source-framework preservation.
18
+ >
19
+ > Use the CLI invocation selected for this flow for every `fimo` command in the migration. Otherwise use `npx fimo@latest`; do not install it globally.
89
20
 
90
- To update QA status and write the handoff report, run:
21
+ ## Core contract
91
22
 
92
- ```bash
93
- node <this-skill>/scripts/write-migration-report.mjs <project-root>
94
- ```
23
+ - Record every route, CMS record, media asset, form, locale, redirect, SEO
24
+ field, and unsupported behavior as imported, deliberately ignored with a
25
+ reason, or unresolved.
26
+ - Prefer source code and exports over inferred crawl data. Use a public URL as
27
+ visual, SEO, route, and behavior evidence when better source material exists.
28
+ - Model content before page code. Generated JSON is not imported content.
29
+ - Keep migration evidence in the canonical ledger from
30
+ `references/manifest.md`.
31
+ - Do not report completion until the QA gate passes or every failed check is
32
+ present in the migration report.
33
+ - Do not deploy while migrating. Import through the data-plane commands,
34
+ verify locally, and propose one final owner-approved deployment.
35
+
36
+ ## Orient and route
37
+
38
+ 1. Read the target project's `AGENTS.md`.
39
+ 2. When creating or changing a Fimo application, load its `fimo` and
40
+ `fimo-cli` skills for the required schemas, entries, forms, assets, and
41
+ framework APIs.
42
+ 3. Classify the available evidence:
43
+ - **source-backed**: source repository, export, downloaded HTML, CMS data,
44
+ or media folder. Treat the source files as truth and run the relevant
45
+ bounded inventory helpers when available. After the canonical manifest
46
+ records `source.rootPath` and `source.inventoryPath`, run
47
+ `fimo migrate inventory [project-root]` for deterministic framework,
48
+ runtime, package, locale, and message-file evidence.
49
+ - **url-only**: only a published URL. Run `fimo migrate <url> [dir]` to
50
+ create the draft evidence pack.
51
+ - **hybrid**: source material plus a public URL. Treat source material as
52
+ truth and the URL as comparison evidence.
53
+ 4. Read `references/workflow.md` before implementation and create or update the
54
+ canonical ledger.
55
+ 5. Load only the framework and inventory references that apply:
56
+ - Next.js source -> `references/frameworks/nextjs.md`.
57
+ - Locale or dictionary evidence -> `references/inventory/locales.md`.
58
+ - Declared next-intl dependency ->
59
+ `references/inventory/locales/next-intl.md`.
60
+ - Deterministic inventory coordination ->
61
+ `references/inventory/coordinator.md`.
62
+
63
+ ## Migration loop
64
+
65
+ 1. Prepare the deterministic inventory plan first. When independent workers
66
+ are available, create one read-only subagent per planned lane; otherwise run
67
+ the same lanes sequentially. Every worker returns its fragment, never a
68
+ prose claim. Run reconcile after every fan-out, then use targeted file reads
69
+ for evidence the inventory leaves unresolved. Use a validator worker that
70
+ produced no fragments to compare the plan, source evidence, fragments, and
71
+ unresolved claims. Reopen only affected lanes when validation finds a gap.
72
+ 2. Normalize CMS, media, forms, routes, redirects, locales, and unsupported
73
+ behavior into the canonical ledger.
74
+ 3. Model content and references before writing pages.
75
+ 4. Generate or update schemas, entries, media mappings, forms, routes, and
76
+ application code with native Fimo contracts.
77
+ 5. Import reviewed media, schemas, entries, and forms in the order required by
78
+ `references/import-contract.md`.
79
+ 6. Run the local QA gate in `references/qa.md`.
80
+ 7. Write `.fimo/migration/migration-report.md` with coverage, counts,
81
+ mappings, unresolved items, and next actions.
82
+
83
+ Use the bundled deterministic helpers whenever their contract fits. If a
84
+ helper cannot prove a source fact, follow the bounded fallback in the relevant
85
+ inventory reference instead of treating the whole inventory as failed.
95
86
 
96
87
  ## References
97
88
 
98
- - `references/workflow.md` - full decision tree and phase order.
89
+ - `references/workflow.md` - phase order, source intake, URL artifacts, and
90
+ implementation loop.
99
91
  - `references/manifest.md` - canonical migration ledger schema.
100
92
  - `references/content.md` - CMS, entries, references, and source value rules.
101
- - `references/media.md` - media inventory, upload, dedupe, and replacement rules.
102
- - `references/forms.md` - form classification and Fimo replacement rules.
103
- - `references/import-contract.md` - exact import obligations for media, entries,
104
- and forms.
93
+ - `references/media.md` - media inventory, upload, dedupe, and replacement.
94
+ - `references/forms.md` - form classification and Fimo replacement.
95
+ - `references/import-contract.md` - import obligations for media, entries, and
96
+ forms.
105
97
  - `references/platforms.md` - platform-specific source-of-truth and rebuild
106
98
  notes.
107
- - `references/qa.md` - required acceptance gate and report format.
108
- - `scripts/build-canonical-manifest.mjs` - creates
109
- `.fimo/migration/manifest.json` from existing migration ledgers.
110
- - `scripts/write-migration-report.mjs` - updates manifest QA status and writes
111
- `.fimo/migration/migration-report.md`.
112
-
113
- Load only the references needed for the current phase.
114
-
115
- ## Completion Rule
116
-
117
- Final status must be one of:
118
-
119
- - **complete**: QA gate passed, counts match, imports verified.
120
- - **complete-with-unresolved**: site builds and known gaps are documented with
121
- owner-friendly reasons and next actions.
122
- - **draft-only**: user explicitly asked for a draft or the migration cannot
123
- import/verify yet.
124
-
125
- Never use “complete” when CMS entries, media mappings, forms, or route coverage
126
- are unknown. Generated seed JSON and media bundled under `public/` are **draft
127
- state**, not imported content: a migration whose entries were never created in
128
- Fimo, or whose referenced media was never uploaded to the Fimo media library, is
129
- `draft-only` (or `complete-with-unresolved` only when each gap is an explicit,
130
- owner-visible unresolved item). The QA gate enforces this and exits non-zero
131
- otherwise.
132
-
133
- ## Deployment
134
-
135
- Deployment is **out of scope for the migration loop** and happens at most once,
136
- at the very end, with the owner's approval.
137
-
138
- - Never run `fimo deploy` or `fimo publish` to verify, preview, or "check"
139
- rendering while migrating. All verification (build, local dev, route render,
140
- visual comparison) is done locally.
141
- - Importing content (`fimo assets upload`, `fimo schemas push`,
142
- `fimo entries create`, `fimo forms push`) is part of the migration and does
143
- not deploy the site — run those as the import contract requires.
144
- - After the QA gate passes and the report is written, end by **proposing**
145
- deployment: tell the owner the migration is ready and that running
146
- `fimo deploy` once will publish it. Let them decide; do not deploy on their
147
- behalf unless they explicitly ask in this turn.
148
-
149
- ## URL-Only Migration Contract
150
-
151
- `fimo migrate <url> [dir]` creates migration evidence and a draft project; it
152
- does not replace the agent rebuild pass. After the command completes, read:
153
-
154
- - `.fimo/migrations/current/brief.md`
155
- - `.fimo/migrations/current/manifest.json`
156
- - `.fimo/migrations/current/extracted/pages.json`
157
- - `.fimo/migrations/current/extracted/forms.json`
158
- - `.fimo/migrations/current/extracted/design-tokens.json`
159
- - `.fimo/migrations/current/refine/agent-prompt.md` when present
160
- - `.fimo/migrations/current/refine/pages/*.md` when present
161
-
162
- Raw source HTML snapshots may exist under `.fimo/migrations/current/source/`.
163
- Use them as evidence, not as final runtime code.
164
-
165
- If the default crawl misses client-rendered or lazy-loaded content, use the
166
- agent or harness browser tools to collect additional HTML, screenshots, and
167
- route notes, then merge that evidence into the migration artifacts. Import
168
- reviewed media, schemas, forms, and entries with the regular Fimo CLI commands
169
- instead of relying on `fimo migrate` to push content directly.
99
+ - `references/qa.md` - acceptance gate and report format.
100
+ - `references/frameworks/nextjs.md` - Next.js source inventory routing.
101
+ - `references/inventory/locales.md` - locale evidence and agent fallback.
102
+ - `references/inventory/locales/next-intl.md` - next-intl strategy and support
103
+ boundary.
104
+ - `references/inventory/coordinator.md` - deterministic inventory fan-out,
105
+ worker, and fan-in commands.
106
+ - `scripts/build-canonical-manifest.mjs` - bootstrap the canonical ledger.
107
+ - `scripts/write-migration-report.mjs` - update QA state and write the report.
108
+
109
+ ## Completion and deployment
110
+
111
+ Use one final status:
112
+
113
+ - **complete**: QA passed, counts match, and imports are verified.
114
+ - **complete-with-unresolved**: the site builds and every known gap has an
115
+ owner-readable reason and next action.
116
+ - **draft-only**: imports or verification are incomplete, or the user asked for
117
+ a draft.
118
+
119
+ Never call a migration complete when CMS entries, media mappings, forms, or
120
+ route coverage are unknown. Never run `fimo deploy` or `fimo publish` as a
121
+ preview or QA step. After local QA passes, propose one final deployment and run
122
+ it only when the owner explicitly approves it in the current turn.
@@ -0,0 +1,26 @@
1
+ # Next.js source inventory
2
+
3
+ Load this reference when the migration source is a Next.js application. This
4
+ reference selects evidence strategies; use the target project's `fimo-code`
5
+ framework guidance when implementing the migrated application.
6
+
7
+ ## Inventory
8
+
9
+ 1. Record the installed Next.js and internationalization package declarations.
10
+ 2. Identify App Router, Pages Router, or a mixed tree without changing it.
11
+ 3. Inspect `next.config.*`, request configuration, middleware or proxy files,
12
+ navigation helpers, route segments, and message dictionaries.
13
+ 4. Keep these claims separate:
14
+ - dictionary locale candidates;
15
+ - configured locales;
16
+ - default locale;
17
+ - publicly routable locales;
18
+ - localized pathnames.
19
+ 5. When next-intl is declared, load
20
+ `references/inventory/locales/next-intl.md` and run its bounded strategy.
21
+ 6. Record dynamic, imported, remote, or otherwise unproven configuration as
22
+ unresolved for the locale inventory fan-in.
23
+
24
+ Use package versions to prioritize likely strategies, not as proof of the
25
+ source shape. Projects backport, customize, and combine conventions across
26
+ versions; accept a claim only when its source evidence supports it.
@@ -0,0 +1,40 @@
1
+ # Deterministic inventory coordination
2
+
3
+ Prepare before running lanes:
4
+
5
+ ```bash
6
+ fimo migrate inventory <project-root> --prepare
7
+ ```
8
+
9
+ Read `inventory-plan.json`, then run each listed area in an independent worker
10
+ that treats application source as read-only:
11
+
12
+ ```bash
13
+ fimo migrate inventory <project-root> --area runtime-config
14
+ fimo migrate inventory <project-root> --area locales
15
+ ```
16
+
17
+ Run only areas present in the plan. The `locales` area is currently planned
18
+ only when the source package manifest declares `next-intl`.
19
+
20
+ Workers must return the written deterministic fragment, not a prose summary.
21
+ They must read only the source root and write only their planned fragment and
22
+ execution receipt. A worker may report structured unresolved claims in its
23
+ fragment; process outcome and timing belong in the run receipt.
24
+
25
+ If independent workers are unavailable, run the same areas sequentially:
26
+
27
+ ```bash
28
+ fimo migrate inventory <project-root> --sequential
29
+ ```
30
+
31
+ After every fan-out, run deterministic fan-in:
32
+
33
+ ```bash
34
+ fimo migrate inventory <project-root> --reconcile
35
+ ```
36
+
37
+ Use a separate validator worker that did not produce fragments to compare the
38
+ plan, source evidence, fragments, and unresolved claims. If it finds a gap,
39
+ reopen only the affected area and reconcile again. The CLI never starts an
40
+ LLM or chooses a harness.
@@ -0,0 +1,39 @@
1
+ # next-intl locale inventory
2
+
3
+ Use the shipped analyzer after `package.json` proves a next-intl dependency:
4
+
5
+ ```bash
6
+ node <this-skill>/scripts/inventory/locales/next-intl.mjs <source-root>
7
+ ```
8
+
9
+ It detects conventional JSON dictionaries, JSON imports with one dynamic locale
10
+ segment, and static `defineRouting` locale/default-locale values. It emits
11
+ deterministic facts and file/line evidence without changing the source.
12
+
13
+ If request configuration does not reveal a custom JSON dictionary layout, let
14
+ the agent select one relative pattern containing `{locale}` exactly once:
15
+
16
+ ```bash
17
+ node <this-skill>/scripts/inventory/locales/next-intl.mjs <source-root> \
18
+ --messages-pattern 'src/translations/{locale}/common.json'
19
+ ```
20
+
21
+ The script rejects absolute paths, paths outside the source root, non-JSON
22
+ patterns, and ambiguous placeholders.
23
+
24
+ ## Support boundary
25
+
26
+ The analyzer intentionally leaves a claim unresolved when its static source
27
+ shape is unknown. Current gaps include:
28
+
29
+ - locales/default locale declared only through legacy middleware or navigation
30
+ helpers;
31
+ - dynamic or remote locale configuration;
32
+ - non-JSON dictionaries such as extracted PO catalogs;
33
+ - public route reachability.
34
+
35
+ Treat package version as evidence that helps prioritize likely source shapes,
36
+ not as the primary switch. If the analyzer cannot prove a claim, follow the
37
+ temporary read-only strategy in `references/inventory/locales.md`. A zero exit
38
+ code means the analyzer ran successfully; read `unresolved[]` as the exact
39
+ claims still requiring evidence.
@@ -0,0 +1,41 @@
1
+ # Locale inventory
2
+
3
+ Inventory locale evidence without deciding that every dictionary is configured
4
+ or publicly routable.
5
+
6
+ ## Evidence contract
7
+
8
+ Keep these facts distinct:
9
+
10
+ - **dictionary candidates**: locale-like values derived from message files or
11
+ records;
12
+ - **configured locales**: values proven by static application configuration;
13
+ - **default locale**: one statically proven fallback when present;
14
+ - **public locales**: values proven reachable through the application's routes;
15
+ - **unresolved claims**: individual facts that no strategy proved.
16
+
17
+ A successful script run means evidence collection executed correctly. It does
18
+ not mean every locale claim is known. Preserve proven facts when another claim
19
+ remains unresolved.
20
+
21
+ ## Bounded fallback
22
+
23
+ 1. Run the shipped strategy for the detected locale system.
24
+ 2. If the dictionary layout is the only unknown, pass a supported bounded path
25
+ pattern to that strategy.
26
+ 3. If a claim remains unresolved, inspect only the files likely to own it.
27
+ 4. When repeated manual reads would be slower or less reliable, let the agent
28
+ create one disposable script in the harness or operating-system temporary
29
+ directory, outside the application source tree. The script must:
30
+ - read only the selected source root;
31
+ - perform no network calls or source writes;
32
+ - have explicit file, byte, or time bounds;
33
+ - print deterministic facts, evidence paths, and unresolved claims;
34
+ - avoid claiming route reachability from dictionary files alone.
35
+ 5. Validate the output, copy its evidence into the canonical ledger, and remove
36
+ the temporary script. Do not commit it to the migrated application.
37
+ 6. At fan-in, compare configured, default, dictionary, and public locales. Keep
38
+ every mismatch or unproven claim unresolved until evidence settles it.
39
+
40
+ If the same temporary strategy is needed repeatedly across migrations, turn it
41
+ into a tested shipped script in a separate Fimo change.
@@ -188,6 +188,7 @@ Deployment is not part of the migration loop and is never run to preview or
188
188
  verify. Once Phase 8 passes:
189
189
 
190
190
  1. Do not run `fimo deploy` or `fimo publish` yourself.
191
- 2. End by proposing it: tell the owner the migration is ready and that a single
192
- `fimo deploy` will publish it.
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.
193
194
  3. Deploy only if the owner explicitly asks in this turn, and then only once.