fimo 2.2.0-staging.9 → 2.2.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 (94) hide show
  1. package/assets/agent-templates/_default/config.yaml +6 -0
  2. package/assets/agent-templates/broken-link-sweeper/config.yaml +1 -0
  3. package/assets/content-templates/shared/types.eta +65 -6
  4. package/assets/skills/fimo-cli/SKILL.md +5 -3
  5. package/assets/skills/fimo-cli/references/agents.md +28 -3
  6. package/assets/skills/fimo-cli/references/assets.md +38 -2
  7. package/assets/skills/fimo-cli/references/branches.md +9 -8
  8. package/assets/skills/fimo-cli/references/content.md +1 -1
  9. package/assets/skills/fimo-cli/references/credits.md +12 -19
  10. package/assets/skills/fimo-cli/references/deploy.md +6 -6
  11. package/assets/skills/fimo-cli/references/history.md +2 -2
  12. package/assets/skills/fimo-cli/references/inbox.md +86 -0
  13. package/assets/skills/fimo-cli/references/init.md +7 -6
  14. package/assets/skills/fimo-cli/references/invite.md +11 -9
  15. package/assets/skills/fimo-cli/references/labels.md +3 -11
  16. package/assets/skills/fimo-cli/references/locales.md +5 -3
  17. package/assets/skills/fimo-cli/references/preview.md +1 -2
  18. package/assets/skills/fimo-cli/references/projects.md +8 -8
  19. package/assets/skills/fimo-cli/references/schedules.md +2 -2
  20. package/assets/skills/fimo-cli/references/webhooks.md +4 -4
  21. package/assets/skills/fimo-code/references/assets.md +22 -11
  22. package/assets/skills/fimo-code/references/content/clients.md +15 -1
  23. package/assets/skills/fimo-code/references/content/schema.md +1 -0
  24. package/assets/skills/fimo-code/references/frameworks/astro.md +1 -1
  25. package/assets/skills/fimo-code/references/frameworks/next/app-router.md +12 -1
  26. package/assets/skills/fimo-code/references/frameworks/next/locales.md +2 -2
  27. package/assets/skills/fimo-code/references/frameworks/next.md +1 -1
  28. package/assets/skills/fimo-code/references/locales.md +4 -2
  29. package/assets/skills/fimo-migration/SKILL.md +54 -16
  30. package/assets/skills/fimo-migration/references/frameworks/nextjs.md +8 -0
  31. package/assets/skills/fimo-migration/references/media.md +11 -0
  32. package/assets/skills/fimo-migration/references/qa.md +30 -4
  33. package/assets/skills/fimo-migration/references/questions-and-improvements.md +188 -0
  34. package/assets/skills/fimo-migration/references/workers/content-planner.md +8 -3
  35. package/assets/skills/fimo-migration/references/workers/validator.md +20 -6
  36. package/assets/skills/fimo-migration/references/workers.md +17 -6
  37. package/assets/skills/fimo-migration/references/workflow.md +36 -6
  38. package/assets/skills/fimo-studio/SKILL.md +3 -1
  39. package/assets/skills/fimo-studio/references/agents.md +25 -0
  40. package/assets/skills/fimo-studio/references/ai-chat.md +1 -2
  41. package/assets/skills/fimo-studio/references/billing-and-credits.md +14 -7
  42. package/assets/skills/fimo-studio/references/webhooks.md +1 -1
  43. package/dist/cli/bundle.json +2 -2
  44. package/dist/cli/index.js +207 -176
  45. package/dist/runtime/content/serialization.d.ts +4 -3
  46. package/dist/runtime/content/serialization.js +4 -3
  47. package/dist/runtime/primitives/lib/primitives.d.ts +15 -7
  48. package/dist/runtime/primitives/lib/primitives.js +14 -1
  49. package/dist/runtime/shared/local-runtime-env.d.ts +2 -2
  50. package/dist/runtime/shared/local-runtime-env.js +14 -9
  51. package/dist/runtime/templates.d.ts +9 -2
  52. package/dist/runtime/templates.js +36 -7
  53. package/dist/scripts/validate-schemas.js +10 -15
  54. package/package.json +10 -8
  55. package/release.json +2 -2
  56. package/templates/astro/AGENTS.md +1 -1
  57. package/templates/astro/package.json +2 -2
  58. package/templates/nextjs/AGENTS.md +2 -2
  59. package/templates/nextjs/package.json +3 -3
  60. package/templates/nextjs/src/app/layout.tsx +4 -1
  61. package/templates/react-router/AGENTS.md +2 -2
  62. package/templates/react-router/package.json +4 -4
  63. package/templates/sveltekit/AGENTS.md +1 -1
  64. package/templates/sveltekit/package.json +2 -2
  65. package/templates/vite/AGENTS.md +5 -1
  66. package/templates/vite/package.json +4 -4
  67. package/templates/welcome/manifest.json +655 -0
  68. package/templates/welcome/media/analytics-overview.avif +0 -0
  69. package/templates/welcome/media/autonomous-loop.avif +0 -0
  70. package/templates/welcome/media/editable-preview.avif +0 -0
  71. package/templates/welcome/media/media-library.avif +0 -0
  72. package/templates/welcome/media/slack-teams.avif +0 -0
  73. package/templates/welcome/template/.fimo/agents/welcome-guide/GOAL.md +12 -0
  74. package/templates/welcome/template/.fimo/agents/welcome-guide/capabilities.yaml +3 -0
  75. package/templates/welcome/template/.fimo/agents/welcome-guide/config.yaml +8 -0
  76. package/templates/welcome/template/.fimo/config.json +53 -0
  77. package/templates/welcome/template/src/font.css +60 -0
  78. package/templates/welcome/template/src/pages/ArticleDetail.tsx +104 -0
  79. package/templates/welcome/template/src/pages/Index.tsx +36 -0
  80. package/templates/welcome/template/src/pages/SiteContent.tsx +674 -0
  81. package/templates/welcome/template/src/pages/fallback-content.ts +152 -0
  82. package/templates/welcome/template/src/routes.ts +9 -0
  83. package/templates/welcome/template/src/schemas/Article.json +34 -0
  84. package/templates/welcome/template/src/schemas/Article.ts +54 -0
  85. package/templates/welcome/template/src/schemas/Article.types.ts +93 -0
  86. package/templates/welcome/template/src/schemas/Author.json +17 -0
  87. package/templates/welcome/template/src/schemas/Author.ts +51 -0
  88. package/templates/welcome/template/src/schemas/Author.types.ts +54 -0
  89. package/templates/welcome/template/src/schemas/Category.json +17 -0
  90. package/templates/welcome/template/src/schemas/Category.ts +51 -0
  91. package/templates/welcome/template/src/schemas/Category.types.ts +54 -0
  92. package/templates/welcome/template/src/schemas/HomePage.json +110 -0
  93. package/templates/welcome/template/src/schemas/HomePage.ts +22 -0
  94. package/templates/welcome/template/src/schemas/HomePage.types.ts +116 -0
@@ -11,7 +11,7 @@ Invite collaborators to your Fimo organization or project. After deploying a web
11
11
  Typical scenarios where inviting is appropriate:
12
12
 
13
13
  - Multi-person projects (agencies, teams)
14
- - Client hand-off (invite client as `view` or `comment`)
14
+ - Client hand-off (invite client as `view`)
15
15
  - Content editors (invite as `edit` for CMS access)
16
16
  - Developers (invite as `edit` or `full`)
17
17
 
@@ -30,12 +30,14 @@ fimo invite --project <project-id> --email "john@acme.com" --role full
30
30
 
31
31
  Project roles:
32
32
 
33
- | Role | Access Level | Use Case |
34
- | --------- | --------------------------------------------- | --------------------------- |
35
- | `view` | Read-only | Clients, stakeholders |
36
- | `comment` | View + leave comments | Reviewers, approvers |
37
- | `edit` | Edit code, content, assets, use AI chat | Developers, content editors |
38
- | `full` | Full access including settings and publishing | Project leads |
33
+ | Role | Access Level | Use Case |
34
+ | ------ | --------------------------------------------- | -------------------------------- |
35
+ | `view` | Read-only | Clients, stakeholders, reviewers |
36
+ | `edit` | Edit code, content, assets, use AI chat | Developers, content editors |
37
+ | `full` | Full access including settings and publishing | Project leads |
38
+
39
+ `comment` is no longer offered. Fimo has no comment system, so it granted exactly what `view` grants. It is still
40
+ accepted by `--role` and still held by anyone already assigned it, but do not hand it out — use `view`.
39
41
 
40
42
  ## Invite to an organization
41
43
 
@@ -76,8 +78,8 @@ Next steps:
76
78
  # Give client view-only access
77
79
  fimo invite --email "client@company.com" --role view
78
80
 
79
- # Give client comment access for feedback
80
- fimo invite --email "client@company.com" --role comment
81
+ # Reviewers get the same read-only access
82
+ fimo invite --email "reviewer@company.com" --role view
81
83
  ```
82
84
 
83
85
  ### Adding a developer
@@ -27,18 +27,10 @@ There is no `fimo translations` command. Use `fimo labels`.
27
27
 
28
28
  ## Locale config
29
29
 
30
- `.fimo/config.json` controls label/content locales:
31
-
32
- ```json
33
- {
34
- "i18n": {
35
- "defaultLocale": "en",
36
- "locales": ["en"]
37
- }
38
- }
39
- ```
30
+ Use `references/locales.md` to change the supported locales or default.
40
31
 
41
- - `defaultLocale` is what `fimo validate` and label commands use when `--locale` is omitted.
32
+ - `fimo validate` reads `defaultLocale` from the synchronized local config so it can run without a Fimo session.
33
+ - Label writes with no `--locale` leave the locale unset; the selected Branch API resolves its configured default.
42
34
  - `locales` is the enabled locale list and must include `defaultLocale`. Do not add non-default locales unless the user asks for multiple languages, localized routes, translations, or a specific locale.
43
35
  - If multiple locales are configured, create or update label values for every configured locale.
44
36
  - For a non-default locale, pass `--locale <locale>` explicitly.
@@ -13,13 +13,13 @@ fimo locales set-default es --yes --json
13
13
  fimo locales remove es --yes --json
14
14
  ```
15
15
 
16
- Studio chat can run `locales list`. Manage the locale lifecycle through Studio Settings or the standalone CLI.
16
+ In a linked project, change the locale set or default only through these commands or Studio Settings. Never edit `i18n.defaultLocale` or `i18n.locales` directly. Studio chat can run `locales list`.
17
17
 
18
18
  These commands update the selected Branch through the locale lifecycle API. The API commits `.fimo/config.json` to the Fimo Branch, then the CLI synchronizes the **whole local branch** to that commit. They refuse a dirty config, a local-ahead branch, or a diverged branch before applying the remote change. `--yes` bypasses only the explanatory prompt.
19
19
 
20
20
  If a mutation exits with code `2` and `data.code` is `LOCALE_APPLIED_SYNC_REQUIRED`, the remote operation succeeded (`data.applied` is `true`) but the local fast-forward did not. **Do not retry the locale command.** Run the commands in `data.sync.recovery`, resolve the checkout, and confirm with `fimo status` or `fimo locales list`.
21
21
 
22
- Edit `.fimo/config.json` only for declarative locale and route metadata:
22
+ The synchronized `.fimo/config.json` remains the application runtime's declarative locale configuration:
23
23
 
