@wix/agent-skills 1.18.2 → 1.19.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 (68) hide show
  1. package/package.json +1 -1
  2. package/skills/wix-app/SKILL.md +42 -40
  3. package/skills/wix-app/references/BACKEND_API.md +151 -152
  4. package/skills/wix-app/references/DASHBOARD_PAGE.md +6 -10
  5. package/skills/wix-app/references/EDITOR_REACT_COMPONENT.md +16 -7
  6. package/skills/wix-app/references/EXTENSION_REGISTRATION.md +12 -8
  7. package/skills/wix-app/references/WIX_PATTERNS_DOCS.md +53 -131
  8. package/skills/wix-app/references/dashboard-page/UX_SUCCESS_MODEL.md +1 -2
  9. package/skills/wix-app/references/editor-react-component/ACCESSIBILITY.md +83 -73
  10. package/skills/wix-app/references/editor-react-component/COMPONENT-CONTRACT.md +3 -2
  11. package/skills/wix-app/references/editor-react-component/CSS-GUIDELINES.md +9 -0
  12. package/skills/wix-app/references/editor-react-component/PARTS.md +5 -2
  13. package/skills/wix-app/references/editor-react-component/REACT-GUIDELINES.md +1 -1
  14. package/skills/wix-app/scripts/pkg-root.cjs +73 -0
  15. package/skills/wix-app/scripts/scan-a11y-code.cjs +310 -40
  16. package/skills/wix-app/scripts/scan-a11y-eslint.cjs +118 -24
  17. package/skills/wix-app/scripts/scan-a11y-render.cjs +551 -0
  18. package/skills/wix-app/scripts/scan-a11y-review.cjs +373 -0
  19. package/skills/wix-base44-connector/SKILL.md +24 -22
  20. package/skills/wix-base44-connector/scripts/utils.cjs +39 -3
  21. package/skills/wix-docs/SKILL.md +47 -20
  22. package/skills/wix-headless/entry/bootstrap.mjs +106 -50
  23. package/skills/wix-headless/entry/skill.md +5 -3
  24. package/skills/wix-headless/references/managed/AUTHENTICATION.md +25 -5
  25. package/skills/wix-headless-fast/SKILL.md +25 -7
  26. package/skills/wix-headless-fast/entry/skill.md +23 -14
  27. package/skills/wix-headless-fast/install/fast-path.mjs +48 -5
  28. package/skills/wix-headless-fast/install/pin-agents-md.mjs +57 -0
  29. package/skills/wix-headless-fast/references/shared/CUSTOM_OPERATIONS.md +3 -3
  30. package/skills/wix-headless-fast/references/storefront/INSTRUCTIONS.md +204 -35
  31. package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useShop.ts +146 -36
  32. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/cart-store.ts +8 -2
  33. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/catalog.ts +95 -20
  34. package/skills/wix-headless-fast/references/storefront/seed/SEED.md +21 -2
  35. package/skills/wix-headless-fast/references/storefront/seed/seed-store.mjs +104 -18
  36. package/skills/wix-manage/SKILL.md +14 -8
  37. package/skills/wix-manage/references/bookings/booking-service-policy-setup.md +59 -33
  38. package/skills/wix-manage/references/bookings/bookings-staff-setup.md +45 -22
  39. package/skills/wix-manage/references/bookings/multi-resource-service-creation.md +70 -12
  40. package/skills/wix-manage/references/calendar/configure-default-business-hours.md +53 -17
  41. package/skills/wix-manage/references/google-ads/billing-and-payment.md +3 -3
  42. package/skills/wix-manage/references/google-ads/create-performance-max-campaign.md +8 -8
  43. package/skills/wix-manage/references/google-ads/get-campaign-suggestions.md +4 -4
  44. package/skills/wix-manage/references/google-ads/google-ads-dashboard-navigation.md +1 -1
  45. package/skills/wix-manage/references/google-ads/install-and-create-account.md +9 -9
  46. package/skills/wix-manage/references/google-ads/query-campaign-analytics.md +7 -7
  47. package/skills/wix-manage/references/seo/manage-content-plan.md +181 -135
  48. package/skills/wix-manage/references/seo/manage-google-search-console.md +272 -0
  49. package/skills/wix-manage/references/sites/upload-static-site.md +53 -0
  50. package/skills/wix-manage/references/stores/change-store-currency.md +1 -1
  51. package/skills/wix-manage/references/stores/create-product-catalog-v3.md +17 -1
  52. package/skills/wix-vibe-headless/platforms/base44-ecom-light-seed-with-install.md +12 -9
  53. package/skills/wix-vibe-headless/platforms/base44-ecom-light-seed.md +12 -9
  54. package/skills/wix-vibe-headless/platforms/base44-ecom-light.md +1 -1
  55. package/skills/wix-vibe-headless/platforms/base44.md +11 -3
  56. package/skills/wix-vibe-headless/references/storefront/INSTRUCTIONS.md +5 -1
  57. package/skills/wix-vibe-headless/references/storefront/seed/SEED.md +5 -4
  58. package/skills/wix-vibe-headless/references/storefront/seed/seed-store.cjs +33 -5
  59. package/skills/wix-app/references/dashboard-page/COLLECTION_TOOLKIT.md +0 -80
  60. package/skills/wix-app/references/dashboard-page/ENTITY_PAGE_TOOLKIT.md +0 -140
  61. package/skills/wix-app/references/dashboard-page/PATTERNS_BUNDLE_READING.md +0 -112
  62. package/skills/wix-headless-fast/references/storefront/app/components/storefront/ProductCard.tsx +0 -100
  63. package/skills/wix-headless-fast/references/storefront/app/components/storefront/ProductDetailView.tsx +0 -130
  64. package/skills/wix-headless-fast/references/storefront/app/components/storefront/ProductGrid.tsx +0 -48
  65. package/skills/wix-headless-fast/references/storefront/app/components/storefront/ShopView.tsx +0 -66
  66. package/skills/wix-headless-fast/references/storefront/app/components/storefront/VariantPicker.tsx +0 -103
  67. package/skills/wix-headless-fast/references/storefront/app-astro/pages/products/[slug].astro +0 -56
  68. package/skills/wix-headless-fast/references/storefront/app-astro/pages/shop.astro +0 -23
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/agent-skills",
3
- "version": "1.18.2",
3
+ "version": "1.19.1",
4
4
  "description": "Wix Skills for AI coding agents — versioned npm distribution of the wix/skills content.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -8,7 +8,7 @@ compatibility: requires `@wix/cli` >= 1.1.192.
8
8
 
9
9
  Helps build extensions for Wix CLI applications. Covers all extension types: dashboard pages, modals, plugins, menu plugins, custom element widgets, Editor React components, site plugins, embedded scripts, backend APIs, events, service plugins, and data collections.
10
10
 
11
- **Scaffolding is owned by the Wix CLI.** For every extension type except Backend API, files, folders, builder boilerplate, UUIDs, and `src/extensions.ts` registration are generated by `wix generate --params`. This skill provides the decision logic, API guidance, configuration semantics, and business-logic patterns that fill in the generated stubs.
11
+ **Scaffolding is owned by the Wix CLI.** Use `wix generate --params` for every supported type. It generates files and, where applicable, builder boilerplate, UUIDs, and `src/extensions.ts` registration. HTTP endpoints are discovered from files and need no registration. This skill provides the decision logic, API guidance, configuration semantics, and business-logic patterns that fill in the generated stubs.
12
12
 
13
13
  ## ⚠️ MANDATORY WORKFLOW CHECKLIST ⚠️
14
14
 
@@ -22,14 +22,19 @@ Helps build extensions for Wix CLI applications. Covers all extension types: das
22
22
  - [ ] Determined full scoped collection IDs if Data Collection extension is being created (see [Collection ID Coordination](#collection-id-coordination))
23
23
  - [ ] Explained recommendation with reasoning
24
24
  - [ ] **Step 2:** Read extension reference file(s) for the chosen type(s) and the project-wide [CODE_QUALITY.md](references/CODE_QUALITY.md)
25
- - [ ] **Dashboard page UI:** Translated the prompt into a workflow before choosing components — what the user must understand, focus on, investigate, act on, and see confirmed. See [UX Success Model](references/dashboard-page/UX_SUCCESS_MODEL.md), and [Collection Toolkit](references/dashboard-page/COLLECTION_TOOLKIT.md) for which component serves each need.
26
- - [ ] **The page shows aggregate numbers, not only rows** (`SummaryBar`) — unless the prompt asks for a single record. "How many, and which ones need me" is why someone opens a dashboard.
25
+ - [ ] **Dashboard page UI:** Translated the prompt into a workflow before choosing components — what the user must understand, focus on, investigate, act on, and see confirmed. See [UX Success Model](references/dashboard-page/UX_SUCCESS_MODEL.md), and the installed package's own `Collection Toolkit.md` guide for which component serves each need ([The Discovery Chain](references/WIX_PATTERNS_DOCS.md#the-discovery-chain)).
27
26
  - [ ] **A row the user can open** — WDS `SidePanel` to inspect without losing the filtered list, or `EntityPage` for deep or shareable detail — unless the prompt is explicitly a report or an export.
28
27
  - [ ] **Every filter reaches the query**: declared in the collection hook's `filters` and read inside `fetchData`. Filter UI that never narrows the rows is a defect that looks like a feature.
29
28
 
30
- A filtered table with none of the three is what gets built when nobody states the requirement — it is the most common way a generated dashboard disappoints.
31
- - [ ] **🛑 Patterns Docs Gate (MANDATORY for any dashboard page UI):** Read [WIX_PATTERNS_DOCS.md](references/WIX_PATTERNS_DOCS.md), then `Read` `dist/dts-bundle/index.json` for the component inventory, upgrading `@wix/patterns` if that file is missing. The patterns docs are only ever read directly from those two published files — never by hand from anywhere else in `node_modules`.
32
- - [ ] **🛑 Component Docs Gate (MANDATORY, dashboard UI only):** Printed the doc for every patterns component, hook, and state type you are about to write — `Read` its file from `dist/docs/index.json`, and `Read` its bundled `.d.ts` from `dist/dts-bundle/index.json` for any patterns type you name in your own code. The inventory gives the name; the doc gives the props and the import path. Name what you read before the first line of JSX.
29
+ A filtered table with neither of the two is what gets built when nobody states the requirement — it is the most common way a generated dashboard disappoints.
30
+ - [ ] **🛑 Patterns Docs Gate (MANDATORY for any dashboard page UI):** Read [WIX_PATTERNS_DOCS.md](references/WIX_PATTERNS_DOCS.md), then **probe** `dist/docs/index.json` with `grep`/`python3` — never a whole-file `Read`, which truncates it silently. It is the one file that says, per symbol, where to import it from (`importPath`), whether its props live in the doc or in a `.d.ts` (`bundle`), and which worked examples exist (`examples`). Upgrade `@wix/patterns` if that file is missing. Patterns API facts come only from the published `dist/docs/` (pages), `dist/examples/` (worked calls) and `dist/dts-bundle/` (types) trees — never from `src/`, `dist/esm/`, or any other path inside the package, with one named exception: `dist/types/` when a bundle has stubbed the prop you need (WIX_PATTERNS_DOCS.md step 5).
31
+ - [ ] **🛑 Component Docs Gate (MANDATORY, dashboard UI only):** For each patterns symbol you are about to write, decided **from the index** which single artifact answers the question you actually have, and read that one — not all three:
32
+ - **Where do I import it from?** → the entry's `importPath`. No file read at all.
33
+ - **How do I call it?** (generics, what a callback receives and returns, how the pieces nest) → the **example** named in `examples`. One worked example beats reconstructing a call from a chain of type files; a hook's example is often filed under the component it pairs with.
34
+ - **What props, and which are optional?** → **the example first** — it shows the props in use, correctly typed. For what an example cannot show (optionality, union members, an exact callback signature): entry has `bundle` ⇒ read that `.d.ts`; entry has no `bundle` ⇒ the doc's own table is complete and marks `Required`, so read the doc. The two are mutually exclusive — reading both is always one hop too many. **Two thirds of bundles stub the parent that holds the props** (`propsTotal` far above what the file declares is the tell); when that happens, read the parent the index names — one hop — batch any `readWith` files you still need into a single call, and fall back to `dist/types/` for the declaration `tsc` enforces. WIX_PATTERNS_DOCS.md step 5 has the procedure.
35
+ - **Any setup requirement or gotcha?** → the doc's prose. Rare, but load-bearing where present (routers, providers).
36
+
37
+ State which artifact you read per symbol, and why, before the first line of JSX. Reading a doc *and* its bundle for the same symbol, or opening a page for an `importPath` the index already gave you, is the failure this gate exists to prevent.
33
38
  - [ ] **Step 3:** Checked API references; used MCP discovery only for gaps
34
39
  - [ ] Site/editor extensions only: kept SDK calls in the extension by default, routing out only business-wide methods a visitor genuinely cannot call (see [Identity and Elevation Requirement](#identity-and-elevation-requirement))
35
40
  - [ ] **Step 4a:** Scaffolded each CLI-supported extension via `wix generate --params`
@@ -107,32 +112,31 @@ Dashboard pages at Wix are built from two libraries. For **every** UI element, r
107
112
 
108
113
  ### 1. `@wix/patterns` — page structure and data collections
109
114
 
110
- Patterns owns the page shell and everything collection-shaped. These concepts are patterns' territory — if you need one, look it up there first rather than assembling it from WDS parts:
111
-
112
- | Need | Look for |
113
- | --- | --- |
114
- | Page shell, header, content area, sticky footer | `CollectionPage`, `EntityPage`, `SettingsPage` (+ their `.Header` / `.Content` sub-parts) |
115
- | Table, grid, table↔grid switch, folder views | `Table`, `Grid`, `TableGridSwitch`, `TableFolders`, `GridFolders` |
116
- | Collection state — paging, sorting, selection, loading | `useTableCollection()` and its sibling hooks (one per collection type) |
117
- | Filters, search, sorting, view presets/tabs | the collection's filter and view APIs |
118
- | Row actions, bulk actions, drag-and-drop | the collection's feature APIs |
119
- | Multiple pages inside one extension | `PatternsReactRouter`, `PatternsReactRoute`, `usePatternsNavigate` |
120
- | **Add / edit / view one item from a collection** | `EntityPage` + `useEntityPage` (fetch + save + validation), reached with `usePatternsNavigate().navigateToEntityPage`. Form state via `useForm` / `useController` from `@wix/patterns/form` (`useController`, never `register`). **Not** a dashboard modal — see [Entity create and edit](#entity-create-and-edit) |
121
- | Overlays tied to a collection (item picker, bulk-action confirm) | `PickerModal` / `usePickerModal`, `bulkActionModal` |
122
-
123
- **Looking a component up is two direct file reads** — no script, never `node_modules` browsed by hand. Resolve the installed package root once per session ([Prerequisites](references/WIX_PATTERNS_DOCS.md#prerequisites)), then reuse it. Start with what exists:
124
-
125
- ```bash
126
- cat <pkgRoot>/dist/dts-bundle/index.json
127
- ```
115
+ Patterns owns the page shell and everything collection-shaped: page shells and their header /
116
+ content / footer sub-parts, tables and grids and the switch between them, folder views,
117
+ collection state (paging, sorting, selection, loading), filters, search, view presets, row and
118
+ bulk actions, drag-and-drop, in-extension routing, the overlays tied to a collection, and the
119
+ add / edit / view page for one listed item. If you need one of those, it is patterns' — look it
120
+ up rather than assembling it from WDS parts.
128
121
 
129
- Then read the doc for each name you plan to use, including the state types they cross-reference — `Read <pkgRoot>/dist/docs/index.json` to find the file, then `Read` it directly. Props and import paths exist only there, and patterns is not a flat namespace — `@wix/patterns/page`, `/provider`, `/form` — so an import from memory is a guess.
122
+ **Which component serves a given need is the library's own answer, not this skill's.** It ships
123
+ that answer as guides inside the installed package, with every component name in them checked
124
+ against the real package at build time. Walk them: [The Discovery Chain](references/WIX_PATTERNS_DOCS.md#the-discovery-chain).
130
125
 
131
- Each doc gives its import line, props table, and an example. For a TypeScript type rather than a component — `Filter<T>`, `RangeItem<T>`, `CursorQuery`, a `...Props` interface — look it up the same way in `dist/dts-bundle/index.json` instead and `Read` the `.d.ts` at exactly the `file` path it gives; it's already fully resolved, which is what keeps a deep `@wix/bex-core/dist/types/...` path out of the tree.
126
+ The short version — probe `<pkgRoot>/dist/docs/index.json` first (`grep`/`python3`, not a
127
+ whole-file `Read`), then the guides it lists. From
128
+ there the index answers per symbol: `importPath` is the import line (no read needed), `examples`
129
+ names the worked call, and `bundle` says whether props live in a `.d.ts` or in the doc's own
130
+ table. Read the one artifact your open question needs. Resolve `<pkgRoot>` once per session
131
+ ([Prerequisites](references/WIX_PATTERNS_DOCS.md#prerequisites)) and reuse it.
132
132
 
133
- If `dist/dts-bundle/index.json` doesn't exist, the installed `@wix/patterns` predates this feature — upgrade it, then re-check. See [Prerequisites](references/WIX_PATTERNS_DOCS.md#prerequisites). **A missing index is not a reason to fall through to step 2**; it means the lookup has not happened yet. Falling through here is the single most common way a dashboard page ends up built entirely from WDS.
133
+ **Add / edit / view one item from a collection is an `EntityPage`, not a dashboard modal** — see
134
+ [Entity create and edit](#entity-create-and-edit), and `Collection to Entity Flow.md` in the
135
+ package for the flow itself.
134
136
 
135
- Full lookup workflow, provider selection, and the provider/page separation rule: [WIX_PATTERNS_DOCS.md](references/WIX_PATTERNS_DOCS.md).
137
+ **Falling through to step 2 because a lookup was inconvenient is the single most common way a
138
+ dashboard page ends up built entirely from WDS.** A missing index means the lookup has not
139
+ happened yet, not that patterns lacks the component.
136
140
 
137
141
  ### 2. `@wix/design-system` — everything inside the shell
138
142
 
@@ -163,9 +167,9 @@ This is the most common place the selection order gets dropped: the collection g
163
167
 
164
168
  The documented flow:
165
169
 
166
- 1. From the collection page's action cell or primary action, call `navigateToEntityPage({ path, entity })` from `usePatternsNavigate()`. (The patterns docs give this exact use case — "navigate to an entity page on an action cell click on a collection page" — and it renders the entity header immediately, before the fetch resolves.) On the **create** route there is no record to pass: omit `entity` and see [ENTITY_PAGE_TOOLKIT.md § Create route](references/dashboard-page/ENTITY_PAGE_TOOLKIT.md#create-route), which is what the whole "add new" flow turns on.
170
+ 1. From the collection page's action cell or primary action, call `navigateToEntityPage({ path, entity })` from `usePatternsNavigate()`. (The patterns docs give this exact use case — "navigate to an entity page on an action cell click on a collection page" — and it renders the entity header immediately, before the fetch resolves.) On the **create** route there is no record to pass: omit `entity` and read the **Create route** section of `<pkgRoot>/dist/docs/useEntityPage.md`, which is what the whole "add new" flow turns on.
167
171
  2. Register the route with `PatternsReactRoute` inside `PatternsReactRouter`.
168
- 3. In the entity page, `useEntityPage({ fetch, onSave })` owns fetching, saving, validation, dirty state, loading skeletons, and error states. Form state comes from `useForm` / `useController` in `@wix/patterns/form`. The call itself — both generics, what `onSave` receives, which params exist — is in [ENTITY_PAGE_TOOLKIT.md](references/dashboard-page/ENTITY_PAGE_TOOLKIT.md).
172
+ 3. In the entity page, `useEntityPage({ fetch, onSave })` owns fetching, saving, validation, dirty state, loading skeletons, and error states. Form state comes from `useForm` / `useController` in `@wix/patterns/form`. The call itself — both generics, what `onSave` receives, which params exist — is in `<pkgRoot>/dist/docs/useEntityPage.md`.
169
173
  4. Compose the body from `EntityPage.Header`, `EntityPage.MainContent`, `EntityPage.AdditionalContent`, and `EntityPage.Card`. **WDS goes inside those cards** — `FormField`, `Input`, `Text` for the individual fields.
170
174
 
171
175
  Use a Dashboard Modal for dialogs that neither write nor display a listed record: a delete or discard confirmation, an unsaved-changes prompt, an informational notice, or any dialog on a page that lists nothing. Dialog size and field count are not exceptions — a one-field create form over a listed record is still an `EntityPage`. Reach for a modal because the interaction persists nothing, never because "the form should open in a modal."
@@ -183,7 +187,7 @@ Use a Dashboard Modal for dialogs that neither write nor display a listed record
183
187
  | Service Plugin | Backend | `SERVICE_PLUGIN` | [SERVICE_PLUGIN.md](references/SERVICE_PLUGIN.md) |
184
188
  | App Tools (AI assistant tools) | Backend | `APP_TOOLS`, then `SERVICE_PLUGIN` with `pluginType: TOOLS_PROVIDER_CONFIG` | [APP_TOOLS.md](references/APP_TOOLS.md) |
185
189
  | Backend Event Extension | Backend | `EVENT` | [BACKEND_EVENT.md](references/BACKEND_EVENT.md) |
186
- | Backend API | Backend | — (manual, see banner below) | [BACKEND_API.md](references/BACKEND_API.md) |
190
+ | Backend API (HTTP endpoint) | Backend | `HTTP_ENDPOINT` | [BACKEND_API.md](references/BACKEND_API.md) |
187
191
  | Data Collection | Backend | `DATA_COLLECTION` | [DATA_COLLECTION.md](references/DATA_COLLECTION.md) |
188
192
  | Editor React component | Site | `EDITOR_REACT_COMPONENT` | [EDITOR_REACT_COMPONENT.md](references/EDITOR_REACT_COMPONENT.md) |
189
193
  | Custom element widget | Site | `CUSTOM_ELEMENT` | [CUSTOM_ELEMENT_WIDGET.md](references/CUSTOM_ELEMENT_WIDGET.md) |
@@ -193,7 +197,7 @@ Use a Dashboard Modal for dialogs that neither write nor display a listed record
193
197
  **Key constraints:**
194
198
  - Dashboard Page cannot use `<Modal />`; use a separate Dashboard Modal and `dashboard.openModal()`.
195
199
 
196
- > **⚠️ Backend API is the only extension type the CLI does NOT scaffold.** `wix generate` has no `BACKEND_API` handler. Create files directly per [BACKEND_API.md](references/BACKEND_API.md).
200
+ > **HTTP endpoints:** Generate with `extensionType: "HTTP_ENDPOINT"` (not `BACKEND_API`). See [BACKEND_API.md](references/BACKEND_API.md) for project-specific directories, handler types, and frontend URLs.
197
201
 
198
202
  ## Extension Comparison
199
203
 
@@ -216,8 +220,6 @@ Use a Dashboard Modal for dialogs that neither write nor display a listed record
216
220
  | Official Documentation Links | [DOCUMENTATION.md](references/DOCUMENTATION.md) |
217
221
  | Wix Patterns Dashboard Pages | [WIX_PATTERNS_DOCS.md](references/WIX_PATTERNS_DOCS.md) |
218
222
  | Dashboard UX Success Model (what a good dashboard contains) | [UX_SUCCESS_MODEL.md](references/dashboard-page/UX_SUCCESS_MODEL.md) |
219
- | Dashboard Collection Toolkit (which component per user need) | [COLLECTION_TOOLKIT.md](references/dashboard-page/COLLECTION_TOOLKIT.md) |
220
- | Reading a patterns bundle or doc file the index names | [PATTERNS_BUNDLE_READING.md](references/dashboard-page/PATTERNS_BUNDLE_READING.md) |
221
223
 
222
224
  ---
223
225
 
@@ -418,17 +420,17 @@ Use the Extension Types Reference Table and decision content above. State extens
418
420
 
419
421
  ### Step 4a: Scaffold via the CLI
420
422
 
421
- For each extension **except Backend API**, run `npx wix generate --params '<json>'`. The command returns `{"success":true,"extensionType":"...","newFiles":[...]}` on success.
423
+ For each supported type, including HTTP endpoints, run `npx wix generate --params '<json>'`. The command returns `{"success":true,"extensionType":"...","newFiles":[...]}` on success.
422
424
 
423
- If the command fails because of unknown or invalid params, run `npx wix schema generate --type <extensionType>` to print the JSON Schema for that extension type, fix the `--params` payload, and retry. Do not fall back to manual scaffolding.
425
+ If the command fails because of unknown or invalid params, run `npx wix schema generate --type <extensionType>` to print the JSON Schema for that extension type, fix the `--params` payload, and retry. Do not fall back to manual scaffolding. The one exception is `HTTP_ENDPOINT` on a CLI older than 1.1.243, which predates the generator but still supports the extension: create the endpoint file by hand as described in [BACKEND_API.md](references/BACKEND_API.md#generate-for-the-project-type).
424
426
 
425
427
  **What the CLI does automatically:**
426
428
  - Creates folders and stub files
427
- - Generates a fresh UUID for the extension `id`
428
- - Updates `src/extensions.ts` with the import and `.use()` call
429
+ - For registered extensions, generates a fresh UUID and updates `src/extensions.ts` with the import and `.use()` call
430
+ - For HTTP endpoints, creates the route file without changing `src/extensions.ts`
429
431
  - Enforces naming rules (kebab-case, hyphen-required custom elements, etc.)
430
432
 
431
- **Backend API exception:** Create `src/pages/api/*.ts` files manually per [BACKEND_API.md](references/BACKEND_API.md).
433
+ **HTTP endpoints:** Run `npx wix generate --params '{"extensionType":"HTTP_ENDPOINT","name":"hello"}'`, then implement the handler in the returned file. Follow [BACKEND_API.md](references/BACKEND_API.md); if the route does not respond, its troubleshooting hint shows how to confirm discovery from the build output.
432
434
 
433
435
  ### Step 4b: Fill in business logic
434
436
 
@@ -497,7 +499,7 @@ The following actions need to be done manually by you:
497
499
 
498
500
  ## Extension Registration
499
501
 
500
- `wix generate --params` updates `src/extensions.ts` automatically for every CLI-supported extension type. The only case that still requires manual editing is Backend API. For background, troubleshooting, and the manual recovery pattern when `src/extensions.ts` drifts, see [EXTENSION_REGISTRATION.md](references/EXTENSION_REGISTRATION.md).
502
+ `wix generate --params` updates `src/extensions.ts` automatically for registered extensions. HTTP endpoints require no import or `.use()` call; the runtime discovers their files. For background, troubleshooting, and the manual recovery pattern when `src/extensions.ts` drifts, see [EXTENSION_REGISTRATION.md](references/EXTENSION_REGISTRATION.md).
501
503
 
502
504
  ---
503
505
 
@@ -1,82 +1,95 @@
1
1
 
2
2
  # Wix Backend API Builder
3
3
 
4
- Creates HTTP endpoints for Wix CLI applications — server-side routes that handle HTTP requests, process data, and return responses. HTTP endpoints are powered by Astro endpoints and are automatically discovered from the file system.
4
+ Creates HTTP endpoints for Wix app projects. Determine the existing runtime
5
+ before choosing the directory, handler type, or frontend URL.
5
6
 
6
- **Key facts:**
7
+ ## Scope and Runtime Detection
7
8
 
8
- - Files live in `src/pages/api/` with `.ts` extension
9
- - Cannot be added via `npm run generate` — create files directly
10
- - Don't appear on the Extensions page in the app dashboard
11
- - No extension registration needed (auto-discovered)
12
- - Replace the legacy "HTTP functions" from the previous Wix CLI for Apps
9
+ - The CLI uses the `@wix/custom-extensions` runtime when the project's own
10
+ `package.json` declares that package in `dependencies` or `devDependencies`. A
11
+ transitive installation under `node_modules` is not enough. Do not infer the
12
+ runtime from using `wix dev`, `wix build`, or the Wix CLI alone.
13
+ - Existing `@wix/astro` apps retain Astro routing. Do not add
14
+ `@wix/custom-extensions`, move routes into `src/endpoints`, change their handler
15
+ imports, or introduce `WIX_SERVER_BASE_PATH` to apply the other runtime's recipe.
13
16
 
14
- ## Use Cases
17
+ ## Generate for the Project Type
15
18
 
16
- Use HTTP endpoints when you need to:
19
+ ```bash
20
+ npx wix generate --params '{"extensionType":"HTTP_ENDPOINT","name":"hello"}'
21
+ ```
17
22
 
18
- - Build REST APIs with multiple HTTP methods
19
- - Integrate with external APIs or services
20
- - Handle complex form submissions or file uploads
21
- - Serve dynamic content (images, RSS feeds, personalized data)
22
- - Access runtime data or server-side databases
23
+ Names use lowercase letters, digits, and hyphens; slash-separated names such as
24
+ `payments/checkout` create nested routes. Do not include a leading slash or `.ts`.
25
+ The generator creates GET/POST stubs; keep only the methods the task needs.
26
+
27
+ For Wix app projects, the generator preserves the selected runtime:
28
+
29
+ | Project | Generated file | Route before any server base path | `APIRoute` import |
30
+ | --- | --- | --- | --- |
31
+ | `@wix/custom-extensions` | `src/endpoints/hello.ts` | `/hello` | `@wix/custom-extensions/types` |
32
+ | `@wix/astro` | `src/pages/api/hello.ts` | `/api/hello` | `astro` |
33
+
34
+ In `@wix/custom-extensions` projects, endpoints live in `src/endpoints` by default and require
35
+ `@wix/custom-extensions@^0.2.14`; older releases neither scan that directory by
36
+ default nor export `./types`, and the build passes without serving anything. The
37
+ generator upgrades the package; when creating the file by hand, upgrade it
38
+ yourself. Install changed dependencies before validating. If `app()` in
39
+ `src/extensions.ts` passes `apiDir`, that directory (under `src/`) is the one the
40
+ runtime scans instead, and the generator does not read it: either remove `apiDir`
41
+ to use the default, or move the generated file into `src/<apiDir>`. The route is
42
+ `/<name>` either way.
43
+
44
+ If `wix generate` does not recognize `HTTP_ENDPOINT`, the CLI predates the
45
+ generator (added in `@wix/cli` 1.1.243). Update the CLI, or create the file by hand:
46
+ put it in the directory from the table above, export the handlers shown in
47
+ [HTTP Methods](#http-methods), and import `APIRoute` from
48
+ `@wix/custom-extensions/types` or from `astro`, matching the project's runtime. Do
49
+ not add `astro` to a `@wix/custom-extensions` project to make an Astro-style import
50
+ resolve. No registration step is needed.
23
51
 
24
52
  ## File Structure and Naming
25
53
 
26
- ### Basic Endpoint
27
-
28
- File path determines the endpoint URL:
29
-
30
- ```
31
- src/pages/api/<your-endpoint-name>.ts
32
- ```
33
-
34
- ### Dynamic Routes
54
+ Nested paths are relative to the runtime's endpoint directory:
35
55
 
36
- Use square brackets for dynamic parameters:
37
-
38
- ```
39
- src/pages/api/users/[id].ts → /api/users/:id
40
- src/pages/api/posts/[slug].ts → /api/posts/:slug
41
- src/pages/api/users/[userId]/posts/[postId].ts → /api/users/:userId/posts/:postId
42
- ```
56
+ | `@wix/custom-extensions` file | Route | Astro equivalent |
57
+ | --- | --- | --- |
58
+ | `src/endpoints/payments/checkout.ts` | `/payments/checkout` | `src/pages/api/payments/checkout.ts` → `/api/payments/checkout` |
59
+ | `src/endpoints/users/[id].ts` | `/users/:id` | `src/pages/api/users/[id].ts` → `/api/users/:id` |
43
60
 
44
61
  ## HTTP Methods
45
62
 
46
- Export named functions for each HTTP method. Type with `APIRoute` from `astro`. Each handler receives a `request` object and returns a `Response`:
63
+ Export a named handler for each requested HTTP method. Preserve the generated
64
+ `APIRoute` import for the project's runtime. For `@wix/custom-extensions` projects:
47
65
 
48
66
  ```typescript
49
- import type { APIRoute } from "astro";
50
-
51
- export const GET: APIRoute = async ({ request }) => {
52
- console.log("Log from GET."); // This message logs to your CLI.
53
- return new Response("Response from GET."); // This response is visible in the browser console
54
- };
67
+ import type { APIRoute } from "@wix/custom-extensions/types";
55
68
 
56
- export const POST: APIRoute = async ({ request }) => {
57
- const data = await request.json();
58
- console.log("Log POST with body: ", data); // This message logs to your CLI.
59
- return new Response(JSON.stringify(data)); // This response is visible in the browser console.
69
+ export const GET: APIRoute = async () => {
70
+ return Response.json({
71
+ message: "Hello from the backend!",
72
+ timestamp: new Date().toISOString(),
73
+ });
60
74
  };
61
75
  ```
62
76
 
77
+ In an Astro project, use `import type { APIRoute } from "astro"` instead.
78
+ The request/response examples below apply to both runtimes.
79
+
63
80
  ## Request Handling
64
81
 
65
82
  ### Path Parameters
66
83
 
67
84
  ```typescript
68
85
  export const GET: APIRoute = async ({ params }) => {
69
- const { id } = params; // From /api/users/[id]
86
+ const { id } = params; // From users/[id].ts in the endpoint directory
70
87
 
71
88
  if (!id) {
72
- return new Response(JSON.stringify({ error: "ID required" }), {
73
- status: 400,
74
- statusText: "Bad Request",
75
- headers: { "Content-Type": "application/json" },
76
- });
89
+ return Response.json({ error: "ID required" }, { status: 400 });
77
90
  }
78
91
 
79
- // Use id to fetch data
92
+ return Response.json({ id });
80
93
  };
81
94
  ```
82
95
 
@@ -91,7 +104,7 @@ export const GET: APIRoute = async ({ request }) => {
91
104
  const limit = parseInt(url.searchParams.get("limit") || "10", 10);
92
105
  const offset = parseInt(url.searchParams.get("offset") || "0", 10);
93
106
 
94
- // Use query parameters
107
+ return Response.json({ search, limit, offset });
95
108
  };
96
109
  ```
97
110
 
@@ -106,23 +119,15 @@ export const POST: APIRoute = async ({ request }) => {
106
119
  const { title, content } = body;
107
120
 
108
121
  if (!title || !content) {
109
- return new Response(
110
- JSON.stringify({ error: "Title and content required" }),
111
- {
112
- status: 400,
113
- statusText: "Bad Request",
114
- headers: { "Content-Type": "application/json" },
115
- }
122
+ return Response.json(
123
+ { error: "Title and content required" },
124
+ { status: 400 }
116
125
  );
117
126
  }
118
127
 
119
- // Process data
128
+ return Response.json({ title, content });
120
129
  } catch {
121
- return new Response(JSON.stringify({ error: "Invalid JSON" }), {
122
- status: 400,
123
- statusText: "Bad Request",
124
- headers: { "Content-Type": "application/json" },
125
- });
130
+ return Response.json({ error: "Invalid JSON" }, { status: 400 });
126
131
  }
127
132
  };
128
133
  ```
@@ -136,116 +141,110 @@ const contentType = request.headers.get("Content-Type");
136
141
 
137
142
  ## Response Patterns
138
143
 
139
- Always return a `Response` object with proper status codes and headers:
144
+ Return a `Response` from every handler path. `Response.json(body, { status })`
145
+ serializes JSON and sets `Content-Type: application/json` automatically.
140
146
 
141
- ```typescript
142
- // 200 OK
143
- return new Response(JSON.stringify({ data: result }), {
144
- status: 200,
145
- headers: { "Content-Type": "application/json" },
146
- });
147
-
148
- // 201 Created
149
- return new Response(JSON.stringify({ id: newId, ...data }), {
150
- status: 201,
151
- headers: { "Content-Type": "application/json" },
152
- });
153
-
154
- // 204 No Content (for DELETE)
155
- return new Response(null, { status: 204 });
156
-
157
- // 400 Bad Request
158
- return new Response(JSON.stringify({ error: "Invalid input" }), {
159
- status: 400,
160
- statusText: "Bad Request",
161
- headers: { "Content-Type": "application/json" },
162
- });
163
-
164
- // 404 Not Found
165
- return new Response(JSON.stringify({ error: "Not found" }), {
166
- status: 404,
167
- statusText: "Not Found",
168
- headers: { "Content-Type": "application/json" },
169
- });
170
-
171
- // 500 Internal Server Error
172
- return new Response(JSON.stringify({ error: "Internal server error" }), {
173
- status: 500,
174
- statusText: "Internal Server Error",
175
- headers: { "Content-Type": "application/json" },
176
- });
177
- ```
147
+ | Status | Use |
148
+ | --- | --- |
149
+ | 200 | Successful read or update (default) |
150
+ | 201 | Resource created |
151
+ | 204 | Success without a body: `new Response(null, { status: 204 })` |
152
+ | 400 | Invalid request |
153
+ | 404 | Resource not found |
154
+ | 500 | Unexpected server failure; return a generic error |
155
+
156
+ For example: `Response.json({ error: "Not found" }, { status: 404 })`.
178
157
 
179
158
  ## Frontend Integration
180
159
 
181
- Call HTTP endpoints from frontend components using Wix's built-in HTTP client (`httpClient.fetchWithAuth()`):
160
+ For app extensions, use `httpClient.fetchWithAuth()` from `@wix/essentials`.
161
+ Build the URL from the extension module's origin, not the host page's origin.
162
+
163
+ ### `@wix/custom-extensions` Projects
164
+
165
+ `wix dev` may run with `--base`, so the request must preserve
166
+ `import.meta.env.WIX_SERVER_BASE_PATH`. The runtime defaults this value to `/`
167
+ without a configured base, including the normal production build.
168
+ During dev, the injected value is Vite's resolved base, which already has a
169
+ trailing slash even when `--base` omits it. Concatenate the endpoint name
170
+ directly, with `/` as a fallback for a missing/empty value.
171
+ Do not hardcode the base prefix or add `/api` to a `@wix/custom-extensions` route.
182
172
 
183
173
  ```typescript
184
174
  import { httpClient } from "@wix/essentials";
185
175
 
186
- // GET request
187
- const baseApiUrl = new URL(import.meta.url).origin;
188
- const res = await httpClient.fetchWithAuth(
189
- `${baseApiUrl}/api/<your-endpoint-name>`,
190
- );
191
- const data = await res.text();
192
-
193
- // POST request
194
- const res = await httpClient.fetchWithAuth(
195
- `${baseApiUrl}/api/<your-endpoint-name>`,
196
- {
197
- method: "POST",
198
- body: JSON.stringify({ message: "Hello from frontend" }),
199
- },
200
- );
176
+ const origin = new URL(import.meta.url).origin;
177
+ const basePath = import.meta.env.WIX_SERVER_BASE_PATH || "/";
178
+ const endpointUrl = `${origin}${basePath}hello`;
179
+
180
+ // Inside an event handler or runtime data-loading function:
181
+ const res = await httpClient.fetchWithAuth(endpointUrl);
182
+ if (!res.ok) {
183
+ throw new Error(`Request failed: ${res.status}`);
184
+ }
201
185
  const data = await res.json();
202
186
  ```
203
187
 
204
- ## Identity and Authorization
188
+ Keep the module origin: passing only `${basePath}hello` can resolve against the
189
+ hosting site's origin instead of the app server.
190
+
191
+ ### Astro App Extensions
205
192
 
206
- Endpoints run as the **app**, so this is one of the few places `auth.elevate` is valid — it works only in backend code, never in a site, editor, or dashboard extension. It wraps the SDK method rather than being called around it, so inside a request handler you invoke the wrapper:
193
+ For a standard Astro app endpoint, use its `/api` route without the
194
+ `WIX_SERVER_BASE_PATH` variable. If the existing Astro configuration has its own base path,
195
+ preserve that project's URL handling instead of applying the root-only example:
207
196
 
208
197
  ```typescript
209
- import { auth } from "@wix/essentials";
210
- import { locations } from "@wix/business-tools";
198
+ import { httpClient } from "@wix/essentials";
211
199
 
212
- const elevatedArchive = auth.elevate(locations.archiveLocation);
213
- const archived = await elevatedArchive(locationId); // locationId read from the request
200
+ const endpointUrl = new URL("/api/hello", import.meta.url).href;
201
+ const res = await httpClient.fetchWithAuth(endpointUrl);
214
202
  ```
215
203
 
216
- **Only create an endpoint for calls that need it.** Settle that with [Identity and Elevation Requirement](../SKILL.md#identity-and-elevation-requirement) *before* adding a file under `src/pages/api/` — an endpoint wrapping a call the extension could have made itself is a correctness or privacy bug, not extra indirection, because elevating inside it re-targets a session-resolved call away from the visitor or hands back what the platform deliberately withheld.
217
-
218
- **Elevation bypasses Wix's permission check, so the endpoint must re-check the caller itself** — otherwise every caller who can reach it gets the elevated operation, and only `httpClient.fetchWithAuth()` (see [Frontend Integration](#frontend-integration)) sends the caller's identity for the handler to check; a bare `fetch` sends nothing and leaves the endpoint open.
219
-
220
- What you can establish depends on the host: a dashboard caller is a Wix user, whose roles already limit them. From a site or editor extension `members.getMyMember()` identifies a logged-in member, but there is **no documented way to prove the caller is the site owner** — a real constraint, not an oversight, so an owner-only operation belongs in a dashboard extension, where the Wix user identity already carries the authority, rather than behind an endpoint reachable from a site extension.
221
-
222
- ## Build, Deploy, and Delete
204
+ For either runtime, a POST uses the same endpoint URL with `method: "POST"`, a
205
+ JSON body, and `Content-Type: application/json`, provided the route exports POST.
223
206
 
224
- To take HTTP endpoints to production, build and release your project:
225
-
226
- 1. Build the project assets using the [`build`](https://dev.wix.com/docs/wix-cli/command-reference/project-commands/build) command.
227
- 2. Optionally create preview URLs using the [`preview`](https://dev.wix.com/docs/wix-cli/command-reference/project-commands/preview) command to share with team members for testing.
228
- 3. Release your project using the [`release`](https://dev.wix.com/docs/wix-cli/command-reference/project-commands/release) command.
229
-
230
- Once released, endpoints are accessible at production URLs and handle live traffic.
207
+ ## Identity and Authorization
231
208
 
232
- To delete an HTTP endpoint, remove the file under `src/pages/api/` and release again.
209
+ `auth.elevate` works only in backend code. Wrap the SDK method, then invoke
210
+ that wrapper inside the request handler:
233
211
 
234
- ## Output Structure
212
+ ```typescript
213
+ import { auth } from "@wix/essentials";
214
+ import { locations } from "@wix/business-tools";
235
215
 
216
+ const elevatedArchive = auth.elevate(locations.archiveLocation);
217
+ const archived = await elevatedArchive(locationId); // locationId read from the request
236
218
  ```
237
- src/pages/api/
238
- ├── users.ts # /api/users endpoint
239
- ├── users/
240
- │ └── [id].ts # /api/users/:id endpoint
241
- └── posts.ts # /api/posts endpoint
242
- ```
243
-
244
- ## Backend-API-specific Conventions
245
219
 
246
- - Type all handlers with `APIRoute` from `astro`.
247
- - Always return `Response` objects with `JSON.stringify()` for JSON.
248
- - Use proper HTTP status codes (200, 201, 204, 400, 404, 500).
249
- - Include `Content-Type: application/json` header on JSON responses.
250
- - Include `statusText` in error responses.
251
- - Validate input parameters and request bodies.
220
+ Before routing SDK calls through an endpoint, apply the
221
+ [Identity and Elevation Requirement](../SKILL.md#identity-and-elevation-requirement).
222
+ Keep visitor/session-resolved and caller-filtered calls in the frontend: elevation
223
+ can change whose data is accessed or expose data the platform withheld.
224
+
225
+ **Elevation bypasses Wix's permission check.** The endpoint must authorize the
226
+ caller before invoking an elevated method. Use `httpClient.fetchWithAuth()` to
227
+ send caller identity; a bare `fetch` does not supply that identity. Authentication
228
+ alone does not grant permission to perform the operation.
229
+
230
+ Dashboard callers are Wix users. For site/editor callers, `members.getMyMember()`
231
+ identifies a logged-in member but does not prove site ownership. Owner-only
232
+ operations belong in a dashboard extension; do not expose them to site visitors
233
+ on the assumption that member authentication proves ownership.
234
+
235
+ ## Validate, Deploy, and Delete
236
+
237
+ 1. Install changed dependencies, typecheck, and run `wix build`.
238
+ 2. If a dev site is configured (`wix dev-site`), run `wix dev` and request the
239
+ URL; also exercise the frontend caller when one was requested. `wix preview`
240
+ uploads a version and exits; it is not a server.
241
+ 3. When deployment is requested, use the normal build/preview/release commands,
242
+ unless the environment hosting the project manages deployment itself.
243
+
244
+ To delete an endpoint, remove its file from the appropriate directory and apply
245
+ that change through the same deployment flow. No `.use()` cleanup is needed.
246
+
247
+ If a route 404s, or the file was created by hand, confirm it was discovered: in a
248
+ `@wix/custom-extensions` build `grep 'pattern:' dist/server/index.mjs` lists every route (a
249
+ dynamic segment prints as `:"id"`); in an Astro build the route string appears
250
+ under `dist/`. A missing entry means the file is outside the scanned directory.
@@ -6,17 +6,13 @@ Dashboard pages appear in the site owner's Wix dashboard, where admins manage da
6
6
 
7
7
  A dashboard page is a workflow, not a screen. The site owner has to understand the situation, focus on what needs attention, investigate one record, act, and see the result confirmed — so translate the prompt into those needs before choosing any component.
8
8
 
9
- Do this first because a bare filtered table answers "what are all the records" and none of "how many", "which one needs my attention", or "why did this happen" — and a table is what you get by default if the workflow was never named. Read [UX Success Model](dashboard-page/UX_SUCCESS_MODEL.md) now, and run its evaluation checklist before calling the page done. Which component serves each need: [Collection Toolkit](dashboard-page/COLLECTION_TOOLKIT.md).
9
+ Do this first because a bare filtered table answers "what are all the records" and neither "which one needs my attention" nor "why did this happen" — and a table is what you get by default if the workflow was never named. Read [UX Success Model](dashboard-page/UX_SUCCESS_MODEL.md) now, and run its evaluation checklist before calling the page done. Which component serves each need is the installed package's own answer — see [The Discovery Chain](WIX_PATTERNS_DOCS.md#the-discovery-chain).
10
10
 
11
11
  ## UI Libraries — Read Before Writing Any JSX
12
12
 
13
- At Wix, dashboard pages are built from `@wix/patterns` and `@wix/design-system`, in that order of preference:
13
+ `@wix/patterns` first, `@wix/design-system` for the leaf UI inside its shell, custom React only when neither has it. Do not hand-write React for anything either library provides, and do not decide a component is missing without checking.
14
14
 
15
- 1. **`@wix/patterns` first** — page shells (`CollectionPage`, `EntityPage`, `SettingsPage`), tables/grids, collection state hooks, filters, sorting, row and bulk actions, in-extension routing. Look every name up directly in `dist/dts-bundle/index.json` and `dist/docs/index.json` (start with the inventory). See [WIX_PATTERNS_DOCS.md](WIX_PATTERNS_DOCS.md).
16
- 2. **`@wix/design-system` second** — the leaf UI inside that shell (inputs, buttons, form fields, text, layout, cards, badges, icons). Choose components via the `wix-design-system` skill.
17
- 3. **Custom React last** — only when neither library has it.
18
-
19
- Do not hand-write React for anything either library already provides, and do not decide a component is missing without checking. Full rule: [SKILL.md → Component Selection Order](../SKILL.md#component-selection-order).
15
+ The order, what each library owns, and how to look a name up are stated once: [SKILL.md → Component Selection Order](../SKILL.md#component-selection-order).
20
16
 
21
17
  ## Scaffold
22
18
 
@@ -33,9 +29,9 @@ wix generate --params '{"extensionType":"DASHBOARD_PAGE","title":"<title>","rout
33
29
 
34
30
  The CLI generates the folder, `page.tsx`, the builder file, the UUID, and the `src/extensions.ts` registration. After scaffolding, implement the page UI in the generated `page.tsx`.
35
31
 
36
- **Never reuse `<route>` as a path prefix inside this page's `PatternsReactRouter`** — its location is already page-scoped, so a page scaffolded `route: "shifts"` still routes from `path="/"`, and `path="/shifts"` silently never matches. Page-relative paths: [Entity Page Toolkit](dashboard-page/ENTITY_PAGE_TOOLKIT.md).
32
+ **Never reuse `<route>` as a path prefix inside this page's `PatternsReactRouter`** — its location is already page-scoped, so a page scaffolded `route: "shifts"` still routes from `path="/"`, and `path="/shifts"` silently never matches. Page-relative paths: `<pkgRoot>/dist/docs/Collection to Entity Flow.md`.
37
33
 
38
- **Then, before writing UI:** resolve the package root and `Read <pkgRoot>/dist/dts-bundle/index.json` once, per [Prerequisites](WIX_PATTERNS_DOCS.md#prerequisites). Each Bash call is a fresh shell — re-set the path variable in every call.
34
+ **Then, before writing UI:** resolve the package root and probe `<pkgRoot>/dist/docs/index.json` once with `grep`/`python3` — not a whole-file `Read`, which truncates it silently — per [Prerequisites](WIX_PATTERNS_DOCS.md#prerequisites). That index carries each symbol's `importPath`, `examples` and `bundle`, which is what decides whether you need to open anything else at all. Each Bash call is a fresh shell — re-set the path variable in every call.
39
35
 
40
36
  ## Capabilities
41
37
 
@@ -74,7 +70,7 @@ Dashboard Pages cannot use `<Modal />`. For a true dialog overlay you **MUST** u
74
70
  >
75
71
  > **If this page lists nothing** (settings, config) the rule doesn't apply. But "I built the list without `@wix/patterns`" is not an exception: a page that lists records should be a `CollectionPage`.
76
72
  >
77
- > See [Entity create and edit](../SKILL.md#entity-create-and-edit) and [WIX_PATTERNS_DOCS.md](WIX_PATTERNS_DOCS.md); for the `useEntityPage` call itself, [Entity Page Toolkit](dashboard-page/ENTITY_PAGE_TOOLKIT.md).
73
+ > See [Entity create and edit](../SKILL.md#entity-create-and-edit) and [WIX_PATTERNS_DOCS.md](WIX_PATTERNS_DOCS.md); for the `useEntityPage` call itself, `<pkgRoot>/dist/docs/useEntityPage.md`.
78
74
 
79
75
  **Ecom Navigation:** See [Ecom Navigation Reference](dashboard-page/ECOM_NAVIGATION.md) for ecom-specific navigation helpers.
80
76