@wix/agent-skills 1.20.1 → 1.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/package.json +1 -1
  2. package/skills/wix-app/SKILL.md +14 -112
  3. package/skills/wix-app/references/APP_TOOLS.md +2 -1
  4. package/skills/wix-app/references/BACKEND_EVENT.md +3 -3
  5. package/skills/wix-app/references/CUSTOM_ELEMENT_WIDGET.md +41 -152
  6. package/skills/wix-app/references/DASHBOARD_MODAL.md +4 -4
  7. package/skills/wix-app/references/SDK_MODULE_MAP.md +44 -0
  8. package/skills/wix-app/references/SITE_PLUGIN.md +36 -190
  9. package/skills/wix-app/references/app-tools/TOOLS.md +3 -1
  10. package/skills/wix-app/references/custom-element-widget/SETTINGS_PANEL.md +21 -0
  11. package/skills/wix-app/references/dashboard-page/ECOM_NAVIGATION.md +17 -0
  12. package/skills/wix-app/references/dashboard-plugin/SLOTS.md +4 -18
  13. package/skills/wix-app/references/site-plugin/EXAMPLES.md +1 -1
  14. package/skills/wix-headless-fast/SKILL.md +134 -49
  15. package/skills/wix-headless-fast/entry/skill.md +4 -3
  16. package/skills/wix-headless-fast/install/AGENTS.md +32 -0
  17. package/skills/wix-headless-fast/install/agents-md.mjs +39 -0
  18. package/skills/wix-headless-fast/install/attach.mjs +149 -42
  19. package/skills/wix-headless-fast/install/setup.mjs +239 -0
  20. package/skills/wix-headless-fast/references/blog/INSTRUCTIONS.md +2 -0
  21. package/skills/wix-headless-fast/references/blog/seed/read-site.mjs +22 -0
  22. package/skills/wix-headless-fast/references/bookings/INSTRUCTIONS.md +2 -0
  23. package/skills/wix-headless-fast/references/bookings/seed/read-site.mjs +28 -0
  24. package/skills/wix-headless-fast/references/cms/INSTRUCTIONS.md +2 -0
  25. package/skills/wix-headless-fast/references/cms/seed/read-site.mjs +20 -0
  26. package/skills/wix-headless-fast/references/events/INSTRUCTIONS.md +2 -0
  27. package/skills/wix-headless-fast/references/events/seed/read-site.mjs +26 -0
  28. package/skills/wix-headless-fast/references/forms/INSTRUCTIONS.md +2 -0
  29. package/skills/wix-headless-fast/references/forms/seed/read-site.mjs +20 -0
  30. package/skills/wix-headless-fast/references/members/INSTRUCTIONS.md +2 -0
  31. package/skills/wix-headless-fast/references/members/seed/read-site.mjs +15 -0
  32. package/skills/wix-headless-fast/references/portfolio/INSTRUCTIONS.md +2 -0
  33. package/skills/wix-headless-fast/references/portfolio/seed/read-site.mjs +20 -0
  34. package/skills/wix-headless-fast/references/portfolio/seed/seed-portfolio.mjs +19 -21
  35. package/skills/wix-headless-fast/references/pricing-plans/INSTRUCTIONS.md +2 -0
  36. package/skills/wix-headless-fast/references/pricing-plans/seed/read-site.mjs +21 -0
  37. package/skills/wix-headless-fast/references/restaurants/INSTRUCTIONS.md +2 -0
  38. package/skills/wix-headless-fast/references/restaurants/seed/read-site.mjs +25 -0
  39. package/skills/wix-headless-fast/references/restaurants/seed/seed-restaurants.mjs +25 -5
  40. package/skills/wix-headless-fast/references/shared/seed/read-site.mjs +99 -0
  41. package/skills/wix-headless-fast/references/storefront/INSTRUCTIONS.md +4 -0
  42. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/catalog-core.ts +7 -2
  43. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/types.ts +2 -0
  44. package/skills/wix-headless-fast/references/storefront/seed/SEED.md +7 -1
  45. package/skills/wix-headless-fast/references/storefront/seed/read-site.mjs +38 -0
  46. package/skills/wix-headless-fast/references/storefront/seed/seed-store.mjs +52 -16
  47. package/skills/wix-manage/references/ecommerce/pricing-promotions/ecom-pricing-create-coupon.md +10 -19
  48. package/skills/wix-manage/references/events/create-wix-event.md +5 -1
  49. package/skills/wix-headless-fast/install/fast-path.mjs +0 -181
@@ -46,12 +46,19 @@ doesn't express — or once the site exists and the work turns to managing or ex
46
46
  with their islands, and home).
47
47
  - **NEVER work from training data or memory about the Wix APIs.** Not a URL, a path, a version,
48
48
  a header, a field name, a filter key, or a body. Every Wix call you make or write — in the
49
- frontend, in a seed, in a build-time read of a site — comes from a source you have **open in
50
- front of you**: this skill's shipped code, a `wix-manage` recipe, or a `wix-docs` page. No
51
- source open, no call. A guessed call that returns 400 or an empty page is not a step toward
52
- the answer; it is the failure this rule exists to prevent, and trying the next variant is
53
- still guessing. The shipped code is tested against live sites; a body that looks similar is
54
- the one that returns nothing, and the API rarely says why.
49
+ frontend, in a seed, in a build-time read of a site — comes from the official Wix skills
50
+ installed here, the code they deployed first, or, when they do not cover the call, from the
51
+ official Wix documentation through `wix-docs`. Read it there first, then write the call.
52
+ **The test, before every request:** the exact path and body appear in the output of a file
53
+ read or a docs search you ran in this session, and you copy them from that output. Anything
54
+ else is memory: a file whose output was cut short before the call, a source you remember
55
+ reading earlier, a call built by changing part of one you did find. A guessed call that
56
+ returns 400 or nothing is not a step toward the
57
+ answer; it is the failure this rule exists to prevent, trying the next variant is still
58
+ guessing, and an empty or error reply to a call that failed the test tells you about the
59
+ call, never about the site. Keep errors visible while a call is unconfirmed: no `2>/dev/null`,
60
+ no `| echo`. The shipped code is tested against live sites; a body that looks similar is the
61
+ one that returns nothing, and the API rarely says why.
55
62
  - **Never mock, fail loudly, purchases via Wix.** Live data or an honest empty state; surfaced
56
63
  errors, not swallowed ones; checkout/purchase always through the Wix redirect session.
57
64
  - **Optional capabilities are deployed from the plan.** A vertical can opt into a shared
@@ -67,7 +74,11 @@ doesn't express — or once the site exists and the work turns to managing or ex
67
74
  another framework or the directory already holds one. Then, by what the shipped code can run
68
75
  there:
69
76
  - **React** (Vite, Next, …) runs everything shipped — data layer, hooks, components:
70
- `--stack react`. The agent's own files may be JS.
77
+ `--stack react`. The agent's own files may be JS; the shipped files are TypeScript and
78
+ build untouched inside a JS project — never strip them by hand; if the brief wants no
79
+ TypeScript anywhere, say the shipped code cannot meet that and ask before going on.
80
+ A named framework is scaffolded with its own command
81
+ first (`npm create vite@latest`, …), then step 3 runs in that folder.
71
82
  - **Another bundled JS framework** (Vue, Svelte, Solid, plain Vite): the data layer and the
72
83
  framework-free stores run (`src/wix/` has no React in it), the React hooks and components
73
84
  don't apply: `--stack lib`. The agent binds the stores and writes its framework's components
@@ -75,6 +86,30 @@ doesn't express — or once the site exists and the work turns to managing or ex
75
86
  - **No bundler, or another language** — a static site (plain HTML/CSS/JS), a server-rendered
76
87
  app (Flask, Laravel, Rails, …): **reference mode** (below). Nothing from `app/` deploys; the
77
88
  REST layer deploys for the browser side, and the server side ports it for its reads.
