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
@@ -32,7 +32,7 @@ const items = [
32
32
 
33
33
  Do not use variables or interpolated expressions as label keys. Namespace literal keys by page/section/component, such as `hero.title`, `nav.signIn`, or `contact.form.submit`.
34
34
 
35
- Missing keys render as an empty tracked value. Run `fimo validate`, then create values with `fimo labels set` or `set-many`; do not add fallback copy to code.
35
+ Missing keys render as an empty tracked value. Run `fimo validate`, then create values with `fimo labels set` or `set-many`; do not add fallback copy to code (the one exception is a component that cannot mount under the provider — see "Provider mount" below).
36
36
 
37
37
  ## Framework adapters
38
38
 
@@ -46,6 +46,14 @@ The label contract is shared; acquisition differs by runtime:
46
46
 
47
47
  Load the matching framework reference before choosing a provider or server reader.
48
48
 
49
+ ## Provider mount
50
+
51
+ Components that render `Label` or call `useLabels()` MUST be mounted below the framework's `FimoProvider` (or the framework integration that supplies label context). Globally mounted components — cookie banners, toasts, consent dialogs injected near the document root — are the common escapees: outside the provider they render blank labels with no error.
52
+
53
+ If a component genuinely cannot be moved under the provider, use an explicit hardcoded, non-editable fallback and report that tradeoff to the user. Never ship silently blank copy.
54
+
55
+ When a label renders empty, check in order: (1) the key exists (`fimo validate`, `fimo labels list`), (2) the active locale has a value, (3) the component is under the provider. Add fallback copy only after those checks, and only in the cannot-mount case above.
56
+
49
57
  ## Locale behavior
50
58
 
51
59
  `.fimo/config.json#i18n.defaultLocale` selects the default (fallback `en`). The application resolves the active locale and gives it to the framework adapter. Create explicit label values for each configured locale the product supports.
@@ -13,7 +13,9 @@ The application owns locale resolution and routing. Fimo consumes the resolved l
13
13
  }
