fimo 0.8.0 → 0.9.0-staging.1

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 (44) hide show
  1. package/assets/content-templates/hooks-template.eta +4 -2
  2. package/assets/content-templates/types-template.eta +66 -1
  3. package/assets/skills/fimo/SKILL.md +17 -54
  4. package/assets/skills/fimo-cli/SKILL.md +21 -17
  5. package/assets/skills/fimo-cli/references/agent-setup.md +36 -53
  6. package/assets/skills/fimo-cli/references/agents.md +4 -4
  7. package/assets/skills/fimo-cli/references/content.md +62 -3
  8. package/assets/skills/fimo-cli/references/deploy.md +1 -1
  9. package/assets/skills/fimo-cli/references/forms.md +1 -1
  10. package/assets/skills/fimo-cli/references/init.md +16 -24
  11. package/assets/skills/fimo-cli/references/integrations/firecrawl.md +20 -4
  12. package/assets/skills/fimo-cli/references/integrations.md +5 -1
  13. package/assets/skills/fimo-cli/references/project-vars-and-secrets.md +14 -11
  14. package/assets/skills/fimo-cli/references/projects.md +1 -1
  15. package/assets/skills/fimo-cli/references/support.md +11 -9
  16. package/assets/skills/fimo-cli/references/webhooks.md +164 -0
  17. package/assets/skills/fimo-code/SKILL.md +67 -0
  18. package/assets/skills/{fimo → fimo-code}/references/content.md +86 -15
  19. package/assets/skills/fimo-studio/SKILL.md +5 -3
  20. package/assets/skills/fimo-studio/references/cms.md +9 -1
  21. package/assets/skills/fimo-studio/references/webhooks.md +42 -0
  22. package/dist/cli/bundle.json +1 -1
  23. package/dist/cli/index.js +306 -297
  24. package/dist/runtime/content/client/createContentClient.js +2 -1
  25. package/dist/runtime/content/client/internal.js +1 -0
  26. package/dist/runtime/content/client/types.d.ts +16 -0
  27. package/dist/scripts/validate-schemas.js +42 -1
  28. package/package.json +1 -1
  29. package/release.json +2 -2
  30. package/scripts/postinstall.mjs +11 -65
  31. package/templates/react-router/AGENTS.md +44 -0
  32. package/templates/react-router/CLAUDE.md +5 -0
  33. package/templates/react-router/package.json +1 -1
  34. package/assets/agents-starter/AGENTS.md +0 -66
  35. /package/assets/skills/{fimo → fimo-code}/assets/react-router-locales/navigation.tsx +0 -0
  36. /package/assets/skills/{fimo → fimo-code}/assets/react-router-locales/routes.ts +0 -0
  37. /package/assets/skills/{fimo → fimo-code}/references/assets.md +0 -0
  38. /package/assets/skills/{fimo → fimo-code}/references/design.md +0 -0
  39. /package/assets/skills/{fimo → fimo-code}/references/forms.md +0 -0
  40. /package/assets/skills/{fimo → fimo-code}/references/labels.md +0 -0
  41. /package/assets/skills/{fimo → fimo-code}/references/locales.md +0 -0
  42. /package/assets/skills/{fimo → fimo-code}/references/setup-plain-vite.md +0 -0
  43. /package/assets/skills/{fimo → fimo-code}/references/setup-react-router.md +0 -0
  44. /package/assets/skills/{fimo → fimo-code}/references/ui.md +0 -0
@@ -4,9 +4,11 @@
4
4
  <% if (model.isSingleton) { -%>
5
5
  import { createSingletonClient } from "fimo/ui";
6
6
  import type { SingletonContentClient } from "fimo/ui";
7
+ import type { ContentSchema } from "fimo/ui";
7
8
  <% } else { -%>
8
9
  import { createContentClient } from "fimo/ui";
9
10
  import type { CollectionContentClient } from "fimo/ui";
11
+ import type { ContentSchema } from "fimo/ui";
10
12
  <% } -%>
11
13
 
12
14
  import schema from "./<%= model.uid %>.json";
@@ -39,13 +41,13 @@ const client: SingletonContentClient<<%= model.pascal %>, <%= model.pascal %>Inp
39
41
  <%= model.pascal %>,
40
42
  <%= model.pascal %>Input
41
43
  >({
42
- schema,
44
+ schema: schema as unknown as ContentSchema,
43
45
  <% } else { -%>
44
46
  const client: CollectionContentClient<<%= model.pascal %>, <%= model.pascal %>Input> = createContentClient<
45
47
  <%= model.pascal %>,
46
48
  <%= model.pascal %>Input
47
49
  >({
48
- schema,
50
+ schema: schema as unknown as ContentSchema,
49
51
  <% } -%>
50
52
  <% if (model.referenceImports && model.referenceImports.length > 0) { -%>
51
53
  references: { <%= model.referenceImports.map((referenceImport) => referenceImport.pascal).join(", ") %> },
@@ -70,7 +70,7 @@ if (model.fields) {
70
70
  Object.entries(model.fields).forEach(([key, field]) => {
71
71
  const type = getInputTypeForField(field);
72
72
  -%>
73
- <%= key %><%= field.required ? '' : '?' %>: <%= type %>;
73
+ <%= key %><%= isRequiredField(field) ? '' : '?' %>: <%= type %>;
74
74
  <%
75
75
  });
76
76
  }
@@ -85,6 +85,7 @@ if (model.fields) {
85
85
  function getTypeForField(field) {
86
86
  switch(field.type) {
87
87
  case 'string':
88
+ case 'text':
88
89
  return 'FimoString';
89
90
  case 'richtext':
90
91
  return 'FimoRichText';
@@ -102,6 +103,8 @@ function getTypeForField(field) {
102
103
  const raw = Array.isArray(field.targets) && field.targets.length > 0 ? 'FimoPolymorphicReference' : 'FimoReference';
103
104
  return field.many ? `${raw}[]` : `${raw} | null`;
104
105
  }
106
+ case 'blocks':
107
+ return getBlocksType(field, false);
105
108
  default:
106
109
  return 'any';
107
110
  }
@@ -110,6 +113,7 @@ function getTypeForField(field) {
110
113
  function getInputTypeForField(field) {
111
114
  switch(field.type) {
112
115
  case 'string':
116
+ case 'text':
113
117
  return 'string';
114
118
  case 'richtext':
115
119
  return 'FimoRichTextContent';
@@ -129,10 +133,71 @@ function getInputTypeForField(field) {
129
133
  const raw = Array.isArray(field.targets) && field.targets.length > 0 ? 'FimoPolymorphicReference' : 'FimoReference';
130
134
  return field.many ? `${raw}[]` : `${raw} | null`;
131
135
  }
136
+ case 'blocks':
137
+ return getBlocksType(field, true);
132
138
  default:
133
139
  return 'unknown';
134
140
  }
135
141
  }
142
+
143
+ function getNestedFieldType(field, input) {
144
+ switch(field.type) {
145
+ case 'string':
146
+ case 'text':
147
+ return 'string';
148
+ case 'richtext':
149
+ return 'FimoRichTextContent';
150
+ case 'number':
151
+ return 'number';
152
+ case 'boolean':
153
+ return 'boolean';
154
+ case 'date':
155
+ return 'string';
156
+ case 'json':
157
+ case 'media':
158
+ return 'Record<string, unknown>';
159
+ case 'reference': {
160
+ const raw = Array.isArray(field.targets) && field.targets.length > 0 ? 'FimoPolymorphicReference' : 'FimoReference';
161
+ return field.many ? `${raw}[]` : `${raw} | null`;
162
+ }
163
+ case 'blocks':
164
+ return getBlocksType(field, input);
165
+ default:
166
+ return 'unknown';
167
+ }
168
+ }
169
+
170
+ function getBlockObjectType(fields, input, metadata = {}) {
171
+ const properties = [];
172
+ if (metadata.key) {
173
+ properties.push(`_key${input ? '?' : ''}: string`);
174
+ }
175
+ if (metadata.type) {
176
+ properties.push(`_type: "${metadata.type}"`);
177
+ }
178
+ for (const [key, field] of Object.entries(fields || {})) {
179
+ properties.push(`${key}${isRequiredField(field) ? '' : '?'}: ${getNestedFieldType(field, input)}`);
180
+ }
181
+ return `{ ${properties.join('; ')} }`;
182
+ }
183
+
184
+ function getBlocksType(field, input) {
185
+ const schema = field.schema || {};
186
+ let item;
187
+ if (Array.isArray(schema.oneOf)) {
188
+ item = schema.oneOf
189
+ .map((variant) => getBlockObjectType(variant.fields, input, { key: true, type: variant.uid }))
190
+ .join(' | ') || 'never';
191
+ item = `(${item})`;
192
+ } else {
193
+ item = getBlockObjectType(schema.fields, input, { key: true });
194
+ }
195
+ return `${item}[]`;
196
+ }
197
+
198
+ function isRequiredField(field) {
199
+ return Boolean(field.required || (field.type === 'blocks' && Number(field.min || 0) > 0));
200
+ }
136
201
  -%>
137
202
 
138
203
  export interface <%= model.pascal %>References {
@@ -1,67 +1,30 @@
1
1
  ---
2
2
  name: fimo
3
3
  description: >-
4
- How to write code in a Fimo project — the npm package surface. Load when
5
- writing JSX that renders schema content, defining schemas or forms (JSON),
6
- using `t()` for labels, plugging media into `fimo/ui` components,
7
- or applying the project's code conventions. CLI commands and workflows
8
- (push, deploy, sync, etc.) live in the `fimo-cli` skill.
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
7
+ code, running CLI/deploy workflows, using the dashboard, or migrating a site.
9
8
  ---
10
9
 
11
10
  # Fimo
12
11
 
13
- You are writing code in a Fimo project — a content + media + forms + analytics platform for React websites with a CMS dashboard. This skill describes the **`fimo` npm package surface** as installed in this specific project: what's exported from `fimo`, `fimo/ui`, `fimo/vite`; the JSON shapes you write; the generated React Query hooks and Zod schemas you import; and the code conventions for using them.
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.
14
14
 
15
- This skill is version-locked to this project's installed `fimo` package — the shapes here match what your code can actually use.
15
+ When you are about to do Fimo work:
16
16
 
17
- For CLI commands and workflows (creating a project, pushing schemas/forms, deploying, managing labels, etc.), the **`fimo-cli`** skill is the source of truth. Run every CLI command as `npx fimo@latest <command>` (always the latest, no global install). If `fimo-cli` isn't loaded for your AI tool, register it with `npx fimo@latest skills install --mode=copy`.
17
+ 1. List what's available: `npx fimo@latest skills list`
18
+ 2. Load the relevant skill: `npx fimo@latest skills get <name>` (add `--ref <doc>` for a reference doc)
18
19
 
19
- ## Critical: NEVER hardcode user-facing things
20
+ Pick by task:
20
21
 
21
- This is the load-bearing rule for every code change. **Fimo's whole point is that content editors edit content in the dashboard, not in code.** Anything hardcoded breaks that.
22
+ - Writing code — schema-driven JSX, schemas/forms JSON, `t()` labels, `fimo/ui` media → `fimo-code`
23
+ - CLI commands and workflows — push, deploy, sync, labels, domains, analytics → `fimo-cli`
24
+ - The Fimo Studio dashboard / web app UI → `fimo-studio`
25
+ - Migrating an existing site into Fimo → `fimo-migration`
22
26
 
23
- - **Content** (posts, products, pages, lists, anything structured) → declare a schema, render collections with generated `useList()` or `useInfiniteList()` hooks + `fimo/ui` components. Use `useGet()` only for legacy fixed array queries. **Never** write `const posts = [...]` in JSX.
24
- - **Strings** (labels, CTAs, headings, descriptions, any visible text) → wrap in `t('key')` and create the default-locale value with `fimo labels set`. Use `--locale <locale>` only when intentionally writing a non-default locale. **Never** write `<h1>Welcome</h1>` directly — write `<Text value={t('home.title')} as="h1" />`.
25
- - **Media** (images, videos, files) → use `<Image>` / `<Video>` from `fimo/ui` for schema media, `<StaticImage>` for hard-coded URLs. **Never** use `<img src={...}>`.
26
- - **Forms** → use the generated Zod schema + `submitX` helper from `@/forms/<name>`. Never hand-roll fetch or validation.
27
+ If a confirmed Fimo platform failure or missing capability materially blocks the task, finish or safely preserve the main work first, then use the built-in `supportReport` tool. Load the `fimo-cli` support instructions for the reporting criteria.
27
28
 
28
- If you find yourself about to hardcode anything user-facing, **stop and use the appropriate Fimo primitive instead.** For pushing the schema/form/asset to the backend, that's CLI territory — see the `fimo-cli` skill.
29
-
30
- ## When starting code work, load these references up front
31
-
32
- These define the package surface for the load-bearing primitives. **Read all six before generating significant code:**
33
-
34
- - `references/content.md` — schema JSON shape, field types, Tiptap nodes, generated React Query hooks
35
- - `references/forms.md` — form JSON spec, generated Zod + `submitX` helper
36
- - `references/assets.md` — `FimoMedia` shape, how to render assets
37
- - `references/labels.md` — `t()` helper, `useLabels()`, wrap rules
38
- - `references/locales.md` — locale routing helpers, `FimoLink`, custom-framework contract
39
- - `references/ui.md` — `fimo/ui` components + JSX code conventions + app code rules
40
-
41
- Workflow / CLI-side concerns (pushing schemas, generating images, managing labels, deploying) live in the **`fimo-cli`** skill's matching references.
42
-
43
- ## Decision Tree (specific tasks)
44
-
45
- - **Setting up Fimo in a new project** — pick the framework:
46
- - React Router framework mode (new projects use React Router 8) → `references/setup-react-router.md`
47
- - Plain Vite + React (or upgrading a legacy v3 project) → `references/setup-plain-vite.md`
48
- - Writing schema JSON / picking field types / Tiptap richtext → `references/content.md`
49
- - Writing form JSON / generated form client / form code → `references/forms.md`
50
- - Plugging media into a component / `FimoMedia` shape → `references/assets.md`
51
- - ANY user-facing string in code → `references/labels.md`
52
- - Locale-aware routes, links, or framework adapters → `references/locales.md`
53
- - ANY JSX rendering schema content or `t()` output → `references/ui.md`
54
- - Major visual / redesign / hero section / brand → `references/design.md`
55
-
56
- ## Anti-Patterns
57
-
58
- - **Hardcoding content in JSX** — `<h1>My Blog</h1>` + an array of posts in code. Use schemas + entries + `t()`.
59
- - **Raw HTML for schema content** — `<img src={post.coverImage.url}>` instead of `<Image value={post.coverImage}>`. The `fimo/ui` components carry metadata for inline editing in the admin.
60
- - **Raw `<a href>` for internal navigation** — causes full page reloads. Use `<FimoLink>` for locale-aware internal links or React Router `<Link>` when intentionally bypassing locale helpers. Reserve `<a>` for external links.
61
- - **Pulling stock photos from external URLs** — editors can't manage them. Use a Fimo media task such as `fimo image generate`.
62
- - **Editing generated `.ts` files** under `src/schemas/` or `src/forms/` — regenerate them through `fimo validate` or the matching push command.
63
- - **Writing raw HTML in `richtext` fields** — must be Tiptap JSONContent.
64
- - **Calling `t()` with a dynamic first argument** — the key must be a string literal so the extractor finds it.
65
- - **Decorating the disposable starter** — `src/pages/Index.tsx` is throwaway scaffolding. On first real generation, replace it entirely.
66
- - **Skipping legal pages** — `Privacy.tsx` + `Terms.tsx` are required for public sites; the template ships them.
67
- - **Showing Fimo branding** in the generated site unless the user explicitly asks for it.
29
+ If the project has an `AGENTS.md` (or `CLAUDE.md`), read it too — it carries project-specific context.
30
+ Always fetch the skill fresh from the CLI rather than trusting a copy.
@@ -4,8 +4,9 @@ description: >-
4
4
  The `fimo` CLI scaffolds and manages Fimo projects from the command line.
5
5
  Load when the user wants to create a new Fimo project, build content
6
6
  (schemas, entries, forms, media, labels/locales), deploy a site, manage
7
- custom domains, check site traffic/analytics, invite collaborators, inspect
8
- AI credits, report a failing or slow Fimo API, rejected documented argument,
7
+ custom domains, configure outbound webhooks and event-driven integrations,
8
+ check site traffic/analytics, invite collaborators, inspect AI credits,
9
+ report a failing or slow Fimo API, rejected documented argument,
9
10
  undocumented workaround, missing capability that blocks work, forces a
10
11
  fragile or heavily manual workaround, or would materially accelerate a
11
12
  recurring workflow, or other Fimo platform problem to support, log in or
@@ -17,15 +18,17 @@ description: >-
17
18
 
18
19
  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.
19
20
 
20
- 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), see the `fimo` skill — its description triggers automatically when the agent is in a Fimo project.
21
+ 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`.
21
22
 
22
23
  Use `fimo <command> --help` for full flag details on any command.
23
24
 
25
+ > **Webhooks are beta.** Verify a destination with `fimo webhooks test <id> --wait` and inspect its delivery history before depending on it in production.
26
+
24
27
  ## Running the CLI: always `npx fimo@latest`
25
28
 
26
29
  Run every command as **`npx fimo@latest <command>`**. It always fetches the latest CLI — no install, nothing to keep up to date, and it can't fall behind and get blocked. Do **not** install `fimo` globally.
27
30
 
28
- The examples in this skill and its references write `fimo <command>` for brevity — mentally prefix them with `npx fimo@latest`. (One exception, because npx has no stable package path to symlink into: install skills with `npx fimo@latest skills install --mode=copy`.)
31
+ The examples in this skill and its references write `fimo <command>` for brevity — mentally prefix them with `npx fimo@latest`.
29
32
 
30
33
  ## Output for agents: `--json` is the stable contract
31
34
 
@@ -52,11 +55,11 @@ A project can have multiple **envs** — each is a git branch _plus_ its own DB,
52
55
 
53
56
  ```bash
54
57
  npx fimo@latest login # authenticate via browser
55
- npx fimo@latest skills install --mode=copy # install Fimo skills for your AI tools (copy mode: required under npx)
58
+ npx fimo@latest skills install # install the global Fimo skill for your AI tools
56
59
  npx fimo@latest init my-site --org <id> # one-stop setup: sign in, create/link a project, install deps + skills. Use the org **id** from `fimo orgs list`, NOT the slug.
57
60
  npx fimo@latest init --project-id <id> my-site # link an EXISTING project instead of creating one
58
61
  npx fimo@latest clone # interactively choose an existing project to clone locally
59
- cd my-site # the `fimo` project skill auto-loads from here
62
+ cd my-site # then load skills on demand: npx fimo@latest skills get fimo-code
60
63
  pnpm dev # run the app locally (use the project's PM: pnpm/npm run/yarn/bun) — your iteration loop
61
64
  npx fimo@latest credits # inspect the owning org's AI credit balance (read-only)
62
65
  npx fimo@latest validate # run all checks + codegen; fails on missing DB labels
@@ -70,21 +73,22 @@ The working loop is local: run the app with the project's package-manager `dev`
70
73
 
71
74
  ## Decision Tree
72
75
 
73
- Load the matching reference when the user's request fires its trigger. Recipes that involve writing code also need the `fimo` skill's package references — they're called out where relevant.
76
+ 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.
74
77
 
75
78
  - "Create a new Fimo project / scaffold a site / start a new website / link an existing project locally" → `references/init.md`
76
- - "Add a content type / blog / products / pages / CMS" → `references/content.md` (workflow) **+ load `fimo/references/content.md` for the JSON shape and React hooks**
77
- - "Add a contact / signup / feedback / newsletter form" → `references/forms.md` (workflow) **+ load `fimo/references/forms.md` for the JSON spec and generated client**
79
+ - "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**
80
+ - "Add a contact / signup / feedback / newsletter form" → `references/forms.md` (workflow) **+ load `fimo-code/references/forms.md` for the JSON spec and generated client**
78
81
  - "View form submissions / who filled out the contact form / inspect what users sent / how many signups" → `references/forms.md` § Reading submissions
79
- - "Upload an image / hero / cover / existing media file" → `references/assets.md` (workflow: upload, browse, open, delete) **+ load `fimo/references/assets.md` 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) **+ load `fimo/references/assets.md` 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) **+ load `fimo/references/labels.md` for the `t()` helper and wrap rules**
82
- - "Enable locales / configure default locale / route by locale prefix / fix locale route validation" → `references/locales.md` **+ load `fimo/references/locales.md` for code helpers**
82
+ - "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**
83
+ - "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**
84
+ - "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**
85
+ - "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**
83
86
  - "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`
84
87
  - "Deploy / publish / go live / push my changes" → `references/deploy.md`
85
88
  - "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`
86
89
  - "Schedule a command / cron / nightly publish / recurring checks / `fimo schedules`" → `references/schedules.md`
87
90
  - "Set env vars / configure API keys / add project secrets / local `.env.local` / `fimo vars` / `fimo secrets`" → `references/project-vars-and-secrets.md`
91
+ - "React to form submissions / publish changes / agent runs / analytics reports / media activity / send events to Resend, Slack, GitHub, Zapier, or an HTTP endpoint / configure or debug outbound webhooks" → `references/webhooks.md`
88
92
  - "Enable provider tools / integrations / API key connection for a provider / agent integration access" → `references/integrations.md`
89
93
  - "Firecrawl / scrape a public website / competitor research / agent web research" → `references/integrations.md` **+ load `references/integrations/firecrawl.md`**
90
94
  - "Check credits / credit balance / can I keep using AI / billing credits / running low / how many credits are left" → `references/credits.md`
@@ -99,7 +103,7 @@ Load the matching reference when the user's request fires its trigger. Recipes t
99
103
  - "Create / scaffold / run / validate / activate / deactivate an agent / agent bundle / list agent templates / view agent runs, reports, or logs (`fimo agents *`)" → `references/agents.md`
100
104
  - "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`
101
105
  - "Refresh / update installed Fimo skills / fimo skills sync / agent missing the latest fimo conventions" → `references/agent-setup.md`
102
- - "Report a Fimo problem or 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 missing capability blocks work, forces a fragile or heavily manual workaround, or would materially accelerate a recurring workflow such as bulk create" → `references/support.md`
106
+ - "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`
103
107
  - "Regenerate rule files / I edited AGENTS.md / fimo rules sync" → `references/agent-setup.md`
104
108
  - "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)
105
109
  - "Mark a date on the analytics chart / annotate the chart with a deploy / add a launch note" → `references/analytics.md` § Annotations
@@ -108,7 +112,7 @@ Load the matching reference when the user's request fires its trigger. Recipes t
108
112
 
109
113
  These fire at specific moments in the project lifecycle. **Surface them proactively** rather than waiting for the user to ask:
110
114
 
111
- - **Right after `fimo init`** → `cd` into the new directory, then `Read` the project's `AGENTS.md` (or `CLAUDE.md` for Claude Code) **and** `.claude/skills/fimo/SKILL.md` (or `.cursor/skills/fimo/SKILL.md` etc. for other agents) to load the project context before generating any code. The new files came into existence mid-session and may not be auto-loaded by the harness. See `references/init.md` § Load the project context.
115
+ - **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.
112
116
  - **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`.
113
117
  - **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.
114
118
  - **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`.
@@ -116,7 +120,7 @@ These fire at specific moments in the project lifecycle. **Surface them proactiv
116
120
  - **Iterative code-only deploys** → once you are deploying, `fimo deploy --no-restart` skips the sandbox dev-server restart on HMR-safe edits. See `references/deploy.md` § Skipping the dev-server restart for when it's safe.
117
121
  - **You need the current preview URL but haven't changed code** (opening it, screenshotting it, handing it to another tool, the previous URL expired) → `fimo preview url`, never a no-op `fimo deploy`. See `references/preview.md`.
118
122
  - **When the user wants to try something risky / explore a redesign without touching the live site** → suggest a feature env: `fimo checkout -b <name>` gives an isolated branch + DB + preview. Deploy previews there, then `fimo merge` it back and `fimo publish`. See `references/branches.md`.
119
- - **When a Fimo API or command still fails after one safe recovery attempt, rejects a documented or previously working argument, needs an undocumented workaround for a supported operation, is repeatedly abnormally slow, or lacks a capability that blocks work, forces a fragile or heavily manual workaround, or would materially accelerate a recurring workflow** → offer to prepare a support report. Show the exact report and wait for explicit approval before running `fimo support report --yes`. See `references/support.md`.
123
+ - **After completing or safely preserving the user's main work, when a confirmed Fimo platform failure still materially blocks the task after one safe recovery attempt, or a confirmed missing capability blocks completion or forces a fragile or heavily manual workaround** → use the built-in `supportReport` tool. Do not wait for the user to ask and do not stop after only describing the gap. See `references/support.md`.
120
124
  - **After the first successful `fimo deploy`** → suggest `fimo invite` if the project involves multiple people. Typical roles: `edit` for developers/content editors, `view` or `comment` for clients/stakeholders, `full` for project leads. See `references/invite.md`.
121
125
  - **When the user wants to modify the URL of their website** → walk through `references/domains.md`. The CLI surface covers renaming the Fimo-provided subdomain (`fimo domains rename-default`, free), attaching a domain they already own (`fimo domains add`, Premium), and buying a new domain through Fimo (`fimo domains buy`, Premium). The auto-generated default URL on every project is a fallback, not a final choice — proactively offer this after `fimo deploy --publish` if the user mentioned a real brand or domain.
122
126
 
@@ -128,7 +132,7 @@ These fire at specific moments in the project lifecycle. **Surface them proactiv
128
132
  - **Running `fimo deploy` just to get a fresh preview URL** — that's a commit + push + sandbox sync for what should be a sub-second read. Use `fimo preview url` instead. See `references/preview.md`.
129
133
  - **Using `fimo deploy --publish` casually** — `--publish` makes the site live to the public. Plain `fimo deploy` (preview) is the default. Use `--publish` only when the user says "ship it" / "go live" / "publish".
130
134
  - **Bare `fimo init` in a non-interactive shell** — will hang. Always pass `[dir]`, `--no-install` (or `--install`), `--no-skills` (or `--skills`), and `--org`/`--agents` as needed explicitly when scripted.
131
- - **Hardcoding content / strings / images in code** — that's what schemas, `t()`, and the media library are for. See the `fimo` skill's anti-patterns.
135
+ - **Hardcoding content / strings / images in code** — that's what schemas, `t()`, and the media library are for. See the `fimo-code` skill's anti-patterns.
132
136
  - **Adding another deploy tool (Vercel, Netlify, Cloudflare Pages)** — Fimo handles deploys; don't bolt another platform on.
133
137
  - **Committing secrets** — hidden values use `fimo secrets`; public browser-safe values use `fimo vars`. Local env files are ignored and must not become deploy inputs.
134
138
  - **Hardcoding tokens in flags** — use the credentials written by `fimo login` (one file per backend at `~/.config/fimo/credentials/<host>-<hash>.json`).
@@ -2,75 +2,59 @@
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 three layers:
5
+ Fimo wires up to AI coding tools in two layers:
6
6
 
7
- 1. **Global skills** — `fimo-cli`, `fimo-studio`, and `fimo-migration` skills installed once per user, machine-wide. They describe the CLI workflows, the Fimo Studio web app, and URL/source-backed migrations, and load in any compatible AI tool.
8
- 2. **Per-project rule files** — `AGENTS.md` (universal) plus per-agent variants (`CLAUDE.md`, `.cursor/rules/fimo.mdc`, `.windsurfrules`, `GEMINI.md`, `.claude/settings.json`) generated for the AI tools each project supports.
9
- 3. **Project-scope `fimo` skill** — the code-side skill (npm package surface: schemas, forms, `t()`, `fimo/ui` components) installed under `.claude/skills/fimo/`, `.cursor/skills/fimo/`, etc., **version-locked to the project's installed `fimo` package**.
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`.
10
9
 
11
- Two CLI namespaces manage all three:
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:
12
11
 
13
- - `fimo skills install / sync / uninstall` — skill artifacts (layers 1 + 3)
14
- - `fimo rules sync` — rule files (layer 2)
12
+ ```bash
13
+ npx fimo@latest skills list # what's available
14
+ npx fimo@latest skills get fimo-code # writing code: schemas, forms, labels, fimo/ui
15
+ npx fimo@latest skills get fimo-cli # CLI + workflows (this skill)
16
+ npx fimo@latest skills get fimo-cli --ref deploy # a reference doc
17
+ ```
15
18
 
16
- ## Set up skills (no install needed)
19
+ Two CLI namespaces manage the two layers:
17
20
 
18
- Run the CLI via `npx fimo@latest` — do not install `fimo` globally. To set up the Fimo skills for your AI tools, use **copy mode** (npx runs from an ephemeral cache with no stable package path to symlink into):
21
+ - `fimo skills install / sync / uninstall` — the single global bootstrap skill (layer 1)
22
+ - `fimo rules sync` — per-project rule files (layer 2)
19
23
 
20
- ```bash
21
- npx fimo@latest skills install --mode=copy
22
- ```
24
+ ## Set up the global skill (no install needed)
23
25
 
24
- This opens the agent picker and installs everything that applies (see below). Then connect your account when you are ready:
26
+ Run the CLI via `npx fimo@latest` — do not install `fimo` globally.
25
27
 
26
28
  ```bash
27
- npx fimo@latest login
29
+ npx fimo@latest skills install # opens the agent picker, installs the global fimo bootstrap
30
+ npx fimo@latest login # connect your account when ready
28
31
  ```
29
32
 
30
33
  ## `fimo skills` — install + sync + uninstall
31
34
 
32
35
  ```bash
33
- fimo skills install # interactive: pick agents, install everything that applies
36
+ fimo skills install # interactive: pick agents, install the global bootstrap
34
37
  fimo skills install --agents=claude-code,cursor # explicit list
35
38
  fimo skills install -a claude-code -a cursor # repeatable form
36
- fimo skills install --agents=claude-code --yes # skip the install preview prompt (headless / scripts)
37
- fimo skills install --mode=copy # copy files instead of symlinking (required under npx)
38
- fimo skills sync # refresh installed skills (global + project, where applicable)
39
- fimo skills uninstall # remove the global skills
39
+ fimo skills sync # re-ensure the bootstrap + clean up stale old skills
40
+ fimo skills uninstall # remove the global bootstrap
40
41
  ```
41
42
 
42
- `fimo skills install` shows a one-screen preview of every path it will touch (`.agents/skills/...`, `.claude/skills/...`, `AGENTS.md`, per-agent rule files, …) before writing. Pass `-y` / `--yes` to skip the confirmation in scripts.
43
-
44
- **`fimo skills install` is context-aware**:
45
-
46
- - **Outside a Fimo project** — installs only the global `fimo-cli`, `fimo-studio`, and `fimo-migration` skills for the selected agents.
47
- - **Inside a Fimo project** (`.fimo.settings.json` found by walking up from cwd) — installs the global skills _and_ writes the project `fimo` skill _and_ generates the per-agent rule file (`CLAUDE.md` / `.cursor/rules/fimo.mdc` / `.windsurfrules` / `GEMINI.md`) for each selected agent. One command, full setup.
48
-
49
- The command prints exactly which files were written, so the context-aware behavior is never silent magic.
50
-
51
- **Adding an agent to an existing project** is the same command — `fimo skills install --agents=cursor` inside the project does global + project skill + rule file for cursor in one shot.
52
-
53
- **`fimo skills sync`** is the refresh / update path — no consent prompts, no new agents added. It re-copies whatever is already installed:
54
-
55
- - Global skills for whichever agents already have them
56
- - Project `fimo` skill for whichever agents have rule files (when run inside a Fimo project)
57
-
58
- You rarely have to invoke it by hand:
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.
59
44
 
60
- - **Global skills auto-refresh** whenever a newer CLI runs — any `npx fimo@latest …` command detects a version change (marker at `~/.config/fimo/last-version`) and re-copies the latest skills.
61
- - **The project skill auto-refreshes during Fimo-controlled installs** when the `fimo` package version bumps — the package's postinstall hook re-syncs the skill from `node_modules/fimo/assets/skills/fimo/` (which is version-locked to the installed package). For pnpm, `fimo init --install`, sandbox `fimopm install`, and E2E helper installs pass a scoped allow-all-builds flag so the hook can run without persisting build-script approvals in the template. npm / yarn run lifecycle scripts by default and need no extra config.
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.
62
46
 
63
- Invoke `fimo skills sync` explicitly when iterating on skill content locally, when you bumped the package via something other than a fresh install, or any time you want to force a refresh.
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.
64
48
 
65
- **`fimo skills uninstall`** removes only the global skills. Project files are part of the project — delete the project (or `rm -rf .claude/skills/fimo .cursor/skills/fimo`) if you want them gone.
49
+ **`fimo skills uninstall`** removes the global bootstrap for the selected agents.
66
50
 
67
51
  ## `fimo rules sync` — rule files only
68
52
 
69
- `fimo init` writes `AGENTS.md` (the universal-spec file) and per-agent variants for the AI tools you selected. Variants and their generators:
53
+ `fimo init` scaffolds `AGENTS.md` (the universal-spec file) and `CLAUDE.md` from the template. Other agents' variants are generated on demand:
70
54
 
71
55
  | Agent | File(s) generated |
72
56
  | --------------------------------- | ------------------------------------- |
73
- | claude-code | `CLAUDE.md` + `.claude/settings.json` |
57
+ | claude-code | `CLAUDE.md` (ships in the template) |
74
58
  | cursor | `.cursor/rules/fimo.mdc` |
75
59
  | windsurf | `.windsurfrules` |
76
60
  | gemini-cli | `GEMINI.md` |
@@ -79,16 +63,16 @@ Invoke `fimo skills sync` explicitly when iterating on skill content locally, wh
79
63
  `fimo rules sync` regenerates these variants from the current `AGENTS.md`. Use it when:
80
64
 
81
65
  - You edited `AGENTS.md` and want variants refreshed (delete the variant first — see below).
82
- - You added an agent in a different way and need its rule file generated.
66
+ - You added an agent that needs its own rule file generated.
83
67
 
84
68
  ```bash
85
69
  fimo rules sync # interactive: pick agents
86
70
  fimo rules sync --agents=cursor # explicit
87
71
  ```
88
72
 
89
- `fimo rules sync` is **purely additive** — it creates missing variant files but never overwrites existing ones. Project-specific edits in `CLAUDE.md`, `.cursor/rules/fimo.mdc`, `.claude/settings.json`, etc. are preserved. To regenerate a stale variant, delete the variant file first and re-run.
73
+ `fimo rules sync` is **purely additive** — it creates missing variant files but never overwrites existing ones, so project-specific edits are preserved. To regenerate a stale variant, delete the variant file first and re-run.
90
74
 
91
- **`fimo rules sync` does NOT install skill files.** That's `fimo skills install / sync` territory. The split is deliberate — rules are generated config files, skills are reusable knowledge artifacts.
75
+ **`fimo rules sync` does NOT install skills.** That's `fimo skills` territory. The split is deliberate — rules are generated project config files (committed with the project); skills are fetched on demand and never committed.
92
76
 
93
77
  ## Selecting agents (interactive vs flags)
94
78
 
@@ -98,21 +82,20 @@ Every command that takes agents accepts the same selection inputs:
98
82
  - `-a claude-code -a cursor` — repeatable short form
99
83
  - No flag → interactive multi-select. The picker has two sections:
100
84
  - **Universal** — agents that read `AGENTS.md` natively (codex, opencode, aider, …). Always covered, not toggleable.
101
- - **Additional** — agents that need a per-agent rule file or skills dir. 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. Each row shows the install path next to the name (e.g. `Claude Code (.claude/skills)`). Agents already present on the machine are pre-checked.
102
- - `--agents=none` (only `fimo init`) — skip per-agent variants entirely; write only `AGENTS.md`.
103
- - `--mode=symlink|copy` (only `fimo skills install` and `fimo init`) — pick the install method for the per-agent skills layer. Defaults to symlink so the canonical `.agents/skills/<name>/` is the single source of truth; pass `--mode=copy` to materialize the skill in each per-agent dir.
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
+ - `--agents=none` (only `fimo init`) — skip the global skill entirely.
104
87
 
105
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."
106
89
 
107
- ## Version stamping
90
+ ## Always current, never stale
108
91
 
109
- Every installed `SKILL.md` (global or project) is stamped with `fimoVersion: <cli-version>` in its YAML frontmatter at install time. That gives the CLI (and you) a way to detect stale installs — compare the stamped version to the currently-running CLI version.
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.
110
93
 
111
94
  ## When to use which
112
95
 
113
96
  - "I want this AI tool to know about Fimo" → `fimo skills install` (interactive)
114
- - "I want to add Cursor to this project" → `fimo skills install --agents=cursor` (from inside the project)
115
- - "The agent doesn't know about my project's latest fimo conventions" → `fimo skills sync`
97
+ - "Load the code / CLI / studio / migration skill now" → `fimo skills get fimo-code` / `fimo-cli` / `fimo-studio` / `fimo-migration`
98
+ - "Clean up skills left by an old CLI version" → `fimo skills sync`
116
99
  - "I edited `AGENTS.md` and want variants regenerated" → delete the stale variant + `fimo rules sync`
117
100
  - "I'm done with Fimo on this machine" → `fimo skills uninstall`
118
- - For a fresh project, `fimo init` wires up everything for the AI tools you select at scaffold time.
101
+ - For a fresh project, `fimo init` installs the global skill for the AI tools you select at scaffold time.
@@ -18,9 +18,9 @@ Typical flow:
18
18
  ```
19
19
  fimo agents create <name> # scaffold agents/<name>/ from a template (local)
20
20
  fimo agents secrets add <name> FIRECRAWL_API_KEY # request a project secret in config.yaml
21
- fimo secrets set FIRECRAWL_API_KEY --stdin # store the hidden value in Fimo
22
- fimo agents validate <name> # confirm it parses + passes policy (local)
23
- fimo validate # also checks that requested project secrets exist
21
+ fimo secrets add FIRECRAWL_API_KEY --stdin # store the hidden value in Fimo
22
+ fimo agents validate <name> # parse + policy + composition + requested secrets
23
+ fimo validate # project build and codegen checks
24
24
  fimo deploy # push the bundle to the env's git branch
25
25
  fimo agents activate <name> # wire its triggers on the env (DB row)
26
26
  fimo agents run <name> # trigger a manual run → sessionId
@@ -45,7 +45,7 @@ fimo agents secrets remove <name> <KEY> [-C <dir>]
45
45
  - **`create <name>`** — scaffold `agents/<name>/` from a template (default `_default`, a minimal valid bundle). `--description <text>` writes a one-line tagline into the scaffolded `config.yaml` (surfaces in the dashboard's agents list). When run **without** `-C`, it requires the cwd to be inside a real Fimo project (walks up for `.fimo.settings.json`) and errors out cleanly otherwise, so it never leaks `agents/<name>/` into a stray cwd. If the template declares capabilities, an install-consent flow runs after the copy (`--quiet` skips it; critical caps still abort).
46
46
  - **`list`** — list the agents declared under `<project>/agents/`, with each one's trigger types and capability count. Local — the bundle list is the source of truth even if the project isn't linked yet.
47
47
  - **`validate [name]`** — run the full validation pipeline: parse → capability vocabulary → composition (cycle / missing sub-agents / invalid grants) → semantic + `fimo.config.json` policy checks. Omit `name` to validate every bundle. `--json` emits a structured `ValidationReport` for CI; exit code is non-zero on any failure.
48
- - **`secrets add/remove/list`** — edit or inspect the agent's requested secret names in `agents/<name>/config.yaml`. These commands do not create, rotate, or reveal secret values. Store values with `fimo secrets set`; run `fimo validate` to check that required requested secrets exist in the project. See `references/project-vars-and-secrets.md`.
48
+ - **`secrets add/remove/list`** — edit or inspect the agent's requested secret names in `agents/<name>/config.yaml`. These commands do not create, rotate, or reveal secret values. Store values with `fimo secrets add`; run `fimo agents validate` to check that required requested secrets exist in the project. See `references/project-vars-and-secrets.md`.
49
49
  - **`integrations <name>`** — preview the agent's `integrations` allowlist from `agents/<name>/config.yaml` and, when linked, overlay project integration status. See `references/integrations.md`.
50
50
 
51
51
  Agent integration access is configured in `agents/<name>/config.yaml` with an allowlist. Omitted integrations and omitted tools are not available to the agent: