fimo 0.12.0-staging.2 → 0.12.0-staging.4

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 (55) hide show
  1. package/assets/content-templates/types-template.eta +13 -7
  2. package/assets/skills/fimo/SKILL.md +8 -6
  3. package/assets/skills/fimo-cli/SKILL.md +15 -23
  4. package/assets/skills/fimo-cli/references/agent-setup.md +14 -14
  5. package/assets/skills/fimo-cli/references/assets.md +2 -2
  6. package/assets/skills/fimo-cli/references/content.md +16 -30
  7. package/assets/skills/fimo-cli/references/describe.md +1 -1
  8. package/assets/skills/fimo-cli/references/forms.md +8 -8
  9. package/assets/skills/fimo-cli/references/init.md +5 -4
  10. package/assets/skills/fimo-cli/references/labels.md +4 -4
  11. package/assets/skills/fimo-cli/references/locales.md +3 -3
  12. package/assets/skills/fimo-cli/references/project-vars-and-secrets.md +1 -1
  13. package/assets/skills/fimo-code/SKILL.md +39 -49
  14. package/assets/skills/fimo-code/references/assets.md +6 -4
  15. package/assets/skills/fimo-code/references/content/clients.md +130 -0
  16. package/assets/skills/fimo-code/references/content/primitives.md +5 -0
  17. package/assets/skills/fimo-code/references/content/richtext.md +48 -0
  18. package/assets/skills/fimo-code/references/content/schema.md +122 -0
  19. package/assets/skills/fimo-code/references/content.md +12 -597
  20. package/assets/skills/fimo-code/references/design.md +1 -1
  21. package/assets/skills/fimo-code/references/frameworks/next/app-router.md +116 -0
  22. package/assets/skills/fimo-code/references/frameworks/next/locales.md +59 -0
  23. package/assets/skills/fimo-code/references/frameworks/next/pages-router.md +99 -0
  24. package/assets/skills/fimo-code/references/frameworks/next.md +116 -0
  25. package/assets/skills/fimo-code/references/frameworks/react-router.md +295 -0
  26. package/assets/skills/fimo-code/references/frameworks/vite-react.md +225 -0
  27. package/assets/skills/fimo-code/references/labels.md +24 -83
  28. package/assets/skills/fimo-code/references/locales.md +22 -111
  29. package/assets/skills/fimo-code/references/setup-plain-vite.md +3 -227
  30. package/assets/skills/fimo-code/references/setup-react-router.md +3 -276
  31. package/assets/skills/fimo-code/references/ui.md +32 -78
  32. package/dist/build/vite/plugins/content-sync.js +1 -1
  33. package/dist/cli/bundle.json +1 -1
  34. package/dist/cli/index.js +174 -65
  35. package/dist/runtime/labels/core.d.ts +18 -0
  36. package/dist/runtime/labels/core.js +15 -0
  37. package/dist/runtime/labels/fetch.d.ts +7 -0
  38. package/dist/runtime/labels/fetch.js +41 -0
  39. package/dist/runtime/next/client.d.ts +3 -2
  40. package/dist/runtime/next/client.js +1 -1
  41. package/dist/runtime/next/facade.d.ts +8 -0
  42. package/dist/runtime/next/facade.js +34 -0
  43. package/dist/runtime/next/labels.d.ts +7 -0
  44. package/dist/runtime/next/labels.js +9 -0
  45. package/dist/runtime/next/provider.d.ts +5 -2
  46. package/dist/runtime/next/provider.js +18 -5
  47. package/dist/runtime/next/server.d.ts +5 -0
  48. package/dist/runtime/next/server.js +2 -0
  49. package/dist/scripts/extract-translations.js +8 -1
  50. package/dist/scripts/sync-schemas.d.ts +2 -1
  51. package/dist/scripts/sync-schemas.js +119 -67
  52. package/package.json +2 -1
  53. package/templates/react-router/AGENTS.md +12 -10
  54. package/templates/react-router/package.json +1 -1
  55. package/templates/react-router/react-router.config.ts +1 -1
@@ -225,15 +225,21 @@ function isOptionalOutputField(field) {
225
225
  function isConditionalField(field) {
226
226
  return field.showIf !== undefined || field.showIfAny !== undefined;
227
227
  }
228
+
229
+ const populatedReferenceFields = Object.entries(model.fields || {}).filter(([, field]) => {
230
+ if (field.type !== 'reference') {
231
+ return false;
232
+ }
233
+ return (Array.isArray(field.targetRefs) && field.targetRefs.length > 0) || typeof field.targetPascal === 'string';
234
+ });
228
235
  -%>
229
236
 
237
+ <% if (populatedReferenceFields.length === 0) { -%>
238
+ export type <%= model.pascal %>References = Record<never, never>;
239
+ <% } else { -%>
230
240
  export interface <%= model.pascal %>References {
231
241
  <%
232
- if (model.fields) {
233
- Object.entries(model.fields).forEach(([key, field]) => {
234
- if (field.type !== 'reference') {
235
- return;
236
- }
242
+ populatedReferenceFields.forEach(([key, field]) => {
237
243
  // Polymorphic populated values form a discriminated union on $type —
238
244
  // the generated wrapper stamps it, so `switch (item.$type)` narrows.
239
245
  if (Array.isArray(field.targetRefs) && field.targetRefs.length > 0) {
@@ -252,10 +258,10 @@ if (model.fields) {
252
258
  -%>
253
259
  <%= key %>: <%= type %>;
254
260
  <%
255
- });
256
- }
261
+ });
257
262
  -%>
258
263
  }
264
+ <% } -%>
259
265
 
260
266
  export type <%= model.pascal %>Populate = Populate<<%= model.pascal %>>;
261
267
 
@@ -2,15 +2,15 @@
2
2
  name: fimo
3
3
  description: >-
4
4
  Working in or with a Fimo project (a content + media + forms + analytics
5
- platform for React websites). Load the real, version-locked Fimo skills on
6
- demand through the `fimo` CLI before doing Fimo work — writing schema-driven
5
+ platform for web applications). Load the current Fimo skills on demand through
6
+ the `fimo` CLI before doing Fimo work — writing schema-driven
7
7
  code, running CLI/deploy workflows, using the dashboard, or migrating a site.
8
8
  ---
9
9
 
10
10
  # Fimo
11
11
 
12
- Fimo ships its skills through its CLI so they always match the installed `fimo` version. This file is
13
- just a pointer — do not rely on cached instructions. Fetch the real skill from the CLI when you need it.
12
+ Fimo ships its skills through its CLI. `fimo-code` resolves from the project's installed `fimo` package;
13
+ workflow skills resolve from the CLI you run. This file is only a pointer — fetch the real skill when needed.
14
14
 
15
15
  When you are about to do Fimo work:
16
16
 
@@ -23,9 +23,11 @@ not files in the project. Load them through the CLI, for example
23
23
 
24
24
  Pick by task:
25
25
 
26
- - Writing code — schema-driven JSX, schemas/forms JSON, `t()` labels, `fimo/ui` media → `fimo-code`
26
+ - Writing code — schemas/forms, generated clients, labels, framework adapters, rendering primitives → `fimo-code`
27
27
  - CLI commands and workflows — push, deploy, sync, labels, domains, analytics → `fimo-cli`
28
- - Project MCP setup — configure `fimo mcp` for a local AI client → `fimo-cli` (`references/mcp.md`)
28
+ - Fimo agents — create, configure, validate, deploy, run, or inspect them → `fimo-cli` (`references/agents.md`)
29
+ - AI agent setup — connect Claude Code, Codex, Cursor, or another agent → `fimo-cli` (`references/agent-setup.md`)
30
+ - Project MCP setup — configure `fimo mcp` for a local agent → `fimo-cli` (`references/mcp.md`)
29
31
  - The Fimo Studio dashboard / web app UI → `fimo-studio`
30
32
  - Migrating an existing site into Fimo → `fimo-migration`
31
33
 
@@ -1,23 +1,15 @@
1
1
  ---
2
2
  name: fimo-cli
3
3
  description: >-
4
- The `fimo` CLI scaffolds and manages Fimo projects from the command line.
5
- Load when the user wants to create a new Fimo project, build content
6
- (schemas, entries, forms, media, labels/locales), deploy a site, manage
7
- custom domains, configure outbound webhooks and event-driven integrations,
8
- check site traffic/analytics, inspect or restore project history, invite collaborators, inspect AI credits,
9
- connect an AI coding client to a Fimo project through MCP,
10
- report a failing or slow Fimo API, rejected documented argument,
11
- undocumented workaround, missing capability that blocks work, forces a
12
- fragile or heavily manual workaround, or would materially accelerate a
13
- recurring workflow, or other Fimo platform problem to support, log in or
14
- switch organizations, or set up Fimo for their AI tool. Most "do X with
15
- Fimo" tasks go through this skill.
4
+ Use the `fimo` CLI to create or operate a Fimo project: content, forms,
5
+ media, labels/locales, deploys, environments, domains, analytics,
6
+ integrations, Fimo agents, collaboration, accounts, and credits. Also use
7
+ for AI agent or MCP setup and confirmed Fimo platform blockers.
16
8
  ---
17
9
 
18
10
  # Fimo CLI
19
11
 
20
- The `fimo` CLI is the workflow surface for Fimo. Fimo is a content + media + forms + analytics platform for React websites with a CMS dashboard. The CLI handles project creation, all content / forms / media / labels / locale workflows, deploys, collaboration, account management, AI credit inspection, and AI agent setup.
12
+ The `fimo` CLI is the workflow surface for Fimo. Fimo connects content, media, forms, analytics, editing, and hosting to web applications. The CLI handles project creation, content / forms / media / labels / locale workflows, deploys, collaboration, account management, Fimo agents, AI credit inspection, and AI agent setup.
21
13
 
22
14
  This skill describes **what the CLI does and the workflows it drives**. For the package surface used IN code (component props, generated hooks, JSON shapes, code-side rules), load the `fimo-code` skill on demand with `npx fimo@latest skills get fimo-code`.
23
15
 
@@ -81,13 +73,13 @@ The working loop is local: run the app with the project's package-manager `dev`
81
73
  Load the matching reference when the user's request fires its trigger. Recipes that involve writing code also need the `fimo-code` skill's package references — they're called out where relevant.
82
74
 
83
75
  - "Create a new Fimo project / scaffold a site / start a new website / add the opt-in content starter / link an existing project locally" → `references/init.md`
84
- - "Add a content type / blog / products / pages / CMS" → `references/content.md` (workflow) **+ load `fimo-code/references/content.md` for the JSON shape and React hooks**
85
- - "Add a contact / signup / feedback / newsletter form" → `references/forms.md` (workflow) **+ load `fimo-code/references/forms.md` for the JSON spec and generated client**
76
+ - "Add a content type / blog / products / pages / CMS" → `references/content.md` (workflow) **+ run `npx fimo@latest skills get fimo-code --ref content/schema` and load the detected framework reference**
77
+ - "Add a contact / signup / feedback / newsletter form" → `references/forms.md` (workflow) **+ run `npx fimo@latest skills get fimo-code --ref forms` for the JSON spec and generated client**
86
78
  - "View form submissions / who filled out the contact form / inspect what users sent / how many signups" → `references/forms.md` § Reading submissions
87
- - "Upload an image / hero / cover / existing media file" → `references/assets.md` (workflow: upload, browse, open, delete) **+ load `fimo-code/references/assets.md` for the `FimoMedia` shape and rendering**
88
- - "Generate AI image / video / draft preview / image edit / cover from a prompt" → `references/media.md` (task commands, quality, recipes, and verification) **+ load `fimo-code/references/assets.md` for the `FimoMedia` shape if you'll plug the result into UI**
89
- - "Add labels / update static copy / fix missing `t()` values" → `references/labels.md` (workflow) **+ load `fimo-code/references/labels.md` for the `t()` helper and wrap rules**
90
- - "Enable locales / configure default locale / route by locale prefix / fix locale route validation" → `references/locales.md` **+ load `fimo-code/references/locales.md` for code helpers**
79
+ - "Upload an image / hero / cover / existing media file" → `references/assets.md` (workflow: upload, browse, open, delete) **+ run `npx fimo@latest skills get fimo-code --ref assets` for the `FimoMedia` shape and rendering**
80
+ - "Generate AI image / video / draft preview / image edit / cover from a prompt" → `references/media.md` (task commands, quality, recipes, and verification) **+ run `npx fimo@latest skills get fimo-code --ref assets` for the `FimoMedia` shape if you'll plug the result into UI**
81
+ - "Add labels / update static copy / fix missing `t()` values" → `references/labels.md` (workflow) **+ run `npx fimo@latest skills get fimo-code --ref labels` and load the detected framework reference**
82
+ - "Enable locales / configure default locale / integrate an existing locale system" → `references/locales.md` **+ run `npx fimo@latest skills get fimo-code --ref locales` and load the detected framework locale reference**
91
83
  - "What's in this project / show the project structure / describe the project / what schemas does it have / how many routes / project tree / show me what's here" → `references/describe.md`
92
84
  - "Deploy / publish / go live / push my changes" → `references/deploy.md`
93
85
  - "Get the preview URL / open the preview / what's the URL for this env / refresh the preview link / I just want to see the site / the preview URL stopped working" → `references/preview.md`
@@ -107,9 +99,9 @@ Load the matching reference when the user's request fires its trigger. Recipes t
107
99
  - "Invite a collaborator / add Marc / share with client" → `references/invite.md`
108
100
  - "Login / log out / who am I / switch organization" → `references/account.md` — note: switching **org** is `fimo orgs switch`; bare `fimo switch` switches **env** (see `references/branches.md`)
109
101
  - "Create / scaffold / run / validate an agent / agent bundle / wire or enable its triggers / list agent templates / view agent runs, reports, or logs (`fimo agents *`)" → `references/agents.md`
110
- - "Install Fimo for my AI tool / fimo skills install / set up Claude Code or Cursor for Fimo / add an agent to this project" → `references/agent-setup.md`
111
- - "Connect an AI coding client to a Fimo project through MCP / configure `fimo mcp` / expose Fimo tools to a local MCP client" → `references/mcp.md`
112
- - "Refresh / update installed Fimo skills / fimo skills sync / agent missing the latest fimo conventions" → `references/agent-setup.md`
102
+ - "Install Fimo for my agent / fimo skills install / set up Claude Code, Codex, or Cursor for Fimo" → `references/agent-setup.md`
103
+ - "Connect an agent to a Fimo project through MCP / configure `fimo mcp` / expose Fimo tools to a local MCP client" → `references/mcp.md`
104
+ - "Refresh / update installed Fimo skills / fimo skills sync / agent missing the latest Fimo conventions" → `references/agent-setup.md`
113
105
  - "Report a Fimo problem or blocking feature request / contact Fimo support / a Fimo API or command keeps failing / a documented argument is rejected / a supported operation needs an undocumented workaround / a Fimo API is abnormally slow / a confirmed missing capability blocks completion or forces a fragile or heavily manual workaround" → `references/support.md`
114
106
  - "Regenerate rule files / I edited AGENTS.md / fimo rules sync" → `references/agent-setup.md`
115
107
  - "Show analytics / visitor stats / traffic / pageviews / how is my site performing / top pages / where do visitors come from" → `references/analytics.md` (7-day preview free for all; longer ranges require paid)
@@ -119,7 +111,7 @@ Load the matching reference when the user's request fires its trigger. Recipes t
119
111
 
120
112
  These fire at specific moments in the project lifecycle. **Surface them proactively** rather than waiting for the user to ask:
121
113
 
122
- - **Right after `fimo init`** → `cd` into the new directory, then `Read` the project's `AGENTS.md` (or `CLAUDE.md` for Claude Code) to load the project context, and run `npx fimo@latest skills get fimo-code` to load the code skill before generating any code. The `AGENTS.md`/`CLAUDE.md` came into existence mid-session and may not be auto-loaded by the harness. See `references/init.md` § Load the project context.
114
+ - **Right after `fimo init`** → `cd` into the new directory, read the project's `AGENTS.md` (or `CLAUDE.md` for Claude Code), run `fimo describe --json`, then load `fimo-code` and only the task/framework references it routes to. The rules file came into existence mid-session and may not be auto-loaded by the harness. See `references/init.md` § Load the project context.
123
115
  - **Right after `fimo init`** → suggest `fimo rename "<Display Name>"` to set a human-readable name (the default post-init name is an auto-generated slug). Infer the name from what the user is building (e.g. "Acme Coffee" for a café, "Jane Doe Portfolio" for a personal site). See `references/init.md`.
124
116
  - **Right after `fimo init`** → start the app locally with the project's package-manager `dev` script (`pnpm dev` / `npm run dev` / `yarn dev` / `bun dev`) in the background, then ask the developer what they want to build. This localhost server with live reload is your iteration loop — edit, show, repeat. No deploy is needed to see local changes.
125
117
  - **When a user-visible 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 — or immediately if they ask. Never deploy on your own. See `references/deploy.md`.
@@ -2,16 +2,16 @@
2
2
 
3
3
  > **Run via `npx fimo@latest <command>`** — always the latest CLI, no install needed.
4
4
 
5
- Fimo wires up to AI coding tools in two layers:
5
+ Fimo connects agents in two layers:
6
6
 
7
- 1. **One global bootstrap skill** — a tiny, generic `fimo` skill installed once per user, machine-wide (symlinked into each agent's global skills dir). It doesn't contain workflow content itself; it tells the agent to load the real, version-locked skills on demand from the CLI. It never goes stale because it just points at `fimo skills get`.
8
- 2. **Per-project rule files** — `AGENTS.md` (universal) and `CLAUDE.md` ship in the project template. `fimo rules sync` regenerates the other agents' variants (`.cursor/rules/fimo.mdc`, `.windsurfrules`, `GEMINI.md`) from `AGENTS.md`.
7
+ 1. **One global bootstrap skill** — a tiny, generic `fimo` skill installed once per user, machine-wide (symlinked into each agent's global skills directory). It contains no workflow content; it routes the agent to skills fetched through `fimo skills get`.
8
+ 2. **Per-project rule files** — `AGENTS.md` (universal) and `CLAUDE.md` ship in the project template. `fimo rules sync` generates other agents' variants (`.cursor/rules/fimo.mdc`, `.windsurfrules`, `GEMINI.md`) from `AGENTS.md`.
9
9
 
10
- The rich skills (`fimo-code`, `fimo-cli`, `fimo-studio`, `fimo-migration`) are **never installed as files**. They're served on demand straight from the CLI, so they always match the installed version and never land in the project:
10
+ The rich skills (`fimo-code`, `fimo-cli`, `fimo-studio`, `fimo-migration`) are **never installed as files**. They are served on demand and never land in the project. `fimo-code` resolves from the project's installed package; the others resolve from the CLI being run:
11
11
 
12
12
  ```bash
13
13
  npx fimo@latest skills list # what's available
14
- npx fimo@latest skills get fimo-code # writing code: schemas, forms, labels, fimo/ui
14
+ npx fimo@latest skills get fimo-code # writing code: schemas, generated clients, labels, framework adapters
15
15
  npx fimo@latest skills get fimo-cli # CLI + workflows (this skill)
16
16
  npx fimo@latest skills get fimo-cli --ref deploy # a reference doc
17
17
  ```
@@ -40,15 +40,15 @@ fimo skills sync # re-ensure the bootstrap + clean
40
40
  fimo skills uninstall # remove the global bootstrap
41
41
  ```
42
42
 
43
- `fimo skills install` installs the single global `fimo` bootstrap skill for the selected agents (symlinked into each agent's global skills dir; it transparently falls back to a copy when a symlink can't be created, e.g. under `npx`). It writes **nothing** into your project — the working tree stays clean.
43
+ `fimo skills install` installs the single global `fimo` bootstrap skill for the selected agents (symlinked into each agent's global skills directory; it transparently falls back to a copy when a symlink can't be created, e.g. under `npx`). It writes **nothing** into your project — the working tree stays clean.
44
44
 
45
- Once installed, the agent discovers everything else through the bootstrap: it runs `fimo skills get <name>` to load the real skill for the task at hand.
45
+ Once installed, the agent discovers everything else through the bootstrap: it runs `fimo skills get <name>` to load the skill for the task at hand.
46
46
 
47
- **`fimo skills sync`** re-ensures the global bootstrap for whichever agents already have it, and cleans up stale global skills that older CLI versions used to copy in (`fimo-cli`, `fimo-studio`, `fimo-migration`, and legacy migration skills). You rarely need it: the bootstrap is a symlink, so it always tracks the running CLI, and the real skills are fetched fresh via `fimo skills get`. Run it after upgrading from an old CLI to clear leftovers.
47
+ **`fimo skills sync`** re-ensures the global bootstrap for whichever agents already have it, and cleans up stale global skills that older CLI versions used to copy in (`fimo-cli`, `fimo-studio`, `fimo-migration`, and legacy migration skills). You rarely need it: the bootstrap is a symlink, so it tracks the running CLI, and the real skills are fetched fresh via `fimo skills get`. Run it after upgrading from an old CLI to clear leftovers.
48
48
 
49
49
  **`fimo skills uninstall`** removes the global bootstrap for the selected agents.
50
50
 
51
- ## `fimo rules sync` — rule files only
51
+ ## `fimo rules sync` — agent rule files only
52
52
 
53
53
  `fimo init` scaffolds `AGENTS.md` (the universal-spec file) and `CLAUDE.md` from the template. Other agents' variants are generated on demand:
54
54
 
@@ -60,7 +60,7 @@ Once installed, the agent discovers everything else through the bootstrap: it ru
60
60
  | gemini-cli | `GEMINI.md` |
61
61
  | codex / opencode / aider / others | none — they read `AGENTS.md` natively |
62
62
 
63
- `fimo rules sync` regenerates these variants from the current `AGENTS.md`. Use it when:
63
+ `fimo rules sync` generates these variants from the current `AGENTS.md`. Use it when:
64
64
 
65
65
  - You edited `AGENTS.md` and want variants refreshed (delete the variant first — see below).
66
66
  - You added an agent that needs its own rule file generated.
@@ -81,15 +81,15 @@ Every command that takes agents accepts the same selection inputs:
81
81
  - `--agents=claude-code,cursor` — comma-separated list (headless)
82
82
  - `-a claude-code -a cursor` — repeatable short form
83
83
  - No flag → interactive multi-select. The picker has two sections:
84
- - **Universal** — agents that read `AGENTS.md` natively (codex, opencode, aider, …). Always covered, not toggleable.
84
+ - **Universal** — agents that read `AGENTS.md` natively (Codex, OpenCode, Aider, …). Always covered, not toggleable.
85
85
  - **Additional** — agents that get the global bootstrap skill installed. The 6 popular ones (`claude-code`, `cursor`, `codex`, `opencode`, `windsurf`, `gemini-cli`) appear at the top of an 8-item scrollable viewport; the full list of 50+ supported agents is below the fold. Agents already set up on the machine are pre-checked.
86
86
  - `--agents=none` (only `fimo init`) — skip the global skill entirely.
87
87
 
88
- In headless contexts (CI, AI-tool-spawned commands), pass the flag explicitly. Env-var detection (only Claude Code's `CLAUDECODE` / `CLAUDE_CODE_ENTRYPOINT`) silently targets `claude-code` if the flag is omitted; every other agent must be named explicitly with `--agents` in a headless shell, or the command exits with "No agents detected and no --agents flag passed."
88
+ In headless contexts (CI, agent-spawned commands), pass the flag explicitly. Env-var detection (only Claude Code's `CLAUDECODE` / `CLAUDE_CODE_ENTRYPOINT`) silently targets `claude-code` if the flag is omitted; every other agent must be named explicitly with `--agents` in a headless shell, or the command exits with "No agents detected and no --agents flag passed."
89
89
 
90
90
  ## Always current, never stale
91
91
 
92
- Because the only installed artifact is a generic pointer, and the real skills are fetched with `fimo skills get`, the content an agent reads always matches the running CLI. There's no version stamp to check and no cached copy to refresh — re-run `fimo skills get <name>` any time to get the current instructions.
92
+ Because the only installed artifact is a generic pointer, the agent fetches current instructions with `fimo skills get`. `fimo-code` resolves from the project's installed package; the workflow skills resolve from the CLI being run. Re-run `fimo skills get <name>` any time to refresh them.
93
93
 
94
94
  ## When to use which
95
95
 
@@ -98,4 +98,4 @@ Because the only installed artifact is a generic pointer, and the real skills ar
98
98
  - "Clean up skills left by an old CLI version" → `fimo skills sync`
99
99
  - "I edited `AGENTS.md` and want variants regenerated" → delete the stale variant + `fimo rules sync`
100
100
  - "I'm done with Fimo on this machine" → `fimo skills uninstall`
101
- - For a fresh project, `fimo init` installs the global skill for the AI tools you select at scaffold time.
101
+ - For a fresh project, `fimo init` installs the global skill for the agents you select at scaffold time.
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **Run via `npx fimo@latest <command>`** — always the latest CLI, no install needed.
4
4
 
5
- > For how to plug returned media into UI components (`FimoMedia` shape, `<Image>` integration), see **`fimo/references/assets.md`** and **`fimo/references/ui.md`**.
5
+ > Package contract: run `npx fimo@latest skills get fimo-code --ref assets` for `FimoMedia`, `--ref ui` for rendering primitives, and load the detected framework reference for framework-specific integration.
6
6
  > For **generating** new images / videos with AI, see **`references/media.md`** for the task commands and recipes.
7
7
 
8
8
  This file covers the **CLI workflow** for media that already exists: uploading files, browsing the library, opening an asset to inspect it, moving / deleting items.
@@ -129,4 +129,4 @@ fimo assets delete <asset-id>
129
129
 
130
130
  1. Upload with `fimo assets upload` or generate with a task command such as `fimo image generate`.
131
131
  2. Keep the returned `url` (for direct use) or `id` (to attach to a `media` content-type field).
132
- 3. To use in JSX, see `fimo/references/ui.md` — schema media → `<Image>` / `<Video>`, hardcoded URLs → `<StaticImage>`. **Never** use raw `<img src={asset.url}>`.
132
+ 3. To use in application code, run `npx fimo@latest skills get fimo-code --ref ui` and load the detected framework reference: schema media → `<Image>` / `<Video>`, deliberate non-schema URLs → `<StaticImage>`. Never use raw `<img src={asset.url}>` for tracked media.
@@ -2,19 +2,19 @@
2
2
 
3
3
  > **Run via `npx fimo@latest <command>`** — always the latest CLI, no install needed.
4
4
 
5
- > For the JSON shape, field types, Tiptap node spec, slug rules, and generated React Query hooks — these are package surface (version-locked to the project's `fimo`). See **`fimo/references/content.md`**.
5
+ > Package contract: load the version-locked `fimo-code` skill with `npx fimo@latest skills get fimo-code`, then fetch its nested content and detected-framework references for schema JSON, entry values, generated clients, and imports.
6
6
 
7
7
  This file covers the **CLI workflow** for content. Use it when the user wants to add a content type (blog, products, pages) or manage Singles and entries.
8
8
 
9
9
  ## Flow
10
10
 
11
- 1. Write `src/schemas/{Uid}.json` — PascalCase filename (e.g. `BlogPost.json`). For the JSON shape and field types, load `fimo/references/content.md`.
12
- 2. Run `fimo schemas push {Uid}`. It generates `src/schemas/{Uid}.types.ts` and `src/schemas/{Uid}.ts`, then registers the schema with Fimo. It does not run whole-project validation.
13
- 3. App code imports the generated client from `@/schemas/{Uid}`, not from `.types.ts` directly. See `fimo/references/content.md` for the hook API.
11
+ 1. Write `src/schemas/{Uid}.json` — PascalCase filename (e.g. `BlogPost.json`). Run `npx fimo@latest skills get fimo-code --ref content/schema` for the JSON contract.
12
+ 2. Run `fimo schemas push {Uid}`. It registers the schema and generates the framework-specific public modules. It does not run whole-project validation.
13
+ 3. App code imports generated public modules, never `.types.ts` directly. Load the detected framework reference before choosing server modules, client modules, hooks, or a registry.
14
14
  4. Seed collections via `fimo entries create`, or update one-off content via `fimo singles update`. Generate cover images first with `fimo image generate` if needed (see `media.md` / `assets.md`).
15
- 5. Write React pages that import from `@/schemas/{Uid}` and render with `fimo/ui` components.
15
+ 5. Render tracked fields with the detected framework's Fimo primitives.
16
16
 
17
- Steps 1, 3, and 5 reference the `fimo-code` skill (`npx fimo@latest skills get fimo-code`) for shape and React API. Steps 2 and 4 are CLI commands documented here.
17
+ Steps 1, 3, and 5 use `fimo-code`; steps 2 and 4 are CLI workflows documented here.
18
18
 
19
19
  ## Schema CLI commands
20
20
 
@@ -34,9 +34,9 @@ The command is `fimo schemas` (plural). There is no singular `fimo schema` alias
34
34
 
35
35
  All commands accept `-C, --cwd <dir>` to point at a different project directory.
36
36
 
37
- Blocks schemas support at most 7 nested `blocks` levels, 40 variants in one `schema.oneOf`, and `min` or `max` values up to 200 items per blocks field. Load `fimo/references/content.md` for the complete blocks JSON shape.
37
+ Blocks schemas support at most 7 nested `blocks` levels, 40 variants in one `schema.oneOf`, and `min` or `max` values up to 200 items per blocks field. Run `npx fimo@latest skills get fimo-code --ref content/schema` for the complete blocks JSON shape.
38
38
 
39
- Schema transitions are automatic. Adding optional fields and changing labels preserve content. A new required field backfills its `default` only where existing values need it; the push fails safely when no default can satisfy existing content. Removing a nested field or block variant removes only those values. `string` and `text` preserve values in both directions. Other primitive changes convert safe values and reject unsafe ones without changing the schema or entries. Lowering block `max` trims from the end; raising `min` fills from the blocks `default` templates. A reference target change clears its connections. Use repeatable `--rename old.path=new.path` arguments when a field moved by name so the one-time migration preserves its values; the operation is not stored in schema JSON. Collection-to-Single removes that type's entries and cleans inbound references; Single-to-collection preserves its entry. Run `fimo validate` after pushing.
39
+ Schema transitions are automatic. Adding optional fields and changing labels preserve content. A new required field backfills its `default` only where existing values need it; the push fails safely when no default can satisfy existing content. Removing a nested field or block variant removes only those values. `string` and `text` preserve values in both directions. Other primitive changes convert safe values and reject unsafe ones without changing the schema or entries. Lowering block `max` trims from the end; raising `min` fills from the blocks `default` templates. A reference target change clears its connections. Use repeatable `--rename old.path=new.path` arguments when a field moved by name so the one-time migration preserves its values; the operation is not stored in schema JSON. Collection-to-Single removes that type's entries and cleans inbound references; Single-to-collection preserves its entry.
40
40
 
41
41
  ## Singles CLI commands
42
42
 
@@ -76,7 +76,7 @@ fimo entries bulk-update <TypeName> (--file <path> | --stdin)
76
76
  fimo entries bulk-delete <TypeName> (--ids <id1>,<id2> | --where '<json>') [--locale es]
77
77
  ```
78
78
 
79
- `--body` is a **required** option on `create` and `update`. Its JSON shape (where `slug` goes, how `media` fields look, Tiptap richtext format) lives in `fimo/references/content.md`. **Always read that first before constructing an entry payload — slug must be inside `data`, media has a specific shape, richtext must be Tiptap JSONContent.**
79
+ `--body` is a **required** option on `create` and `update`. Run `npx fimo@latest skills get fimo-code --ref content/richtext` before constructing an entry payload: slug belongs inside `data`, media has a specific shape, and richtext must be Tiptap JSONContent.
80
80
 
81
81
  `entries list` accepts the same read query surface as generated hooks:
82
82
 
@@ -100,7 +100,7 @@ Reference filters take the target `id` string (`{"author":"750e..."}`). On a to-
100
100
 
101
101
  Polymorphic references declare `targets: ["Post", "Product"]` instead of `target` (never both) and their values carry both parts: `{ "contentType": "Post", "id": "..." }`. Populate returns mixed full entries, and generated hooks expose `$type` on each populated value to branch on. `--where` on polymorphic fields is not supported yet and fails with a clear error.
102
102
 
103
- In generated React code, the equivalent is `populate: ['author', 'contributors'] as const` in the schema hook/query params. Let hooks infer the result when possible; if a named TypeScript shape is needed, use the generated `BlogPostResult<TFields, TPopulate>` type documented in `fimo/references/content.md`. Writes use the separate generated `BlogPostInput` type.
103
+ In generated application code, the equivalent is `populate: ['author', 'contributors'] as const` in query params. Let the generated client infer the result when possible; if a named TypeScript shape is needed, use `BlogPostResult<TFields, TPopulate>` as documented by `npx fimo@latest skills get fimo-code --ref content/clients`. Writes use `BlogPostInput`.
104
104
 
105
105
  ### Read-only SQL
106
106
 
@@ -191,7 +191,7 @@ fimo entries bulk-delete BlogPost --where '{"archived":true}'
191
191
 
192
192
  Each bulk request handles at most 1,000 entries. Missing requested IDs do not fail valid work: the CLI prints a warning, and `--json` includes both a top-level `warnings` array and the exact IDs in `data.meta.missing`. Bulk writes use the same validation, locale, reference, and content-change paths as singular entry writes. They apply entries one at a time. Recoverable create and update errors report how many earlier entries were already changed.
193
193
 
194
- For reference schema JSON and entry value shape, load `fimo/references/content.md` § Reference fields. The short version:
194
+ For reference schema JSON and entry value shape, run `npx fimo@latest skills get fimo-code --ref content/schema`. The short version:
195
195
 
196
196
  ```json
197
197
  {
@@ -253,32 +253,18 @@ Rules:
253
253
 
254
254
  Turning an existing field shared is destructive when the languages currently hold different values. The push collapses each document to its default-locale value and discards the others; there is no prompt and no undo. Most documents already agree, so most collapses change nothing — but tell the user what will happen before adding `"i18n": false` to a field that already holds content, and check whether the languages differ if you are unsure.
255
255
 
256
- Use `"isSingleton": true` for a Single with exactly one set of content. Generated Single clients expose `get`/`update` and their React Query hooks, not collection create/remove APIs.
256
+ Use `"isSingleton": true` for a Single with exactly one set of content. Generated Single clients expose `get`/`update` and client hooks where the framework supports them, not collection create/remove APIs.
257
257
 
258
258
  ## "Add a blog" recipe
259
259
 
260
- 1. Load `fimo/references/content.md` for the JSON shape and field types.
260
+ 1. Run `npx fimo@latest skills get fimo-code --ref content/schema` for the JSON shape and field types.
261
261
  2. Write `src/schemas/BlogPost.json` with fields `title`, `body` (richtext), `coverImage` (media), etc. Do NOT declare a `slug` field — `slug` (and `id`, `entryId`, `documentId`, `locale`, `createdAt`, `updatedAt`, `__fimo`) is reserved entry metadata and will be rejected; every entry gets a `slug` for free.
262
262
  3. Run `fimo schemas push BlogPost`.
263
263
  4. Generate cover images: `fimo image generate --prompt "..." --aspect-ratio 16:9` (see `media.md`).
264
264
  5. Seed entries: `fimo entries create BlogPost --body '{"data": {"slug": "first-post", "title": "...", "coverImage": {...}}}'`.
265
- 6. Load `fimo/references/ui.md` for the `<Text>`, `<Image>`, `<RichText>` components.
266
- 7. Load `fimo/references/labels.md` for wrapping labels in `t()`.
267
- 8. Write the React page using the generated `useGet()` hook from `@/schemas/BlogPost`.
268
-
269
- ## When to run sync manually
270
-
271
- `fimo schemas push`, `fimo validate`, and the `fimo/vite` development watcher all reuse the same schema generator. Production builds do not rewrite generated source files. `schemas push` does not run route, label, agent, form, or project-wide checks. For a full local validation and codegen pass without updating the remote schema, use:
272
-
273
- ```bash
274
- fimo validate # runs all phases: codegen, lint, route validation, label checks
275
- ```
276
-
277
- Advanced/internal (hidden from `fimo --help`) — for the bare regen phase:
278
-
279
- ```bash
280
- fimo scripts sync-schemas # regenerate src/schemas/*.types.ts and src/schemas/*.ts
281
- ```
265
+ 6. Run `npx fimo@latest skills get fimo-code --ref ui` and load the detected framework reference for rendering primitives.
266
+ 7. Run `npx fimo@latest skills get fimo-code --ref labels` and load the detected framework reference for labels.
267
+ 8. Load the detected framework reference, then build the page with its generated server or client surface.
282
268
 
283
269
  ## Non-interactive use
284
270
 
@@ -77,5 +77,5 @@ The scoped view still emits the project-level metadata header (name, framework,
77
77
  ## Notes for AI tools
78
78
 
79
79
  - The JSON shape is stable; parse it rather than scraping the human output when you need a specific field.
80
- - The `framework` field is detected from `package.json#dependencies` (v1 detector). For multi-framework projects or unusual setups, the field may be `null` — fall back to reading `package.json` yourself.
80
+ - The `framework` field uses Fimo's shared Vercel filesystem detector, which considers package dependencies, configuration files, and framework-specific file layout. For unusual or deliberately mixed projects it may be `null`; inspect `package.json` and the application tree before choosing a framework reference.
81
81
  - The command runs in any directory that contains `.fimo/project.json` or one of its ancestors. If you're not in a Fimo project, `describe` will run against whatever directory you point it at (it doesn't require Fimo credentials).
@@ -2,16 +2,16 @@
2
2
 
3
3
  > **Run via `npx fimo@latest <command>`** — always the latest CLI, no install needed.
4
4
 
5
- > For the JSON spec, generated Zod schema, submit helper signature, and React usage patterns — these are package surface (version-locked to the project's `fimo`). See **`fimo/references/forms.md`**.
5
+ > Package contract: run `npx fimo@latest skills get fimo-code --ref forms` for the JSON spec, generated Zod schema, submit helper, and application usage.
6
6
 
7
7
  This file covers the **CLI workflow** for forms. Use it when the user wants to add a contact form, signup, feedback form, etc.
8
8
 
9
9
  ## Flow
10
10
 
11
- 1. Write `src/forms/{name}.json` — kebab-case filename (e.g. `contact-us.json`). For the JSON spec and field types, load `fimo/references/forms.md`.
11
+ 1. Write `src/forms/{name}.json` — kebab-case filename (e.g. `contact-us.json`). For the JSON spec and field types, run `npx fimo@latest skills get fimo-code --ref forms`.
12
12
  2. Register with `fimo forms push {name}` — creates the form, obtains its `id`, patches it back into the JSON file.
13
- 3. Pre-build generates `src/forms/{name}.ts` (Zod schema + `submitX` helper). See `fimo/references/forms.md` for the generated API.
14
- 4. Write a React component that imports from `@/forms/{name}`.
13
+ 3. Pre-build generates `src/forms/{name}.ts` (Zod schema + `submitX` helper). Use the same `fimo-code` reference for the generated API.
14
+ 4. Write the application form using the generated `@/forms/{name}` module and the existing framework conventions.
15
15
 
16
16
  Steps 1, 3, and 4 reference the `fimo-code` skill (`npx fimo@latest skills get fimo-code`). Step 2 is the CLI command.
17
17
 
@@ -45,12 +45,12 @@ Use this when the user asks "who filled out the contact form?", "how many signup
45
45
 
46
46
  ## "Add a contact form" recipe
47
47
 
48
- 1. Load `fimo/references/forms.md` for the JSON spec.
48
+ 1. Run `npx fimo@latest skills get fimo-code --ref forms` for the JSON spec.
49
49
  2. Write `src/forms/contact-us.json` with the required fields.
50
50
  3. Run `fimo forms push contact-us` — the `id` is patched back into the JSON automatically.
51
- 4. Load `fimo/references/forms.md` for the generated `submitContactUs` + `ContactUsSchema` API.
52
- 5. Load `fimo/references/labels.md` for wrapping form labels in `t()`.
53
- 6. Write the React form component that imports from `@/forms/contact-us`.
51
+ 4. Use the same `fimo-code` forms reference for the generated `submitContactUs` + `ContactUsSchema` API.
52
+ 5. Run `npx fimo@latest skills get fimo-code --ref labels` and load the detected framework reference for form labels.
53
+ 6. Write the application form using the generated `@/forms/contact-us` module.
54
54
 
55
55
  **Register BEFORE writing app code that depends on the form** — otherwise the generated `.ts` doesn't exist and the runtime fetch 404s.
56
56
 
@@ -74,7 +74,7 @@ Pass `--project-id <id>` to link an EXISTING project instead of creating one. Th
74
74
  - `.fimo/project.json` — links this directory to the remote project (read-only after creation)
75
75
  - `.fimo/config.json` — project, route, locale, SEO, and agent policy
76
76
  - `.fimo/agents/` — versioned agent bundles
77
- - `.env` — initial env vars (currently just `VITE_API_URL`)
77
+ - `.env` — tenant content API URLs for Vite and Next runtimes
78
78
  - `AGENTS.md` + `CLAUDE.md` — project rules (from the template) read by AGENTS.md-compatible tools and Claude Code. Both point the agent at `fimo skills get` to load the real skills on demand.
79
79
  - A git repository with `fimo` as the remote, and — after dependencies install — an initial commit (including the lockfile) plus an initial push
80
80
 
@@ -119,10 +119,11 @@ After `fimo init` completes, the project root has `AGENTS.md` (universal) and `C
119
119
 
120
120
  1. `cd <project-dir>` — switch into the new project.
121
121
  2. `Read` the project rules file: `AGENTS.md` (or `CLAUDE.md` if you're Claude Code).
122
- 3. Load the code skill on demand: `npx fimo@latest skills get fimo-code`.
123
- 4. From the `fimo-code` skill's "load these references up front" section, batch-read the referenced docs (`npx fimo@latest skills get fimo-code --ref content`, `--ref forms`, `--ref assets`, `--ref labels`, `--ref locales`, `--ref ui`) before generating any significant code.
122
+ 3. Run `npx fimo@latest describe --json` and read the detected framework, schemas, locales, and tree.
123
+ 4. Load the code skill on demand: `npx fimo@latest skills get fimo-code`.
124
+ 5. Follow its decision tree and load only the task reference plus the detected framework reference. For Next.js, start with `npx fimo@latest skills get fimo-code --ref frameworks/next`, then load App Router, Pages Router, or locales only when the project shape requires it.
124
125
 
125
- Once those are in context, generation respects the project's conventions (schemas, `t()`, `fimo/ui` components, asset handling).
126
+ Do not batch-load every reference. Progressive disclosure keeps unrelated framework and product guidance out of the coding context.
126
127
 
127
128
  ## Adding another AI tool to an existing project later
128
129
 
@@ -2,14 +2,14 @@
2
2
 
3
3
  > **Run via `npx fimo@latest <command>`** — always the latest CLI, no install needed.
4
4
 
5
- > For the `t()` helper signature, `useLabels()` hook, key naming rules, and the "wrap every user-facing string" rule, see **`fimo/references/labels.md`**.
5
+ > Package contract: run `npx fimo@latest skills get fimo-code --ref labels` for the `t()` contract and key rules, then load the detected framework reference for its label readers.
6
6
  > For locale configuration and route-prefix validation, see **`references/locales.md`**.
7
7
 
8
8
  This file covers the **CLI workflow** for labels: static UI copy such as nav items, buttons, headings, placeholders, alt text, and SEO strings.
9
9
 
10
10
  ## What validate does
11
11
 
12
- `fimo validate` scans `src/**/*.{ts,tsx,js,jsx}` for `t('literal-key')` calls (skipping `src/ui` and `node_modules`) and verifies every key has a value in the tenant DB for the default locale.
12
+ `fimo validate` scans `src/**/*.{ts,tsx,js,jsx}` for literal `t('key')` calls, including server readers such as `labels.t('key')` (skipping `src/ui` and `node_modules`), and verifies every key has a value in the tenant DB for the default locale.
13
13
 
14
14
  The database is the source of truth for visible label values. Code declares keys; it does not create visible copy.
15
15
 
@@ -61,9 +61,9 @@ Prefer `fimo validate` — this primitive is for narrow debugging/test use.
61
61
 
62
62
  ## Workflow
63
63
 
64
- 1. Write JSX with `t('key')` calls. Load `fimo/references/labels.md` for the rules.
64
+ 1. Write code with literal `t('key')` calls. Run `npx fimo@latest skills get fimo-code --ref labels` and load the detected framework reference.
65
65
  2. Run `fimo validate`.
66
66
  3. Add missing values with `fimo labels set` or `fimo labels set-many`.
67
67
  4. Editors can now change copy in the Fimo admin without code changes.
68
68
 
69
- For the helper signatures, hooks, and code patterns, **always** load `fimo/references/labels.md` before writing code that uses `t()`.
69
+ For helper signatures and code patterns, run `npx fimo@latest skills get fimo-code --ref labels` before writing code that uses `t()`.
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **Run via `npx fimo@latest <command>`** — always the latest CLI, no install needed.
4
4
 
5
- This file covers CLI-side locale configuration and validation. For code helpers such as `fimoRoutes()` and `FimoLink`, load `fimo/references/locales.md`.
5
+ This file covers CLI-side locale configuration and validation. For code integration, run `npx fimo@latest skills get fimo-code --ref locales` plus the detected framework's locale reference.
6
6
 
7
7
  ## Configure Locales
8
8
 
@@ -65,13 +65,13 @@ Do not add `/es/pricing` as a second Fimo route. The route selector localizes ca
65
65
  import { fimoRoutes } from 'fimo/react-router/routes';
66
66
  ```
67
67
 
68
- For custom frameworks, the project may implement its own URL scheme, but it still needs to pass the active locale into Fimo and keep canonical route metadata if it wants Fimo Studio route selection to work.
68
+ For every framework, the application owns its URL scheme and passes the resolved locale into Fimo. Canonical route metadata is optional unless the project wants Fimo Studio route selection/navigation.
69
69
 
70
70
  ## Migrate An Existing Locale System
71
71
 
72
72
  Inspect the existing locale provider, route table, switcher, redirects, and public URLs before editing configuration. Preserve working URL behavior during the migration.
73
73
 
74
- For React Router projects, prefer one contract based on `.fimo/config.json`, `fimoRoutes()`, and `FimoLink`; migrate existing wrappers into the framework root instead of layering a second locale context. If that would change established URLs, keep the custom router temporarily, pass its active locale to `FimoProviders`, and ask the user to choose canonical URLs and redirects before rewriting routes.
74
+ Preserve the existing locale provider, router, switcher, redirects, and public URLs. Use framework helpers only when they fit that architecture. Next.js projects run `npx fimo@latest skills get fimo-code --ref frameworks/next/locales`; React Router projects load the React Router setup reference.
75
75
 
76
76
  ## Labels And Content
77
77
 
@@ -45,7 +45,7 @@ Secrets are not written to `.env.local`, preview app env files, browser bundles,
45
45
 
46
46
  ## Local Env Files
47
47
 
48
- `fimo init` writes `.env` for bootstrap app runtime values such as `VITE_API_URL`. This lets `pnpm dev` work without a Fimo wrapper.
48
+ `fimo init` writes `.env` with tenant content API URLs for Vite and Next runtimes. This lets the framework's normal dev command work without a Fimo wrapper.
49
49
 
50
50
  `fimo vars add`, `fimo vars update`, and `fimo vars pull` write public project variables to a managed block in `.env.local`.
51
51