fimo 0.3.1 → 0.3.2-experimental.1783328062928

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 (130) hide show
  1. package/README.md +6 -12
  2. package/assets/agents-starter/AGENTS.md +14 -2
  3. package/assets/skills/fimo/SKILL.md +1 -1
  4. package/assets/skills/fimo/references/content.md +14 -2
  5. package/assets/skills/fimo/references/setup-plain-vite.md +8 -3
  6. package/assets/skills/fimo/references/setup-react-router.md +13 -6
  7. package/assets/skills/fimo/references/ui.md +1 -1
  8. package/assets/skills/fimo-cli/SKILL.md +30 -18
  9. package/assets/skills/fimo-cli/references/account.md +4 -2
  10. package/assets/skills/fimo-cli/references/agent-setup.md +14 -16
  11. package/assets/skills/fimo-cli/references/agents.md +2 -0
  12. package/assets/skills/fimo-cli/references/analytics.md +2 -0
  13. package/assets/skills/fimo-cli/references/assets.md +2 -0
  14. package/assets/skills/fimo-cli/references/branches.md +2 -0
  15. package/assets/skills/fimo-cli/references/content.md +3 -1
  16. package/assets/skills/fimo-cli/references/credits.md +2 -0
  17. package/assets/skills/fimo-cli/references/deploy.md +10 -4
  18. package/assets/skills/fimo-cli/references/describe.md +2 -0
  19. package/assets/skills/fimo-cli/references/domains.md +2 -0
  20. package/assets/skills/fimo-cli/references/forms.md +2 -0
  21. package/assets/skills/fimo-cli/references/init.md +114 -0
  22. package/assets/skills/fimo-cli/references/integrations/firecrawl.md +2 -0
  23. package/assets/skills/fimo-cli/references/integrations.md +2 -0
  24. package/assets/skills/fimo-cli/references/invite.md +2 -0
  25. package/assets/skills/fimo-cli/references/labels.md +2 -0
  26. package/assets/skills/fimo-cli/references/locales.md +2 -0
  27. package/assets/skills/fimo-cli/references/media.md +2 -0
  28. package/assets/skills/fimo-cli/references/preview.md +2 -0
  29. package/assets/skills/fimo-cli/references/project-vars-and-secrets.md +3 -1
  30. package/assets/skills/fimo-cli/references/projects.md +5 -3
  31. package/assets/skills/fimo-cli/references/schedules.md +2 -0
  32. package/assets/skills/fimo-migration/SKILL.md +16 -1
  33. package/assets/skills/fimo-migration/references/manifest.md +40 -1
  34. package/assets/skills/fimo-migration/references/qa.md +21 -2
  35. package/assets/skills/fimo-migration/references/workflow.md +12 -1
  36. package/assets/skills/fimo-migration/references/wrap.md +155 -0
  37. package/assets/skills/fimo-studio/references/visual-editing.md +5 -3
  38. package/dist/build/vite/index.d.ts.map +1 -1
  39. package/dist/build/vite/index.js +8 -6
  40. package/dist/build/vite/plugins/translations.d.ts +2 -8
  41. package/dist/build/vite/plugins/translations.d.ts.map +1 -1
  42. package/dist/build/vite/plugins/translations.js +3 -121
  43. package/dist/cli/bundle.json +2 -2
  44. package/dist/cli/index.js +4547 -3255
  45. package/dist/runtime/app/FimoProviders.d.ts +1 -11
  46. package/dist/runtime/app/FimoProviders.d.ts.map +1 -1
  47. package/dist/runtime/app/FimoProviders.js +2 -23
  48. package/dist/runtime/i18n/FimoLocaleContext.d.ts.map +1 -1
  49. package/dist/runtime/i18n/FimoLocaleContext.js +1 -0
  50. package/dist/runtime/next/FimoFileLink.d.ts +17 -0
  51. package/dist/runtime/next/FimoFileLink.d.ts.map +1 -0
  52. package/dist/runtime/next/FimoFileLink.js +19 -0
  53. package/dist/runtime/next/FimoMediaImage.d.ts +14 -0
  54. package/dist/runtime/next/FimoMediaImage.d.ts.map +1 -0
  55. package/dist/runtime/next/FimoMediaImage.js +20 -0
  56. package/dist/runtime/next/FimoMediaVideo.d.ts +14 -0
  57. package/dist/runtime/next/FimoMediaVideo.d.ts.map +1 -0
  58. package/dist/runtime/next/FimoMediaVideo.js +20 -0
  59. package/dist/runtime/next/FimoNextProviders.d.ts +30 -0
  60. package/dist/runtime/next/FimoNextProviders.d.ts.map +1 -0
  61. package/dist/runtime/next/FimoNextProviders.js +106 -0
  62. package/dist/runtime/next/FimoNextScripts.d.ts +10 -0
  63. package/dist/runtime/next/FimoNextScripts.d.ts.map +1 -0
  64. package/dist/runtime/next/FimoNextScripts.js +19 -0
  65. package/dist/runtime/next/FimoRichTextBlock.d.ts +23 -0
  66. package/dist/runtime/next/FimoRichTextBlock.d.ts.map +1 -0
  67. package/dist/runtime/next/FimoRichTextBlock.js +22 -0
  68. package/dist/runtime/next/FimoText.d.ts +22 -0
  69. package/dist/runtime/next/FimoText.d.ts.map +1 -0
  70. package/dist/runtime/next/FimoText.js +20 -0
  71. package/dist/runtime/next/WrappedContentContext.d.ts +28 -0
  72. package/dist/runtime/next/WrappedContentContext.d.ts.map +1 -0
  73. package/dist/runtime/next/WrappedContentContext.js +30 -0
  74. package/dist/runtime/next/index.d.ts +14 -0
  75. package/dist/runtime/next/index.d.ts.map +1 -0
  76. package/dist/runtime/next/index.js +14 -0
  77. package/dist/runtime/next/server.d.ts +33 -0
  78. package/dist/runtime/next/server.d.ts.map +1 -0
  79. package/dist/runtime/next/server.js +107 -0
  80. package/dist/runtime/primitives/labels-hook.d.ts +33 -0
  81. package/dist/runtime/primitives/labels-hook.d.ts.map +1 -0
  82. package/dist/runtime/primitives/labels-hook.js +41 -0
  83. package/dist/runtime/primitives/labels-store.d.ts +12 -0
  84. package/dist/runtime/primitives/labels-store.d.ts.map +1 -0
  85. package/dist/runtime/primitives/labels-store.js +60 -0
  86. package/dist/runtime/primitives/labels-store.test.d.ts +2 -0
  87. package/dist/runtime/primitives/labels-store.test.d.ts.map +1 -0
  88. package/dist/runtime/primitives/labels-store.test.js +66 -0
  89. package/dist/runtime/primitives/lib/useFimoLiveValue.d.ts +5 -3
  90. package/dist/runtime/primitives/lib/useFimoLiveValue.d.ts.map +1 -1
  91. package/dist/runtime/primitives/lib/useFimoLiveValue.js +8 -4
  92. package/dist/runtime/primitives/translations.d.ts +1 -27
  93. package/dist/runtime/primitives/translations.d.ts.map +1 -1
  94. package/dist/runtime/primitives/translations.js +7 -85
  95. package/dist/runtime/react/index.d.ts +24 -0
  96. package/dist/runtime/react/index.d.ts.map +1 -0
  97. package/dist/runtime/react/index.js +28 -0
  98. package/dist/runtime/shared/display-routes.d.ts +14 -0
  99. package/dist/runtime/shared/display-routes.d.ts.map +1 -0
  100. package/dist/runtime/shared/display-routes.js +25 -0
  101. package/dist/runtime/shared/fimo-config.server.d.ts.map +1 -1
  102. package/dist/runtime/shared/fimo-config.server.js +1 -0
  103. package/dist/runtime/shared/fimo-config.types.d.ts +2 -0
  104. package/dist/runtime/shared/fimo-config.types.d.ts.map +1 -1
  105. package/dist/runtime/shared/labels-fetch.server.d.ts +14 -0
  106. package/dist/runtime/shared/labels-fetch.server.d.ts.map +1 -0
  107. package/dist/runtime/shared/labels-fetch.server.js +145 -0
  108. package/dist/scripts/detect-framework.d.ts +12 -0
  109. package/dist/scripts/detect-framework.js +32 -0
  110. package/dist/scripts/detect-framework.test.d.ts +1 -0
  111. package/dist/scripts/detect-framework.test.js +39 -0
  112. package/dist/scripts/lib/discover-next-routes.d.ts +11 -0
  113. package/dist/scripts/lib/discover-next-routes.js +76 -0
  114. package/dist/scripts/lib/discover-next-routes.test.d.ts +1 -0
  115. package/dist/scripts/lib/discover-next-routes.test.js +40 -0
  116. package/dist/scripts/scan-wrappable.d.ts +29 -0
  117. package/dist/scripts/scan-wrappable.js +191 -0
  118. package/dist/scripts/scan-wrappable.test.d.ts +1 -0
  119. package/dist/scripts/scan-wrappable.test.js +48 -0
  120. package/dist/scripts/validate-route-metadata.js +11 -0
  121. package/dist/scripts/validate-schemas.d.ts +13 -0
  122. package/dist/scripts/validate-schemas.js +113 -0
  123. package/dist/scripts/validate-schemas.test.d.ts +1 -0
  124. package/dist/scripts/validate-schemas.test.js +132 -0
  125. package/package.json +29 -1
  126. package/release.json +2 -2
  127. package/scripts/postinstall.mjs +10 -54
  128. package/templates/react-router/package.json +1 -1
  129. package/assets/agents-starter/claude/settings.json +0 -19
  130. package/assets/skills/fimo-cli/references/create.md +0 -90
@@ -0,0 +1,114 @@
1
+ # `fimo init`
2
+
3
+ > **Run via `npx fimo@latest <command>`** — always the latest CLI, no install needed.
4
+
5
+ One-stop project setup: sign in, create a new Fimo project (or link an existing one), install dependencies, and optionally set up Fimo skills for your AI tools.
6
+
7
+ ## Command
8
+
9
+ ```bash
10
+ fimo init [dir] [options]
11
+ ```
12
+
13
+ `fimo init` runs the full onboarding in one shot:
14
+
15
+ 1. **Signs in automatically** — if there's no session it opens the browser loopback login. In `--json` / non-TTY with no session it fails with `NOT_AUTHENTICATED` (run `fimo login` first).
16
+ 2. **Resolves the project** — with `--project-id <id>` it links an EXISTING project (clones it); without it, it creates a NEW project. An interactive TTY shows a "Create new / Link existing" picker; non-interactive shells default to create-new.
17
+ 3. **Installs dependencies** — prompts for the package manager, or honor `--package-manager <pm>` / `--no-install`.
18
+ 4. **Optionally sets up Fimo skills** — confirm prompt, or `--skills` / `--no-skills`.
19
+
20
+ | Flag | Required | Purpose |
21
+ | ---------------------------- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
22
+ | `[dir]` positional | yes in non-TTY for create-new | Target directory (e.g. `my-site`) |
23
+ | `--project-id <id>` | no | Link an EXISTING project instead of creating one (clones it). |
24
+ | `--org <id>` | no | Target organization **id** when creating (use the `ID` column from `fimo orgs list`, NOT the slug). Picker shown interactively if omitted and TTY. |
25
+ | `--env <name>` | no | Env to check out when linking an existing project (defaults to `main`). |
26
+ | `--package-manager <pm>` | no | `npm` \| `pnpm` \| `yarn` \| `bun`. |
27
+ | `--install` / `--no-install` | yes in non-TTY | Install deps after checkout (or skip it). |
28
+ | `--skills` / `--no-skills` | yes in non-TTY | Set up Fimo skills (or skip it). |
29
+ | `--agents <list>` | no | Comma-separated agent IDs (e.g. `claude-code,cursor`). Pass `none` to write only universal AGENTS.md. |
30
+ | `-a, --agent <id>` | alternative | Repeatable form: `-a claude-code -a cursor`. |
31
+ | `--mode <symlink\|copy>` | no | Project skill install method. |
32
+ | `--template-root <path>` | no | Override the bundled template (development only). |
33
+ | `-y, --yes` | no | Skip the skills install preview confirmation. |
34
+
35
+ In a non-TTY shell the create-new path requires `[dir]`, `--install` / `--no-install`, and `--skills` / `--no-skills` (and `--org` if you have no active org and belong to multiple orgs). Without them the command exits with `Cannot prompt in a non-interactive shell.`
36
+
37
+ > **Zero-install:** run `npx fimo@latest init` — no global install needed. `fimo projects create` is also an alias of `fimo init` (create-new path).
38
+
39
+ For `--agents`, pass the AI tool you're running in: `--agents=claude-code` for Claude Code, `--agents=cursor` for Cursor, `--agents=codex` for Codex, etc. When the flag is omitted, env-var detection of the invoking harness (e.g. `CLAUDECODE` / `CLAUDE_CODE_ENTRYPOINT` → claude-code) auto-targets that agent; other agents must be selected explicitly via `--agents`/`-a` or the interactive picker.
40
+
41
+ ## Linking an existing project
42
+
43
+ Pass `--project-id <id>` to link an EXISTING project instead of creating one. This clones the project's git repo into `[dir]` and writes the local `.fimo.settings.json` + agent files, the same as `fimo clone` (init's `--project-id` path reuses it). Use `--env <name>` to check out a specific env (defaults to `main`). Without `--project-id`, `fimo init` creates a new project.
44
+
45
+ ## What gets written (create-new)
46
+
47
+ `fimo init` (create-new path) scaffolds:
48
+
49
+ - The project template (Vite + React 19 + TypeScript + Tailwind v4 + shadcn/ui + react-router)
50
+ - `.fimo.settings.json` — links this directory to the remote project (read-only after creation)
51
+ - `.env` — initial env vars (currently just `VITE_API_URL`)
52
+ - `AGENTS.md` — project rules read by all agentskills.io-compatible AI tools (Codex, OpenCode, Aider, etc.)
53
+ - Per-agent variants based on `--agents`:
54
+ - `claude-code` → `CLAUDE.md` + `.claude/settings.json`
55
+ - `cursor` → `.cursor/rules/fimo.mdc`
56
+ - `windsurf` → `.windsurfrules`
57
+ - `gemini-cli` → `GEMINI.md`
58
+ - codex / opencode / aider / others → no extra file; AGENTS.md is read natively
59
+ - The project-scope `fimo` skill (npm package surface: schemas, forms, `t()`, `fimo/ui` components) copied into each selected agent's skill dir (`.claude/skills/fimo/`, `.cursor/skills/fimo/`, etc.). Version-locked to the bundled `fimo` package — the installed `SKILL.md` is stamped with `fimoVersion`. Refresh later with `fimo skills sync`. See `references/agent-setup.md`.
60
+ - A git repository with `fimo` as the remote, an initial commit, and an initial push
61
+
62
+ Codex, OpenCode, Aider, and similar AGENTS.md-native tools work directly off AGENTS.md without a per-agent variant.
63
+
64
+ `.env` is only the bootstrap app env so local `pnpm dev` works immediately. User-managed public variables are stored with `fimo vars set` and synced into a managed `.env.local` block; hidden values use `fimo secrets set`. See `references/project-vars-and-secrets.md`.
65
+
66
+ ## Right after scaffolding
67
+
68
+ Set a human-readable display name with `fimo rename "<Name>"`. Infer it from what the user is building (e.g. "Acme Coffee" for a café site, "Jane Doe Portfolio" for a personal site). The default post-`fimo init` name is an auto-generated slug; renaming updates the dashboard label and the SEO `siteName`.
69
+
70
+ ```bash
71
+ cd my-site
72
+ fimo rename "Acme Coffee"
73
+ ```
74
+
75
+ **Then start the local dev loop and ask the developer what they want to build.** Run the app with the project's package-manager `dev` script — `pnpm dev`, `npm run dev`, `yarn dev`, or `bun dev` (match the lockfile) — in the background; it serves the site on localhost with live reload. Edit, show, iterate. You do not need to deploy to see local changes.
76
+
77
+ ```bash
78
+ pnpm dev & # or npm run dev / yarn dev / bun dev — the project's package manager
79
+ ```
80
+
81
+ When a unit of work looks done, **offer** to deploy (`fimo deploy` for a hosted preview / shareable link, `fimo deploy --publish` to go live) and run it only after the developer confirms.
82
+
83
+ **Optional — warm the sandbox early:** only if you already know a deploy is coming, kick off a background `fimo deploy -m "chore: init" &` so the one-time ~15-30s sandbox provision + dep install happens while you work. This is a perf optimization, not a required step — skip it while you're just iterating locally. See `references/deploy.md` § Warm the sandbox early in a session.
84
+
85
+ ## Load the project context
86
+
87
+ After `fimo init` completes, the project root has:
88
+
89
+ - `AGENTS.md` (universal) plus the per-agent variant for the AI tool you're running in (e.g. `CLAUDE.md` for Claude Code, `.cursor/rules/fimo.mdc` for Cursor)
90
+ - `.claude/skills/fimo/SKILL.md` (or the equivalent per-agent path) — the project-scope `fimo` skill, version-locked to the installed `fimo` package
91
+
92
+ **These files came into existence mid-session, so they may not be auto-loaded by the harness.** Explicitly:
93
+
94
+ 1. `cd <project-dir>` — switch into the new project.
95
+ 2. `Read` the project rules file: `AGENTS.md` (or `CLAUDE.md` if you're Claude Code).
96
+ 3. `Read` the project skill: `.claude/skills/fimo/SKILL.md` (or `.cursor/skills/fimo/SKILL.md` for Cursor, etc.).
97
+ 4. From the project skill's "load these references up front" section, batch-read `references/content.md`, `references/forms.md`, `references/assets.md`, `references/labels.md`, `references/locales.md`, `references/ui.md` before generating any significant code.
98
+
99
+ Once those are in context, generation respects the project's conventions (schemas, `t()`, `fimo/ui` components, asset handling).
100
+
101
+ ## Adding another AI tool to an existing project later
102
+
103
+ If a teammate joins on a different AI tool (e.g. Cursor) after the project was scaffolded for claude-code only:
104
+
105
+ ```bash
106
+ fimo skills install --agents=cursor # one command — global skill + project skill + rule file
107
+ ```
108
+
109
+ Run from inside the project. The command detects the project context and wires up everything for the new agent in a single shot. See `references/agent-setup.md`.
110
+
111
+ ## Multi-org accounts
112
+
113
+ If you belong to a single organization, `fimo init` defaults to it. If you belong to multiple and don't pass `--org`, the CLI shows an interactive picker. For `fimo init`, pass the org **id** (from the `ID` column of `fimo orgs list`) — not the slug. Use `fimo orgs switch --org <id-or-slug>` to set a default for future `fimo init` invocations. See `references/account.md`.
114
+ </content>
@@ -1,5 +1,7 @@
1
1
  # Firecrawl Integration
2
2
 
3
+ > **Run via `npx fimo@latest <command>`** — always the latest CLI, no install needed.
4
+
3
5
  Use Firecrawl when an agent needs to inspect public websites: landing-page research, competitor structure analysis, migration prep, link extraction, and factual page snapshots. Do not use Firecrawl for private URLs, logged-in websites, or content the user has not asked you to fetch.
4
6
 
5
7
  Current execution support is `search`, `scrape`, `map`, `crawl`, and `monitor.*`.
@@ -1,5 +1,7 @@
1
1
  # Integrations
2
2
 
3
+ > **Run via `npx fimo@latest <command>`** — always the latest CLI, no install needed.
4
+
3
5
  Use integrations to enable external services for a Fimo project. API keys are stored by Fimo and never printed back to the CLI. Teammates and agents receive access to the integration, not the underlying token.
4
6
 
5
7
  ## Inspect
@@ -1,5 +1,7 @@
1
1
  # Invite users
2
2
 
3
+ > **Run via `npx fimo@latest <command>`** — always the latest CLI, no install needed.
4
+
3
5
  Invite collaborators to your Fimo organization or project. After deploying a website for the first time, suggest inviting team members so they can contribute.
4
6
 
5
7
  ## When to suggest inviting users
@@ -1,5 +1,7 @@
1
1
  # Labels workflow
2
2
 
3
+ > **Run via `npx fimo@latest <command>`** — always the latest CLI, no install needed.
4
+
3
5
  > For the `t()` helper signature, `useLabels()` hook, key naming rules, and the "wrap every user-facing string" rule, see **`fimo/references/labels.md`**.
4
6
  > For locale configuration and route-prefix validation, see **`references/locales.md`**.
5
7
 
@@ -1,5 +1,7 @@
1
1
  # Locales Workflow
2
2
 
3
+ > **Run via `npx fimo@latest <command>`** — always the latest CLI, no install needed.
4
+
3
5
  This file covers CLI-side locale configuration and validation. For code helpers such as `fimoRoutes()` and `FimoLink`, load `fimo/references/locales.md`.
4
6
 
5
7
  ## Configure Locales
@@ -1,5 +1,7 @@
1
1
  # Media generation
2
2
 
3
+ > **Run via `npx fimo@latest <command>`** — always the latest CLI, no install needed.
4
+
3
5
  > For uploading existing files, browsing the library, and opening assets, see
4
6
  > `references/assets.md`. This file is **only** about generating new media
5
7
  > via AI — the `fimo generate <model>` surface.
@@ -1,5 +1,7 @@
1
1
  # Preview URL (without deploying)
2
2
 
3
+ > **Run via `npx fimo@latest <command>`** — always the latest CLI, no install needed.
4
+
3
5
  **Use `fimo preview url` whenever you need the current preview link — to open it, screenshot it, hand it to another tool, or verify a change you've already deployed. Never trigger a `fimo deploy` just to refresh a URL.**
4
6
 
5
7
  `fimo deploy` is a milestone command: it commits, pushes, syncs the sandbox, and only then prints the preview URL. `fimo preview url` skips all of that. It calls the API directly, gets a fresh 15-min token, and prints the URL. No commit, no push, no restart. Sub-second on a warm sandbox.
@@ -1,5 +1,7 @@
1
1
  # Project Variables And Secrets
2
2
 
3
+ > **Run via `npx fimo@latest <command>`** — always the latest CLI, no install needed.
4
+
3
5
  Use project variables for values that are safe to expose to the browser. Use project secrets for hidden values such as API keys, tokens, webhooks, and service credentials.
4
6
 
5
7
  There is no private-variable mode. If leaking the value would be a problem, use `fimo secrets`.
@@ -40,7 +42,7 @@ Secrets are not written to `.env.local`, preview app env files, browser bundles,
40
42
 
41
43
  ## Local Env Files
42
44
 
43
- `fimo create` writes `.env` for bootstrap app runtime values such as `VITE_API_URL`. This lets `pnpm dev` work without a Fimo wrapper.
45
+ `fimo init` writes `.env` for bootstrap app runtime values such as `VITE_API_URL`. This lets `pnpm dev` work without a Fimo wrapper.
44
46
 
45
47
  `fimo vars set` and `fimo vars pull` write public project variables to a managed block in `.env.local`.
46
48
 
@@ -1,12 +1,14 @@
1
1
  # Managing projects
2
2
 
3
+ > **Run via `npx fimo@latest <command>`** — always the latest CLI, no install needed.
4
+
3
5
  Commands for listing projects across an org, cloning a remote project locally, and managing the lifecycle of a single project (delete, publish, unpublish, rename). Most lifecycle commands operate on the **current project** (read from `.fimo.settings.json` in the cwd) by default; for `delete`, `publish`, and `unpublish` you can pass an explicit `[projectId]` to target another. (`rename` is local-only — it never targets a different project; see below.)
4
6
 
5
7
  ## The `fimo projects` namespace
6
8
 
7
9
  ```bash
8
10
  fimo projects list [--org <id>] # list projects in an org (defaults to active org)
9
- fimo projects create [dir] [--org <id>] [--install|--no-install] # alias of `fimo create`
11
+ fimo projects create [dir] [--org <id>] [--install|--no-install] # alias of `fimo init` (create-new path)
10
12
  fimo projects clone [projectId] [dir] [--env <name>] # clone an existing project locally
11
13
  fimo projects delete [projectId] [-C <dir>] [-y] # delete (defaults to current project)
12
14
  fimo projects publish [projectId] [-C <dir>] # make the project live (publish from main)
@@ -15,7 +17,7 @@ fimo projects rename <name> [projectId] [-C <dir>] # local-only: set seo.siteN
15
17
  ```
16
18
 
17
19
  - **`list`** — projects you can see in the org. Live projects are marked.
18
- - **`create`** — identical to `fimo create`; see `references/create.md`.
20
+ - **`create`** — identical to `fimo init` (create-new path); see `references/init.md`.
19
21
  - **`clone`** — clone a remote Fimo project's git repo to your machine and write the local `.fimo.settings.json`/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 `--env <name>` to clone a specific env. The target directory defaults to the project display name/name, or pass `[dir]` explicitly.
20
22
  - **`delete`** — destructive; prompts unless `-y`. Removes the remote project.
21
23
  - **`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). This is **not** the versioned release path — for that, see `fimo publish` in `references/branches.md`.
@@ -39,7 +41,7 @@ fimo unpublish [-C <dir>] # unpublish the current project
39
41
  fimo rename "<Site Name>" # local edit: set seo.siteName in fimo-config.json
40
42
  ```
41
43
 
42
- `fimo rename` sets the **site name** (`seo.siteName`) in the local `fimo-config.json` — it is a local edit, not a remote update, so it requires a follow-up commit + `fimo deploy` to take effect. It does **not** change the project's remote display name (the `displayName` shown by `projects list`), which is set once at creation time from the project directory name. See `references/create.md` and `references/deploy.md`.
44
+ `fimo rename` sets the **site name** (`seo.siteName`) in the local `fimo-config.json` — it is a local edit, not a remote update, so it requires a follow-up commit + `fimo deploy` to take effect. It does **not** change the project's remote display name (the `displayName` shown by `projects list`), which is set once at creation time from the project directory name. See `references/init.md` and `references/deploy.md`.
43
45
 
44
46
  ## Three "publish" verbs — don't confuse them
45
47
 
@@ -1,5 +1,7 @@
1
1
  # Scheduled Commands
2
2
 
3
+ > **Run via `npx fimo@latest <command>`** — always the latest CLI, no install needed.
4
+
3
5
  `fimo schedules` manages recurring commands for a project env. A schedule is scoped to the env of the current checkout by default, or to `--env <name>` when passed.
4
6
 
5
7
  ## Commands
@@ -17,6 +17,8 @@ exports, source repositories, CMS exports, media folders, or any hybrid of those
17
17
  It owns intake, source inventory, URL crawl bootstrapping, ledger normalization,
18
18
  imports, and QA so any LLM can run the work without silently dropping content.
19
19
 
20
+ > Run every `fimo` command as `npx fimo@latest <command>` — always the latest CLI, no global install.
21
+
20
22
  ## Non-Negotiables
21
23
 
22
24
  - No source data may disappear silently. Every route, CMS export, entry, media
@@ -28,6 +30,9 @@ imports, and QA so any LLM can run the work without silently dropping content.
28
30
  ledger.
29
31
  - Source exports beat inferred crawls. If CSV/XML/JSON exports, media folders, or
30
32
  source code exist, treat the public URL as visual/SEO reference only.
33
+ - A working JS codebase is wrapped, not rewritten. Wrap mode
34
+ (`references/wrap.md`) keeps the user's routing, styling, and components
35
+ untouched; the diff is wiring + wrappers + config only.
31
36
  - Builder HTML is evidence, not the final runtime. Rebuild with Fimo conventions,
32
37
  schemas, forms, media primitives, translations, and routes.
33
38
  - Do not report completion until the QA gate passes or every failed check is
@@ -57,7 +62,15 @@ imports, and QA so any LLM can run the work without silently dropping content.
57
62
  pack.
58
63
  - **hybrid**: source files plus public URL. Use source-backed as truth and URL
59
64
  for route, SEO, visual, and behavior comparison.
60
- 4. Create or update the canonical ledger described in
65
+ 4. Pick the mode:
66
+ - **wrap** (default for a source-backed, working JS codebase — Next.js,
67
+ Vite/React, React Router): keep the user's stack, adopt the repo with
68
+ `fimo init`, and make content editable by wrapping it in place. Never
69
+ rewrite routing, styling, or components. Follow `references/wrap.md`.
70
+ - **rebuild**: url-only sources, builder exports/HTML dumps, non-JS
71
+ backends, or codebases that do not build. Follow the standard workflow
72
+ phases.
73
+ 5. Create or update the canonical ledger described in
61
74
  `references/manifest.md`.
62
75
 
63
76
  ## Workflow
@@ -94,6 +107,8 @@ node <this-skill>/scripts/write-migration-report.mjs <project-root>
94
107
  ## References
95
108
 
96
109
  - `references/workflow.md` - full decision tree and phase order.
110
+ - `references/wrap.md` - wrap mode: adopt a working JS codebase and wrap its
111
+ content in place (default for source-backed JS sites).
97
112
  - `references/manifest.md` - canonical migration ledger schema.
98
113
  - `references/content.md` - CMS, entries, relations, and source value rules.
99
114
  - `references/media.md` - media inventory, upload, dedupe, and replacement rules.
@@ -34,6 +34,7 @@ follow-up agents, and import/QA checks.
34
34
  "seo": [],
35
35
  "unsupported": [],
36
36
  "unresolved": [],
37
+ "wrap": null,
37
38
  "qa": {
38
39
  "status": "not-run|passed|failed|passed-with-unresolved",
39
40
  "checks": []
@@ -41,6 +42,40 @@ follow-up agents, and import/QA checks.
41
42
  }
42
43
  ```
43
44
 
45
+ ## Wrap Block (wrap mode only)
46
+
47
+ When the migration is a wrap (see `references/wrap.md`), set
48
+ `source.mode: "source-backed"` and fill the `wrap` block; leave it `null` for
49
+ rebuild migrations:
50
+
51
+ ```json
52
+ {
53
+ "wrap": {
54
+ "mode": "wrap",
55
+ "framework": "next|react-router|vite",
56
+ "adopted": true,
57
+ "wired": true,
58
+ "coverage": {
59
+ "wrappable": 0,
60
+ "wrapped": 25,
61
+ "ignored": 0,
62
+ "unresolvedItems": 0
63
+ },
64
+ "seeded": {
65
+ "labels": 21,
66
+ "wrappedMedia": 3,
67
+ "wrappedRichText": 1
68
+ },
69
+ "planPath": ".fimo/migration/wrap-plan.json"
70
+ }
71
+ }
72
+ ```
73
+
74
+ `coverage` mirrors the final `fimo migrate wrap --check` output: `wrappable`
75
+ must be 0 (or fully accounted for by `ignored` + `unresolvedItems`, each with a
76
+ ledger entry). `seeded` counts must match what `fimo labels list` /
77
+ `fimo entries list` report — fallback-only content is not seeded.
78
+
44
79
  ## Required Item Fields
45
80
 
46
81
  Every route, content type, entry batch, media asset, form, redirect, locale, SEO
@@ -76,7 +111,6 @@ than first-party CSV/XML/JSON exports.
76
111
  "importedCount": 0,
77
112
  "fields": {
78
113
  "title": { "type": "string", "source": "Name" },
79
- "slug": { "type": "string", "source": "Slug" },
80
114
  "body": { "type": "richtext", "source": "Post Body" },
81
115
  "coverImage": { "type": "media", "source": "Main Image" },
82
116
  "publishedAt": { "type": "datetime", "source": "Published On" }
@@ -85,6 +119,11 @@ than first-party CSV/XML/JSON exports.
85
119
  }
86
120
  ```
87
121
 
122
+ > **Do not put reserved names in `fields`.** `id`, `documentId`, `slug`, `locale`,
123
+ > `createdAt`, `updatedAt`, and `__fimo` are built-in entry metadata — declaring them as
124
+ > schema fields makes `fimo schemas push` fail with a 400. Map a source "Slug" column onto
125
+ > the entry's built-in `slug` (inside `data`) at import time, not onto a schema field.
126
+
88
127
  ## Entry Batch Item
89
128
 
90
129
  ```json
@@ -18,8 +18,11 @@ Run this gate before reporting completion.
18
18
  ## Behavior
19
19
 
20
20
  - Dependencies are installed in the target project.
21
- - The project builds successfully.
22
- - Local dev starts without Vite loader/schema/form generation errors.
21
+ - The project builds successfully **with its own toolchain** (`next build`,
22
+ `vite build`, …) — wrapped sites are not Vite/React-Router projects; never
23
+ assume Fimo-template tooling.
24
+ - Local dev starts without loader/schema/form generation errors (Vite errors
25
+ apply to rebuild-mode projects only).
23
26
  - Primary routes render without console/runtime errors.
24
27
  - Collection listing/detail pages work with imported data, seed data, or explicit
25
28
  empty states.
@@ -33,6 +36,22 @@ Run this gate before reporting completion.
33
36
  - Remove generated placeholder copy from visible UI.
34
37
  - Verify media aspect ratios and no broken images on primary routes.
35
38
 
39
+ ## Wrap Mode (additional blocking checks)
40
+
41
+ When the manifest says `mode: "wrap"`:
42
+
43
+ - `fimo migrate wrap --check` exits zero, or every remaining item is an
44
+ explicit ignored/unresolved ledger entry with a reason.
45
+ - Labels are seeded: every `FimoText`/`t()` key exists in `fimo labels list`
46
+ with the original string. Fallback-only content fails the gate.
47
+ - Wrapped media/rich text have their `WrappedMedia`/`WrappedRichText` entries
48
+ created and assets uploaded.
49
+ - Render parity: pages render identically to pre-migration — same text, same
50
+ formatting marks (bold/italic/underline/links), same media.
51
+ - Diff audit: the migration diff contains only wiring, wrappers, label calls,
52
+ config, and dependency changes. Any routing/styling/component rewrite fails
53
+ the gate.
54
+
36
55
  ## Import Verification
37
56
 
38
57
  Record:
@@ -2,6 +2,14 @@
2
2
 
3
3
  Use this as the phase contract for complete migrations.
4
4
 
5
+ > **Mode fork.** For a source-backed, WORKING JS codebase (Next.js, Vite/React,
6
+ > React Router), wrap mode is the default: skip Phases 0 and 6 below and follow
7
+ > `references/wrap.md` (adopt via `fimo init`, scan via `fimo migrate wrap`,
8
+ > wrap in place, seed, verify). Phases 3–5 (content model, media/forms, import)
9
+ > and Phase 8 (QA + report) still apply — wrap changes how content becomes
10
+ > editable, not the accounting obligations. Everything else here is the rebuild
11
+ > path.
12
+
5
13
  ## Phase 0: Target Safety
6
14
 
7
15
  1. Confirm the target path.
@@ -119,7 +127,10 @@ Required order:
119
127
  Record target IDs, import counts, failures, and unresolved items in the
120
128
  canonical ledger. Generated JSON without import counts is still draft state.
121
129
 
122
- ## Phase 6: Fimo Implementation
130
+ ## Phase 6: Fimo Implementation (rebuild mode)
131
+
132
+ In wrap mode this phase is replaced by `references/wrap.md` phases W3–W5
133
+ (wire, wrap, seed); do not rebuild pages for a wrapped site.
123
134
 
124
135
  Implement routes, schemas, forms, entries, media, redirects, translations, and
125
136
  React pages with Fimo conventions.
@@ -0,0 +1,155 @@
1
+ # Wrap Mode
2
+
3
+ Wrap mode is the default migration for a **source-backed, working JS codebase**
4
+ (Next.js, Vite/React, React Router; other frameworks via the same contract).
5
+ The user's stack stays. Nothing is rebuilt. The migration is a mechanical
6
+ wrapping pass that makes existing content editable from Fimo, plus a mandatory
7
+ content-seeding pass so Fimo becomes the source of truth.
8
+
9
+ **Never rewrite routing, styling, structure, or component logic.** The final
10
+ diff must contain only: the one-time wiring, wrapper components, label calls,
11
+ config files, and lockfile/dependency changes. If a change does not make
12
+ content editable, it does not belong in a wrap migration.
13
+
14
+ ## When wrap does NOT apply
15
+
16
+ - URL-only migrations (no code) → rebuild path (`fimo migrate <url>`).
17
+ - Builder exports / static HTML dumps → rebuild path.
18
+ - Codebases that do not build/run as-is → fix-first is the owner's call;
19
+ wrap assumes a working site.
20
+ - Non-JS backends (PHP/WordPress/Drupal) → not supported yet.
21
+
22
+ ## Phases
23
+
24
+ ### W1. Adopt
25
+
26
+ Connect the existing site to a Fimo project. From the site directory:
27
+
28
+ ```bash
29
+ fimo init # interactive: detects the framework, confirms the adopt
30
+ fimo init . -y # non-interactive (agents/CI): explicit dir = consent
31
+ ```
32
+
33
+ Adoption creates the project, writes `fimo-config.json` (`framework` +
34
+ scanned `routes` for the Studio page switcher), `.fimo.settings.json`, the
35
+ framework env flavor (`NEXT_PUBLIC_FIMO_API_URL`,
36
+ `NEXT_PUBLIC_FIMO_PREVIEW_SCRIPT_URL` for Next), wires the `fimo` git remote
37
+ into the existing repo, and pushes the site as-is. No template is copied.
38
+
39
+ Next.js: ensure `next.config` allowlists the preview origin, or the sandbox
40
+ preview serves a black iframe with failing HMR websockets:
41
+
42
+ ```ts
43
+ allowedDevOrigins: ['*.preview.fimo.ai'],
44
+ ```
45
+
46
+ If the user's config sets CSP headers with `frame-ancestors`, the Fimo Studio
47
+ origins must be permitted or the preview iframe will be blocked.
48
+
49
+ ### W2. Scan + automatic wiring
50
+
51
+ ```bash
52
+ fimo migrate # inside an adopted JS codebase this IS the wrap flow
53
+ ```
54
+
55
+ (`fimo migrate wrap` is the explicit form; `fimo migrate <url>` remains the
56
+ crawl-and-rebuild path for URL-only migrations.)
57
+
58
+ Writes `.fimo/migration/wrap-plan.json` (every unwrapped item with
59
+ `kind`/`file`/`line`/`preview`) and `.fimo/migration/wrap/agent-prompt.md`.
60
+ The scan finds hardcoded JSX text, `img`/`Image`/`video` sources, file links
61
+ (pdf/zip/docx/…), and user-visible attribute strings (`placeholder`, `title`,
62
+ `aria-label`). Content already inside Fimo wrappers or `t()` calls counts as
63
+ covered.
64
+
65
+ The command also performs the deterministic wiring itself: it adds the `fimo`
66
+ dependency (platform-pinned) and, for Next.js, inserts `allowedDevOrigins`
67
+ into the next config when missing. Run the project's package manager install
68
+ afterwards.
69
+
70
+ ### W3. Wire the layout (one-time)
71
+
72
+ - Root layout (Next.js app router):
73
+
74
+ ```tsx
75
+ import { FimoNextProviders, FimoNextScripts } from 'fimo/next';
76
+ import { loadFimoConfig, loadFimoLabels } from 'fimo/next/server';
77
+
78
+ const config = loadFimoConfig();
79
+ const labels = await loadFimoLabels();
80
+ // <head><FimoNextScripts /></head>
81
+ // <body><FimoNextProviders config={config} labels={labels}>{children}</FimoNextProviders></body>
82
+ ```
83
+
84
+ - React (framework-agnostic) uses `fimo/react`; React Router projects keep
85
+ `fimo/react-router`.
86
+
87
+ RSC rule: the wrapper primitives are client components. Server components may
88
+ render them directly as JSX children; do not call hooks like `useLabels()`
89
+ outside client components (`'use client'`).
90
+
91
+ ### W4. Wrap
92
+
93
+ Work through `wrap-plan.json` item by item:
94
+
95
+ | Item kind | Wrap with |
96
+ | ----------------------------------- | -------------------------------------------------------------------------------------- |
97
+ | text (plain) | `<FimoText id="…">original text</FimoText>` |
98
+ | text (formatted: strong/em/u/links) | `<FimoRichTextBlock id="…">…original markup…</FimoRichTextBlock>` — marks must survive |
99
+ | attribute | `const { t } = useLabels()` then `placeholder={String(t('key', 'original value'))}` |
100
+ | image | `<FimoMediaImage id="…" src="/original.png" …/>` |
101
+ | video | `<FimoMediaVideo id="…" src="/original.mp4" …/>` |
102
+ | file-link | `<FimoFileLink id="…" href="/original.pdf">…</FimoFileLink>` |
103
+
104
+ Rules:
105
+
106
+ - The original value always stays inline as the fallback (child or prop). Wrap
107
+ fallbacks are deliberate: they keep the site rendering without Fimo
108
+ connectivity. This differs from Fimo-template projects, where inline
109
+ fallbacks are forbidden by lint — do not "fix" wrap fallbacks to match.
110
+ - Key naming: `<route>.<section>.<n>` — `home.hero.title`,
111
+ `pricing.plans.starter.description`. Stable, human-readable, no indexes
112
+ unless the content is genuinely a list.
113
+ - Repeated hardcoded arrays of 3+ structurally identical items (cards, tiles)
114
+ are still collections: model a schema + entries as in
115
+ `references/content.md`, render from `fetchEntries` (`fimo/next/server`).
116
+ Wrapping each array literal string individually is acceptable only as a
117
+ first pass and must be recorded as an unresolved modeling item.
118
+
119
+ ### W5. Seed (MANDATORY)
120
+
121
+ Fallbacks are resilience, not storage. Every wrapped item is seeded into Fimo:
122
+
123
+ - Labels: every `FimoText`/`t()` key with its original string via
124
+ `fimo labels set-many --file <json>`.
125
+ - Media/files: `fimo assets upload <path>` per item, then a `WrappedMedia`
126
+ entry per wrapper id (`key` = wrapper id, `image` = the asset) via
127
+ `fimo schemas push` + `fimo entries create`.
128
+ - Rich text: `WrappedRichText` entries (`key`, `body` = TipTap JSON converted
129
+ from the original markup; bold/italic/underline/link marks preserved).
130
+
131
+ A wrap migration whose labels/entries were never created in Fimo is
132
+ `draft-only`, exactly like a rebuild migration with un-imported seed JSON.
133
+
134
+ ### W6. Verify
135
+
136
+ - `fimo migrate wrap --check` exits zero (or every remaining item is an
137
+ explicit ignored/unresolved ledger entry with a reason).
138
+ - The site builds and runs **with its own toolchain** (`next build`,
139
+ `npm run dev`, …) — never assume Vite.
140
+ - Rendered output is identical to pre-migration: same text, same formatting
141
+ marks, same media. Diff rendered pages, not just code.
142
+ - Diff audit: the migration diff contains only wiring, wrappers, label calls,
143
+ config, and dependency changes.
144
+ - Then `fimo deploy` (allowed in wrap mode: it pushes the preview env and
145
+ boots the sandbox preview — it does not publish). Verify in Fimo Studio that
146
+ the preview renders and Edit mode can select and edit wrapped content, and
147
+ that an edited label round-trips (`fimo labels set <key> "new"` → reload →
148
+ rendered). `fimo publish` / `fimo deploy --publish` remain owner-only.
149
+
150
+ ## Manifest
151
+
152
+ Record wrap mode in the canonical ledger (`references/manifest.md`): set
153
+ `mode: "wrap"` and fill the `wrap` block (framework, coverage counts, seeded
154
+ counts, wiring status). Routes/media/forms sections apply as usual — wrap mode
155
+ changes how content becomes editable, not the accounting obligations.
@@ -12,7 +12,9 @@ For text elements, the side panel shows editable fields where you can change the
12
12
 
13
13
  ### Editing Styles
14
14
 
15
- The side panel organizes style controls into these categories:
15
+ Style controls are only available on projects created before July 2026. Newer projects edit styles through the AI chat instead (for example: "make the hero title larger and dark blue"). If the user does not see the style controls described below, their project is a newer one -- point them to the chat.
16
+
17
+ On projects that have them, the side panel organizes style controls into these categories:
16
18
 
17
19
  - **Typography** -- Font family, font size, font weight, line height, letter spacing, text alignment, and bold/italic/underline/strikethrough toggles.
18
20
  - **Color** -- Text and foreground colors.
@@ -31,5 +33,5 @@ Click the **Edit mode** toggle again or close the side panel. The side editor cl
31
33
 
32
34
  ## When to Use Edit Mode vs. Chat
33
35
 
34
- - **Edit mode** is best for quick visual tweaks -- changing a color, adjusting spacing, updating text, or trying a different font.
35
- - **Chat** is better for bigger changes -- adding new sections, restructuring a page layout, or building new functionality.
36
+ - **Edit mode** is best for content changes -- updating text (including bold, italic, underline, and links), and replacing images. On older projects it also covers quick style tweaks like colors and spacing.
37
+ - **Chat** is better for style and structural changes -- changing colors or spacing (on newer projects), adding new sections, restructuring a page layout, or building new functionality.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/build/vite/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAU,YAAY,EAAE,MAAM,MAAM,CAAC;AAyEjD,MAAM,WAAW,eAAe;IAC9B;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;;;;;;;;OAUG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAGD,wBAAgB,IAAI,CAAC,IAAI,GAAE,eAAoB,GAAG,YAAY,EAAE,CAsB/D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/build/vite/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAU,YAAY,EAAE,MAAM,MAAM,CAAC;AA2EjD,MAAM,WAAW,eAAe;IAC9B;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;;;;;;;;OAUG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAGD,wBAAgB,IAAI,CAAC,IAAI,GAAE,eAAoB,GAAG,YAAY,EAAE,CAsB/D"}
@@ -35,15 +35,17 @@ function bundleFimoIntoSsrPlugin() {
35
35
  ssr: { noExternal: ['fimo'] },
36
36
  optimizeDeps: {
37
37
  include: ['fimo/ui'],
38
- esbuildOptions: {
38
+ rolldownOptions: {
39
39
  plugins: [
40
40
  {
41
41
  name: 'fimo-externalize-virtuals',
42
- setup(build) {
43
- build.onResolve({ filter: /^virtual:/ }, (args) => ({
44
- path: args.path,
45
- external: true,
46
- }));
42
+ resolveId(id) {
43
+ if (id.startsWith('virtual:')) {
44
+ return {
45
+ id,
46
+ external: true,
47
+ };
48
+ }
47
49
  },
48
50
  },
49
51
  ],
@@ -1,11 +1,5 @@
1
1
  import type { Plugin } from 'vite';
2
- interface LabelBundle {
3
- dictionaries: Record<string, Record<string, string>>;
4
- defaultLocale: string;
5
- locales: string[];
6
- updatedAt: string | null;
7
- }
2
+ import { loadLabelBundle } from '../../../runtime/shared/labels-fetch.server.js';
8
3
  export default function translationsPlugin(): Plugin;
9
- export declare function loadLabelBundle(rootDir: string): Promise<LabelBundle>;
10
- export {};
4
+ export { loadLabelBundle };
11
5
  //# sourceMappingURL=translations.d.ts.map