fimo 0.17.0 → 0.19.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.
- package/assets/astro/components/DateTime.astro +22 -0
- package/assets/astro/components/index.d.ts +1 -0
- package/assets/astro/components/index.js +1 -0
- package/assets/content-templates/shared/types.eta +2 -0
- package/assets/skills/fimo-cli/SKILL.md +8 -6
- package/assets/skills/fimo-cli/references/branches.md +2 -2
- package/assets/skills/fimo-cli/references/content.md +2 -2
- package/assets/skills/fimo-cli/references/deploy.md +17 -9
- package/assets/skills/fimo-cli/references/hosting.md +114 -0
- package/assets/skills/fimo-cli/references/init.md +13 -6
- package/assets/skills/fimo-cli/references/integrations/firecrawl.md +2 -0
- package/assets/skills/fimo-cli/references/locales.md +38 -14
- package/assets/skills/fimo-cli/references/pages.md +70 -0
- package/assets/skills/fimo-cli/references/preview.md +26 -20
- package/assets/skills/fimo-cli/references/webhooks.md +1 -1
- package/assets/skills/fimo-code/SKILL.md +11 -0
- package/assets/skills/fimo-code/assets/react-router-locales/LocaleLayout.tsx +12 -0
- package/assets/skills/fimo-code/assets/react-router-locales/routes.ts +7 -6
- package/assets/skills/fimo-code/references/best-practices/astro.md +47 -0
- package/assets/skills/fimo-code/references/best-practices/next.md +42 -0
- package/assets/skills/fimo-code/references/best-practices/sveltekit.md +17 -0
- package/assets/skills/fimo-code/references/content/richtext.md +5 -0
- package/assets/skills/fimo-code/references/content/schema.md +4 -1
- package/assets/skills/fimo-code/references/frameworks/astro.md +5 -3
- package/assets/skills/fimo-code/references/frameworks/hosting.md +5 -2
- package/assets/skills/fimo-code/references/frameworks/next/app-router.md +6 -0
- package/assets/skills/fimo-code/references/frameworks/next/locales.md +12 -2
- package/assets/skills/fimo-code/references/frameworks/next.md +7 -0
- package/assets/skills/fimo-code/references/frameworks/react-router.md +15 -7
- package/assets/skills/fimo-code/references/frameworks/sveltekit.md +15 -8
- package/assets/skills/fimo-code/references/labels.md +9 -1
- package/assets/skills/fimo-code/references/locales.md +8 -2
- package/assets/skills/fimo-code/references/migrations/react-router-route-ownership.md +93 -0
- package/assets/skills/fimo-code/references/ui.md +21 -2
- package/assets/skills/fimo-migration/SKILL.md +276 -51
- package/assets/skills/fimo-migration/references/content.md +119 -35
- package/assets/skills/fimo-migration/references/decision.md +72 -0
- package/assets/skills/fimo-migration/references/forms.md +38 -6
- package/assets/skills/fimo-migration/references/frameworks/nextjs.md +179 -23
- package/assets/skills/fimo-migration/references/import-contract.md +71 -19
- package/assets/skills/fimo-migration/references/manifest.md +11 -161
- package/assets/skills/fimo-migration/references/media.md +33 -1
- package/assets/skills/fimo-migration/references/platforms.md +26 -2
- package/assets/skills/fimo-migration/references/qa.md +167 -13
- package/assets/skills/fimo-migration/references/workers/content-execution.md +39 -0
- package/assets/skills/fimo-migration/references/workers/content-planner.md +64 -0
- package/assets/skills/fimo-migration/references/workers/framework.md +37 -0
- package/assets/skills/fimo-migration/references/workers/validator.md +25 -0
- package/assets/skills/fimo-migration/references/workers.md +82 -0
- package/assets/skills/fimo-migration/references/workflow.md +140 -192
- package/assets/skills/fimo-migration/scripts/apply-decision.mjs +534 -0
- package/assets/skills/fimo-migration/scripts/build-canonical-manifest.mjs +7 -4
- package/assets/skills/fimo-migration/scripts/write-migration-report.mjs +191 -4
- package/assets/skills/fimo-studio/references/ai-chat.md +1 -1
- package/assets/skills/fimo-studio/references/cms.md +25 -7
- package/assets/skills/fimo-studio/references/webhooks.md +1 -1
- package/assets/sveltekit/components/DateTime.svelte +35 -0
- package/assets/sveltekit/components/FimoProvider.svelte +2 -2
- package/assets/sveltekit/components/index.d.ts +1 -0
- package/assets/sveltekit/components/index.js +1 -0
- package/dist/build/next/config.d.ts +4 -1
- package/dist/build/next/config.js +21 -5
- package/dist/build/sveltekit/vite.d.ts +3 -4
- package/dist/build/sveltekit/vite.js +3 -4
- package/dist/build/vite/plugins/runtime-env.d.ts +2 -1
- package/dist/build/vite/plugins/runtime-env.js +14 -10
- package/dist/cli/bundle.json +2 -2
- package/dist/cli/index.js +113 -108
- package/dist/runtime/app/FimoProviders.js +25 -14
- package/dist/runtime/app/prefetch.d.ts +3 -1
- package/dist/runtime/app/prefetch.js +11 -55
- package/dist/runtime/astro/preview.js +7 -9
- package/dist/runtime/content/client/internal.js +1 -0
- package/dist/runtime/i18n/locale.d.ts +6 -3
- package/dist/runtime/i18n/locale.js +16 -41
- package/dist/runtime/next/client-runtime.js +5 -1
- package/dist/runtime/next/client.d.ts +3 -2
- package/dist/runtime/next/client.js +2 -1
- package/dist/runtime/next/labels.d.ts +2 -2
- package/dist/runtime/next/labels.js +2 -2
- package/dist/runtime/next/preview.d.ts +13 -0
- package/dist/runtime/next/preview.js +34 -0
- package/dist/runtime/next/primitives/server.d.ts +2 -0
- package/dist/runtime/next/primitives/server.js +8 -0
- package/dist/runtime/next/provider.d.ts +5 -0
- package/dist/runtime/next/provider.js +17 -3
- package/dist/runtime/next/server-runtime.js +4 -1
- package/dist/runtime/next/server.d.ts +1 -1
- package/dist/runtime/next/server.js +1 -1
- package/dist/runtime/paths/get-fimo-paths.d.ts +6 -5
- package/dist/runtime/paths/get-fimo-paths.js +43 -42
- package/dist/runtime/preview/location.d.ts +19 -2
- package/dist/runtime/preview/location.js +16 -2
- package/dist/runtime/primitives/index.d.ts +1 -0
- package/dist/runtime/primitives/index.js +1 -0
- package/dist/runtime/react/primitives/editable/DateTime.d.ts +4 -0
- package/dist/runtime/react/primitives/editable/DateTime.js +13 -0
- package/dist/runtime/react/primitives/renderers/DateRenderer.d.ts +7 -1
- package/dist/runtime/react/primitives/renderers/DateRenderer.js +11 -8
- package/dist/runtime/react-router/{routes.d.ts → legacy/routes.d.ts} +6 -1
- package/dist/runtime/react-router/{routes.js → legacy/routes.js} +22 -7
- package/dist/runtime/routes/index.d.ts +162 -0
- package/dist/runtime/routes/index.js +335 -0
- package/dist/runtime/routing/AppRoutesProvider.js +4 -3
- package/dist/runtime/seo/resolver.d.ts +5 -0
- package/dist/runtime/seo/resolver.js +10 -42
- package/dist/runtime/shared/fimo-config.types.d.ts +14 -13
- package/dist/runtime/shared/preview-location.d.ts +1 -22
- package/dist/runtime/shared/preview-location.js +5 -93
- package/dist/runtime/sveltekit/preview.d.ts +12 -3
- package/dist/runtime/sveltekit/preview.js +13 -8
- package/dist/runtime/templates.d.ts +19 -0
- package/dist/runtime/templates.js +33 -0
- package/dist/scripts/sync-forms.js +1 -1
- package/dist/scripts/sync-schemas.js +1 -4
- package/dist/scripts/validate-fimo-config.js +5 -1
- package/dist/scripts/validate-page-registry.d.ts +2 -0
- package/dist/scripts/validate-page-registry.js +167 -0
- package/dist/scripts/validate-route-metadata.js +132 -41
- package/package.json +10 -5
- package/templates/astro/.fimo/config.json +13 -5
- package/templates/astro/AGENTS.md +5 -1
- package/templates/astro/astro.config.mjs +7 -0
- package/templates/astro/pnpm-workspace.yaml +0 -3
- package/templates/astro/src/components/ProjectOverview.astro +9 -6
- package/templates/astro/src/layouts/Base.astro +1 -1
- package/templates/astro/src/locales.ts +4 -0
- package/templates/astro/src/pages/[locale]/index.astro +19 -0
- package/templates/astro/src/pages/[locale]/projects/[slug].astro +35 -0
- package/templates/astro/src/pages/[locale]/projects/index.astro +19 -0
- package/templates/astro/src/pages/index.astro +5 -2
- package/templates/astro/src/pages/projects/[slug].astro +4 -2
- package/templates/astro/src/pages/projects/index.astro +5 -2
- package/templates/nextjs/.fimo/config.json +2 -1
- package/templates/nextjs/AGENTS.md +5 -0
- package/templates/nextjs/src/app/(default)/layout.tsx +10 -0
- package/templates/nextjs/src/app/[locale]/layout.tsx +22 -0
- package/templates/nextjs/src/app/[locale]/page.tsx +1 -0
- package/templates/nextjs/src/components/Document.tsx +26 -0
- package/templates/nextjs/src/components/FimoPreviewBridge.tsx +13 -0
- package/templates/nextjs/src/locales.ts +13 -0
- package/templates/react-router/.fimo/config.json +3 -6
- package/templates/react-router/AGENTS.md +4 -0
- package/templates/react-router/package.json +1 -1
- package/templates/react-router/pnpm-workspace.yaml +1 -3
- package/templates/react-router/react-router.config.ts +4 -10
- package/templates/react-router/src/pages/LocaleLayout.tsx +12 -0
- package/templates/react-router/src/root.tsx +2 -4
- package/templates/react-router/src/routes.ts +5 -3
- package/templates/sveltekit/.fimo/config.json +2 -1
- package/templates/sveltekit/AGENTS.md +5 -0
- package/templates/sveltekit/src/app.html +1 -1
- package/templates/sveltekit/src/hooks.server.ts +11 -0
- package/templates/sveltekit/src/locales.ts +8 -0
- package/templates/sveltekit/src/params/locale.ts +5 -0
- package/templates/sveltekit/src/routes/+layout.server.ts +6 -1
- package/templates/sveltekit/src/routes/+layout.svelte +5 -0
- package/assets/skills/fimo-migration/references/inventory/coordinator.md +0 -40
- package/assets/skills/fimo-migration/references/inventory/locales/next-intl.md +0 -39
- package/assets/skills/fimo-migration/references/inventory/locales.md +0 -41
- package/assets/skills/fimo-migration/scripts/inventory/locales/next-intl.mjs +0 -459
- package/templates/nextjs/src/app/layout.tsx +0 -17
- /package/templates/nextjs/src/app/{page.tsx → (default)/page.tsx} +0 -0
- /package/templates/sveltekit/src/routes/{+page.svelte → [[locale=locale]]/+page.svelte} +0 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Content execution workers
|
|
2
|
+
|
|
3
|
+
Execute the content planner's text handoff. Do not rediscover the source,
|
|
4
|
+
reclassify values, redesign schemas, or edit files outside the assigned batch.
|
|
5
|
+
If the handoff is incomplete, report the missing item to the coordinator so the
|
|
6
|
+
planner can repair it.
|
|
7
|
+
|
|
8
|
+
## Data worker
|
|
9
|
+
|
|
10
|
+
Own one bounded schema/locale payload. Start only after every referenced asset
|
|
11
|
+
has a confirmed Fimo mapping and, during conversion, the framework gate passes.
|
|
12
|
+
Perform create-or-update writes and read the batch back before returning.
|
|
13
|
+
|
|
14
|
+
For entry batches, use
|
|
15
|
+
`fimo entries bulk-create <Uid> --file <payload> --upsert-by slug` and report
|
|
16
|
+
per-chunk created, updated, reconciled, and conflict counts. Do not leave a
|
|
17
|
+
payload as evidence of an import. An unavailable dependency blocks promptly;
|
|
18
|
+
do not poll indefinitely.
|
|
19
|
+
|
|
20
|
+
## Code worker
|
|
21
|
+
|
|
22
|
+
Start only after this batch's real records read back as non-empty. Own exactly
|
|
23
|
+
the consumer files assigned by the planner.
|
|
24
|
+
|
|
25
|
+
1. Load the active framework's `fimo-code` reference.
|
|
26
|
+
2. Establish the generated Fimo client/adapter needed by the batch.
|
|
27
|
+
3. Replace every planned `sourceFile`/`sourceKey` at its existing consumer in
|
|
28
|
+
place. Appending a disconnected duplicate section is not wiring.
|
|
29
|
+
4. Preserve executable React/MDX children in order around editable prose.
|
|
30
|
+
5. Render at least one real imported item through every Server-to-Client or
|
|
31
|
+
plain-JSON boundary in the batch. Use the framework's generated
|
|
32
|
+
serialization/hydration contract; do not partially unwrap tracked values.
|
|
33
|
+
6. Confirm each original literal or data source is gone only where its Fimo
|
|
34
|
+
replacement now renders once.
|
|
35
|
+
|
|
36
|
+
A loader that reads Fimo while the consuming markup is missing, an imported
|
|
37
|
+
entry no route consumes, or a successful build over empty data is incomplete.
|
|
38
|
+
Return source items wired, files changed, read-back/render evidence, and any
|
|
39
|
+
unresolved item in plain text.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Content planning worker
|
|
2
|
+
|
|
3
|
+
Own semantic discovery, schema authoring, payload preparation, and the text
|
|
4
|
+
handoff. Do not import entries or rewrite application consumers.
|
|
5
|
+
|
|
6
|
+
1. Inspect every content-bearing source and consumer: Markdown/MDX bodies and
|
|
7
|
+
frontmatter, JSX/TSX modules, hardcoded arrays and objects, imports, data
|
|
8
|
+
clients, and call sites. Read local exports and public APIs directly. A
|
|
9
|
+
private API requires a user-provided export or narrowly scoped server-side
|
|
10
|
+
credential; never recover or copy secret values.
|
|
11
|
+
2. Classify each value as collection content, single content, an
|
|
12
|
+
editor-visible label, or application-owned code. Repetition is evidence,
|
|
13
|
+
not an automatic collection rule. Assistive text, identifiers, and values
|
|
14
|
+
that drive behavior are not labels.
|
|
15
|
+
3. Define complete schemas from source evidence: types, requiredness, defaults,
|
|
16
|
+
uniqueness, locale behavior, media constraints, references, and
|
|
17
|
+
cardinalities. Do not invent constraints. Load `references/decision.md` and
|
|
18
|
+
the target project's Fimo schema guidance.
|
|
19
|
+
4. Trace every item to the route, component, loader, query, or render module
|
|
20
|
+
that consumes it. Record its `sourceFile`, `sourceKey`, target files, payload
|
|
21
|
+
file, and worker batch. Finding data without consumers is incomplete.
|
|
22
|
+
5. Enumerate every media field and rich-text image node as an asset obligation.
|
|
23
|
+
6. Write and push `src/schemas/*.json`, generate required clients/types, and
|
|
24
|
+
write self-contained JSON payloads for the data workers.
|
|
25
|
+
7. Write `.fimo/migration/content-plan.md` before any entry, label, single, or
|
|
26
|
+
content-driven code rewrite begins.
|
|
27
|
+
|
|
28
|
+
The text plan has one source item per independently migrated construct and
|
|
29
|
+
groups them into non-overlapping data and code batches. Every object in a
|
|
30
|
+
hardcoded content array is an item. MDX prose and executable imports/components
|
|
31
|
+
are separate items when needed; executable JSX cannot disappear inside a
|
|
32
|
+
rich-text conversion.
|
|
33
|
+
|
|
34
|
+
Keep the handoff short:
|
|
35
|
+
|
|
36
|
+
```md
|
|
37
|
+
## BlogPost
|
|
38
|
+
|
|
39
|
+
- Source: `content/blog/post.mdx`
|
|
40
|
+
- Schema: `src/schemas/BlogPost.json` (pushed)
|
|
41
|
+
- Payload: `.fimo/migration/content/BlogPost.en.json`
|
|
42
|
+
- Items: title, body, cover, `CoverageChart` behavior
|
|
43
|
+
- Consumers: `src/app/blog/[slug]/page.tsx`
|
|
44
|
+
- Data worker: `BlogPost/en`
|
|
45
|
+
- Code worker: `blog-rendering`, owns the consumer above
|
|
46
|
+
|
|
47
|
+
## Unresolved
|
|
48
|
+
|
|
49
|
+
- `content/blog/post.mdx:11`: `CoverageChart` implementation is absent; owner
|
|
50
|
+
must restore it. Do not remove the node silently.
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
A construct is unresolved only when it genuinely cannot be migrated. Include
|
|
54
|
+
its exact source, user-visible impact, reason, and owner action; "custom" is not
|
|
55
|
+
a reason.
|
|
56
|
+
|
|
57
|
+
## Optional extraction helpers
|
|
58
|
+
|
|
59
|
+
Start with `rg` and targeted reads. A bounded read-only helper under
|
|
60
|
+
`.fimo/migration/tmp/` may parse repeated frontmatter, JSON/YAML exports, or
|
|
61
|
+
literal structures while preserving source locations. Spot-check its output.
|
|
62
|
+
The agent still owns classification, schema design, and consumer tracing. Do
|
|
63
|
+
not build a generic codemod system or let the helper write Fimo data or app
|
|
64
|
+
code.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Framework conversion worker
|
|
2
|
+
|
|
3
|
+
Use this worker only after the user explicitly chose a framework conversion.
|
|
4
|
+
Preserve mode never uses it.
|
|
5
|
+
|
|
6
|
+
`fimo migrate init` creates the target first. Inspect the initialized template
|
|
7
|
+
and its real paths before writing. Own all structural target code: dependencies,
|
|
8
|
+
framework config, root layout and providers, app tree, route modules, 404,
|
|
9
|
+
redirects, headers, middleware, sitemap/robots/OG structure, and locale-routing
|
|
10
|
+
structure. There is no separate runtime or route writer during conversion.
|
|
11
|
+
|
|
12
|
+
Port the source APIs, loaders, hardcoded content, integrations, and visible
|
|
13
|
+
behavior into the new framework unchanged. Do not migrate those values to Fimo
|
|
14
|
+
in this pass; schemas, data, and Fimo consumer wiring belong to later content
|
|
15
|
+
workers. The content planner may inspect the source in parallel but must not
|
|
16
|
+
edit structural target code.
|
|
17
|
+
|
|
18
|
+
Load the target framework's `fimo-code` and hosting references. For Next.js,
|
|
19
|
+
also load `references/frameworks/nextjs.md` and translate portable hosting
|
|
20
|
+
behavior before declaring provider-specific behavior unresolved.
|
|
21
|
+
|
|
22
|
+
## Framework gate
|
|
23
|
+
|
|
24
|
+
Before returning, self-check and report:
|
|
25
|
+
|
|
26
|
+
- dependencies install cleanly;
|
|
27
|
+
- the framework build succeeds;
|
|
28
|
+
- every source route maps to a target route and renders locally with its
|
|
29
|
+
expected status, including 404 behavior;
|
|
30
|
+
- representative source text landmarks appear;
|
|
31
|
+
- exactly one app tree and one root layout exist; and
|
|
32
|
+
- primary routes have no runtime or console errors.
|
|
33
|
+
|
|
34
|
+
Return a plain-text route map, files changed, check results, preserved behavior,
|
|
35
|
+
and unresolved behavior. The coordinator independently reruns the build and
|
|
36
|
+
representative route checks. Content data cannot start until this gate and the
|
|
37
|
+
asset gate pass.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Migration validator
|
|
2
|
+
|
|
3
|
+
The validator is an independent read-only worker. It did not author the
|
|
4
|
+
migration and starts only after all writers return.
|
|
5
|
+
|
|
6
|
+
Compare the source, content plan, actual `git diff`, real Fimo state, and local
|
|
7
|
+
application behavior. A worker report is a claim, not evidence.
|
|
8
|
+
|
|
9
|
+
Verify:
|
|
10
|
+
|
|
11
|
+
- every source route renders with expected status and representative content;
|
|
12
|
+
- schemas, entries, singles, labels, media, forms, and locales exist through
|
|
13
|
+
CLI read-back;
|
|
14
|
+
- every planned source item is consumed at its original behavior path, not in
|
|
15
|
+
an appended duplicate section;
|
|
16
|
+
- media URLs load as their expected media type;
|
|
17
|
+
- native Fimo APIs are used without migration-only wrappers;
|
|
18
|
+
- imports are safe to rerun;
|
|
19
|
+
- build and representative browser interactions pass; and
|
|
20
|
+
- every unsupported item names its impact and owner action.
|
|
21
|
+
|
|
22
|
+
Return a plain-text report with status, duration, checks run, counts, failing
|
|
23
|
+
source items, and suggested bounded repair surface. The coordinator may run one
|
|
24
|
+
repair for that surface and rerun validation. It does not restart every worker
|
|
25
|
+
or loop indefinitely.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Migration workers
|
|
2
|
+
|
|
3
|
+
The root coding agent is the coordinator. It inspects the initialized target,
|
|
4
|
+
writes a short text plan, starts independent workers through its native
|
|
5
|
+
subagent mechanism, and fans their results back in. If subagents are
|
|
6
|
+
unavailable, run the same lanes sequentially; never skip a surface silently.
|
|
7
|
+
|
|
8
|
+
The CLI does not start language models. JSON is reserved for Fimo schemas and
|
|
9
|
+
content payloads. Worker ownership, dependencies, reports, and unresolved work
|
|
10
|
+
stay in `.fimo/migration/*.md` or the agents' plain-text responses.
|
|
11
|
+
|
|
12
|
+
## Schedule
|
|
13
|
+
|
|
14
|
+
Plan a lane only when the source proves that surface exists:
|
|
15
|
+
|
|
16
|
+
| worker | owns | starts when |
|
|
17
|
+
| --------------- | ----------------------------------------------- | ------------------------ |
|
|
18
|
+
| runtime | framework/runtime files and provider config | immediately |
|
|
19
|
+
| routes | route modules, redirects, SEO and host behavior | immediately |
|
|
20
|
+
| content planner | schemas, content payloads, and content handoff | immediately |
|
|
21
|
+
| locales | locale setup and translated UI copy | immediately |
|
|
22
|
+
| assets/forms | media uploads and form behavior | after content planner |
|
|
23
|
+
| content data | one schema/locale import | after assets |
|
|
24
|
+
| content code | listed consuming files | after its data read-back |
|
|
25
|
+
| validator | read-only final checks | after all writers |
|
|
26
|
+
|
|
27
|
+
This is preserve mode, the default. When the user explicitly chose a framework
|
|
28
|
+
conversion, one framework worker replaces runtime and routes and owns all
|
|
29
|
+
structural target code. The content planner may run beside it. Data then waits
|
|
30
|
+
for both the asset and framework gates, and code waits for real imported-data
|
|
31
|
+
read-back.
|
|
32
|
+
|
|
33
|
+
## Ownership
|
|
34
|
+
|
|
35
|
+
- **runtime** preserves the detected framework, router, runtime, dependencies,
|
|
36
|
+
provider setup, environment wiring, and provider-specific configuration. An
|
|
37
|
+
unclear or unsupported setup produces a question, not a silent conversion.
|
|
38
|
+
- **routes** preserves every route, redirect, 404, SEO/OG/social output,
|
|
39
|
+
sitemap, robots, feeds, headers, and other observable host behavior. A file
|
|
40
|
+
that consumes migrated content belongs to its later content-code worker.
|
|
41
|
+
- **content planner** discovers and models all editable content, labels,
|
|
42
|
+
consumers, schemas, payloads, media obligations, and execution batches. It
|
|
43
|
+
never imports entries or rewrites consumers. Read
|
|
44
|
+
`references/workers/content-planner.md`.
|
|
45
|
+
- **assets/forms** uploads every planner media obligation and patches payload
|
|
46
|
+
references. It replaces a form or integration only when Fimo preserves its
|
|
47
|
+
behavior end to end; otherwise it preserves or reports it.
|
|
48
|
+
- **content data and code** execute the planner handoff without rediscovering
|
|
49
|
+
or redesigning it. Read `references/workers/content-execution.md`.
|
|
50
|
+
- **locales** owns locale configuration, locale routing, and translated
|
|
51
|
+
visitor-visible labels.
|
|
52
|
+
- **framework conversion** is used only after explicit user choice. Read
|
|
53
|
+
`references/workers/framework.md`.
|
|
54
|
+
- **validator** authors nothing. Read `references/workers/validator.md`.
|
|
55
|
+
|
|
56
|
+
If two lanes need one file, name one owner in the text plan and sequence the
|
|
57
|
+
other after it. Do not add a metadata format for a small overlap.
|
|
58
|
+
|
|
59
|
+
## Coordinator gates
|
|
60
|
+
|
|
61
|
+
1. Run `fimo migrate init` and inspect the real target paths before workers
|
|
62
|
+
write.
|
|
63
|
+
2. Start runtime/routes/content-planner/locales together, or the framework
|
|
64
|
+
worker plus content planner/locales in conversion mode.
|
|
65
|
+
3. After the content plan, upload every planned asset and patch payloads.
|
|
66
|
+
4. Start data workers only after the asset gate and, in conversion mode, the
|
|
67
|
+
framework gate.
|
|
68
|
+
5. Start each code worker only after its own imported records read back as
|
|
69
|
+
non-empty. A build over empty data proves nothing.
|
|
70
|
+
6. Start the independent validator only after every writer has returned.
|
|
71
|
+
|
|
72
|
+
Each prompt names the worker's source paths, exact target ownership, applicable
|
|
73
|
+
reference above, and dependencies. Each report states status, duration, source
|
|
74
|
+
evidence, files changed, Fimo writes, source items handled, unresolved work,
|
|
75
|
+
and the next action. The coordinator verifies those claims against `git diff`,
|
|
76
|
+
CLI read-back, and rendered routes.
|
|
77
|
+
|
|
78
|
+
A source item is covered only when its target value exists and the application
|
|
79
|
+
consumes it at the original behavior path, or when an explicit unresolved item
|
|
80
|
+
names the impact and owner action. If validation fails, create one bounded
|
|
81
|
+
repair task for that surface and rerun the validator; do not restart every
|
|
82
|
+
worker.
|
|
@@ -1,194 +1,142 @@
|
|
|
1
1
|
# Migration Workflow
|
|
2
2
|
|
|
3
|
-
Use this as the phase contract for complete
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
- Unsupported source behavior is replaced with a Fimo-native equivalent or shown
|
|
144
|
-
as unresolved, never hidden behind broken UI.
|
|
145
|
-
|
|
146
|
-
## Phase 7: Import
|
|
147
|
-
|
|
148
|
-
Import only reviewed artifacts:
|
|
149
|
-
|
|
150
|
-
- media assets and media map updates
|
|
151
|
-
- schemas
|
|
152
|
-
- forms
|
|
153
|
-
- entries
|
|
154
|
-
- redirects/locales when supported by the current project tooling
|
|
155
|
-
|
|
156
|
-
After import, update the ledger with created IDs, uploaded asset IDs, failures,
|
|
157
|
-
and counts.
|
|
158
|
-
|
|
159
|
-
## Phase 8: QA Gate And Report
|
|
160
|
-
|
|
161
|
-
Run `references/qa.md`. Write `.fimo/migration/migration-report.md` with:
|
|
162
|
-
|
|
163
|
-
- source summary
|
|
164
|
-
- route coverage
|
|
165
|
-
- CMS source/import counts
|
|
166
|
-
- media source/upload/reference counts
|
|
167
|
-
- form coverage
|
|
168
|
-
- build/runtime checks
|
|
169
|
-
- visual checks
|
|
170
|
-
- unresolved/unsupported items
|
|
171
|
-
- exact next actions
|
|
172
|
-
|
|
173
|
-
Use the bundled report script to make the QA state explicit:
|
|
174
|
-
|
|
175
|
-
```bash
|
|
176
|
-
node <this-skill>/scripts/write-migration-report.mjs <project-root>
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
The script exits non-zero when required coverage checks fail. That is a prompt
|
|
180
|
-
to continue the migration or document the gaps, not a reason to hide the report.
|
|
181
|
-
|
|
182
|
-
All checks in this phase are **local** (build, local dev, route render, visual
|
|
183
|
-
comparison). Do not run `fimo deploy` / `fimo publish` to verify anything.
|
|
184
|
-
|
|
185
|
-
## Phase 9: Propose Deployment
|
|
186
|
-
|
|
187
|
-
Deployment is not part of the migration loop and is never run to preview or
|
|
188
|
-
verify. Once Phase 8 passes:
|
|
189
|
-
|
|
190
|
-
1. Do not run `fimo deploy` or `fimo publish` yourself.
|
|
191
|
-
2. End by proposing it: tell the owner the migration is ready, that one
|
|
192
|
-
`fimo deploy` creates its hosted preview, and that going live requires a
|
|
193
|
-
separate explicit publish.
|
|
194
|
-
3. Deploy only if the owner explicitly asks in this turn, and then only once.
|
|
3
|
+
Use this as the phase contract for a complete migration. The coordinator and
|
|
4
|
+
workers communicate in plain text. JSON is used only for Fimo schemas and the
|
|
5
|
+
content payloads that the data-plane commands import.
|
|
6
|
+
|
|
7
|
+
## Phase 0: Initialize the target
|
|
8
|
+
|
|
9
|
+
1. Confirm the target path. The target is a separate directory; the source
|
|
10
|
+
checkout remains read-only evidence.
|
|
11
|
+
2. Initialize or reuse exactly one linked Fimo target before workers start:
|
|
12
|
+
- URL migration: `fimo migrate init <source-url> <target-dir> --framework <framework>`
|
|
13
|
+
- link an existing project: `fimo migrate init <target-dir> --project-id <projectId> --framework <framework>`
|
|
14
|
+
- create a project: `fimo migrate init <target-dir> --org <organizationId> --framework <framework>`
|
|
15
|
+
Use the detected source framework for source-backed migrations. A framework
|
|
16
|
+
conversion requires an explicit user choice; URL-only and rebuild
|
|
17
|
+
migrations ask the user which framework to use. Never choose a framework by
|
|
18
|
+
copying an arbitrary `--template-root`, invent a project ID, or hand-write
|
|
19
|
+
`.fimo/project.json`.
|
|
20
|
+
3. Inspect the target's real `package.json`, `.fimo/config.json`, framework config, and route
|
|
21
|
+
directories. They are the authority for paths. Do not infer an app root
|
|
22
|
+
from a skill example and do not create a second `app/` or `src/app/` tree.
|
|
23
|
+
4. If the target is non-empty and not a Fimo project, stop and ask for a target
|
|
24
|
+
path; do not overlay a template on top of it.
|
|
25
|
+
5. Keep source material in `.fimo/migration/source` or another explicit source
|
|
26
|
+
location. Do not copy source files over the initialized target root.
|
|
27
|
+
|
|
28
|
+
Write a short `.fimo/migration/migration-plan.md` containing the source
|
|
29
|
+
location, selected framework, actual target directories, worker owners, and
|
|
30
|
+
known questions. Do not create `target.json`, `manifest.json`,
|
|
31
|
+
`worker-plan.json`, `decision.json`, or JSON worker receipts for a new run.
|
|
32
|
+
|
|
33
|
+
## Phase 1: Source intake
|
|
34
|
+
|
|
35
|
+
Read the source directly with `rg`, `find`, `ls`, and targeted file reads.
|
|
36
|
+
Classify the available evidence:
|
|
37
|
+
|
|
38
|
+
- source repository, export, downloaded HTML, or media folder;
|
|
39
|
+
- CMS CSV/XML/JSON exports and public APIs;
|
|
40
|
+
- forms and third-party form actions;
|
|
41
|
+
- integrations and the environment-key names they need, never secret values;
|
|
42
|
+
- redirects, security headers, locales, SEO, robots, sitemap, and OG behavior;
|
|
43
|
+
- unsupported behavior such as auth, commerce, search, members, custom JS, or
|
|
44
|
+
provider-specific workers.
|
|
45
|
+
|
|
46
|
+
For private APIs or CMSs, ask for a user-provided export or a narrowly scoped
|
|
47
|
+
server-side credential. Never recover credentials from browser bundles or copy
|
|
48
|
+
them into migration artifacts. Missing access blocks only that lane and becomes
|
|
49
|
+
an unresolved item; never invent replacement content.
|
|
50
|
+
|
|
51
|
+
For URL-only migrations, run `fimo migrate <url> [dir]` and inspect the
|
|
52
|
+
generated `.fimo/migrations/current/` files as source evidence. Do not copy
|
|
53
|
+
that crawl manifest into another canonical JSON registry.
|
|
54
|
+
|
|
55
|
+
## Phase 2: Fan out workers
|
|
56
|
+
|
|
57
|
+
The coordinator launches only the workers supported by the source:
|
|
58
|
+
|
|
59
|
+
- **runtime**: preserve the detected framework, router, runtime, dependencies,
|
|
60
|
+
provider configuration, and environment wiring. A framework conversion needs
|
|
61
|
+
an explicit user choice.
|
|
62
|
+
- **routes/SEO**: preserve one target route per source route, redirects, 404,
|
|
63
|
+
metadata, OG/social output, sitemap, robots, and other observable behavior.
|
|
64
|
+
- **content planner**: discover content, labels, data sources, consumers, and
|
|
65
|
+
schemas; push schemas and prepare content payloads. It does not rewrite page
|
|
66
|
+
code or import every entry itself.
|
|
67
|
+
- **locales**: configure locales and migrate translated UI-visible copy when
|
|
68
|
+
the source has it.
|
|
69
|
+
- **assets/forms**: after content planning, upload every referenced media item
|
|
70
|
+
and preserve, replace, or report forms and integrations.
|
|
71
|
+
|
|
72
|
+
When the user explicitly chose a framework conversion, one framework
|
|
73
|
+
conversion worker replaces the runtime and routes lanes and owns all
|
|
74
|
+
structural target code (see `references/workers/framework.md`). The content
|
|
75
|
+
planner may read the source in parallel, but it must not convert the framework
|
|
76
|
+
or rewrite page code. Follow the asset, data, and code gates in
|
|
77
|
+
`references/workers.md`.
|
|
78
|
+
|
|
79
|
+
The coordinator gives each worker a plain-language prompt naming its ownership,
|
|
80
|
+
files, dependencies, and worker-specific reference from `references/workers/`.
|
|
81
|
+
Workers may write the application inside their ownership. They do not need a
|
|
82
|
+
JSON plan or receipt. If two workers need the same file, name one owner and run
|
|
83
|
+
the other after it.
|
|
84
|
+
|
|
85
|
+
## Phase 3: Content planning
|
|
86
|
+
|
|
87
|
+
The planner follows `references/workers/content-planner.md`, plus
|
|
88
|
+
`references/content.md`, `references/decision.md`, and
|
|
89
|
+
`references/import-contract.md`. Its text plan and payloads must be complete
|
|
90
|
+
before Phase 4; data workers must not rediscover unrelated source files.
|
|
91
|
+
|
|
92
|
+
## Phase 4: Media, forms, and integrations
|
|
93
|
+
|
|
94
|
+
1. Account for every planner media obligation, including schema media fields
|
|
95
|
+
and richtext/Tiptap image nodes, plus route, SEO, and form media.
|
|
96
|
+
2. Upload media through Fimo and replace references only after the upload is
|
|
97
|
+
confirmed. A local `public/` copy or source URL is not an imported asset.
|
|
98
|
+
3. Preserve third-party integrations unless Fimo reproduces their exact
|
|
99
|
+
user-visible behavior. Record required environment-key names only.
|
|
100
|
+
4. Use a Fimo-native form only when it matches the source behavior end to end;
|
|
101
|
+
otherwise preserve the integration or report it unresolved.
|
|
102
|
+
|
|
103
|
+
After every media obligation has a target mapping, patch the content payloads
|
|
104
|
+
and run one data worker per schema/locale. Verify each imported batch by
|
|
105
|
+
read-back before starting its content code worker. The code worker replaces
|
|
106
|
+
each planned consumer in place and proves at least one real imported item
|
|
107
|
+
crosses every Server-to-Client or plain-JSON boundary it uses. A build over an
|
|
108
|
+
empty result is not proof. Load the active `fimo-code` framework reference for
|
|
109
|
+
the exact serialization and hydration contract.
|
|
110
|
+
|
|
111
|
+
## Phase 5: Framework implementation
|
|
112
|
+
|
|
113
|
+
Preserve the detected source framework, router, runtime, and configuration.
|
|
114
|
+
React Router/Vite stays React Router/Vite and Next.js stays Next.js. Convert to
|
|
115
|
+
Next.js only after the user explicitly chooses it. An explicit conversion is a
|
|
116
|
+
faithful first pass owned by the framework conversion worker: it ports the
|
|
117
|
+
source's APIs, loaders, hardcoded content, integrations, and visible behavior
|
|
118
|
+
into the new framework, and it must pass the framework gate in
|
|
119
|
+
`references/workers/framework.md` before content code work continues. A gate
|
|
120
|
+
failure is draft-only or unresolved; never fall back silently to a generic
|
|
121
|
+
shell or another framework. Load the matching `fimo-code` framework and
|
|
122
|
+
hosting references before integration work.
|
|
123
|
+
|
|
124
|
+
Preserve the source route surface and behavior. Do not replace many pages with
|
|
125
|
+
one generic static shell. Apply the matching framework reference before
|
|
126
|
+
disposing of provider-specific rules; redirects, headers, feeds, metadata,
|
|
127
|
+
forms, and freshness behavior are observable contracts.
|
|
128
|
+
|
|
129
|
+
## Phase 6: Fan in, validate, and report
|
|
130
|
+
|
|
131
|
+
Workers return the plain-text receipt defined in `references/workers.md`.
|
|
132
|
+
The coordinator checks those claims against the diff, source, CLI read-back,
|
|
133
|
+
build, and rendered routes. Then an independent worker follows
|
|
134
|
+
`references/workers/validator.md`; a worker saying "done" is not evidence.
|
|
135
|
+
|
|
136
|
+
Write `.fimo/migration/migration-report.md` with route/content/media/form/SEO
|
|
137
|
+
coverage, import counts, worker timings, unresolved items, and next actions.
|
|
138
|
+
Use `complete` only when required checks pass, `complete-with-unresolved` when
|
|
139
|
+
the app works and every gap is explicit, and `draft-only` when import or
|
|
140
|
+
verification is incomplete.
|
|
141
|
+
|
|
142
|
+
All checks are local. Do not deploy or publish to verify a migration.
|