14
14
  ```
15
15
 
16
- Keep one locale unless the product asks for multilingual output. Locale tags should be structurally valid, such as `en`, `pt-BR`, or `zh-Hans`.
16
+ For new projects, derive the primary locale from the request; when several are explicit, the first one named is the default. Update `i18n.defaultLocale`, `i18n.locales`, the framework-native route boundary and matcher, and the document language default. If the user gives no locale signal, retain the starter default and state that choice.
17
+
18
+ Keep one locale unless the product asks for multilingual output. Keep it locale-ready without forcing `/en`, a language switcher, global path-prefix routing, or localized schemas. Locale tags should be structurally valid, such as `en`, `pt-BR`, or `zh-Hans`.
17
19
 
18
20
  For an already linked project, enable each locale in Fimo before writing non-default label or content variants. Load `fimo-cli` with its `locales` reference and run `fimo locales add <locale> --yes --json`; local config and `fimo validate` do not provision project locales. Do not change the application's route strategy to work around a missing locale.
19
21
 
@@ -22,6 +24,8 @@ For an already linked project, enable each locale in Fimo before writing non-def
22
24
  - Resolve locale from its router, route parameters, domain, request headers, middleware, cookie, existing i18n library, or user preference.
23
25
  - Keep its existing public URLs, redirects, links, `<html lang/dir>`, and SEO behavior.
24
26
  - Pass the resolved locale to Fimo's server reads and client provider.
27
+ - Keep the default locale separate from the URL prefix policy. `optional: true` means omit the configured default locale from the URL: with `defaultLocale: "en"`, `/pricing` is English and `/fr/pricing` is French. With `optional: false`, every locale is prefixed (`/en/pricing` and `/fr/pricing`).
28
+ - Treat routes without a `:locale` segment as application-owned. Fimo does not add or interpret a locale prefix for them.
25
29
  - Treat any optional Studio route catalog as framework-adapter-specific; load the framework reference before creating or changing one.
26
30
 
27
31
  ## Fimo responsibilities
@@ -39,4 +43,6 @@ For an already linked project, enable each locale in Fimo before writing non-def
39
43
  - React Router standard locale routing → load `references/frameworks/react-router.md`.
40
44
  - Vite + React/custom React router → load `references/frameworks/vite-react.md` and pass locale through its existing provider seam.
41
45
 
42
- Do not replace an existing locale system merely to add Fimo. Do not duplicate localized routes in the Studio catalog. Do not assume Fimo's route helpers are universal framework APIs.
46
+ Do not replace an existing locale system merely to add Fimo. Do not duplicate localized routes in the Studio catalog. Every framework resolves its active locale and passes it to Fimo through that framework's provider or server-read seam.
47
+
48
+ Astro and Next implement an optional locale boundary with paired native filesystem route trees: one unprefixed tree for the default locale and one prefixed tree for the other locales. Neither framework has an optional single-segment filesystem folder.
@@ -0,0 +1,93 @@
1
+ # React Router locale route ownership upgrade
2
+
3
+ Use this guide to move an existing project from the deprecated
4
+ `fimo/react-router/routes` compatibility adapter to application-owned React
5
+ Router routes. Existing projects can upgrade before completing this migration,
6
+ but new projects should not use the adapter and a future breaking release may
7
+ remove it.
8
+
9
+ ## Identify the installed contract
10
+
11
+ Run the project-local CLI with the package manager selected by the lockfile:
12
+
13
+ ```bash
14
+ pnpm exec fimo --version
15
+ ```
16
+
17
+ Then inspect `package.json`, the lockfile, `src/routes.ts`, the locale layout or
18
+ provider, `.fimo/config.json` (or legacy `fimo-config.json`), the language
19
+ selector, redirects, and SEO/static-generation setup. The installed package is
20
+ authoritative. Do not use a newer globally installed CLI to rewrite the app.
21
+
22
+ Choose the path by the installed and target contracts, not by a guessed
23
+ version number:
24
+
25
+ | Installed project | Target project | Action |
26
+ | ------------------------------------- | --------------- | ------------------------------------------------------------------------- |
27
+ | Uses `fimo/react-router/routes` | Current release | Upgrade safely, then follow this guide to leave the deprecated adapter. |
28
+ | Already uses application-owned routes | Later release | Keep the app-owned routes; no routing migration is needed. |
29
+ | Uses another router or framework | Any release | Keep that framework's locale system and pass its resolved locale to Fimo. |
30
+
31
+ The package export and `pnpm exec fimo --version` are the reliable boundary
32
+ until release notes assign concrete version numbers.
33
+
34
+ ## Replace the deprecated route wrapper
35
+
36
+ Remove the `fimo/react-router/routes` import and declare each localized path
37
+ directly. React Router uses `:locale?`; route metadata uses `/:locale` with an
38
+ optional locale descriptor:
39
+
40
+ ```ts
41
+ import type { RouteConfig } from '@react-router/dev/routes';
42
+ import { layout, route } from '@react-router/dev/routes';
43
+
44
+ export default [
45
+ layout('./pages/LocaleLayout.tsx', [
46
+ route(':locale?/pricing', './pages/Pricing.tsx'),
47
+ route(':locale?/blog/:slug', './pages/BlogPost.tsx'),
48
+ ]),
49
+ ] satisfies RouteConfig;
50
+ ```
51
+
52
+ Keep the public URL matrix unchanged:
53
+
54
+ | URL | route | active locale |
55
+ | --------------- | --------- | ------------------ |
56
+ | `/pricing` | pricing | configured default |
57
+ | `/es/pricing` | pricing | `es` |
58
+ | `/blog/hello` | blog post | configured default |
59
+ | `/es/blog/hola` | blog post | `es` |
60
+
61
+ Do not add a default-locale prefix. Read the optional route locale in an
62
+ application-owned layout and pass it to `<FimoProviders locale={locale}>`.
63
+ When it is omitted, FimoProviders resolves the configured default locale.
64
+ Preserve existing redirects, link behavior, document language/direction, and
65
+ locale validation.
66
+
67
+ The copyable boundary is:
68
+
69
+ ```tsx
70
+ import { FimoProviders } from 'fimo/react-router';
71
+ import { Outlet, useParams } from 'react-router';
72
+
73
+ export default function LocaleLayout() {
74
+ const { locale } = useParams();
75
+ return (
76
+ <FimoProviders locale={locale}>
77
+ <Outlet />
78
+ </FimoProviders>
79
+ );
80
+ }
81
+ ```
82
+
83
+ ## Verify before finishing
84
+
85
+ Run the project-local `fimo validate`, then verify all four URL shapes in the
86
+ preview. Switch languages in the application selector and in Studio, and check
87
+ that both report the same locale. Confirm canonical URLs, `hreflang`, sitemap or
88
+ prerender output, and locale-specific metadata/content remain correct.
89
+
90
+ If the installed version has no exact matching reference, preserve every
91
+ existing public URL and routing behavior. Report the installed version, the
92
+ pattern found, the checks completed, and any uncertainty instead of guessing a
93
+ new route shape.
@@ -9,7 +9,8 @@ Use Fimo components for source-tracked schema and label values so Studio can ide
9
9
  | media as `FimoMedia` | `Image` | schema media images |
10
10
  | non-schema URL | `StaticImage` | decorative/static image URLs |
11
11
  | media as `FimoMedia` | `Video` | schema media videos |
12
- | date as `FimoString` | `Date` | schema dates |
12
+ | date as `FimoString` | `Date` | schema dates; `<time datetime>` is the calendar day |
13
+ | datetime as `FimoString` | `DateTime` | schema instants; `<time datetime>` keeps the time |
13
14
  | boolean as `FimoBoolean` | `Boolean` | schema booleans |
14
15
  | source-tagged plain JSON | `Json` | schema JSON |
15
16
  | number | normal JSX; SvelteKit `Number` | numbers stay plain; SvelteKit `Number` formats display-only values |
@@ -21,6 +22,7 @@ Use Fimo components for source-tracked schema and label values so Studio can ide
21
22
  <RichText value={article.body} />
22
23
  <Image value={article.cover} width={1200} height={630} />
23
24
  <Date value={article.publishedAt} />
25
+ <DateTime value={article.lastReviewedAt} />
24
26
  ```
25
27
 
26
28
  Pass the tracked value directly. Do not replace `<Text>` with `<h1>{article.title}</h1>`, unwrap media into raw `<img>`, or hand-roll richtext rendering.
@@ -44,7 +46,24 @@ Blocks do not change this rule. Every visible nested scalar is source-tracked to
44
46
 
45
47
  Do not render those values as `{program.title}` or `{highlight.label}`. That displays text but bypasses the primitive that Studio uses to resolve the exact nested edit target.
46
48
 
47
- Use `<StaticImage>` only when the image is deliberately not editor-managed. Use `String(value)` for attributes/third-party APIs that cannot accept a `FimoString`; keep editable visible text in `<Text>`.
49
+ Use `<StaticImage>` only when the image is deliberately not editor-managed.
50
+
51
+ ## Wrapper values in JavaScript logic
52
+
53
+ `FimoString`, `FimoBoolean`, and the other tracked values are objects, not primitives: a plain string or boolean cannot carry the source field, locale, and edit-target metadata Fimo editing needs. That gives one two-sided rule:
54
+
55
+ - **MUST** pass the wrapper directly to Fimo rendering primitives (`Text`, `Boolean`, …). Unwrapping first removes the edit target.
56
+ - **MUST** normalize the wrapper before any JavaScript comparison, condition, attribute, or third-party API: `String(value)` for strings, `value.value` (or `value.valueOf()`) for booleans.
57
+
58
+ ```ts
59
+ fimoValue === 'build'; // false — an object never strict-equals a primitive
60
+ String(fimoValue) === 'build'; // true
61
+
62
+ if (fimoFlag) { … } // always runs — an object is truthy even when the value is false
63
+ if (fimoFlag.value) { … } // correct
64
+ ```
65
+
66
+ Keep editable visible text in `<Text>`; normalized primitives are for logic and APIs only, never a substitute for rendering through the primitive.
48
67
 
49
68
  Numeric fields stay plain JavaScript numbers, so they do not carry Studio source metadata. SvelteKit's `Number` component is an optional display/formatting helper; it is not source-editable. Other framework surfaces should render numeric fields normally until a shared tracked-number contract exists.
50
69
 
@@ -14,24 +14,158 @@ description: >-
14
14
  Move published URLs, exports, source repositories, CMS data, media, and forms
15
15
  into a real Fimo project without silently dropping source material.
16
16
 
17
- > **Experimental:** migration support is limited. Assess what can be preserved, explain unsupported parts, and never promise source-framework preservation.
17
+ > **Experimental:** migration support is limited. Assess what can be preserved,
18
+ > explain unsupported parts, record every gap as an owner-visible unresolved
19
+ > item, and do not promise behavior that the target cannot prove. When the CLI
20
+ > supports the source framework, preserve it explicitly and verify the runtime
21
+ > before importing data.
18
22
  >
19
23
  > 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.
20
24
 
25
+ The first pass is a faithful migration, not a framework conversion. Detect the
26
+ source framework before creating the target and pass it explicitly to
27
+ `fimo migrate init`. For a Next.js source, use `--framework nextjs`; never rely
28
+ on the React Router default. The setup receipt must report the target runtime
29
+ framework, and a mismatch is a setup failure before any schemas, entries,
30
+ assets, labels, or forms are imported.
31
+
32
+ Keep third-party integrations when Fimo does not reproduce their behavior
33
+ end-to-end. Preserve the original code path and record required environment
34
+ variable names only; never read or copy secret values. A missing secret is a
35
+ follow-up for the owner, not permission to silently remove the integration.
36
+
37
+ ## Execution environment
38
+
39
+ Run this skill from a coding-agent process that has direct access to the
40
+ migration checkout. The process must be able to read and write source files,
41
+ run bounded shell scripts, spawn its own subagents, and invoke the selected
42
+ standalone Fimo CLI. The root agent owns the complete loop: fan out workers,
43
+ fan in their reports, repair what they missed, and validate the real target.
44
+
45
+ A plan, an evidence pack, or a generated report without source changes and
46
+ verified Fimo state is only a draft. Do not finish with an explanation when the
47
+ migration request requires an implementation.
48
+
49
+ ## CLI provenance
50
+
51
+ Run every `fimo` command in the migration through one released, pinned CLI
52
+ artifact, and record which one.
53
+
54
+ - Use the exact CLI invocation selected for this flow. If none was provided,
55
+ stop and request an exact released version or immutable package URL. Never
56
+ default to `latest` or another moving dist-tag, never install it globally,
57
+ and never switch artifacts mid-run.
58
+ - Never run the migration through a `file:`-linked workspace CLI from a Fimo
59
+ source checkout: the workspace binary skips the publish-time bundle and can
60
+ miss bundled workspace packages such as `@fimo/cli-kit`. When the migration
61
+ must exercise unreleased CLI changes, publish a pinned dev artifact from that
62
+ checkout first (`pnpm -F fimo publish-cli -- --id <task-name>`, or
63
+ `node scripts/remote-dev-publish-cli.mjs --id <task-name>` when the checkout
64
+ runs on a Dev Remote box) and use the exact package the publish recorded in
65
+ that checkout's `.fimo/dev.json`.
66
+ - Record the provenance in the migration report - the `fimo --version` output
67
+ plus the artifact source (an npm version, or the pinned artifact URL from
68
+ `.fimo/dev.json`).
69
+
70
+ ## Initialized target precondition
71
+
72
+ Before workers start, the root process must establish a real Fimo project and
73
+ environment, link the migration checkout to it, and prove the data plane is
74
+ reachable with a read such as `fimo schemas list -C <target> --env <env>` using
75
+ the selected pinned CLI. Give workers the project id, environment, exact CLI
76
+ invocation, and verification command. Generated `.fimo` JSON without a
77
+ successful platform read is not initialization.
78
+
79
+ For an existing non-empty application, reuse the CLI's real flow: create or
80
+ select the Fimo project with `fimo init`, then run
81
+ `fimo link <project-id> -C <target> --env <env>` and verify the data plane.
82
+ `fimo migrate init <url> <dir>` is only usable when the target directory is
83
+ empty or already linked.
84
+ If authentication, organization selection, project creation, environment
85
+ resolution, linking, or the verification read fails, stop before workers and
86
+ report the exact failed command and setup requirement.
87
+
21
88
  ## Core contract
22
89
 
90
+ - Migrate 1:1, not a compact approximation. Keep the source's route surface
91
+ and user-visible behavior: do not refactor routes merely to make the
92
+ migration easier, and do not replace many source pages with one generic
93
+ static shell. Every source page, content construct, array item, Markdown or
94
+ MDX block, imported component, and meaningful UI behavior ends with a
95
+ consuming target route or component, or with an explicit
96
+ unresolved/incompatible item in the text plan/report.
97
+ - The first migration produces a working Fimo app with minimal refactoring.
98
+ Source-backed migrations preserve the detected source framework, router,
99
+ runtime, provider structure, and configuration by default: React Router/Vite
100
+ stays React Router/Vite, and Next.js stays Next.js. Framework conversion is
101
+ always an explicit user choice. URL-only and rebuild migrations have no
102
+ source framework to preserve, so the user must choose the target framework
103
+ explicitly; do not silently inherit a scaffold default. An explicit
104
+ conversion is still a faithful first pass: the framework conversion worker
105
+ ports the source's APIs, loaders, hardcoded content, integrations, and
106
+ visible behavior into the new framework unchanged, and Fimo schemas,
107
+ payloads, imports, and code wiring happen later through the content workers
108
+ (`references/workers/content-execution.md`). If the framework or hosting
109
+ setup is unclear or unsupported, stop and ask instead of guessing,
110
+ converting it, or deleting provider-specific files.
111
+ - Inventory provider-specific files and rules before editing them. Classify each
112
+ as `preserved`, `replaced`, `safely-unnecessary-implementation-detail`, or
113
+ `unresolved`, with source evidence and affected behavior. Delete only after
114
+ proving redundancy or recording the user's acceptance of the loss.
115
+ - Preserve an existing third-party integration (email, marketing, payments,
116
+ analytics) unless Fimo reproduces its exact user-visible behavior end to
117
+ end. When behavior is not 1:1 - a Brevo newsletter flow, for example - keep
118
+ the original integration wired and record the credential environment keys it
119
+ needs by name, without reading secret values. A missing secret is a user
120
+ follow-up in the report, never a reason to delete behavior or to block
121
+ local build, evaluation, or QA checks.
23
122
  - Record every route, CMS record, media asset, form, locale, redirect, SEO
24
123
  field, and unsupported behavior as imported, deliberately ignored with a
25
124
  reason, or unresolved.
125
+ - When Fimo cannot support a source feature, do not silently drop or simplify
126
+ it. Preserve the original behavior when possible; otherwise leave the
127
+ existing source behavior or its documented fallback in place and record an
128
+ unresolved item with the source evidence, the owner action, and the
129
+ user-visible impact. Never claim completion while source content is
130
+ unwired.
26
131
  - Prefer source code and exports over inferred crawl data. Use a public URL as
27
132
  visual, SEO, route, and behavior evidence when better source material exists.
133
+ - Read local files and exports directly and public APIs without credentials.
134
+ Private APIs and CMSs require a user-provided export or a narrowly scoped
135
+ server-side credential. Never read credentials from browser code or copy
136
+ them into browser code, migration artifacts, or reports. Target-project
137
+ authentication does not grant source access. Missing access stops only that
138
+ data lane and becomes unresolved; never invent replacement content.
28
139
  - Model content before page code. Generated JSON is not imported content.
29
- - Keep migration evidence in the canonical ledger from
30
- `references/manifest.md`.
140
+ - Model editorial content Fimo-natively: blocks for structured or repeatable
141
+ sections, richtext for rich bodies, references for categories, authors,
142
+ related items, and repeated taxonomies, and singleton content types for
143
+ editable header, footer, navigation, and site settings. A `json` field is the
144
+ last resort for opaque or application-owned data and carries a recorded
145
+ reason. Better modeling never redesigns the site: preserve the source's
146
+ content shape and behavior, and record the source-to-Fimo mapping
147
+ (`references/content.md`).
148
+ - Media owns its alt text. Preserve the source alt on the media value and pass
149
+ it to asset metadata when the upload command supports it; never add a
150
+ standalone alt field to a content schema. Record the limitation when the
151
+ command cannot carry it (`references/media.md`).
152
+ - Every write is create-or-update, so any step can be rerun without duplicating
153
+ a schema, entry, asset, single, or label.
154
+ - Every decision cites the source file (and line when it matters) that proves
155
+ it. What no worker could prove stays unresolved with an owner action.
156
+ - Keep coordination evidence in the plain-text files
157
+ `.fimo/migration/migration-plan.md` and
158
+ `.fimo/migration/migration-report.md`. Use JSON only for actual Fimo
159
+ schema/content payloads that a data-plane command needs to import, except for
160
+ the versioned URL-only Source Evidence Pack in
161
+ `.fimo/migration/source-evidence/`. That pack records observed source facts
162
+ and pointers to raw browser artifacts; it is not a worker plan, target
163
+ description, decision registry, or completion receipt.
31
164
  - Do not report completion until the QA gate passes or every failed check is
32
165
  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.
166
+ - Import through the data-plane commands and verify locally before deployment.
167
+ Propose one preview deployment after a successful run, but deploy or publish
168
+ only after an explicit user request.
35
169
 
36
170
  ## Orient and route
37
171
 
@@ -41,70 +175,177 @@ into a real Fimo project without silently dropping source material.
41
175
  framework APIs.
42
176
  3. Classify the available evidence:
43
177
  - **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.
178
+ or media folder. The source files are truth; the workers read them
179
+ directly.
180
+ - **url-only**: only a published URL. Use the URL form of
181
+ `fimo migrate init` to create the target and static draft, then read
182
+ `references/url-evidence.md` and build the rendered Source Evidence Pack
183
+ before reconstruction. Do not run the legacy apply/refine path first.
184
+ Static HTML, settled screenshots, or a late DOM snapshot alone are
185
+ incomplete source evidence.
51
186
  - **hybrid**: source material plus a public URL. Treat source material as
52
187
  truth and the URL as comparison evidence.
53
188
  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:
189
+ plain-text migration plan.
190
+ 5. Load the references that apply:
191
+ - Coordinator ownership and dependency gates -> `references/workers.md`.
192
+ - URL-only rendered capture and browser acquisition ->
193
+ `references/url-evidence.md`.
194
+ - URL observation workers -> `references/workers/url-observer.md`.
195
+ - Framework conversion worker -> `references/workers/framework.md`.
196
+ - Content planner -> `references/workers/content-planner.md`.
197
+ - Content data/code workers -> `references/workers/content-execution.md`.
198
+ - Independent validator -> `references/workers/validator.md`.
56
199
  - 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`.
200
+ - React Router/Vite source -> load the target project's `fimo-code`
201
+ `frameworks/react-router`, `frameworks/vite-react`, and
202
+ `frameworks/hosting` references as applicable.
203
+ - Next.js implementation -> load the target project's `fimo-code`
204
+ `frameworks/next` and `frameworks/hosting` references. Those references
205
+ describe available equivalents; verify hosting support instead of assuming
206
+ every Next.js rule or runtime behavior is automatic.
207
+ Framework, provider, and rendering-primitive rules live in the `fimo-code`
208
+ skill; this skill routes to them and does not restate them.
209
+
210
+ ## Target setup
211
+
212
+ The target is its own Fimo project directory. The client source checkout is
213
+ read-only evidence: never run setup inside it, never modify it, and never
214
+ hand-write a `.fimo/project.json` marker to fake a link.
215
+
216
+ `fimo migrate init` is the migration setup gate. For a source-backed migration
217
+ it validates the target and CLI auth, then delegates project selection and
218
+ creation to the standard `fimo init` flow (same options, no separate creation
219
+ path), and returns a setup receipt covering auth, the target link, the
220
+ migration directory, and readiness. It fails with a structured error when auth
221
+ is missing, the target is missing or invalid, or the project or organization
222
+ is inaccessible. Both forms need a real ID supplied by the owner — without
223
+ one, stop with an unresolved owner action instead of inventing an ID:
224
+
225
+ - Link an owner-supplied (empty) project:
226
+ `fimo migrate init <target-dir> --project-id <projectId> --framework <framework>`
227
+ - Create a new project in an owner-supplied organization:
228
+ `fimo migrate init <target-dir> --org <organizationId> --framework <framework>`
229
+
230
+ After setup, check `.fimo/config.json#runtime.framework` and the scaffold's
231
+ framework files before starting workers. A Next.js target must still have its
232
+ Next runtime/configuration (`next.config.*` and the source router shape), not a
233
+ React Router scaffold.
234
+
235
+ Setup scaffolds the target and pushes its initial commit; that is the only
236
+ remote write it performs — it never pushes schemas, uploads assets, or imports
237
+ entries. `fimo deploy` and `fimo publish` stay separate and are never run
238
+ automatically (see Completion and deployment).
239
+
240
+ ## Command surface
241
+
242
+ Plan-only commands operate on local artifacts and work before the target is
243
+ linked:
244
+
245
+ - `fimo migrate init <url> [dir]` — URL migrations only: crawl the live site
246
+ into the draft evidence pack.
247
+ - `fimo migrate inspect` — summarize the URL draft or an existing legacy ledger.
248
+ - `fimo migrate import` — print the import plan; it writes no data.
249
+ - `fimo migrate apply` / `fimo migrate refine` — URL-draft-only scaffold and
250
+ refinement handoff; they play no role in a source-backed migration. `apply`
251
+ must never run against an initialized non-React-Router target: it is the
252
+ legacy React Router scaffold path and must fail instead of downgrading a
253
+ Next.js (or another framework) project.
254
+ - `fimo migrate manifest` / `fimo migrate report` — legacy URL-draft helpers.
255
+ New source-backed migrations use the plain-text migration plan, worker
256
+ reports, and final migration report; they do not bootstrap another JSON
257
+ registry.
258
+
259
+ Commands that perform actual data writes, all requiring the linked target:
260
+
261
+ - `fimo schemas push`, `fimo assets upload`, `fimo entries create|update`,
262
+ `fimo singles update`, `fimo labels set|set-many`, `fimo forms push`.
263
+ - `fimo migrate init` (source-backed form): the project link/creation and
264
+ initial commit push described above.
265
+ - `fimo deploy` / `fimo publish` — owner-approved only.
62
266
 
63
267
  ## Migration loop
64
268
 
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.
269
+ 1. Run `fimo migrate init` and inspect the initialized target before any worker
270
+ edits it. Choose the target framework through the same canonical option as
271
+ `fimo init`: pass the detected source framework for a source-backed
272
+ migration, the framework the user explicitly chose for a conversion, and —
273
+ for a URL-only or rebuild migration — the framework the user selected (ask
274
+ when they have not). `--template-root` is a development/test
275
+ override only; normal migration prompts must not select a framework by
276
+ copying an arbitrary template path. The target's real files and directories
277
+ are the authority for framework paths; do not invent a second `app/` or
278
+ `src/app/` tree from an example.
279
+ 2. For URL-only migrations, run the observation crew in
280
+ `references/workers/url-observer.md` before any reconstruction worker. The
281
+ crew produces `.fimo/migration/source-evidence/index.json`, compact
282
+ normalized route evidence, and pointers to sanitized raw browser artifacts.
283
+ Do not hand-write a replacement source summary or let reconstruction begin
284
+ while the pack reports incomplete capture.
285
+ 3. Write a short `.fimo/migration/migration-plan.md` containing the chosen
286
+ framework, source/target paths, worker owners, important dependencies, and
287
+ known questions. Start the independent workers in `references/workers.md`:
288
+ runtime/config, routes/SEO, content planning, and locales when those surfaces
289
+ exist. When the user explicitly chose a framework conversion,
290
+ one framework conversion worker replaces the runtime and routes lanes, owns
291
+ all structural target code, and must pass the framework gate in
292
+ `references/workers/framework.md` before content data and code workers
293
+ start. Worker prompts and worker reports are plain text.
294
+ 4. The content planner reads every content-bearing source and consumer, writes
295
+ and pushes complete schemas, and writes the content import payloads required
296
+ by the Fimo CLI. It records source items, consumers, batches, and unresolved
297
+ behavior in the text plan; it does not create a second orchestration format.
298
+ 5. Once the content plan is ready, upload every planned asset and patch its
299
+ target payload references. After the asset gate passes (and, in conversion
300
+ mode, the framework gate), run data workers per schema/locale. Start content
301
+ code workers only after their imported records read back successfully, so
302
+ they can prove real values render through the native Fimo APIs.
303
+ 6. Fan in the workers' plain-text reports. Compare their claimed files with
304
+ `git diff`, their Fimo writes with read-back CLI queries, and their source
305
+ coverage with the content plan. Every source item must be migrated,
306
+ deliberately preserved, or listed as unresolved with an owner action. A
307
+ report that merely says “done” is not evidence.
308
+ 7. Validate against the real target with a validator that did not author the
309
+ changes and starts only after every other worker report is terminal: read
310
+ back schemas, entries, singles, labels, and assets through the CLI, build
311
+ the project, render the migrated routes, and verify hosting compatibility
312
+ (local startup, Fimo Preview embeddability, build). Record `browserProof`
313
+ when a browser is available; otherwise use deterministic
314
+ HTTP/header/process/log checks and mark visual proof unavailable. Then run
315
+ the QA gate in `references/qa.md`.
316
+ 8. Write `.fimo/migration/migration-report.md` with coverage, counts, mappings,
317
+ unresolved items, timings from worker reports, and next actions.
86
318
 
87
319
  ## References
88
320
 
89
321
  - `references/workflow.md` - phase order, source intake, URL artifacts, and
90
322
  implementation loop.
91
- - `references/manifest.md` - canonical migration ledger schema.
323
+ - `references/url-evidence.md` - rendered-browser capability, capture, Source
324
+ Evidence Pack, and normalization contract for URL-only sources.
325
+ - `references/decision.md` - plain-text decision and schema guidance; no
326
+ decision JSON is required.
92
327
  - `references/content.md` - CMS, entries, references, and source value rules.
93
- - `references/media.md` - media inventory, upload, dedupe, and replacement.
328
+ - `references/media.md` - media obligations, upload, dedupe, and replacement.
94
329
  - `references/forms.md` - form classification and Fimo replacement.
95
330
  - `references/import-contract.md` - import obligations for media, entries, and
96
331
  forms.
97
332
  - `references/platforms.md` - platform-specific source-of-truth and rebuild
98
333
  notes.
99
334
  - `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.
335
+ - `references/frameworks/nextjs.md` - Next.js routes, config, locales, and
336
+ Markdown or MDX content.
337
+ - `references/workers.md` - coordinator schedule, ownership, and gates.
338
+ - `references/workers/url-observer.md` - route scout, shared-system observer,
339
+ page observer, and evidence normalizer contracts.
340
+ - `references/workers/framework.md` - explicit framework-conversion contract.
341
+ - `references/workers/content-planner.md` - discovery, schemas, payloads, and
342
+ handoff contract.
343
+ - `references/workers/content-execution.md` - data import and code-wiring
344
+ contracts.
345
+ - `references/workers/validator.md` - independent fan-in validation.
346
+ - Existing manifest/decision helper scripts are legacy compatibility tools for
347
+ older migration artifacts. Do not invoke them in a new migration unless the
348
+ user explicitly asks to replay an older artifact.
108
349
 
109
350
  ## Completion and deployment
110
351
 
@@ -117,6 +358,9 @@ Use one final status:
117
358
  a draft.
118
359
 
119
360
  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.
361
+ route coverage are unknown. Local QA remains the acceptance gate. If
362
+ `fimo migrate init` created a new Fimo project, run one `fimo deploy` after QA
363
+ and return its preview and dashboard links; skip it when the user said not to
364
+ deploy or `FIMO_MIGRATION_NO_DEPLOY=1` is set. For an existing linked project,
365
+ offer the deployment and wait for approval. Never run `fimo publish` without an
366
+ explicit request.
@@ -1,4 +1,4 @@
1
1
  interface:
2
2
  display_name: 'Fimo Migration'
3
- short_description: 'Migrate complete websites into Fimo with verified CMS, media, and forms.'
4
- default_prompt: 'Migrate this website into a clean, editable Fimo project and verify routes, CMS entries, media, forms, and unresolved gaps.'
3
+ short_description: 'Migrate complete websites into Fimo with rendered behavior and editable content preserved.'
4
+ default_prompt: 'Migrate this website into a clean, editable Fimo project and verify routes, rendered layout and motion, CMS entries, media, forms, and unresolved gaps.'