24
24
  ```jsonc
25
25
  {
@@ -36,6 +36,8 @@ Edit `.fimo/config.json` only for declarative locale and route metadata:
36
36
  - New projects do not need a global routing strategy. The route contract declares locale placement with `/:locale`; legacy `i18n.routing.strategy` values are read only for compatibility while migrating.
37
37
  - If multiple locales are configured, create or update labels and localized content for every configured locale. Create schemas with `i18n: { "enabled": false }` only once.
38
38
 
39
+ Edit application-owned settings such as `routes` directly in `.fimo/config.json`. Locale membership and the default use the lifecycle commands above because they must update the selected Fimo Branch and local checkout together.
40
+
39
41
  `fimo locales remove` permanently deletes that locale's stored entries and labels.
40
42
 
41
43
  ## Validate
@@ -108,7 +110,7 @@ Neither Astro nor Next supports an optional single-segment filesystem folder. As
108
110
 
109
111
  ## Migrate An Existing Locale System
110
112
 
111
- Inspect the existing locale provider, route table, switcher, redirects, and public URLs before editing configuration. Preserve working URL behavior during the migration.
113
+ Inspect the existing locale provider, route table, switcher, redirects, and public URLs before changing locale behavior. Preserve working URL behavior during the migration.
112
114
 
113
115
  Preserve the existing locale provider, router, switcher, redirects, and public URLs. Next.js projects run `fimo skills get fimo-code --ref frameworks/next/locales`; React Router projects load the React Router setup reference and its focused route-ownership migration when upgrading; Astro projects run `fimo skills get fimo-code --ref frameworks/astro` and pass the page-resolved locale into server reads and `getLabels`.
114
116
 
@@ -14,7 +14,7 @@ fimo preview url --all # print every destination a
14
14
  curl -L "$(fimo preview url)" # fetch the raw sandbox preview
15
15
  ```
16
16
 
17
- `--env <name>` remains a deprecated alias for `--branch <name>`; the two disagreeing is an error, not a precedence rule. The JSON envelope carries `branch` and keeps `env` as a duplicate of it. Studio deep links still use the `/env/` path, which redirects to `/branch/`.
17
+ `--env <name>` is rejected as a Branch selector; use `--branch <name>`. The JSON envelope carries the canonical `branch` field and may include a deprecated `env` compatibility duplicate. Studio deep links still use the `/env/` path, which redirects to `/branch/`.
18
18
 
19
19
  ## Human and machine behavior
20
20
 
@@ -32,7 +32,6 @@ curl -L "$(fimo preview url)" # fetch the raw sandbox pre
32
32
  "project_id": "prj_abc",
33
33
  "branch": "main",
34
34
  "env": "main",
35
- "env": "main",
36
35
  "preview_url": "https://fimo.ai/preview/prj_abc/main",
37
36
  "sandbox_url": "https://preview.provider.example/session",
38
37
  "sandbox_expires_at": "2026-08-20T18:42:00.000Z",
@@ -9,16 +9,16 @@ fimo projects list [--org <id>] # list projects in an org (defau
9
9
  fimo projects create [dir] [--org <id>] [--framework react-router|astro|nextjs|sveltekit] [--install|--no-install]
10
10
  fimo projects clone [projectId] [dir] [--branch <name>] # clone an existing project locally
11
11
  fimo projects delete [projectId] [-C <dir>] [-y] # delete (defaults to current project)
12
- fimo projects publish [projectId] [-C <dir>] # make the project live (publish from main)
12
+ fimo projects publish [projectId] [-C <dir>] # make the project live from its Production source Branch
13
13
  fimo projects unpublish [projectId] [-C <dir>] # take the project offline
14
14
  fimo projects rename <name> [projectId] [-C <dir>] # set seo.siteName in the linked project config
15
15
  ```
16
16
 
17
17
  - **`list`** — projects you can see in the org. Live projects are marked.
18
18
  - **`create`** — identical to `fimo init` (create-new path); see `references/init.md`.
19
- - **`clone`** — clone a remote Fimo project's git repo to your machine and write the local `.fimo/project.json` and agent files. Use `fimo clone <projectId>` when scripting or when the ID is known. In an interactive terminal, bare `fimo clone` opens a project picker for the active org; JSON mode and non-TTY shells require an explicit project ID and fail fast instead of prompting. By default it clones `main`; pass `--branch <name>` to clone a specific Branch. The legacy `--env <name>` spelling remains a compatibility alias. The target directory defaults to the project display name/name, or pass `[dir]` explicitly.
19
+ - **`clone`** — clone a remote Fimo project's git repo to your machine and write the local `.fimo/project.json` and agent files. Use `fimo clone <projectId>` when scripting or when the ID is known. In an interactive terminal, bare `fimo clone` opens a project picker for the active org; JSON mode and non-TTY shells require an explicit project ID and fail fast instead of prompting. By default it clones `main`; pass `--branch <name>` to clone a specific Branch. The removed `--env <name>` spelling is rejected as a Branch selector. The target directory defaults to the project display name/name, or pass `[dir]` explicitly.
20
20
  - **`delete`** — destructive; prompts unless `-y`. Removes the remote project.
21
- - **`publish` / `unpublish`** — toggle the project's public visibility. `publish` flips the current `main` state live (the same "go live" as `fimo deploy --publish`, minus the git push).
21
+ - **`publish` / `unpublish`** — toggle the project's public visibility. `publish` flips the configured Production source state live (the same "go live" as `fimo deploy --publish`, minus the git push).
22
22
  - **`rename`** — edits only the linked local project's `seo.siteName`. It does not commit or deploy. It requires a project marker in the cwd, and if you pass a `[projectId]` that doesn't match the linked project it errors and exits 1 (so you can't rename a different project). Later remote config commands may require reconciliation while the local config is dirty. Finish your local edits, then explicitly run `fimo deploy --no-wait` when ready for a quick sync.
23
23
 
24
24
  ## Top-level clone shortcut
@@ -43,10 +43,10 @@ fimo rename "<Site Name>" # local edit: set seo.siteName in the project c
43
43
 
44
44
  ## Publish commands
45
45
 
46
- | Command | Effect |
47
- | ----------------------- | ----------------------------------------------------------------------- |
48
- | `fimo deploy --publish` | Push current `main` + flip the project live in one shot. |
49
- | `fimo projects publish` | Flip the project live (no git push). |
50
- | `fimo publish` | Flip the already-synced `main` revision live; optional label and notes. |
46
+ | Command | Effect |
47
+ | ----------------------- | -------------------------------------------------------------------------- |
48
+ | `fimo deploy --publish` | Push the current Production source + flip the project live in one shot. |
49
+ | `fimo projects publish` | Flip the project live (no git push). |
50
+ | `fimo publish` | Flip the synced Production source revision live; optional label and notes. |
51
51
 
52
52
  See `references/deploy.md` and `references/branches.md` for the full picture.
@@ -2,7 +2,7 @@
2
2
 
3
3
  `fimo schedules` manages recurring commands for one project Branch. It uses the
4
4
  current checkout Branch by default, or the Branch passed with `--branch <name>`.
5
- The legacy `--env <name>` spelling remains a compatibility alias.
5
+ The removed `--env <name>` spelling is rejected as a Branch selector.
6
6
 
7
7
  The command starts in that Branch's sandbox. Commands can still target another
8
8
  Branch explicitly, for example with `fimo schemas list --branch preview`.
@@ -72,6 +72,6 @@ All schedule commands support the CLI's global `--json` mode. List, detail, and
72
72
 
73
73
  ## Notes
74
74
 
75
- - Every operation is scoped to the active Branch unless `--branch` (or the legacy `--env` alias) is passed.
75
+ - Every operation is scoped to the active Branch unless `--branch` is passed.
76
76
  - Pausing stops future cron runs. It does not delete history.
77
77
  - A failed or skipped manual run exits non-zero with its run ID and an exact `runs show` command for inspecting detail.
@@ -28,12 +28,13 @@ Run this before writing a custom payload. The list shows supported event types,
28
28
  - Publish: `publish.started`, `publish.succeeded`, `publish.failed`, `publish.unpublished`
29
29
  - Agents: run started/completed/failed/cancelled and review requested/resolved
30
30
  - Analytics: `analytics.report_ready`
31
- - Media: uploaded/updated/deleted/generated/processing_failed
31
+ - Media: uploaded/updated/deleted
32
32
  - Entries: `entry.changed`
33
33
  - Domains: `domain.created`, `domain.deleted`
34
34
  - Labels: `label.changed`
35
35
  - Locales: `locale.created`, `locale.default_changed`, `locale.deleted`
36
- - Environment events (legacy wire names): `environment.created`, `environment.deleted`, `environment.merged`, `environment.restored`
36
+ - Branch restore: `branch.restored`
37
+ - Existing lifecycle wire names: `environment.created`, `environment.deleted`, `environment.merged`
37
38
 
38
39
  Do not guess variable paths. The common envelope is:
39
40
 
@@ -110,9 +111,8 @@ Available filters are event-specific:
110
111
  - `--agent <name>` for agent events
111
112
  - `--media-type <image|video|audio|document|other>` for media events
112
113
  - `--action <created|updated|deleted>`, `--content-type <name>`, and `--locale <locale>` for `entry.changed`
113
- - `--debounce-changes <immediate|5s|30s|1m>` for direct `entry.changed` delivery grouping
114
114
 
115
- `entry.changed` represents content accepted in the selected Environment. New entry webhooks wait 5 seconds after the last direct edit by default, then send one delivery with the combined `data.changes`. Exact repeated autosave changes appear once. Use `--debounce-changes immediate` to disable grouping. Accepted agent edits and environment merges already carry compact batches and send immediately. Operations above the delivery batch size share an `operationId` and include `{ index, total }` batch metadata. Every event includes scalar `environment` and `branch` context and keeps the legacy Branch value at `event.env.name`. Publish events always report Production on `main`.
115
+ `entry.changed` represents content committed in the selected Environment. Each committed write sends one delivery whose `data.changes` lists every affected entry; environment merges arrive the same way with `reason: "environment_merge"`. Operations above the delivery batch size share an `operationId` and include `{ index, total }` batch metadata. Retries resend the same delivery (same event `id`), never a new one. Every event includes scalar `environment` and `branch` context and keeps the legacy Branch value at `event.env.name`. Publish events always report Production on `main`.
116
116
 
117
117
  ## Inspect before depending on it
118
118
 
@@ -1,12 +1,12 @@
1
- # Assets — package surface
1
+ # Assets in code
2
2
 
3
3
  > For the CLI commands (`fimo assets upload`, `fimo image generate`, folder management) and the "when to generate AI images" workflow rules, see **`fimo-cli/references/assets.md`**.
4
4
 
5
- This file covers the package surface for working with assets in code: the `media` field value shape, rendering primitives, and URL format.
5
+ This file covers media fields and the Fimo image components.
6
6
 
7
- ## `media` field value (stored/wire shape)
7
+ ## Media field values
8
8
 
9
- Asset values returned from `fimo assets upload` or Fimo media tasks, and stored in `media` content-type fields:
9
+ A media field stores a reference to an asset, not a copy of the asset metadata. Write the value returned by upload or generation:
10
10
 
11
11
  ```json
12
12
  {
@@ -16,11 +16,22 @@ Asset values returned from `fimo assets upload` or Fimo media tasks, and stored
16
16
  }
17
17
  ```
18
18
 
19
- - `source`: `"local"` for uploaded/generated assets in the Fimo media library. `"external"` for hard-coded third-party URLs (avoid when possible — editors can't manage these).
20
- - `url`: stable HTTPS URL, no auth required, safe to embed.
21
- - `alt`: optional alt text.
19
+ - `source`: `"local"` for a Fimo media-library asset, or `"external"` for a third-party URL.
20
+ - `url`: the public asset URL.
21
+ - `alt`: optional text owned by the entry.
22
22
 
23
- Generated content reads wrap this stored value in `FimoMedia`, which exposes `url`, `alt`, `name`, `mime`, and optional `width`/`height`. It does not expose `source`; Fimo tracks that internally. Pass the whole entry value to `<Image>` / `<Video>`.
23
+ For a local asset, Fimo stores its ID and keeps the URL as a fallback. Do not copy `name`, `mime`, `width`, or `height` into the value. Those facts belong to the asset and are removed from writes.
24
+
25
+ By default, reads return the stored reference without an asset lookup. Name a media or blocks field in `populate` when the page needs the asset's current URL, name, MIME type, or intrinsic size:
26
+
27
+ ```ts
28
+ const post = await Post.getBySlug('hello');
29
+ const withAsset = await Post.getBySlug('hello', { populate: ['cover'] });
30
+ ```
31
+
32
+ `populate` takes top-level field names. A blocks field populates every media value inside it. One lookup covers all selected media in the response. Media inside a populated reference target stays a reference. Use `fimo assets open <id> --download` to inspect the source file.
33
+
34
+ Generated reads wrap media in `FimoMedia`. Its `id`, `alt`, `name`, `mime`, `width`, and `height` can be absent. A populated value has the current facts when the asset resolves; missing or external assets stay unchanged. `source` is internal. Pass the whole value to `<Image>` or `<Video>`.
24
35
 
25
36
  ## Rendering in application code
26
37
 
@@ -41,11 +52,11 @@ import { Image, StaticImage, Video } from 'fimo-next';
41
52
  <StaticImage src="https://assets.fimo.ai/<project>/<id>.jpg" alt="Hero" width={1200} height={630} />
42
53
  ```
