@wix/origami-skills 0.0.0-stage → 1.30.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.
package/README.md CHANGED
@@ -1,3 +1,30 @@
1
- # Temporary Holding Version
1
+ # `@wix/origami-skills`
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Markdown-only package holding the agent skills for sites exported by Origami.
4
+
5
+ ## Layout
6
+
7
+ ```
8
+ skills/
9
+ <skill-name>/
10
+ SKILL.md ← skill definition (frontmatter `name` + `description`, then instructions)
11
+ *.md ← optional guides the skill links to
12
+ ```
13
+
14
+ `wix-site-edit` is the native authoring skill: `SKILL.md` routes to `references/`, `playbooks/` and `examples/`, and
15
+ runs `wix origami` CLI commands.
16
+
17
+ `origami-setup` is the first-run skill: it skips what already works (one `wix whoami` first), installs the Wix CLI and its origami flow, signs in and
18
+ exports a site. An agent reads it before any site or `node_modules` exists, so it is one `SKILL.md` with no links. It
19
+ ends by reading `wix-site-edit` at its installed path and carrying on with the user's request.
20
+
21
+ Every site created by `@wix/origami-site-generator` installs this package. The site itself has only a pointer: a
22
+ `wix-site-edit` skill in `.claude/skills/`, plus `AGENTS.md` and a `CLAUDE.md`, which agents always load. All three tell the
23
+ agent to read `node_modules/@wix/origami-skills/skills/wix-site-edit/SKILL.md` before every change. A new release reaches
24
+ existing sites with `yarn install`; no re-export is needed.
25
+
26
+ The skills refer to each other by their installed path (`node_modules/@wix/origami-skills/skills/<skill-name>/...`). Keep
27
+ those paths in sync when you rename or move a file.
28
+
29
+ The package has no build step; the files are published as-is. `pnpm test` checks that every Markdown link and
30
+ anchor resolves inside the package.
package/package.json CHANGED
@@ -1,6 +1,37 @@
1
1
  {
2
2
  "name": "@wix/origami-skills",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "1.30.1",
4
+ "description": "Origami agent skills and READMEs, distributed as Markdown files",
5
+ "main": "README.md",
6
+ "files": [
7
+ "README.md",
8
+ "skills",
9
+ "!**/*.tsbuildinfo"
10
+ ],
11
+ "scripts": {
12
+ "build": "exit 0",
13
+ "lint": "exit 0",
14
+ "test": "node --test test/*.test.mjs"
15
+ },
16
+ "publishUnscoped": false,
17
+ "publishConfig": {
18
+ "registry": "https://registry.npmjs.org/",
19
+ "access": "public"
20
+ },
21
+ "wix": {
22
+ "artifact": {
23
+ "groupId": "com.wixpress.npm",
24
+ "artifactId": "origami-skills",
25
+ "targets": {
26
+ "docker": false
27
+ }
28
+ },
29
+ "validations": {
30
+ "postBuild": [
31
+ "test",
32
+ "lint"
33
+ ]
34
+ }
35
+ },
36
+ "falconPackageHash": "c9f08abfbe146be78c67bc5d9818ea9e75abc2859a4879408d4375c8"
6
37
  }
@@ -0,0 +1,35 @@
1
+ ---
2
+ name: editor-react-component
3
+ description: Build a component when `packages/site-app/site-component-catalog.json` has no `{Name}` (and the type is not Page / Section / Header / Footer). Use for a missing component or behavior on this exported site, or inside a Wix CLI app. Read the local wix-app references; do not fetch them from GitHub. If the catalog has the type but the wrapper is missing, fetch the wrapper — do not use this skill.
4
+ ---
5
+
6
+ # Editor React component
7
+
8
+ The docs and scripts are in `wix-app/` at the workspace root, vendored from [EDITOR_REACT_COMPONENT.md](https://github.com/wix/skills/blob/main/skills/wix-app/references/EDITOR_REACT_COMPONENT.md). Read those local files. Do not fetch them from GitHub.
9
+
10
+ When a file under `wix-app/` says `<SKILL_ROOT>`, that directory is `wix-app` (it contains `scripts/` and `references/`). Links such as `editor-react-component/ACCESSIBILITY.md` resolve under `wix-app/references/`.
11
+
12
+ ## Which path
13
+
14
+ - **Wix CLI app.** If the project has `wix.config.json`, follow `wix-app/references/EDITOR_REACT_COMPONENT.md` as written. Scaffold with `npx wix generate` only when the component folder does not exist. Do not edit `*.generated.ts`. Finish with `npx wix build && npx wix generate manifest`.
15
+ - **This exported site.** There is no `wix.config.json` (its `wix.config.mjs` only adds the `wix origami` commands). Do not run the Wix CLI app commands (`wix generate`, `wix build`). Do not scaffold `src/extensions/`. Do not add `*.generated.ts`, `component.preview.tsx`, or `*.extension.ts`.
16
+
17
+ ## This exported site
18
+
19
+ 0. Confirm `{Name}` is absent from `packages/site-app/site-component-catalog.json`. If a catalog row exists, stop and fetch the wrapper (`node_modules/@wix/origami-skills/skills/origami-component-usage/SKILL.md`).
20
+
21
+ 1. Read only the matching rows in `wix-app/references/EDITOR_REACT_COMPONENT.md`. The reference policy in that file still applies: read the required and triggered docs, and do not expand scope.
22
+ 2. Create `packages/site-app/src/components/<component-name>/`:
23
+ - `<component-name>.jsx` — UI and behavior
24
+ - `<component-name>.module.css` — scoped styles
25
+
26
+ This package is JavaScript. Keep the public props, semantic root, named parts, direction, and accessibility rules from the reference docs, and express the props in the JSX file.
27
+ 3. Import the component from `packages/site-app/src/pages/<page>/structure.jsx` and place it inside a Section. Direct children of `Page` stay Header, Footer, Section, or pinned.
28
+ 4. After the JSX is written, run:
29
+
30
+ ```bash
31
+ node wix-app/scripts/scan-a11y-review.cjs packages/site-app/src/components/<component-name>
32
+ ```
33
+
34
+ Then follow `wix-app/references/editor-react-component/ACCESSIBILITY.md`. If the scanner cannot load the component, say so and still apply that guide.
35
+ 5. Validate with `yarn build` from the workspace root. Do not run `npx wix build` or `npx wix generate manifest` here: `origami import-site` generates the manifest before it uploads the code.
@@ -0,0 +1,133 @@
1
+ ---
2
+ name: origami-component-usage
3
+ description: Use whenever importing, rendering, or styling any UI component in a .tsx/.jsx file — a page/screen file or another component's file — including setting its props, adding CSS overrides, or applying a preset/theme. Resolve the type in `packages/site-app/site-component-catalog.json` first, then read `packages/site-app/llm-context/{module}/{Name}.md` and the wrapper `@origami-wrappers/{module}/{name}`. Do not guess from memory or other node_modules.
4
+ ---
5
+
6
+ Resolve the type, then read its contract, then write the instance. Do not guess props, CSS, or presets from memory, from `node_modules`, or from a previous page. Do not look in `src/origamiComponents` or `wix-origami-components/`.
7
+
8
+ The inventory is `packages/site-app/site-component-catalog.json`. The importable component is the wrapper `@origami-wrappers/{module}/{name}`: the `{name}` folder of its app's wrapper package, where `{name}` is `{Name}` lowercased (`wixEditorElements.WRichText` → `@origami-wrappers/wixEditorElements/wrichtext`). The readable contract is `packages/site-app/llm-context/{module}/{Name}.md`. Never treat `node_modules/@wix/origami-poc-runtime-snapshot/components/` as the catalog. Do not invent a wrapper by hand.
9
+
10
+ After this dump: JSX trees (Section, BoxContainer + InternalContainer, Button / WRichText) in `node_modules/@wix/origami-skills/skills/wix-site-edit/references/components.md`, layout in `node_modules/@wix/origami-skills/skills/wix-site-edit/references/layout.md`, paint in `node_modules/@wix/origami-skills/skills/wix-site-edit/references/style.md`, import behavior in `node_modules/@wix/origami-skills/skills/wix-site-edit/playbooks/save-and-verify.md`.
11
+
12
+ ## 1. Catalog — pick the component
13
+
14
+ Choosing what to build? Read `packages/site-app/component-catalog.md`, which lists every component the site has by kind, with its name and purpose, and pick the one whose purpose fits the content. Then look up that name here.
15
+
16
+ Open `packages/site-app/site-component-catalog.json`. Top-level keys are modules (`wixEditorElements`, `wixSystemElements`, `wixGalleriesElements`, …). Each module has `appDefId`, `revision` and `entries`, which keeps components and context providers apart: `entries.components.{Name}` and `entries.contextProviders.{Name}`, each with `componentId`, `version`, and `description`. Render only a `components` entry; a `contextProviders` entry is a context provider (with its `hook`, when it has one), not a component to render.
17
+
18
+ ```sh
19
+ NAME=Button # replace with the component you're looking up
20
+ CATALOG="packages/site-app/site-component-catalog.json"
21
+ python3 -c "
22
+ import json,sys
23
+ name=sys.argv[1]
24
+ c=json.load(open(sys.argv[2]))
25
+ for module, body in c.items():
26
+ row=body.get('entries',{}).get('components',{}).get(name)
27
+ if row:
28
+ print(module)
29
+ print(body['appDefId'])
30
+ print(body['revision'])
31
+ print(row['componentId'])
32
+ print(row['version'])
33
+ print(row.get('description',''))
34
+ break
35
+ else:
36
+ sys.exit(1)
37
+ " "$NAME" "$CATALOG"
38
+ ```
39
+
40
+ - **Found.** Remember `{module}`, `{appDefId}`, `{revision}`, `{componentId}`, `{version}`. Continue to step 2.
41
+ - **Not found.** `Page`, `Section`, `HeaderSection`, and `FooterSection` stay on `@wix/origami-poc-runtime-snapshot/components/{Name}` (they are layout shells, not catalog rows). Any other missing name is not on this site; report it as unavailable and do not invent the type.
42
+
43
+ ## 2. Contract and wrapper — in this order
44
+
45
+ Paths (replace `{module}` / `{Name}` from the catalog row):
46
+
47
+ | What | Path |
48
+ | --- | --- |
49
+ | LLM contract (props, CSS allowlist, presets, ref elements) | `packages/site-app/llm-context/{module}/{Name}.md` |
50
+ | Importable wrapper | `@origami-wrappers/{module}/{name}` (`{name}` is `{Name}` lowercased) |
51
+ | Wrapper files, after `yarn install` | `node_modules/@origami-wrappers/{module}/{name}/` at the workspace root |
52
+ | Wrapper entry | `…/index.ts` |
53
+ | Definition / CSS | `…/definition.ts`, `…/defaults.css` |
54
+
55
+ **Read `llm-context/{module}/{Name}.md` first** when that file exists. It is the dump: Props, CSS Defaults, Presets (`PRESET_NAMES`), Ref Elements (`REF_ELEMENTS`).
56
+
57
+ **Then confirm the wrapper package is installed.** Import it from `@origami-wrappers/{module}/{name}`. Do not edit generated files (`// @generated — do not edit by hand`). Do not read `baseComp/` unless the definition or defaults are blocked.
58
+
59
+ If the markdown is missing but the wrapper exists, dump the wrapper:
60
+
61
+ ```sh
62
+ MODULE=wixEditorElements # from the catalog
63
+ NAME=Button
64
+ ROOT="node_modules/@origami-wrappers/$MODULE/$(printf '%s' "$NAME" | tr '[:upper:]' '[:lower:]')"
65
+
66
+ find "$ROOT" -maxdepth 1 \( -name 'definition.ts' -o -name 'defaults.css' -o -name 'index.ts' -o -name '*.tsx' \) \
67
+ | sort \
68
+ | while IFS= read -r f; do echo "--- $f ---"; cat "$f"; done
69
+ ```
70
+
71
+ If the catalog has the type but its app's wrapper package is not a dependency of `packages/site-app/package.json` (or the llm-context file is missing), **fetch it** (step 3). If it is a dependency but its folder is missing, run `yarn install`. Do not import that type from the runtime snapshot.
72
+
73
+ ## 3. Fetch a missing wrapper or llm-context
74
+
75
+ Use the catalog row. Do not invent ids.
76
+
77
+ ```sh
78
+ APP_ID=appDefId_from_catalog
79
+ COMP_ID=componentId_from_catalog
80
+ VERSION=version_from_catalog
81
+ MODULE=module_from_catalog
82
+ NAME=Button
83
+
84
+ BASE="https://dev.wix.com/_api/component-wrapper-server/v1"
85
+
86
+ # LLM markdown → packages/site-app/llm-context/{module}/{Name}.md
87
+ curl --fail -sS "$BASE/component-llm-context/$APP_ID/$COMP_ID?version=$VERSION"
88
+ ```
89
+
90
+ - Wrapper: every wrapper of an app is one package. When `packages/site-app/package.json` has no `@origami-wrappers/{module}` dependency, add the app's tarball to `dependencies`, then run `yarn install` at the workspace root. It needs no login.
91
+ ```json
92
+ "@origami-wrappers/{module}": "https://viewer-apps.parastorage.com/_api/component-wrapper-server/v1/app/{appDefId}/components.tgz?revision={revision}"
93
+ ```
94
+ `{revision}` is the module's `revision` in the catalog. The package always holds the app's latest components; the revision gives each set of component versions its own URL, so yarn and the CDN never answer a stale package for it.
95
+ When the package is installed but has no `{name}/` folder, the type has no wrapper: do not use it.
96
+ - LLM response: `{ "llmContext": "markdown" }`. Write `packages/site-app/llm-context/{module}/{Name}.md`. Auth is the Wix CLI session (`wix login`). A 401 means login, then retry.
97
+ - Do not hand-write wrapper source to skip the fetch.
98
+
99
+ Export already added the wrapper package of every catalog app. Fetch only what is missing.
100
+
101
+ ## 4. Import the wrapper, then author the instance
102
+
103
+ Any page or global Header/Footer `structure.jsx` imports the wrapper from its app's package:
104
+
105
+ ```ts
106
+ import { Name } from '@origami-wrappers/{module}/{name}'
107
+ ```
108
+
109
+ Reuse the import when that file already has the type.
110
+
111
+ **Defaults stylesheet.** The wrapper's `defaults.css` is loaded by the item's generated component: the `.jsx` file in that item's `_generated/` folder named like its stylesheet (often `Home.jsx`, even on a page that is not the home page; a global component's is named after the component), not `index.jsx`. Export writes one import there for every wrapper type the structure used at that time, above `import { Structure }`, so the wrapper CSS loads before the item's own stylesheet; nothing rewrites it when you add a type. When you add a type that the item did not have, add its import to that file yourself, next to the other `@origami-wrappers` imports at the top:
112
+
113
+ ```js
114
+ import '@origami-wrappers/{module}/{name}/css'
115
+ ```
116
+
117
+ Never `@import` it from a `.css` file: the wrapper CSS (and its presets) must come before every site stylesheet, or its rules override the site's.
118
+
119
+ This is the only edit you make under `_generated/`, and it only affects local preview: import sends `structure.jsx`, `layout.css`, `style.css`, and `unmapped.json`, not `_generated/`, and the next export writes that file again. Do not import `presets/*.css` — the wrapper's `defaults.css` loads those.
120
+
121
+ Do not import a catalog type from `@wix/origami-poc-runtime-snapshot/components/{Name}` once its wrapper exists. The exception is `InternalContainer`: import it from `@wix/origami-system-components/InternalContainer`.
122
+
123
+ 1. **Props** — from `{Name}Props` in the llm-context / `definition.ts`. Give every instance an `id`. Pass only props that file lists, as literals. Do not pass `compId` or `role`; set `className` equal to the `id`. Do not wrap instances in a local component. Do not build ids or data with a function call, a template string, or a `.map()`. Image and WRichText nested data objects are in `node_modules/@wix/origami-skills/skills/wix-site-edit/references/components.md` (not in `{Name}Props`). Nesting (Section / InternalContainer / BoxContainer) is there too.
124
+
125
+ 2. **CSS overrides** — from the commented list in CSS Defaults / `defaults.css`. Give each element `className` equal to its `id` and write one `.id` rule per component (the import rejects `#id`). Put only properties from that list onto that component. A property that is not in the list becomes an unexpected `cssProperties` entry and the editor save is rejected. Never target the `{id}-presets-wrapper` class or any class other than the element's own `.id`; the import rejects them. Selector grammar is `node_modules/@wix/origami-skills/skills/wix-site-edit/references/style.md`.
126
+
127
+ 3. **Presets** — from `PRESET_NAMES` in the llm-context / `index.ts` / `.tsx`. If that array is empty, do not set a preset. Do not read `presets/*.css` or use `presets:` from the definition file. Apply the name as `node_modules/@wix/origami-skills/skills/wix-site-edit/references/components.md` (Presets) describes.
128
+
129
+ 4. **Ref (inner) elements** — `elements: { animatedIcon: prop.element<AnimatedIconProps>() }` means the child has its own contract. Recurse this skill for `{Child}` (catalog → llm-context → wrapper). Style the inner part as `.id [data-ie-name="<part>"]` (`node_modules/@wix/origami-skills/skills/wix-site-edit/references/style.md`). If the child has no catalog row, hide or collapse that inner element with a prop from the parent definition (for Button, `iconCollapsed`), not with CSS that is missing from the parent’s `defaults.css`.
130
+
131
+ If the generated files do not match this pattern, trust the files.
132
+
133
+ Services come from `@wix/origami-services` through `OrigamiServicesProvider`. Pages import DM config data from their global components in import order, then their own `servicesConfigs/index.ts`. No services wiring or consent shim is generated. The runtime snapshot is used only for components, never services.
@@ -0,0 +1,74 @@
1
+ ---
2
+ name: origami-setup
3
+ description: Install the Wix CLI and its origami flow, sign in to Wix, and export a site or create a new one, then continue straight into the change the user asked for. Skips every step that already holds. Use when `wix` or its origami commands are not installed, are outdated or are signed out, or when the user is starting with Origami. Never imports or publishes.
4
+ ---
5
+
6
+ # Origami setup
7
+
8
+ Goal: get the user's Wix site into a local folder that is ready to edit, then carry on with what the user asked for.
9
+ Setup is a means, not the result: run only the steps that are missing, and never end the turn at the export.
10
+
11
+ ## 1. Check what is already done
12
+
13
+ Run one command first:
14
+
15
+ ```bash
16
+ wix whoami; wix origami --help
17
+ ```
18
+
19
+ - `wix` is not found: go to step 2.
20
+ - `wix origami` is an unknown command: run `wix flows add origami`, then read the `wix whoami` result below.
21
+ - `wix whoami` prints an email address: Node, the CLI and sign-in all work. Go to step 4 and skip the machine checks and the install.
22
+ - `wix whoami` prints no email address: go to step 3.
23
+ - The working folder, or a folder the user names, already holds an export (`packages/site-app/.env`): reuse it only when `wix origami sites | grep -F -- "<its VITE_WIX_METASITE_ID>"` prints that site and, if the user named a site, is that site. Otherwise export the requested site into a new folder in step 4.
24
+ - When `node_modules/@wix/origami-skills/skills/wix-site-edit/SKILL.md` exists in it, go to step 6.
25
+ - Otherwise ask the user before running `yarn install` in a folder this setup did not export, then go to step 5.
26
+
27
+ ## 2. Install the CLI
28
+
29
+ Origami needs Node 22.16 or later and Corepack.
30
+ Check both in one command, then install the Wix CLI and its origami commands:
31
+
32
+ ```bash
33
+ node -v; corepack -v
34
+ npm install -g @wix/cli
35
+ wix flows add origami
36
+ ```
37
+
38
+ - Install Node or change its version yourself once the user approves, and never run npm with `sudo`.
39
+ - When `wix flows add origami` fails to reach the registry, ask the user to connect to the Wix network or VPN.
40
+ - When a later command prints a CLI update diagnostic, run the update command it prints (outside a site, `wix flows remove origami && wix flows add origami`) and retry that command.
41
+
42
+ ## 3. Sign in
43
+
44
+ - Run `wix login`, give the user the URL and the code it prints, and wait for it to report the signed-in user.
45
+ - Never type the user's password.
46
+
47
+ ## 4. Get the site
48
+
49
+ - Put every value the user gave (site name, folder) in single quotes in the command, writing each `'` inside it as `'\''`, so the shell never expands it. Replace a leading `~` in a folder with the absolute home path first, since `~` does not expand inside quotes.
50
+ - Set `<site>` to a new folder named after the site with only lowercase letters, digits and hyphens, such as `bakery-site`, unless the user names a folder:
51
+ - When the working folder is the home folder, use `~/wix-sites/<name>` and create `~/wix-sites` if it is missing.
52
+ - Otherwise use `./<name>` inside the working folder, so the agent can edit the site and load its instructions without leaving its workspace.
53
+ - When that folder exists and is not empty, add a number, such as `bakery-site-2`.
54
+ - Before you export or create a site, tell the user in one line that the export adds a web OAuth app named `export site` to a site that has none.
55
+ - For a site the user names, narrow the list with `wix origami sites | grep -iF -- '<name or msid>'`; the full list can hold hundreds of sites. Keep only rows whose name or msid equals the user's words exactly, ask the user when none or several remain, then run `wix origami export-site --site <msid> -d <site>`.
56
+ - For a new site, run `wix origami create-site --name '<name>' -d <site>` once; it creates a blank, unpublished Studio 2 site and exports it.
57
+ - When `create-site` prints `was created but isn't ready to export yet`, run the `wix origami export-site` command it prints a minute later; never run `create-site` again for that site.
58
+ - When the export fails without detail, export once more into a new empty folder.
59
+ - Chain the export and the install in one command: `wix origami export-site … -d <site> && cd <site> && yarn install`.
60
+
61
+ ## 5. Install the site's packages
62
+
63
+ - In `<site>`, run `yarn install`.
64
+ - When `yarn` is not found, run `corepack enable`, then run `yarn install` again.
65
+ - When the install fails, report the command and the error, and do not change the exported packages to make it pass.
66
+
67
+ ## 6. Continue with the user's request
68
+
69
+ Read `<site>/node_modules/@wix/origami-skills/skills/wix-site-edit/SKILL.md` now, in the same turn, then:
70
+
71
+ - The user's request names a change (content, design, a page, a section, a new site's purpose): make it now with `wix-site-edit`. Do not stop to report the setup; mention it in one line of the final answer.
72
+ - The request names no change: read the exported pages and theme, then ask what to change, offering 2–4 concrete options that fit this site, such as restyling the theme, rewriting the home page for the user's business, or adding a page. Use a multiple-choice question tool when you have one.
73
+
74
+ Never publish the site.
@@ -0,0 +1,83 @@
1
+ ---
2
+ name: wix-site-edit
3
+ description: Applies Wix Editor-compatible practices for layout, style and components on an exported Wix site, and runs its `wix origami` CLI operations (export, build check, media upload, import). Builds from the site's full component catalog and Site Style/Brand, and keeps the files in a form the Wix Editor can import. Never publishes.
4
+ ---
5
+
6
+ # Origami toolkit
7
+
8
+ Author native Origami files in an exported Wix site workspace, using that export's component contracts.
9
+ The scope is native components, theme, the shared header and footer, pages and menus; CMS bindings and custom components are outside it.
10
+ Keep every edit in a form `wix origami import-site` accepts; the local preview also renders files the import rejects.
11
+ `<site>` is the exported workspace folder.
12
+
13
+ ## Operations
14
+
15
+ Choose the operation the user needs; the playbooks are optional sequences.
16
+
17
+ | Need | Operation or reference |
18
+ | --- | --- |
19
+ | Install, update or sign in to the CLI | Follow `node_modules/@wix/origami-skills/skills/origami-setup/SKILL.md` |
20
+ | Get a site, or create a new one | Section 4 of [origami-setup](../origami-setup/SKILL.md): `wix origami sites` and `wix origami export-site` for an existing site, `wix origami create-site` for a new one |
21
+ | Export a site | `wix origami export-site --site <msid> -d <site>` into an empty folder |
22
+ | See what the site can render | `component-catalog.md`: every component by kind, with its name and purpose ([Browse the catalog](references/components.md#browse-the-catalog)) |
23
+ | Look up a component | find its app in `site-component-catalog.json`, then read `llm-context/<app>/<Name>.md` (props, CSS allowlist, presets, inner parts) |
24
+ | Find font IDs | `wix origami search-font -f <words>` prints Wix font ids and their weights |
25
+ | Validate local files | `yarn lint` from the workspace root after each change; correct reported errors ([Validate local files](playbooks/save-and-verify.md#validate-local-files)) |
26
+ | Render and inspect locally, optionally | [Local render](playbooks/save-and-verify.md#local-render) |
27
+ | Generate images with AI (spends AI credits) | [Generated images](#generated-images) |
28
+ | Upload images named by URL or local file | `wix origami upload-media --site <msid> -d <site>`; it rewrites each `uri` to a Wix media id in place, so run it before `yarn build` and import |
29
+ | Import the full bundle | `wix origami import-site --site <msid> -d <site>`; read [import behavior and verification](playbooks/save-and-verify.md) first |
30
+
31
+ Follow an export's CLI update diagnostic before retrying.
32
+ If an export fails without detail, retry once into a separate empty folder, keeping the partial export, before investigating.
33
+
34
+ ## Generated images
35
+
36
+ From `<site>`, `wix origami generate-image -p "<prompt>" [-p "<prompt>" …]` generates one image per prompt and uploads each to the Media Manager of the site in `packages/site-app/.env` (`VITE_WIX_METASITE_ID`).
37
+
38
+ 1. Run it without `--yes`: it spends nothing and prints the AI credits left.
39
+ 2. Ask the user once for the whole batch, stating the number of images and the credits left. Offer the default model first (under 1 credit an image), then `--model google:4@2` (higher quality, about 6 credits an image).
40
+ 3. Rerun it with `--yes` and put each printed media id, width and height in the Image data.
41
+
42
+ When no credits are left, the user declines, or a prompt is listed as `Failed:`, don't stop the task: tell the user in one line and use other images for the missing ones. Use images the user gives you, images already in the export, or the https URL of a freely licensed photo, then run `wix origami upload-media` ([Upload images](#operations)).
43
+
44
+ ## Workspace
45
+
46
+ Read the exported files before editing them. The editable sources are under `<site>/packages/site-app/`:
47
+
48
+ - the theme, `src/global/themes/theme.css`, and the menus in `src/global/menus/`;
49
+ - `structure.jsx`, `layout.css`, `style.css` and `unmapped.json` of each page in `src/pages/<route>/` (Home is `src/pages/(home)/`);
50
+ - the same four files of the header and footer in `src/global/components/<HeaderSection_…|FooterSection_…>/`.
51
+
52
+ | Task | Read |
53
+ | --- | --- |
54
+ | What components the site has, and their props, data and nesting | [Components](references/components.md) |
55
+ | Grids, Stacks, sizes and backgrounds | [Layout](references/layout.md) |
56
+ | Brand palette, typography and shared styles | [Theme](references/theme.md) |
57
+ | CSS properties, selectors and theme application | [Style](references/style.md) |
58
+ | Breakpoints and mobile layout | [Responsive](references/responsive.md) |
59
+ | Navigation, anchors and Menu | [Links and Menu](references/links-and-menu.md) |
60
+ | Required lines, server rejections and known limits | [Supplement](references/supplement.md) |
61
+ | Start from an empty folder | [Create a site](playbooks/create-a-site.md) |
62
+ | Add a section locally | [Add a section](playbooks/add-a-section.md) |
63
+ | Add a page | [New page](references/new-page.md) |
64
+ | Inspect and import the full bundle | [Save and verify](playbooks/save-and-verify.md) |
65
+
66
+ ## Decision order
67
+
68
+ 1. Theme: follow a custom `theme.css`; when it is still the export default, update it first ([Theme](references/theme.md)).
69
+ 2. Component: [browse the catalog](references/components.md#browse-the-catalog) and use the component that fits the content's purpose most closely, with the props, presets and inner parts its contract offers ([Components](references/components.md)). Compose from boxes, text and images only when no component fits.
70
+ 3. Theme styles: connect the instance to its `var(--wst-…)` slot ([Style](references/style.md)).
71
+ 4. Page CSS: write layout in `layout.css` and paint in `style.css` only when the theme cannot express the styling.
72
+ 5. Missing component: when the catalog has no row for the type and it is not a Page, Section, header or footer, report the type as unavailable instead of building it.
73
+
74
+ ## Conduct
75
+
76
+ - Use only the destination the user supplied or had created at their request.
77
+ - Never publish.
78
+ - Never type the user's credentials.
79
+ - Read [import behavior](playbooks/save-and-verify.md#import-behavior) before describing what will change on the destination.
80
+ - Preserve unrelated authored content and identities during local edits.
81
+ - Complete the requested operation; local authoring or an export alone does not require an import.
82
+ - Report validation, local visual inspection and import results separately, with any tool diagnostic and what remains unverified.
83
+ - Stop once the requested operation and its report are done.
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "Custom Main Menu",
3
+ "id": "CUSTOM_MAIN_MENU",
4
+ "type": "Builder.MenuItems",
5
+ "items": [
6
+ { "label": "Platform", "items": [], "id": "dataItem-menu-item-1", "isVisible": true, "type": "Builder.MenuItem",
7
+ "link": { "type": "AnchorLink", "id": "dataItem-menu-link-1", "anchorName": "Platform", "pageId": "#c1dmp", "anchorDataId": "#anchors-platform" } },
8
+ { "label": "Home", "items": [], "id": "dataItem-menu-item-2", "isVisible": true, "type": "Builder.MenuItem",
9
+ "link": { "type": "PageLink", "id": "dataItem-menu-link-2", "pageId": "#c1dmp", "target": "_self" } }
10
+ ]
11
+ }
@@ -0,0 +1,86 @@
1
+ // Copy this Menu's structure and icon data.
2
+ // Keep all four _id fields populated; the server returns HTTP 500 without them.
3
+ // Keep the animatedIcon SVGs; without them the mobile menu button shows no icon.
4
+ // Choose IDs that do not collide with existing identities and update their references together.
5
+ // Use references/links-and-menu.md for placement, paint and presets.
6
+ // Imports in the header's structure.jsx (exactly these paths):
7
+ // import { Menu } from '@origami-wrappers/wixEditorElements/menu'
8
+ // import CUSTOM_MAIN_MENU from '../../../global/menus/CUSTOM_MAIN_MENU'
9
+ // import InternalContainer from '@wix/origami-system-components/InternalContainer' (if the header doesn't import it yet)
10
+ // Items: global/menus/CUSTOM_MAIN_MENU.json (shape in menu-items.json).
11
+
12
+ <Menu
13
+ id="comp-menu"
14
+ className="comp-menu"
15
+ type="Container"
16
+ elementProps={{
17
+ hamburgerMenu: {
18
+ _id: 'data-mupia9m010',
19
+ content: <InternalContainer id="comp-menu-content" className="comp-menu-content" type="Container" />,
20
+ headerContent: <InternalContainer id="comp-menu-header" className="comp-menu-header" type="Container" />,
21
+ elementProps: {
22
+ hamburgerCloseButton: {
23
+ elementProps: {
24
+ animatedIcon: {
25
+ _id: 'data-mupia9m016',
26
+ svg: {
27
+ uri: '7d72932f870a315ce1b030fcc29ba4e5.svg',
28
+ type: 'Builder.VectorArt',
29
+ id: 'data-mupia9m017',
30
+ },
31
+ svgLastAnimatedSelected: {
32
+ uri: '11062b_702fac46ae484fc083b1aebda93bf545.svg',
33
+ type: 'Builder.VectorArt',
34
+ id: 'data-mupia9m019',
35
+ },
36
+ svgLastStaticSelected: {
37
+ uri: '7d72932f870a315ce1b030fcc29ba4e5.svg',
38
+ type: 'Builder.VectorArt',
39
+ id: 'data-mupia9m018',
40
+ },
41
+ },
42
+ },
43
+ },
44
+ },
45
+ },
46
+ navbar: { _id: 'data-mupia9lz5', items: CUSTOM_MAIN_MENU.items },
47
+ hamburgerOpenButton: {
48
+ elementProps: {
49
+ animatedIcon: {
50
+ _id: 'data-mupia9m028',
51
+ duration: 0.6,
52
+ svg: {
53
+ uri: '11062b_eb9aba2e52494080bb879558d85e4109.svg',
54
+ type: 'Builder.VectorArt',
55
+ id: 'data-mupia9m029',
56
+ },
57
+ svgCustomAnimationSelected: {
58
+ uri: '82fcd3_366fa2d88c2d4f00bca188880220525d.svg',
59
+ type: 'Builder.VectorArt',
60
+ id: 'data-mupia9m030',
61
+ },
62
+ svgLastStaticSelected: {
63
+ uri: '11062b_eb9aba2e52494080bb879558d85e4109.svg',
64
+ type: 'Builder.VectorArt',
65
+ id: 'data-mupia9m031',
66
+ },
67
+ svgLastAnimatedSelected: {
68
+ uri: '82fcd3_366fa2d88c2d4f00bca188880220525d.svg',
69
+ type: 'Builder.VectorArt',
70
+ id: 'data-mupia9m032',
71
+ },
72
+ svgCustomAnimationStart: {
73
+ uri: '82fcd3_721d0e93e6824fe1a0ecc922c651afc4.svg',
74
+ type: 'Builder.VectorArt',
75
+ id: 'data-mupia9m033',
76
+ },
77
+ svgCustomAnimationEnd: {
78
+ uri: '82fcd3_440e71671a8d42c0b224f11e366d98c0.svg',
79
+ type: 'Builder.VectorArt',
80
+ id: 'data-mupia9m034',
81
+ },
82
+ },
83
+ },
84
+ },
85
+ }}
86
+ />
@@ -0,0 +1,25 @@
1
+ // Syntax sample only: how a Section, a BoxContainer with its InternalContainer, and leaves nest.
2
+ // Every element has a className equal to its id; section.layout.css and section.style.css select it as .id.
3
+ // The leaf types (a heading and two buttons) are placeholders; use whichever catalog components fit the content.
4
+ // Imports it needs in a page's structure.jsx (copy the export's own lines if they differ):
5
+ // import Section from '<the runtime snapshot package this export uses>/components/Section'
6
+ // import InternalContainer from '@wix/origami-system-components/InternalContainer'
7
+ // import { Background } from '@origami-wrappers/wixSystemElements/background'
8
+ // import { WRichText } from '@origami-wrappers/wixEditorElements/wrichtext'
9
+ // import { BoxContainer } from '@origami-wrappers/wixEditorElements/boxcontainer'
10
+ // import { Button } from '@origami-wrappers/wixEditorElements/button'
11
+ <Section id="s1" className="s1">
12
+ <InternalContainer id="s1-ic" className="s1-ic" type="Container" backgroundLayer={[<Background id="s1-bg" className="s1-bg" type="Component" />]}>
13
+ <BoxContainer id="s1-group" className="s1-group" _id="dataItem-s1-group" type="Container" children={
14
+ <InternalContainer id="s1-group-ic" className="s1-group-ic" type="Container">
15
+ <WRichText id="s1-title" className="s1-title" type="Component" richText={{"html":"<h2>Heading</h2>","id":"dataItem-s1-title","type":"Builder.RichText"}} />
16
+ <BoxContainer id="s1-actions" className="s1-actions" _id="dataItem-s1-actions" type="Container" children={
17
+ <InternalContainer id="s1-actions-ic" className="s1-actions-ic" type="Container">
18
+ <Button id="s1-a" className="s1-a" type="Component" label={"First"} iconCollapsed={true} />
19
+ <Button id="s1-b" className="s1-b" type="Component" label={"Second"} iconCollapsed={true} />
20
+ </InternalContainer>
21
+ } />
22
+ </InternalContainer>
23
+ } />
24
+ </InternalContainer>
25
+ </Section>
@@ -0,0 +1,62 @@
1
+ /* Decisions only: add the required lines in references/supplement.md. Desktop rules first, then the mobile block. */
2
+ .s1-ic {
3
+ @origami-target internal-container-content-wrapper {
4
+ display: grid;
5
+ grid-template-columns: minmax(0px, 1fr);
6
+ grid-template-rows: auto;
7
+ padding-top: --spx(80);
8
+ padding-right: --spx(40);
9
+ padding-bottom: --spx(80);
10
+ padding-left: --spx(40);
11
+ }
12
+ }
13
+ .s1-group {
14
+ grid-row: 1 / 2;
15
+ grid-column: 1 / 2;
16
+ width: 100%;
17
+ align-self: start;
18
+ justify-self: start;
19
+ }
20
+ .s1-group-ic {
21
+ @origami-target internal-container-content-wrapper {
22
+ display: flex;
23
+ flex-direction: column;
24
+ }
25
+ }
26
+ .s1-title {
27
+ width: 100%;
28
+ align-self: start;
29
+ margin-bottom: --spx(24);
30
+ }
31
+ .s1-actions {
32
+ width: max-content;
33
+ align-self: start;
34
+ }
35
+ .s1-actions-ic {
36
+ @origami-target internal-container-content-wrapper {
37
+ display: flex;
38
+ flex-direction: row;
39
+ }
40
+ }
41
+ .s1-a {
42
+ width: --spx(140);
43
+ align-self: center;
44
+ margin-right: --spx(12);
45
+ }
46
+ .s1-b {
47
+ width: --spx(140);
48
+ align-self: center;
49
+ }
50
+ @media (max-width: 1023px) {
51
+ .s1-ic {
52
+ @origami-target internal-container-content-wrapper {
53
+ display: grid;
54
+ grid-template-columns: minmax(0px, 1fr);
55
+ grid-template-rows: auto;
56
+ padding-top: --spx(40);
57
+ padding-right: --spx(16);
58
+ padding-bottom: --spx(40);
59
+ padding-left: --spx(16);
60
+ }
61
+ }
62
+ }
@@ -0,0 +1,13 @@
1
+ /* Write every field of a theme slot you use (references/supplement.md, Required lines). */
2
+ .s1-bg {
3
+ --backgroundColor: var(--wst-base-1-color);
4
+ }
5
+ .s1-title {
6
+ font: var(--wst-heading-2-font);
7
+ }
8
+ .s1-a {
9
+ background: var(--wst-button-primary-background-color);
10
+ }
11
+ .s1-b {
12
+ background: var(--wst-button-secondary-background-color);
13
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "components": {
3
+ "s1": {
4
+ "anchors": {
5
+ "type": "AnchorInfo",
6
+ "id": "anchors-s1",
7
+ "name": "s1"
8
+ }
9
+ }
10
+ }
11
+ }
@@ -0,0 +1,12 @@
1
+ # Add a section to a page
2
+
3
+ Use this for a local edit in an exported site workspace.
4
+
5
+ 1. [Browse the catalog](../references/components.md#browse-the-catalog) and choose the components that fit the section's content.
6
+ 2. Add the Section in the requested position with [components](../references/components.md#nesting).
7
+ 3. Declare its [anchor](../references/links-and-menu.md#links) if anything links to it.
8
+ 4. Choose Grid or Stack, size and place the content, and add the Section's Page row with [layout](../references/layout.md).
9
+ 5. Author its [responsive layout](../references/responsive.md) and connect [theme styles](../references/style.md).
10
+ 6. Add the [required lines](../references/supplement.md#required-lines) and [validate](save-and-verify.md#validate-local-files) with `yarn lint`.
11
+ 7. Optionally, inspect the change in the [local render](save-and-verify.md#local-render).
12
+ 8. If the user asked to save to Wix, follow [save and verify](save-and-verify.md); the import sends the whole bundle, not only this Section.