89
+
90
+ **What Wix hosting takes, and what each stack needs to be released there.** `wix release`
91
+ uploads the folder named in `wix.config.json` (`site.outputDirectory`) and serves it as
92
+ files — no SPA fallback, no directory index, no rewrites: `/` and real files resolve, a clean
93
+ client-side route answers 404 when loaded directly or shared. Server code runs only as a
94
+ Cloudflare Workers build, declared as `outputDirectory: { client, server }`.
95
+ - **Managed Astro** is the stack the Wix CLI scaffolds: the Wix Astro integration
96
+ (`@wix/astro`, ambient auth), the hosting adapter (`@wix/astro-wix-hosting-adapter`, the
97
+ Workers build), `@astrojs/react` with React 18 for the shipped components, and in
98
+ `astro.config.mjs` `integrations: [wix(), react()]`, `adapter: wixHostingAdapter()`,
99
+ `output: "server"`, `security: { checkOrigin: false }`, `image.domains` with
100
+ `static.wixstatic.com`. An Astro project made without the CLI has none of that; add it
101
+ before deploying, and the site serves every route. The integration supports **Astro 5**: a
102
+ project on another major is pinned to 5 first, or connected as a React host.
103
+ - **React and other bundlers** release their own build as files. So routes are hash routes,
104
+ or one emitted HTML file per route linked by its file name — decided before the first route
105
+ is written; any URL handed to Wix as a return target must be one the host serves. Verify by
106
+ loading a deep URL directly, not by navigating from `/`.
107
+ - **A framework whose build is a server** (Next, Nuxt, Remix, SvelteKit, …) releases only as a
108
+ static export (files, the rule above applies), or as a Workers build through
109
+ `outputDirectory: { client, server }`; otherwise it is self-hosted, with its domain added to
110
+ the OAuth app's allowed domains before checkout can return to it.
111
+ - **Static** (no build): `outputDirectory` points at the folder the pages live in; a route is a
112
+ page plus a query-string slug (reference mode, below).
78
113
  2. **The seed plan.** When the brief supplies the content in any form — a CSV, JSON or
79
114
  spreadsheet, a list in the prompt, a PDF price list, a folder of photos and a text file, a
80
115
  link to their current catalog, anything else that names the content — that IS the plan: map
@@ -87,16 +122,44 @@ doesn't express — or once the site exists and the work turns to managing or ex
87
122
  is there (step 3's attach path). Requires from here on: Node ≥ 20.11 and a logged-in Wix CLI
88
123
  (`npx @wix/cli@latest whoami`; login via the device-code flow — surface the URL+code, never
89
124
  read tokens into context).
90
- 3. **Create runs (empty directory): run the fast path** — one deterministic call:
125
+ 3. **Set up the project, in its folder** — one deterministic call, the same for an empty folder
126
+ and for a project already on disk; **the folder decides** what it does:
91
127
 
92
128
  ```bash
93
- node <SKILL_ROOT>/install/fast-path.mjs --business-name "<Brand>" --plan plan.json --vertical <vertical>
129
+ node <SKILL_ROOT>/install/setup.mjs --vertical <vertical> [--plan plan.json] [--business-name "<Brand>"]
94
130
  ```
95
131
 
132
+ - **Empty** (or only loose files: a CSV, a brief) → **create**: scaffolds the Wix CLI's
133
+ Astro project here; `--business-name` names the site.
134
+ - **A project without `wix.config.json`** (a `package.json`, or an `index.html` at the root:
135
+ someone's Astro, Vite, Next, plain HTML) → **connect**: `init` in place links the folder
136
+ to a new site (the site is named after the folder), then the shipped code deploys into
137
+ the project as it is. Pass `--stack` for the stack you resolved in step 1, and make the
138
+ project what that stack needs on Wix hosting (step 1) before or right after the call.
139
+ - **`wix.config.json` and a project** → refuses: the folder is already a Wix project with a
140
+ frontend, whether the CLI made it, a hand wrote it, or this skill built it. Three commands
141
+ from the project root do everything setup would: `deploy.mjs <vertical…> --stack <stack>`
142
+ adds this skill's code or a solution (the client id is read from the config), then ONE
143
+ `npm install`, then the seed module if there is content to create. A project this skill
144
+ built needs only the first, for a new solution; a change to what is built is file edits
145
+ and a release.
146
+ - **`wix.config.json` and no project** (what `init` leaves in an empty folder) → the site
147
+ exists and has no frontend yet: `attach.mjs` (below), which takes the site from the config,
148
+ reuses its hosting, scaffolds and deploys. No seed: the site owns its content.
149
+ - The brief names a site by id → the existing-site path below, not this call. In a folder
150
+ that already holds a project, attach writes the config into it and deploys for `--stack`
151
+ instead of scaffolding. A frontend that will be hosted elsewhere (Vercel, your own server)
152
+ runs attach with `--hosting self --origin <url>[,<url>]`: no Wix hosting is created, and the
153
+ origins go on the OAuth app's allow-list so checkout can return to them.
154
+
96
155
  `--vertical` is required and picks which shipped code deploys AND which seed runs — use
97
- the vertical you resolved from the Verticals table.
156
+ the vertical you resolved from the Verticals table. **`--plan` decides whether anything is
157
+ seeded**: pass the plan from step 2 when there is one; a site that already holds its content
158
+ gets none. Seeding is **additive**: it never deletes or overwrites what the site holds; if a
159
+ cleanup seems needed, ask. The `ready_for_brand_layer` event says `mode` (create or
160
+ connect), the stack, and the `next` for that stack, including how it releases.
98
161
 
99
- fast-path scaffolds with `--skip-git`: it composes its own steps and leaves version control to
162
+ setup scaffolds with `--skip-git`: it composes its own steps and leaves version control to
100
163
  you / the enclosing repo, so it does **not** create the scaffold's usual git repo + initial
101
164
  commit (which would otherwise become a nested-repo gitlink if the project lands inside a repo).
102
165
 
@@ -127,7 +190,7 @@ doesn't express — or once the site exists and the work turns to managing or ex
127
190
 
128
191
  The installed apps name the verticals (Wix Stores → storefront, Wix Bookings → bookings, and
129
192
  so on per the Verticals table); the brief picks among them. Then one deterministic call, same
130
- shape as the fast path:
193
+ shape as setup:
131
194
 
132
195
  ```bash
133
196
  node <SKILL_ROOT>/install/attach.mjs --site <siteId> --business-name "<site name>" --vertical <vertical>[,<vertical>]
@@ -137,25 +200,34 @@ doesn't express — or once the site exists and the work turns to managing or ex
137
200
  after creating one — the site's OAuth app, Wix hosting, `wix.config.json` — against the site
138
201
  given, scaffolds the CLI's Astro template, deploys the shipped code, and starts the install
139
202
  detached. No seed runs and nothing on the site changes: the content is the site's own, read
140
- live through the deployed data layer. When the site already has a headless frontend,
141
- `attached` says so (`hosting: "reused"`) with its URL — `wix release` from this project
142
- replaces that frontend; say so when you close.
203
+ live through the deployed data layer. `attached` also says whether a frontend is already
204
+ serving at the site's address (`frontend.serving`, with the release date). When it is, a
205
+ `wix release` from this project replaces it — the old deployment keeps its own address and
206
+ production can be pointed back, but the user's site changes. Tell the user before you release,
207
+ with the address and the date; if the brief did not ask for a new frontend, ask first and
208
+ wait. Say it again when you close.
143
209
 
144
210
  **Get the measure of the site before you design.** Enough to know what you are building
145
- for: what the chosen verticals will render, roughly how much of it, and what it is like — a
146
- bakery with six products in three categories designs differently from six hundred. Go
147
- deeper only where the brief points (a flash sale on cakes: is there a Cakes category, do the
148
- cakes carry a sale price). Everything else the pages read live through the deployed data
149
- layer; you are sizing the content, not collecting it. These are build-time reads with the
150
- **site's** token, `npx -y @wix/cli@latest token --site <siteId>`, sent raw as the
151
- `Authorization` header (the account token from the call above does not scope to a site).
152
- **The rule above applies in full: not one of these calls comes from memory.** Open the
153
- source first, then call. Three sources, in this order:
154
- - **The vertical's shipped `rest/` module**, at
155
- `.agents/skills/wix-headless-fast/references/<vertical>/rest/` — the same reads the pages
156
- make, written as literal `fetch` calls: URL, body, `fields`, filter keys. It is not in
157
- `src/` (the Astro stack deploys the SDK layer, which hides the body behind a method), so
158
- read it from the skill.
211
+ for: what the chosen verticals will render, roughly how much of it, and what it is like —
212
+ six items in three groups design differently from six hundred. Run the vertical's reader:
213
+
214
+ ```bash
215
+ node <SKILL_ROOT>/references/<vertical>/seed/read-site.mjs --site <siteId> [--limit <n>]
216
+ ```
217
+
218
+ It prints one JSON: whether the vertical's app is installed, counts, one page of each entity
219
+ with the fields the pages render, and `calls`, the requests it made with their documentation
220
+ URLs. The lists are one page; the counts are the site.
221
+
222
+ When the brief needs a read the script does not make, it is a build-time call with the
223
+ **site's** token, sent raw as the `Authorization` header (the account token from the call
224
+ above does not scope to a site), minted inline in each command —
225
+ `-H "Authorization: $(npx -y @wix/cli@latest token --site <siteId>)"` — and never written to
226
+ a file, not in the project and not in `/tmp`.
227
+ **The rule above applies in full: not one of these calls comes from memory.** Read the
228
+ request where it is written, then call. Where to read, in this order:
229
+ - **The reader**, `references/<vertical>/seed/read-site.mjs` — the reads the pages make, as
230
+ literal calls with their documentation URLs.
159
231
  - **`wix-manage`**, at `.agents/skills/wix-manage/` — REST recipes for managing a site's
160
232
  business solutions: exact endpoint, method and payload per operation, curl included. Its
161
233
  SKILL.md is the index, by solution; open the recipe for the vertical's solution.
@@ -165,17 +237,20 @@ doesn't express — or once the site exists and the work turns to managing or ex
165
237
  /mcp-docs-search/v1/docs/search/markdown`, natural-language `search_term`) that returns
166
238
  condensed method docs — endpoint, request example, response shape — and the rule that any
167
239
  `dev.wix.com/docs/…` URL plus `.md` is the full page. Progressive: search first, read the
168
- full page only when the hit lacks what you need.
169
- If the source you opened does not have the call, go to the next one; do not try a variant.
170
-
171
- **Connect/iterate runs (a project already on disk): never scaffold — use the manual path:**
172
- `CI=1 npm create @wix/new@latest init` in place if there is no `wix.config.json` yet; then
173
- `node <SKILL_ROOT>/install/deploy.mjs <vertical…> --stack astro|react --plan plan.json` from the project root
174
- (react stack: add `--client-id` if there is no `wix.config.json` to read the public id
175
- from); then ONE `npm ci --ignore-scripts || npm install --ignore-scripts` (backgroundable —
176
- but **never run a second npm install concurrently**: two npms in one `node_modules` race and
177
- redo each other's work); then seed per the vertical's `seed/SEED.md`. Seeding is
178
- **additive**: never delete or overwrite existing content; if a cleanup seems needed, ask.
240
+ full document only when the hit lacks what you need.
241
+ If what you opened does not have the call, go to the next; do not try a variant, and do not
242
+ build one from a call you did find: the path and body you send are copied from the output
243
+ you read or they are not sent.
244
+
245
+ **Recovering one step, or adding a solution later:** the pieces run on their own from the
246
+ project root — `node <SKILL_ROOT>/install/deploy.mjs <vertical…> --stack <stack>` (the client
247
+ id is read from `wix.config.json`), ONE `npm ci --ignore-scripts || npm install
248
+ --ignore-scripts` (**never a second npm install concurrently**: two npms in one
249
+ `node_modules` race and redo each other's work; setup already started one — wait on its
250
+ marker), the vertical's seed module per its `seed/SEED.md`.
251
+ A code change on an existing project is done when it is **released** (step 5) and the live
252
+ URL shows it — not when a dev server or a local build shows it. A management change (a
253
+ recipe against the site) needs no release; the frontend reads it live.
179
254
 
180
255
  4. **Design and build the presentation while the install finishes** — in the project dir from
181
256
  the `ready_for_brand_layer` event, per the vertical's `INSTRUCTIONS.md`: set the `@theme`
@@ -195,14 +270,17 @@ doesn't express — or once the site exists and the work turns to managing or ex
195
270
  (`node_modules/.package-lock.json`) and the seed's (`.seed-exit`) both exist — **verify the
196
271
  seed succeeded** (`.seed-exit` contains `0`; `seed-result.json` has the created counts for
197
272
  your summary — if non-zero, read `seed.log` and re-run the seed module manually). Those two
198
- seed files exist **only when fast-path started the seed** (attach runs none: only the install
273
+ seed files exist **only when setup started the seed** (attach runs none: only the install
199
274
  marker is waited on). When you ran `seed-store.mjs`
200
275
  yourself (connect/iterate runs, reference mode), there is no marker to wait for: the process's
201
276
  exit code is the result and its stdout is the JSON — wait on the process (a foreground run,
202
277
  or `wait` on its pid), not on a file. Then
203
- **build & release once** (managed):
204
- `npx @wix/cli@latest build` then `npx @wix/cli@latest release` (if the install failed, run
205
- it once more and then build). Don't build+release mid-flow; backend content is fetched at
278
+ **build & release once** (managed), as the `next` of the `ready_for_brand_layer` event says
279
+ for the stack: Astro → `npx @wix/cli@latest build` then `npx @wix/cli@latest release`;
280
+ React or another bundler → the project's own build, then `npx @wix/cli@latest release` of
281
+ the build folder named in `wix.config.json` (deep URLs must answer 200 directly, step 1);
282
+ static → `release` alone. If the install failed, run it once more and then build. Don't
283
+ build+release mid-flow; backend content is fetched at
206
284
  runtime, so a re-release never "refreshes" seeded data. The run is complete only when the
207
285
  site is released — close with the live URL and the dashboard link
208
286
  `https://manage.wix.com/dashboard/<siteId>`. **Copy the live URL verbatim from the
@@ -255,6 +333,13 @@ them; this section is the mechanics, the same for every vertical.
255
333
  per-visitor tokens. If that state must run server-side anyway, `client.ts`'s header applies:
256
334
  one token set per visitor in the visitor's session, never one process-wide token (that is one
257
335
  identity shared by everyone).
336
+ - **A Wix-hosted flow returns to the origin that started it, and only to one it knows.**
337
+ Checkout, a booking payment, a plan purchase all open on Wix and come back to your server;
338
+ the return works only for an origin on the site's OAuth app allow-list. Add the server's
339
+ origin — the dev one while verifying (`http://localhost:<port>`), the public https one when it
340
+ goes live — before the first checkout test: wix-manage's *Manage OAuth Apps* recipe, "Update an
341
+ OAuth App", field `allowedRedirectDomains`, on the app whose id is `appId` in
342
+ `wix.config.json`. Without it the Wix page opens and cannot return. Do it; do not only say it.
258
343
  - **Pre-rendered → Wix-hosted.** If the project builds to static HTML (Frozen-Flask, Pelican,
259
344
  Hugo, Eleventy, any static-site generator), Wix can host the output: run `deploy.mjs
260
345
  <vertical> --stack static --out <build dir>` so `js/wix/` lands inside the build output (or
@@ -265,7 +350,7 @@ them; this section is the mechanics, the same for every vertical.
265
350
  of that folder after your last build, served as files: every asset a page references must be
266
351
  in there and current — if the pipeline has more than one build step (templates, then a CSS or
267
352
  asset bundle), they all run, in order, on every rebuild, or the release carries a stale piece.
268
- `/shop` does not resolve to `shop/index.html`; name the file and link to it. Generated pages
353
+ a clean path does not resolve to a folder's `index.html`; name the file and link to it. Generated pages
269
354
  sit at different depths, so reference `js/wix/` through one base path (a template variable,
270
355
  or root-relative `/js/wix/…`), never `./js/wix/` — a relative path breaks one level down. **The generated page
271
356
  is the first paint, not the whole surface**: the vertical's interactive behaviour (a store's
@@ -286,8 +371,8 @@ them; this section is the mechanics, the same for every vertical.
286
371
  tile's bottom, an overlay that locks scroll and returns focus). Take the rules; write them in the
287
372
  CSS your stack uses, on a token set you define — nothing here asks you to add Tailwind. Close with run (or
288
373
  rebuild) instructions, the live URL when Wix hosts the output, the dashboard link, and — when
289
- hosting is theirs — the allowed-domain step (add the public https origin to the OAuth app
290
- before a Wix-hosted flow such as checkout can return).
374
+ hosting is theirs — which origins are on the OAuth app's allow-list and that the public one
375
+ must be added when the server moves (the step above).
291
376
  - Both: the calls in `rest/` are the ones a **visitor token** may make from a page — public reads
292
377
  and the visitor's own actions. Anything elevated (writes to content, other people's data) runs
293
378
  server-side per `references/shared/CUSTOM_OPERATIONS.md`; the seed's CLI token never belongs in
@@ -311,10 +396,10 @@ them; this section is the mechanics, the same for every vertical.
311
396
  | Restaurant: menu with photos, online ordering, table reservations | **restaurants** | `references/restaurants/INSTRUCTIONS.md` |
312
397
 
313
398
  Verticals compose: a brief that spans several (a restaurant with a blog, a store with member
314
- accounts) deploys them together — fast-path takes one vertical; deploy the rest with
399
+ accounts) deploys them together — setup takes one vertical; deploy the rest with
315
400
  `node <SKILL_ROOT>/install/deploy.mjs <vertical…>` from the project root before the install
316
401
  starts, and run each vertical's seed. A request that doesn't match any shipped vertical isn't
317
- this skill's fast path — route it to `wix-headless` rather than improvising an unshipped
402
+ this skill's shipped code — route it to `wix-headless` rather than improvising an unshipped
318
403
  vertical here.
319
404
 
320
405
  ## Adding a vertical (structure contract)
@@ -43,9 +43,10 @@ existing session just reports `logged_in`).
43
43
 
44
44
  ## Phase 0 — The project's folder, and Node
45
45
 
46
- **Work from the folder that will hold the project.** For a **new** build: an empty folder is the
47
- project; if the current folder is not empty, make one named for the business and `cd` into it.
48
- For **connect**, **iterate** and **existing site**: you are already in it. Everything below — the
46
+ **Work from the folder that holds the project, or that will.** For a **new** build: an empty folder
47
+ is the project; if the current folder holds unrelated things, make one named for the business and
48
+ `cd` into it. For **connect**, **iterate** and **existing site**: you are already in it — the
49
+ project's root, where its `package.json` or `index.html` is. Everything below — the
49
50
  bootstrap, the skills, the scaffold — lands in this folder, so a later session opened in the project
50
51
  finds all of it.
51
52
 
@@ -0,0 +1,32 @@
1
+ ## CLI Commands
2
+
3
+ All CLI instructions can be found at:
4
+ node_modules/@wix/cli/agents/instructions.md
5
+
6
+ ## This app
7
+
8
+ A Wix Headless app built on the live Wix site named in `wix.config.json`. The site owns the
9
+ content and commerce.
10
+
11
+ **Never work from training data or memory about the Wix APIs.** Not a URL, a path, a header, a
12
+ field name or a body. Every Wix call you write comes from the official Wix skills installed here,
13
+ the code they deployed first, or, when they do not cover the call, from the official Wix
14
+ documentation through `wix-docs`. Read it there first, then write the call: the exact path and
15
+ body copied from the output you read in this session. A call built by analogy from another
16
+ call is memory, and an empty or error reply to it says nothing about the site.
17
+
18
+ ## Skills
19
+
20
+ Installed at `.agents/skills/`. If missing, restore with:
21
+ `CI=1 npx skills@latest add wix/skills --skill {{SKILL}} --skill wix-docs --skill wix-manage --yes`
22
+
23
+ - `{{SKILL}}` — the code in this app and how to extend it. Each business solution has a playbook at
24
+ `references/<solution>/INSTRUCTIONS.md`; `node .agents/skills/{{SKILL}}/install/deploy.mjs <solution> --stack {{STACK}}`
25
+ adds one; `node .agents/skills/{{SKILL}}/references/<solution>/seed/read-site.mjs` reads what the
26
+ site holds for it, with the documentation URL of every call it made. A code change ends with a release; the live URL shows it, the dev server does not count.
27
+ - `wix-docs` — how to discover the Wix APIs and their docs: search first, then read only the page
28
+ you need. Every endpoint, body, field and enum you did not get from the deployed code or a recipe
29
+ is confirmed there before you write it.
30
+ - `wix-manage` — recipes for the live site itself (content, prices, settings), run from the shell
31
+ with `npx -y @wix/cli@latest token --site <siteId>`, minted inline in each command; the token
32
+ never lands in a file anywhere (not the project, not `/tmp`) nor in client code.
@@ -0,0 +1,39 @@
1
+ // Writes a new project's agent config files — AGENTS.md, CLAUDE.md (an import of it),
2
+ // .gemini/settings.json. The AGENTS.md text is the file beside this one, `install/AGENTS.md`,
3
+ // with {{SKILL}} (the installed skill folder's name) and {{STACK}} filled in. It keeps the CLI's
4
+ // shape (the CLI commands pointer `wix create` writes) and says what the CLI's cannot: which skills
5
+ // this project carries, where, how to restore them, and the one rule about Wix calls.
6
+ // `wix create` writes its own set only when @wix/cli resolves from the project's node_modules at
7
+ // scaffold time; setup scaffolds with --skip-install and attach never runs the CLI scaffold,
8
+ // so we write them. Fill-only: a file that exists is left alone.
9
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
10
+ import { dirname, join } from "node:path";
11
+ import { fileURLToPath } from "node:url";
12
+
13
+ const TEMPLATE = join(dirname(fileURLToPath(import.meta.url)), "AGENTS.md");
14
+
15
+ // The three files, as the CLI names them. Exported so setup can drop the CLI's own copies from
16
+ // the scaffold before moving it up (ours replaces them; a file the USER already has is kept).
17
+ export const AGENT_CONFIG_FILES = ["AGENTS.md", "CLAUDE.md", ".gemini"];
18
+
19
+ export function writeAgentsMd(projectDir, vars) {
20
+ const written = [], kept = [];
21
+ const agents = join(projectDir, "AGENTS.md");
22
+ if (existsSync(agents)) kept.push("AGENTS.md");
23
+ else {
24
+ const text = readFileSync(TEMPLATE, "utf8").replace(/\{\{(\w+)\}\}/g, (_, k) => vars[k.toLowerCase()] ?? "");
25
+ writeFileSync(agents, text); written.push("AGENTS.md");
26
+ }
27
+ const claude = join(projectDir, "CLAUDE.md");
28
+ if (existsSync(claude)) kept.push("CLAUDE.md");
29
+ else { writeFileSync(claude, "@AGENTS.md"); written.push("CLAUDE.md"); }
30
+ const gemini = join(projectDir, ".gemini", "settings.json");
31
+ if (existsSync(gemini)) kept.push(".gemini/settings.json");
32
+ else {
33
+ mkdirSync(join(projectDir, ".gemini"), { recursive: true });
34
+ writeFileSync(gemini, JSON.stringify({ contextFileName: "AGENTS.md" }, null, 2) + "\n");
35
+ written.push(".gemini/settings.json");
36
+ }
37
+ // kept: the folder already had its own — left untouched, so it says nothing about these skills
38
+ return { written, kept };
39
+ }