43
54
 
44
- Fimo's `<Image>` is not Next's `next/image` component. Do not pass Next-only props such as `priority`, `fill`, `quality`, or `loader`; use only the props documented for the Fimo primitive. Preserve `next/image` for non-Fimo images when the application needs those Next-specific controls.
55
+ Fimo's `<Image>` is not Next's `next/image`. Use the Fimo props documented here. Keep `next/image` for non-Fimo images that need its controls.
45
56
 
46
- **Provide `width` and `height` when known** so Fimo can optimize the asset and reserve layout space (prevents CLS).
57
+ Choose dimensions, CSS, `sizes`, and `fit` from the page design. Do not copy the source file's intrinsic dimensions into layout props by default. When a read includes intrinsic size, Fimo uses it for aspect-ratio reservation and responsive candidates.
47
58
 
48
- **Never hand-construct a `FimoMedia` object** to pass into `<Image>` — that bypasses inline-editing metadata. If you have a raw URL, use `<StaticImage>` instead.
59
+ **Never hand-construct a `FimoMedia` object** to pass into `<Image>`. That bypasses inline-editing metadata. If you have a raw URL, use `<StaticImage>` instead.
49
60
 
50
61
  See `references/ui.md` for the full component table and rules.
51
62
 
@@ -125,7 +125,21 @@ const page = await Article.list({
125
125
  });
126
126
  ```
127
127
 
128
- Fimo always keeps `id`, `entryId`, `documentId`, and `locale`. Without `populate`, references are `{ id }`; with it, they become the target entry or `null`. Populate is depth-one and only accepts reference field names.
128
+ Fimo always keeps `id`, `entryId`, `documentId`, and `locale`, plus every field named in `populate`.
129
+
130
+ `populate` is depth-one and takes top-level field names of two kinds:
131
+
132
+ | Field named | Without `populate` | With it |
133
+ | -------------------- | ------------------------ | ------------------------------------------------------------------------------------------- |
134
+ | reference | `{ id }` | the target entry, or `null` |
135
+ | media | the stored reference | `FimoPopulatedMedia` with current asset facts when it resolves; asset facts remain optional |
136
+ | blocks holding media | stored references inside | every media value inside it populated; item types unchanged |
137
+
138
+ Any other field name is a 400. A populated reference target carries its own media as stored references. Population does not recurse, and a missing or external asset keeps its stored media value.
139
+
140
+ Even when media is populated, `id`, `name`, `mime`, `width`, and `height` can be absent for external, missing, or incomplete assets. The stored `url` remains the fallback, and `alt` is optional entry-owned text.
141
+
142
+ Generated schema modules keep `FimoMediaRef` and `FimoPopulatedMedia` local. Their shapes depend on the schema, while the installed runtime package may be an older release.
129
143
 
130
144
  When a named type is needed, use the generated result type rather than typing populated data as the base entry:
131
145
 
@@ -140,6 +140,7 @@ Use `schema.fields` for one repeated shape and `schema.oneOf` for selectable var
140
140
  - Fimo adds stable `_key` values; `oneOf` items also receive `_type`.
141
141
  - Nest blocks up to seven levels. One `oneOf` supports up to 40 variants and one blocks field up to 200 items.
142
142
  - Nested scalar values use the same source-tracked value type as top-level fields.
143
+ - Fixed and polymorphic references work inside blocks with the same value shapes as top-level reference fields.
143
144
  - Nested reference population and filtering are not supported.
144
145
 
145
146
  ## References
@@ -115,7 +115,7 @@ export async function getStaticPaths() {
115
115
 
116
116
  Configure Astro i18n from `.fimo/config.json#i18n` and use `Astro.currentLocale` for content reads, `getLabels({ locale })`, and `<html lang>`. The standard starter keeps the configured default locale unprefixed and prefixes the others. Existing applications may instead resolve locale through middleware, domains, cookies, or another application-owned strategy. Astro needs no Fimo locale provider. Ownership rules: `references/locales.md`.
117
117
 
118
- The new-project shell pairs unprefixed default-locale pages with a parallel `[locale]` tree because Astro has no optional single-segment page filename. Add locales in `.fimo/config.json`; Astro's native i18n router validates the prefixed tree. Route metadata uses `/:locale` with `params.locale.optional: true`; Astro page files remain authoritative.
118
+ The new-project shell pairs unprefixed default-locale pages with a parallel `[locale]` tree because Astro has no optional single-segment page filename. Add locales through the `fimo-cli` locale workflow; Astro's native i18n router reads the synchronized config and validates the prefixed tree. Route metadata uses `/:locale` with `params.locale.optional: true`; Astro page files remain authoritative.
119
119
 
120
120
  ## Studio route catalog
121
121
 
@@ -109,7 +109,18 @@ Do not add `'use client'` to a page solely because Fimo is present. Keep promise
109
109
 
110
110
  ## Metadata
111
111
 
112
- Next remains in control through `generateMetadata`. Resolve labels/content on the server and convert tracked strings only where Next expects primitives:
112
+ Fimo owns the site-wide defaults; the application owns per-page overrides. Keep (or add) the starter wiring in the root layout — it maps `.fimo/config.json#seo` (Studio's Settings → SEO: title, description, favicon, share image, robots, theme color, canonical) onto Next `Metadata`/`Viewport`:
113
+
114
+ ```ts
115
+ import { buildFimoMetadata, buildFimoViewport } from 'fimo-next';
116
+
117
+ export const generateMetadata = () => buildFimoMetadata();
118
+ export const generateViewport = () => buildFimoViewport();
119
+ ```
120
+
121
+ If the root layout lacks this wiring, add it (updating the fimo packages if `fimo-next` does not export the helpers); without it, Settings → SEO never reaches the rendered head.
122
+
123
+ Per-page `metadata`/`generateMetadata` exports override the defaults field by field. Resolve labels/content on the server and convert tracked strings only where Next expects primitives:
113
124
 
114
125
  ```ts
115
126
  export async function generateMetadata() {
@@ -35,7 +35,7 @@ When labels are not needed at that boundary, use `<FimoProvider locale={locale}>
35
35
 
36
36
  ## New-project boundary
37
37
 
38
- Choose the primary locale from the user's request before building pages. Put the first explicitly requested locale in `.fimo/config.json#i18n.defaultLocale` and keep all requested locales in `i18n.locales`. That is content and provider configuration: `src/locales.ts` reads the file, so the default locale passed to `FimoProvider` and the `<html lang>` follow it. It does not create locale URLs. If the user gives no locale signal, keep `en` and state that choice. Never add `NEXT_PUBLIC_FIMO_DEFAULT_LOCALE` or `FIMO_DEFAULT_LOCALE`; the runtime ignores them by design.
38
+ Choose the primary locale from the user's request before building pages. Configure the supported locales and default through the `fimo-cli` locale workflow. `src/locales.ts` reads the synchronized config, so the default locale passed to `FimoProvider` and the `<html lang>` follow it. It does not create locale URLs. If the user gives no locale signal, keep `en` and state that choice. Never add `NEXT_PUBLIC_FIMO_DEFAULT_LOCALE` or `FIMO_DEFAULT_LOCALE`; the runtime ignores them by design.
39
39
 
40
40
  The starter is default-only: one ordinary root layout renders `<html lang={defaultLocale}>` and `FimoProvider`, `/` is the homepage, and unknown paths get Next's native 404. Implement a locale routing strategy only when the product asks for one — prefixed `[locale]` segments, middleware, cookies, domains, or an i18n library are all Next decisions — then resolve the locale in that strategy and pass it into Fimo server reads and `FimoProvider`. Do not install a top-level `[locale]` route or an optional catch-all speculatively: it captures `/favicon.ico` and every unknown top-level path, and Fimo never requires it.
41
41
 
@@ -45,7 +45,7 @@ When the app implements a localized URL shape, describe it in `.fimo/config.json
45
45
 
46
46
  With `next-i18next`, keep its routing and translation provider for the strings it owns. Pass the same resolved locale to Fimo; do not replace the library or duplicate its route structure.
47
47
 
48
- Before creating non-default Fimo labels or content variants, confirm that those locales are enabled for the linked Fimo project. Load `fimo-cli` with its `locales` reference and run `fimo locales add <locale> --yes --json`; `.fimo/config.json` documents the application's locale policy, but `fimo validate` does not add project locales.
48
+ Before creating non-default Fimo labels or content variants, confirm that those locales are enabled for the linked Fimo project. Load `fimo-cli` with its `locales` reference and run `fimo locales add <locale> --yes --json`; `fimo validate` does not add project locales.
49
49
 
50
50
  ## Ownership boundary
51
51
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Use this reference when `fimo describe --json` reports `framework.slug: "nextjs"`, or the project uses an App Router (`app/` or `src/app/`) or Pages Router (`pages/` or `src/pages/`) tree.
4
4
 
5
- Fimo supports schema-first content in both routers across static generation, ISR, request-time rendering, and Client Components. The application owns routes, locale resolution, links, `<html lang/dir>`, and SEO. Fimo receives the resolved locale and supplies content, labels, source metadata, and client editing context.
5
+ Fimo supports schema-first content in both routers across static generation, ISR, request-time rendering, and Client Components. The application owns routes, locale resolution, links, `<html lang/dir>`, and per-page SEO overrides. Fimo receives the resolved locale and supplies content, labels, source metadata, client editing context, and the site-wide SEO defaults (App Router: `buildFimoMetadata`/`buildFimoViewport` in the root layout — see the router reference's Metadata section).
6
6
 
7
7
  ## Choose the router reference
8
8
 
@@ -13,11 +13,13 @@ The application owns locale resolution and routing. Fimo consumes the resolved l
13
13
  }
14
14
  ```
15
15
 
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 document language default, and any framework-native locale route boundary or matcher the application implements. If the user gives no locale signal, retain the starter default and state that choice.
16
+ For a linked project, load `fimo-cli` with its `locales` reference and use the typed locale commands to change the supported locales or default. That reference owns the synchronization and recovery contract.
17
+
18
+ For new projects, derive the primary locale from the request; when several are explicit, the first one named is the default. Configure that locale set through the lifecycle commands, then update the document language default and any framework-native locale route boundary or matcher the application implements. If the user gives no locale signal, retain the starter default and state that choice.
17
19
 
18
20
  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`.
19
21
 
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.
22
+ Enable each locale before writing non-default label or content variants. Run `fimo locales add <locale> --yes --json`; `fimo validate` does not provision project locales. Do not change the application's route strategy to work around a missing locale.
21
23
 
22
24
  ## Application responsibilities
23
25
 
@@ -34,6 +34,20 @@ end-to-end. Preserve the original code path and record required environment
34
34
  variable names only; never read or copy secret values. A missing secret is a
35
35
  follow-up for the owner, not permission to silently remove the integration.
36
36
 
37
+ Before any source, target, Fimo, or remote write, inspect the available source
38
+ read-only and follow [questions-and-improvements.md](references/questions-and-improvements.md).
39
+ Use the coding agent's native structured-question UI when available. Ask one
40
+ stacked batch of the decisions the source cannot answer instead of interrupting
41
+ the migration for each question. A migration request never authorizes moving
42
+ environment values or credentials.
43
+
44
+ When migration replaces local or bundled content with Fimo reads, preserving
45
+ content-delivery performance is part of fidelity. Keep build-time and
46
+ server-rendered content off the browser request path, use direct generated-client
47
+ lookups, avoid duplicate or sequential reads, and prove edit freshness. Do not
48
+ ask a generic optimization question or bundle a framework upgrade into the
49
+ migration.
50
+
37
51
  ## Execution environment
38
52
 
39
53
  Run this skill from a coding-agent process that has direct access to the
@@ -139,13 +153,18 @@ report the exact failed command and setup requirement.
139
153
  unwired.
140
154
  - Prefer source code and exports over inferred crawl data. Use a public URL as
141
155
  visual, SEO, route, and behavior evidence when better source material exists.
156
+ When the source defines an active CMS but its deployed records are unavailable,
157
+ rebuild published content from the public site only after the user explicitly
158
+ chooses that lower-confidence path.
142
159
  - Read local files and exports directly and public APIs without credentials.
143
160
  Private APIs and CMSs require a user-provided export or a narrowly scoped
144
161
  server-side credential. Never read credentials from browser code or copy
145
162
  them into browser code, migration artifacts, or reports. Target-project
146
163
  authentication does not grant source access. If the source API URL or access
147
- is missing or unreachable, stop and ask the user for it; do not guess, replace
148
- the content, or mark the lane complete.
164
+ is missing or unreachable, stop and ask whether the owner wants to provide a
165
+ scoped export or read-only access, reconstruct the selected published routes
166
+ from public pages, or migrate code only and leave those records external. Never
167
+ infer permission to scrape, discover secrets, or contact private endpoints.
149
168
  - Model content before page code. Generated JSON is not imported content.
150
169
  - Model editorial content Fimo-natively: blocks for structured or repeatable
151
170
  sections, richtext for rich bodies, references for categories, authors,
@@ -190,9 +209,11 @@ report the exact failed command and setup requirement.
190
209
  create the draft evidence pack.
191
210
  - **hybrid**: source material plus a public URL. Treat source material as
192
211
  truth and the URL as comparison evidence.
193
- 4. Read `references/workflow.md` before implementation and create or update the
212
+ 4. Read `references/questions-and-improvements.md`, finish its read-only
213
+ preflight, and collect the user's decisions before setup or implementation.
214
+ 5. Read `references/workflow.md` before implementation and create or update the
194
215
  plain-text migration plan.
195
- 5. Load the references that apply:
216
+ 6. Load the references that apply:
196
217
  - Coordinator ownership and dependency gates -> `references/workers.md`.
197
218
  - Framework conversion worker -> `references/workers/framework.md`.
198
219
  - Content planner -> `references/workers/content-planner.md`.
@@ -227,9 +248,13 @@ ID supplied by the owner — without one, stop with an unresolved owner action
227
248
  instead of inventing an ID:
228
249
 
229
250
  - Link an owner-supplied (empty) project:
230
- `fimo migrate init <target-dir> --project-id <projectId> --framework <framework>`
251
+ `fimo migrate init <target-dir> --project-id <projectId> --framework <framework> --source-platform <platform>`
231
252
  - Create a new project in an owner-supplied organization:
232
- `fimo migrate init <target-dir> --org <organizationId> --framework <framework>`
253
+ `fimo migrate init <target-dir> --org <organizationId> --framework <framework> --source-platform <platform>`
254
+
255
+ `--source-platform` names what the site is migrated from (`wordpress`, `nextjs`,
256
+ `astro`, `react-router`, `webflow`, `framer`, `squarespace`, `wix`, `carrd`,
257
+ `other`); pass what the source checkout proves, `unknown` only when nothing does.
233
258
 
234
259
  After setup, check `.fimo/config.json#runtime.framework` and the scaffold's
235
260
  framework files before starting workers. A Next.js target must still have its
@@ -265,14 +290,20 @@ Commands that perform actual data writes, all requiring the linked target:
265
290
  - `fimo schemas push`, `fimo assets upload`, `fimo entries create|update`,
266
291
  `fimo singles update`, `fimo labels set|set-many`, `fimo forms push`.
267
292
  - `fimo migrate init` (source-backed form): the project link/creation and
268
- initial commit push described above.
293
+ initial commit push described above. Pass `--source-platform <platform>`
294
+ (webflow, framer, squarespace, wix, carrd, wordpress, nextjs, astro,
295
+ react-router, other) when the source is known; URL crawls detect it.
296
+
269
297
  - `fimo link`: project creation or selection plus the in-place adoption of a
270
298
  copied source target.
271
299
  - `fimo deploy` / `fimo publish` — owner-approved only.
272
300
 
273
301
  ## Migration loop
274
302
 
275
- 1. Run the setup path from "Initialized target precondition" and inspect the
303
+ 1. Inspect the source read-only, then ask the one preflight question batch from
304
+ `references/questions-and-improvements.md`. Do not initialize, link, import,
305
+ edit, or move environment values until the user answers every consent gate.
306
+ 2. Run the setup path from "Initialized target precondition" and inspect the
276
307
  initialized target before any worker edits it. A `fimo link` adoption keeps
277
308
  the source framework; the `fimo init` / `fimo migrate init` paths choose the
278
309
  target framework through the same canonical option as
@@ -284,7 +315,7 @@ Commands that perform actual data writes, all requiring the linked target:
284
315
  copying an arbitrary template path. The target's real files and directories
285
316
  are the authority for framework paths; do not invent a second `app/` or
286
317
  `src/app/` tree from an example.
287
- 2. Write a short `.fimo/migration/migration-plan.md` containing the chosen
318
+ 3. Write a short `.fimo/migration/migration-plan.md` containing the chosen
288
319
  framework, source/target paths, worker owners, important dependencies, and
289
320
  known questions. Start the independent workers in `references/workers.md`:
290
321
  runtime/config, routes/SEO, content planning, and locales when those surfaces
@@ -293,25 +324,25 @@ Commands that perform actual data writes, all requiring the linked target:
293
324
  all structural target code, and must pass the framework gate in
294
325
  `references/workers/framework.md` before content data and code workers
295
326
  start. Worker prompts and worker reports are plain text.
296
- 3. The content planner reads every content-bearing source and consumer. When
327
+ 4. The content planner reads every content-bearing source and consumer. When
297
328
  content comes from an API, it traces the active application client and
298
329
  retrieves the complete accessible dataset before pushing schemas. It then
299
330
  writes complete schemas and import payloads, recording source items,
300
331
  consumers, batches, and unresolved behavior in the text plan rather than a
301
332
  second orchestration format.
302
- 4. Each discovery lane reports active media in its own surface. After the
333
+ 5. Each discovery lane reports active media in its own surface. After the
303
334
  runtime/framework, routes/SEO, and content discovery receipts are terminal,
304
335
  the coordinator performs one fan-in: combine and deduplicate them into the
305
336
  complete media-obligation list. Give only that list to the media worker; do
306
337
  not require a content-planner rescan. Once it returns every mapping, patch
307
338
  code and payload consumers. Start data after the asset gate and content code
308
339
  only after its imported records read back successfully.
309
- 5. Fan in the workers' plain-text reports. Compare their claimed files with
340
+ 6. Fan in the workers' plain-text reports. Compare their claimed files with
310
341
  `git diff`, their Fimo writes with read-back CLI queries, and their source
311
342
  coverage with the content plan. Every source item must be migrated,
312
343
  deliberately preserved, or listed as unresolved with an owner action. A
313
344
  report that merely says “done” is not evidence.
314
- 6. Validate against the real target with a validator that did not author the
345
+ 7. Validate against the real target with a validator that did not author the
315
346
  changes and starts only after every other worker report is terminal: read
316
347
  back schemas, entries, singles, labels, and assets through the CLI, build
317
348
  the project, render the migrated routes, and verify hosting compatibility
@@ -319,13 +350,15 @@ Commands that perform actual data writes, all requiring the linked target:
319
350
  when a browser is available; otherwise use deterministic
320
351
  HTTP/header/process/log checks and mark visual proof unavailable. Then run
321
352
  the QA gate in `references/qa.md`.
322
- 7. Write `.fimo/migration/migration-report.md` with coverage, counts, mappings,
353
+ 8. Write `.fimo/migration/migration-report.md` with coverage, counts, mappings,
323
354
  unresolved items, timings from worker reports, and next actions.
324
355
 
325
356
  ## References
326
357
 
327
358
  - `references/workflow.md` - phase order, source intake, URL artifacts, and
328
359
  implementation loop.
360
+ - `references/questions-and-improvements.md` - structured preflight questions,
361
+ integration consent, and content-delivery performance preservation.
329
362
  - `references/decision.md` - plain-text decision and schema guidance; no
330
363
  decision JSON is required.
331
364
  - `references/content.md` - CMS, entries, references, and source value rules.
@@ -359,10 +392,15 @@ Use one final status:
359
392
  - **draft-only**: imports or verification are incomplete, or the user asked for
360
393
  a draft.
361
394
 
362
- Never call a migration complete when CMS entries, media mappings, forms, or
363
- route coverage are unknown. Local QA remains the acceptance gate. If
395
+ Never call a migration complete when CMS entries, media mappings, forms, route
396
+ coverage, or migration-induced content-delivery regressions are unknown. Local
397
+ QA remains the acceptance gate. If
364
398
  `fimo migrate init` created a new Fimo project, run one `fimo deploy` after QA
365
399
  and return its preview and dashboard links; skip it when the user said not to
366
400
  deploy or `FIMO_MIGRATION_NO_DEPLOY=1` is set. For an existing linked project,
367
401
  offer the deployment and wait for approval. Never run `fimo publish` without an
368
402
  explicit request.
403
+
404
+ Broader performance work and framework modernization are separate tasks. Start
405
+ them only when the user explicitly asks, and never use them to hide a migration
406
+ regression.
@@ -158,6 +158,14 @@ document, and a `public/` reference may become a media upload. The content
158
158
  planner decides the destination from the consuming route and data shape, rather
159
159
  than using a filename or extension as an automatic classification.
160
160
 
161
+ Preserve how that content reaches the page. Local Markdown rendered during a
162
+ Next build stays a Server Component or static-generation read after it moves to
163
+ Fimo. Keep `generateStaticParams` when the source has known routes, list the
164
+ required slugs once, and use the generated client's `getBySlug` for each detail
165
+ page. Do not fetch the full post collection and filter it on every route, and do
166
+ not introduce a Client Component solely to load Fimo content. Follow the shared
167
+ evidence and freshness contract in `references/questions-and-improvements.md`.
168
+
161
169
  Create one source item per Markdown/MDX document and per independently handled
162
170
  construct inside it. Portable prose and an executable MDX component are
163
171
  different items even when they share one file. Read the custom component, its
@@ -86,6 +86,17 @@ the asset owns the uploaded bytes and their metadata, and the entry field holds
86
86
  the media value `{ source, url, alt }` that points at it. Keep both carrying the
87
87
  same alt text, and do not duplicate alt into a second schema field.
88
88
 
89
+ Do not copy upload metadata into media values yourself. Writing `{ source, url,
90
+ alt }` is enough: the write path resolves and persists the media-library ID, and
91
+ a read that names the field in `populate` returns the asset's current URL, name,
92
+ MIME type, and intrinsic dimensions from the library. A read that does not name
93
+ it returns the stored reference. The ID lets you inspect the asset later with
94
+ `fimo assets open <id> --download`.
95
+
96
+ Treat intrinsic dimensions as source facts, not layout instructions. Choose the
97
+ displayed size, crop, `sizes`, loading behavior, and fit from the migrated page's
98
+ design and responsive behavior.
99
+
89
100
  ## Failure Handling
90
101
 
91
102
  If a media asset cannot be downloaded or uploaded: