@wix/agent-skills 1.20.0 → 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 (183) 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 +302 -51
  15. package/skills/wix-headless-fast/entry/skill.md +11 -2
  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 +360 -0
  19. package/skills/wix-headless-fast/install/deploy.mjs +109 -9
  20. package/skills/wix-headless-fast/install/setup.mjs +239 -0
  21. package/skills/wix-headless-fast/references/blog/INSTRUCTIONS.md +226 -60
  22. package/skills/wix-headless-fast/references/blog/app/components/blog/BlogFeedView.tsx +2 -3
  23. package/skills/wix-headless-fast/references/blog/app/components/blog/PostView.tsx +2 -3
  24. package/skills/wix-headless-fast/references/blog/app/hooks/blog/useBlogFeed.ts +24 -116
  25. package/skills/wix-headless-fast/references/blog/app/hooks/blog/usePost.ts +16 -64
  26. package/skills/wix-headless-fast/references/blog/app/wix/blog/blog-feed-store.ts +137 -0
  27. package/skills/wix-headless-fast/references/blog/app/wix/blog/post-store.ts +78 -0
  28. package/skills/wix-headless-fast/references/blog/app/wix/blog/posts-core.ts +117 -0
  29. package/skills/wix-headless-fast/references/blog/app/wix/blog/posts.ts +13 -60
  30. package/skills/wix-headless-fast/references/blog/app/wix/blog/taxonomy-core.ts +47 -0
  31. package/skills/wix-headless-fast/references/blog/app/wix/blog/taxonomy.ts +10 -28
  32. package/skills/wix-headless-fast/references/blog/app-astro/pages/blog/[...slug].astro +2 -4
  33. package/skills/wix-headless-fast/references/blog/rest/posts.ts +42 -0
  34. package/skills/wix-headless-fast/references/blog/rest/taxonomy.ts +62 -0
  35. package/skills/wix-headless-fast/references/blog/seed/SEED.md +9 -0
  36. package/skills/wix-headless-fast/references/blog/seed/read-site.mjs +22 -0
  37. package/skills/wix-headless-fast/references/bookings/INSTRUCTIONS.md +181 -33
  38. package/skills/wix-headless-fast/references/bookings/app/components/bookings/ServiceBookingView.tsx +2 -1
  39. package/skills/wix-headless-fast/references/bookings/app/hooks/bookings/useBookingFlow.ts +26 -132
  40. package/skills/wix-headless-fast/references/bookings/app/hooks/bookings/useServices.ts +18 -49
  41. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/booking-core.ts +218 -0
  42. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/booking-flow-store.ts +169 -0
  43. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/booking.ts +57 -142
  44. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/services-core.ts +92 -0
  45. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/services-store.ts +90 -0
  46. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/services.ts +22 -61
  47. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/types.ts +3 -1
  48. package/skills/wix-headless-fast/references/bookings/rest/booking.ts +113 -0
  49. package/skills/wix-headless-fast/references/bookings/rest/services.ts +55 -0
  50. package/skills/wix-headless-fast/references/bookings/seed/SEED.md +10 -0
  51. package/skills/wix-headless-fast/references/bookings/seed/read-site.mjs +28 -0
  52. package/skills/wix-headless-fast/references/cms/INSTRUCTIONS.md +238 -62
  53. package/skills/wix-headless-fast/references/cms/app/hooks/cms/useCollection.ts +19 -52
  54. package/skills/wix-headless-fast/references/cms/app/hooks/cms/useItem.ts +16 -36
  55. package/skills/wix-headless-fast/references/cms/app/wix/cms/collection-store.ts +158 -0
  56. package/skills/wix-headless-fast/references/cms/app/wix/cms/item-store.ts +93 -0
  57. package/skills/wix-headless-fast/references/cms/app/wix/cms/items-core.ts +177 -0
  58. package/skills/wix-headless-fast/references/cms/app/wix/cms/items.ts +13 -41
  59. package/skills/wix-headless-fast/references/cms/rest/items.ts +125 -0
  60. package/skills/wix-headless-fast/references/cms/seed/SEED.md +9 -0
  61. package/skills/wix-headless-fast/references/cms/seed/read-site.mjs +20 -0
  62. package/skills/wix-headless-fast/references/events/INSTRUCTIONS.md +241 -83
  63. package/skills/wix-headless-fast/references/events/app/components/events/EventConfirmationView.tsx +1 -1
  64. package/skills/wix-headless-fast/references/events/app/components/events/EventRegistrationView.tsx +7 -5
  65. package/skills/wix-headless-fast/references/events/app/components/events/EventsView.tsx +2 -2
  66. package/skills/wix-headless-fast/references/events/app/hooks/events/useEventRegistration.ts +28 -110
  67. package/skills/wix-headless-fast/references/events/app/hooks/events/useEvents.ts +19 -54
  68. package/skills/wix-headless-fast/references/events/app/wix/events/events-core.ts +130 -0
  69. package/skills/wix-headless-fast/references/events/app/wix/events/events-store.ts +97 -0
  70. package/skills/wix-headless-fast/references/events/app/wix/events/events.ts +13 -94
  71. package/skills/wix-headless-fast/references/events/app/wix/events/registration-core.ts +113 -0
  72. package/skills/wix-headless-fast/references/events/app/wix/events/registration-store.ts +156 -0
  73. package/skills/wix-headless-fast/references/events/app/wix/events/registration.ts +38 -69
  74. package/skills/wix-headless-fast/references/events/rest/events.ts +57 -0
  75. package/skills/wix-headless-fast/references/events/rest/registration.ts +83 -0
  76. package/skills/wix-headless-fast/references/events/seed/SEED.md +9 -0
  77. package/skills/wix-headless-fast/references/events/seed/read-site.mjs +26 -0
  78. package/skills/wix-headless-fast/references/forms/INSTRUCTIONS.md +216 -26
  79. package/skills/wix-headless-fast/references/forms/app/hooks/forms/useWixForm.ts +35 -267
  80. package/skills/wix-headless-fast/references/forms/app/wix/forms/form-store.ts +332 -0
  81. package/skills/wix-headless-fast/references/forms/app/wix/forms/forms-core.ts +238 -0
  82. package/skills/wix-headless-fast/references/forms/app/wix/forms/forms.ts +28 -243
  83. package/skills/wix-headless-fast/references/forms/app/wix/forms/submissions-core.ts +216 -0
  84. package/skills/wix-headless-fast/references/forms/app/wix/forms/submissions.ts +32 -204
  85. package/skills/wix-headless-fast/references/forms/rest/forms.ts +34 -0
  86. package/skills/wix-headless-fast/references/forms/rest/submissions.ts +56 -0
  87. package/skills/wix-headless-fast/references/forms/seed/SEED.md +8 -0
  88. package/skills/wix-headless-fast/references/forms/seed/read-site.mjs +20 -0
  89. package/skills/wix-headless-fast/references/forms/seed/seed-forms.mjs +15 -8
  90. package/skills/wix-headless-fast/references/members/INSTRUCTIONS.md +316 -63
  91. package/skills/wix-headless-fast/references/members/app/components/members/LoginForm.tsx +1 -1
  92. package/skills/wix-headless-fast/references/members/app/wix/members/auth-core.ts +105 -0
  93. package/skills/wix-headless-fast/references/members/app/wix/members/auth.ts +36 -65
  94. package/skills/wix-headless-fast/references/members/app/wix/members/client.ts +1 -1
  95. package/skills/wix-headless-fast/references/members/app/wix/members/members-core.ts +43 -0
  96. package/skills/wix-headless-fast/references/members/app/wix/members/members.ts +11 -32
  97. package/skills/wix-headless-fast/references/members/rest/auth.ts +215 -0
  98. package/skills/wix-headless-fast/references/members/rest/members.ts +26 -0
  99. package/skills/wix-headless-fast/references/members/seed/read-site.mjs +15 -0
  100. package/skills/wix-headless-fast/references/portfolio/INSTRUCTIONS.md +240 -59
  101. package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/CollectionProjectsView.tsx +2 -2
  102. package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/CollectionsView.tsx +2 -2
  103. package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/GalleryMedia.tsx +35 -0
  104. package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/ProjectDetailView.tsx +8 -38
  105. package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useCollectionProjects.ts +23 -50
  106. package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useCollections.ts +16 -34
  107. package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useProjectDetail.ts +22 -49
  108. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/collection-projects-store.ts +82 -0
  109. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/collections-store.ts +58 -0
  110. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/portfolio-core.ts +177 -0
  111. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/portfolio.ts +31 -118
  112. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/project-detail-store.ts +81 -0
  113. package/skills/wix-headless-fast/references/portfolio/rest/portfolio.ts +75 -0
  114. package/skills/wix-headless-fast/references/portfolio/seed/SEED.md +8 -0
  115. package/skills/wix-headless-fast/references/portfolio/seed/read-site.mjs +20 -0
  116. package/skills/wix-headless-fast/references/portfolio/seed/seed-portfolio.mjs +19 -21
  117. package/skills/wix-headless-fast/references/pricing-plans/INSTRUCTIONS.md +214 -51
  118. package/skills/wix-headless-fast/references/pricing-plans/app/components/pricing-plans/PlanDetailView.tsx +9 -20
  119. package/skills/wix-headless-fast/references/pricing-plans/app/components/pricing-plans/PlansView.tsx +7 -32
  120. package/skills/wix-headless-fast/references/pricing-plans/app/components/pricing-plans/SubscribeButton.tsx +41 -0
  121. package/skills/wix-headless-fast/references/pricing-plans/app/hooks/pricing-plans/usePlanPurchase.ts +12 -33
  122. package/skills/wix-headless-fast/references/pricing-plans/app/hooks/pricing-plans/usePlans.ts +17 -34
  123. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plan-purchase-store.ts +54 -0
  124. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plans-core.ts +106 -0
  125. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plans-store.ts +64 -0
  126. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plans.ts +7 -55
  127. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/purchase-core.ts +43 -0
  128. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/purchase.ts +11 -34
  129. package/skills/wix-headless-fast/references/pricing-plans/rest/plans.ts +31 -0
  130. package/skills/wix-headless-fast/references/pricing-plans/rest/purchase.ts +20 -0
  131. package/skills/wix-headless-fast/references/pricing-plans/seed/SEED.md +8 -0
  132. package/skills/wix-headless-fast/references/pricing-plans/seed/read-site.mjs +21 -0
  133. package/skills/wix-headless-fast/references/restaurants/INSTRUCTIONS.md +242 -47
  134. package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/MenuView.tsx +2 -2
  135. package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/OrderCartDrawer.tsx +2 -2
  136. package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useMenus.ts +14 -35
  137. package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useReservation.ts +28 -171
  138. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/menu-core.ts +155 -0
  139. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/menu-store.ts +89 -0
  140. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/menu.ts +23 -117
  141. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/ordering-core.ts +124 -0
  142. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/ordering.ts +45 -114
  143. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/reservation-store.ts +193 -0
  144. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/reservations-core.ts +94 -0
  145. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/reservations.ts +15 -87
  146. package/skills/wix-headless-fast/references/restaurants/rest/menu.ts +60 -0
  147. package/skills/wix-headless-fast/references/restaurants/rest/ordering.ts +169 -0
  148. package/skills/wix-headless-fast/references/restaurants/rest/reservations.ts +68 -0
  149. package/skills/wix-headless-fast/references/restaurants/seed/SEED.md +8 -0
  150. package/skills/wix-headless-fast/references/restaurants/seed/read-site.mjs +25 -0
  151. package/skills/wix-headless-fast/references/restaurants/seed/seed-restaurants.mjs +25 -5
  152. package/skills/wix-headless-fast/references/shared/SUPPLIED-CONTENT.md +23 -0
  153. package/skills/wix-headless-fast/references/shared/app/wix/media.ts +45 -4
  154. package/skills/wix-headless-fast/references/shared/app/wix/sdk.ts +13 -0
  155. package/skills/wix-headless-fast/references/shared/rest/client.ts +155 -0
  156. package/skills/wix-headless-fast/references/shared/rest/config.ts +3 -0
  157. package/skills/wix-headless-fast/references/shared/rest/media.ts +65 -0
  158. package/skills/wix-headless-fast/references/shared/seed/read-site.mjs +99 -0
  159. package/skills/wix-headless-fast/references/storefront/INSTRUCTIONS.md +186 -63
  160. package/skills/wix-headless-fast/references/storefront/app/components/storefront/OptionPicker.tsx +95 -0
  161. package/skills/wix-headless-fast/references/storefront/app/components/storefront/QuickAdd.tsx +29 -58
  162. package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useProductDetail.ts +29 -163
  163. package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useShop.ts +26 -300
  164. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/cart-core.ts +121 -0
  165. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/cart.ts +49 -162
  166. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/catalog-core.ts +314 -0
  167. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/catalog.ts +47 -370
  168. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/product-detail-store.ts +147 -0
  169. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/shop-store.ts +289 -0
  170. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/types.ts +2 -0
  171. package/skills/wix-headless-fast/references/storefront/rest/cart.ts +132 -0
  172. package/skills/wix-headless-fast/references/storefront/rest/catalog.ts +123 -0
  173. package/skills/wix-headless-fast/references/storefront/seed/SEED.md +31 -9
  174. package/skills/wix-headless-fast/references/storefront/seed/read-site.mjs +38 -0
  175. package/skills/wix-headless-fast/references/storefront/seed/seed-store.mjs +57 -50
  176. package/skills/wix-manage/references/ecommerce/ecom-shipping.md +1 -1
  177. package/skills/wix-manage/references/ecommerce/pricing-promotions/ecom-pricing-create-coupon.md +10 -19
  178. package/skills/wix-manage/references/events/create-wix-event.md +5 -1
  179. package/skills/wix-vibe-headless/references/storefront/INSTRUCTIONS.md +0 -40
  180. package/skills/wix-vibe-headless/references/storefront/seed/SEED.md +3 -0
  181. package/skills/wix-vibe-headless/references/storefront/seed/seed-store.cjs +6 -0
  182. package/skills/wix-headless-fast/install/fast-path.mjs +0 -186
  183. package/skills/wix-headless-fast/install/pin-agents-md.mjs +0 -57
@@ -5,24 +5,19 @@ description: "Build a Wix Headless site fast by wiring SHIPPED, verified @wix/sd
5
5
 
6
6
  # Wix Headless Fast
7
7
 
8
- Build a Wix Headless site by **deploying shipped code, not authoring it**. Where `wix-headless`
9
- hands the agent recipes to code from, this skill ships the integration itself — a typed data
10
- layer, hooks, components, pages, and a seed script that are already correct — and the agent's
11
- job narrows to brand, layout, copy, and wiring. The decisions live in the code; don't
8
+ Build a Wix Headless site on **shipped, verified code instead of authoring the integration**.
9
+ Each vertical ships the integration itself — a typed data layer, hooks, components, pages, and a
10
+ seed script that are already correct. On a stack that runs it (Wix-managed Astro, any React
11
+ project) the code is **deployed** and the agent's job narrows to brand, layout, copy, and wiring.
12
+ On a stack that can't run it (a static site with no bundler, a server-rendered app in another
13
+ language) the same code is the **reference**: its REST twin deploys for the browser side, and the
14
+ rules it encodes are what the agent ports. Either way the decisions live in the code; don't
12
15
  re-litigate them.
13
16
 
14
- **Scope.** This is the bootstrap, tuned for Wix-managed Astro, and each vertical ships *one*
15
- shape of its solution. Deploy it as-is when the brief doesn't contradict it. When the brief
16
- asks for something that shape doesn't express — or once the site exists and the work turns to
17
- managing or extending it — that's `wix-docs` and `wix-manage`, not a workaround here.
18
-
19
- ## Relationship to sibling skills
20
-
21
- | Skill | Use when |
22
- | ---------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
23
- | **wix-headless-fast** (this) | A supported vertical fits the request and the frontend is Astro or React — the fast path. |
24
- | `wix-headless` | A vertical this skill doesn't ship yet, a non-React frontend, backend-only runs, or stripe/self-managed project types. |
25
- | `wix-vibe-headless` | Client-only REST over a `WIX_CLIENT_ID` inside a vibe platform (Base44 etc.) — no SDK, no CLI. |
17
+ **Scope.** Tuned for Wix-managed Astro, and each vertical ships *one* shape of its solution. Use
18
+ it as-is when the brief doesn't contradict it. When the brief asks for something that shape
19
+ doesn't express — or once the site exists and the work turns to managing or extending it — that's
20
+ `wix-docs` and `wix-manage`, not a workaround here.
26
21
 
27
22
  ## The model
28
23
 
@@ -34,7 +29,7 @@ managing or extending it — that's `wix-docs` and `wix-manage`, not a workaroun
34
29
  islands, with owner-editable item-page SEO pre-wired.
35
30
  - `seed/` — a build-time REST seed script (plain-data plan in, created content out) plus its
36
31
  `SEED.md` contract.
37
- - `INSTRUCTIONS.md` — the vertical's playbook: file map, what you build, hard rules, verify.
32
+ - `INSTRUCTIONS.md` — the vertical's playbook: file map, what you build, hard rules.
38
33
  - **One auth seam.** All shipped code calls Wix through `src/wix/sdk.ts`: on Wix-managed Astro
39
34
  auth is ambient (no client, no id); on any other React setup the same file runs a manual
40
35
  visitor client off the public client id in `src/wix/config.ts`. The deploy step configures
@@ -49,6 +44,21 @@ managing or extending it — that's `wix-docs` and `wix-manage`, not a workaroun
49
44
  INSTRUCTIONS names the surfaces you design and implement yourself on the shipped hooks,
50
45
  with a skeleton carrying each surface's contract (for storefront: the shop and PDP pages
51
46
  with their islands, and home).
47
+ - **NEVER work from training data or memory about the Wix APIs.** Not a URL, a path, a version,
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 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.
52
62
  - **Never mock, fail loudly, purchases via Wix.** Live data or an honest empty state; surfaced
53
63
  errors, not swallowed ones; checkout/purchase always through the Wix redirect session.
54
64
  - **Optional capabilities are deployed from the plan.** A vertical can opt into a shared
@@ -60,32 +70,104 @@ managing or extending it — that's `wix-docs` and `wix-manage`, not a workaroun
60
70
 
61
71
  ## The run
62
72
 
63
- 1. **Resolve the stack.** Default is **Wix-managed Astro** — take it unless the user names a
64
- different React framework or the directory already holds a non-Astro React project. A
65
- non-React frontend is out of scope → `wix-headless`.
66
- 2. **Draft the seed plan** (read only the vertical's `SEED.md` for this — it depends only on
67
- the brief; save the vertical's `INSTRUCTIONS.md` for step 4, where it's needed). Requires from here on: Node ≥ 20.11 and a logged-in Wix CLI
73
+ 1. **Resolve the stack.** Default is **Wix-managed Astro** — take it unless the user names
74
+ another framework or the directory already holds one. Then, by what the shipped code can run
75
+ there:
76
+ - **React** (Vite, Next, …) runs everything shipped — data layer, hooks, components:
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.
82
+ - **Another bundled JS framework** (Vue, Svelte, Solid, plain Vite): the data layer and the
83
+ framework-free stores run (`src/wix/` has no React in it), the React hooks and components
84
+ don't apply: `--stack lib`. The agent binds the stores and writes its framework's components
85
+ against the same contracts.
86
+ - **No bundler, or another language** — a static site (plain HTML/CSS/JS), a server-rendered
87
+ app (Flask, Laravel, Rails, …): **reference mode** (below). Nothing from `app/` deploys; the
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).
113
+ 2. **The seed plan.** When the brief supplies the content in any form — a CSV, JSON or
114
+ spreadsheet, a list in the prompt, a PDF price list, a folder of photos and a text file, a
115
+ link to their current catalog, anything else that names the content — that IS the plan: map
116
+ it into `plan.json` per `references/shared/SUPPLIED-CONTENT.md` and the vertical's `SEED.md`
117
+ ("Supplied content"), every entry, names and prices verbatim, their images and no others.
118
+ Draft a plan from the brief only when nothing was supplied (read only the vertical's
119
+ `SEED.md` for this — it depends only on the brief; save the vertical's `INSTRUCTIONS.md` for
120
+ step 4, where it's needed). **An existing site has no plan**: when the brief names a site by
121
+ its id, the site holds the content already — nothing is seeded, and the frontend reads what
122
+ is there (step 3's attach path). Requires from here on: Node ≥ 20.11 and a logged-in Wix CLI
68
123
  (`npx @wix/cli@latest whoami`; login via the device-code flow — surface the URL+code, never
69
124
  read tokens into context).
70
- 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:
71
127
 
72
128
  ```bash
73
- 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>"]
74
130
  ```
75
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
+
76
155
  `--vertical` is required and picks which shipped code deploys AND which seed runs — use
77
- 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.
78
161
 
79
- 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
80
163
  you / the enclosing repo, so it does **not** create the scaffold's usual git repo + initial
81
164
  commit (which would otherwise become a nested-repo gitlink if the project lands inside a repo).
82
165
 
83
- Optional `--flatten`: by default the project is created in a **new subfolder** (named after the
84
- business). Pass `--flatten` to create it **directly in the current directory** instead — a plain
85
- move of the scaffold's files up into the CWD, done **before** the dependency install starts so
86
- nothing is half-moved (and since git was skipped, there's no nested repo to reconcile). Use it
87
- when bootstrapping into an existing repo that must stay a single flat tree; otherwise omit it
88
- and keep the subfolder.
166
+ The project is created **in the current directory** — the folder the entry had you work from,
167
+ which already holds the installed skills — so the project is self-contained and a later session
168
+ opened in it finds everything. It refuses if the folder already holds a file the scaffold would
169
+ write. `--subfolder` creates it in a new folder named after the business instead, for a current
170
+ folder that must stay as it is; the skills then sit one level above the project.
89
171
 
90
172
  It emits one JSON event per line and returns in **~35s**: **scaffolds** the project,
91
173
  **deploys** the shipped code (patching `package.json` with every dependency the code
@@ -96,14 +178,79 @@ managing or extending it — that's `wix-docs` and `wix-manage`, not a workaroun
96
178
  and both markers. Relay notable events. On an `error` event, recover just that step via the
97
179
  manual path below, then continue.
98
180
 
99
- **Connect/iterate runs (a project already on disk): never scaffold — use the manual path:**
100
- `CI=1 npm create @wix/new@latest init` in place if there is no `wix.config.json` yet; then
101
- `node <SKILL_ROOT>/install/deploy.mjs <vertical…> --stack astro|react --plan plan.json` from the project root
102
- (react stack: add `--client-id` if there is no `wix.config.json` to read the public id
103
- from); then ONE `npm ci --ignore-scripts || npm install --ignore-scripts` (backgroundable —
104
- but **never run a second npm install concurrently**: two npms in one `node_modules` race and
105
- redo each other's work); then seed per the vertical's `seed/SEED.md`. Seeding is
106
- **additive**: never delete or overwrite existing content; if a cleanup seems needed, ask.
181
+ **Existing-site runs (the brief names a Wix site by its id — a new frontend for a site that
182
+ already has its content): read the site, then run attach.** First, one call tells you what
183
+ the site is — its name, currency, and the Wix apps installed on it:
184
+
185
+ ```bash
186
+ curl -sS -X POST 'https://www.wixapis.com/_api/dynamic-context/v1/dynamic-context/markdown' \
187
+ -H "Authorization: $(npx -y @wix/cli@latest token)" -H 'Content-Type: application/json' \
188
+ -d '{"siteId": "<siteId>"}'
189
+ ```
190
+
191
+ The installed apps name the verticals (Wix Stores → storefront, Wix Bookings → bookings, and
192
+ so on per the Verticals table); the brief picks among them. Then one deterministic call, same
193
+ shape as setup:
194
+
195
+ ```bash
196
+ node <SKILL_ROOT>/install/attach.mjs --site <siteId> --business-name "<site name>" --vertical <vertical>[,<vertical>]
197
+ ```
198
+
199
+ `init`/`wix create` always create a site, so they are not used here. attach does what they do
200
+ after creating one — the site's OAuth app, Wix hosting, `wix.config.json` — against the site
201
+ given, scaffolds the CLI's Astro template, deploys the shipped code, and starts the install
202
+ detached. No seed runs and nothing on the site changes: the content is the site's own, read
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.
209
+
210
+ **Get the measure of the site before you design.** Enough to know what you are building
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.
231
+ - **`wix-manage`**, at `.agents/skills/wix-manage/` — REST recipes for managing a site's
232
+ business solutions: exact endpoint, method and payload per operation, curl included. Its
233
+ SKILL.md is the index, by solution; open the recipe for the vertical's solution.
234
+ - **`wix-docs`**, at `.agents/skills/wix-docs/` — the Wix API reference, reached by
235
+ **search, not by browsing files**: the skill folder holds the how-to, not the pages. Open
236
+ its SKILL.md; it gives one `curl` to semantic search (`POST
237
+ /mcp-docs-search/v1/docs/search/markdown`, natural-language `search_term`) that returns
238
+ condensed method docs — endpoint, request example, response shape — and the rule that any
239
+ `dev.wix.com/docs/…` URL plus `.md` is the full page. Progressive: search first, read the
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.
107
254
 
108
255
  4. **Design and build the presentation while the install finishes** — in the project dir from
109
256
  the `ready_for_brand_layer` event, per the vertical's `INSTRUCTIONS.md`: set the `@theme`
@@ -122,18 +269,116 @@ managing or extending it — that's `wix-docs` and `wix-manage`, not a workaroun
122
269
  5. **When both background jobs have completed** — the install's marker
123
270
  (`node_modules/.package-lock.json`) and the seed's (`.seed-exit`) both exist — **verify the
124
271
  seed succeeded** (`.seed-exit` contains `0`; `seed-result.json` has the created counts for
125
- your summary — if non-zero, read `seed.log` and re-run the seed module manually). Then
126
- **build & release once** (managed):
127
- `npx @wix/cli@latest build` then `npx @wix/cli@latest release` (if the install failed, run
128
- it once more and then build). Don't build+release mid-flow; backend content is fetched at
272
+ your summary — if non-zero, read `seed.log` and re-run the seed module manually). Those two
273
+ seed files exist **only when setup started the seed** (attach runs none: only the install
274
+ marker is waited on). When you ran `seed-store.mjs`
275
+ yourself (connect/iterate runs, reference mode), there is no marker to wait for: the process's
276
+ exit code is the result and its stdout is the JSON — wait on the process (a foreground run,
277
+ or `wait` on its pid), not on a file. Then
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
129
284
  runtime, so a re-release never "refreshes" seeded data. The run is complete only when the
130
285
  site is released — close with the live URL and the dashboard link
131
286
  `https://manage.wix.com/dashboard/<siteId>`. **Copy the live URL verbatim from the
132
287
  `wix release` output — never retype it from memory** (a mistyped subdomain hands the user
133
288
  a 404).
134
289
 
135
- Don't smoke-test with a dev server unless the user explicitly asks to verify — correctness
136
- comes from the shipped code, and real errors surface at build/release.
290
+ ## Reference mode — a static site, or a server-rendered app in another language
291
+
292
+ The data layer ships a second time as a **REST layer**: `references/shared/rest/` (the auth seam
293
+ `client.ts`, `media.ts`, `config.ts`) and `references/<vertical>/rest/` (the same exports as the
294
+ vertical's `app/wix/<vertical>/` data layer, over `fetch`), typed against the same `types.ts` and
295
+ importing the same `*-core.ts` rule files as the SDK layer — one implementation of the rules, two
296
+ transports. The vertical's `INSTRUCTIONS.md` names its modules and what each surface does with
297
+ them; this section is the mechanics, the same for every vertical.
298
+
299
+ - **Static site (no bundler).** `npm create @wix/new@latest init` in the project folder (site,
300
+ OAuth app, `wix.config.json`). The site lives in a **subfolder** — `site/` — holding only the
301
+ pages, styles, and `js/`; set `site.outputDirectory` in the config to `"./site"`. `wix release`
302
+ uploads that directory whole, so the project root (config, `plan.json`, seed output, anything
303
+ else) must not be it. Then `node <SKILL_ROOT>/install/deploy.mjs <vertical> --stack static --out
304
+ site` composes the REST layer and the vertical's framework-free stores flat into `site/js/wix/`
305
+ and strips them to browser ESM (comments kept, the `.ts` kept beside the `.js` to read). Pages
306
+ import the vertical's modules from `./js/wix/` in a `<script type="module">`: the stores hold
307
+ the state machines (subscribe, render from `getState()`, call actions), the page holds the
308
+ rendering. The visitor token lives in `localStorage` and is the
309
+ visitor's identity across Wix — never mint one per page. A route is a page plus a query-string
310
+ slug (`item.html?slug=…`). Wix static hosting serves files, not directories: `/shop` does not
311
+ resolve to `shop/index.html`, and there is no routes configuration — name the file and link
312
+ to it. Seed per the vertical's `SEED.md` (Node + the CLI token, no project dependencies).
313
+ Release with `npx @wix/cli@latest release` — no build. Item-page tags come from the entity's
314
+ `seoData`, set after the fetch (`document.title`, the meta description).
315
+ - **Server-rendered, another language (Flask, Laravel, Rails, …).** The same shape as managed
316
+ Astro — pages rendered on the server, the interactive surfaces in the browser — with hosting and
317
+ SEO plumbing theirs. `init` still runs in the project folder; run `deploy.mjs <vertical> --stack
318
+ static` there too: it only needs `wix.config.json` and writes `js/wix/`. Split by where the call
319
+ runs:
320
+ - **Reads render on the server.** Port the vertical's `rest/` read module and its `*-core.ts` to
321
+ the server language: each function is one HTTP call with a literal URL and JSON body, and the
322
+ core carries the rules. That code is tested and proven against live sites — carry its bodies
323
+ over as they are, `fields` arrays and filter keys included (they are not guessable, and a
324
+ near-miss returns empty or unformatted data with no error), and render what Wix returns
325
+ (`formattedAmount`, never a number you format yourself). The shipped JS runs: when in doubt,
326
+ run the module with Node against the same site and compare one entity with your port. Public
327
+ reads need no visitor identity — one anonymous visitor token per server process, refreshed per
328
+ `client.ts`, is enough for them.
329
+ - **Visitor-specific state runs in the browser.** Whatever the vertical does on the visitor's
330
+ behalf (a store's cart and checkout, a booking, an RSVP, a form submit) loads the vertical's
331
+ `js/wix/` module in the templates and talks to Wix from the page, exactly as a static site
332
+ does: the browser owns the visitor token in `localStorage`, so the server handles no
333
+ per-visitor tokens. If that state must run server-side anyway, `client.ts`'s header applies:
334
+ one token set per visitor in the visitor's session, never one process-wide token (that is one
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.
343
+ - **Pre-rendered → Wix-hosted.** If the project builds to static HTML (Frozen-Flask, Pelican,
344
+ Hugo, Eleventy, any static-site generator), Wix can host the output: run `deploy.mjs
345
+ <vertical> --stack static --out <build dir>` so `js/wix/` lands inside the build output (or
346
+ copy it there after each build), make the generator emit a page for **every** entity slug the
347
+ vertical's list read returns (walk it by cursor, never only the first page), point
348
+ `site.outputDirectory` at the build folder, `wix release`. The build's own reads use one
349
+ anonymous visitor token for the duration of the build. What Wix hosts is exactly the contents
350
+ of that folder after your last build, served as files: every asset a page references must be
351
+ in there and current — if the pipeline has more than one build step (templates, then a CSS or
352
+ asset bundle), they all run, in order, on every rebuild, or the release carries a stale piece.
353
+ a clean path does not resolve to a folder's `index.html`; name the file and link to it. Generated pages
354
+ sit at different depths, so reference `js/wix/` through one base path (a template variable,
355
+ or root-relative `/js/wix/…`), never `./js/wix/` — a relative path breaks one level down. **The generated page
356
+ is the first paint, not the whole surface**: the vertical's interactive behaviour (a store's
357
+ sort, filters, and cart; a blog's search; a booking flow) still runs client-side on top of it
358
+ from the same `js/wix/` modules, so the vertical's surface contracts in `INSTRUCTIONS.md`
359
+ apply unchanged. Close with the rebuild + release command and one line for the owner: content
360
+ edits made in the dashboard reach the site when that command runs; the browser-side flows are
361
+ live regardless. A running server (live reads on every request) stays theirs to host.
362
+ Then read the vertical's `INSTRUCTIONS.md` for the surfaces and hard rules, and the shared
363
+ `DESIGN.md`/`CONTENT.md`. **Before writing any surface, read the vertical's shipped hooks and
364
+ components** — its `INSTRUCTIONS.md` lists which files and what to take from each. They don't
365
+ deploy on this stack, and they are working, tested code for exactly the behaviour you are about
366
+ to write in your own; rewriting them from prose is where the bugs come from (the runs that
367
+ skipped them shipped a broken quick-add, the run that read them didn't). Both were written for
368
+ the stacks that receive the code, so they speak that stack's dialect: the Tailwind classes in the
369
+ skeletons and the components are one spelling of layout and behaviour rules that hold everywhere
370
+ (a bounded image band on phones, name and price on separate lines, the buy control pinned to the
371
+ tile's bottom, an overlay that locks scroll and returns focus). Take the rules; write them in the
372
+ CSS your stack uses, on a token set you define — nothing here asks you to add Tailwind. Close with run (or
373
+ rebuild) instructions, the live URL when Wix hosts the output, the dashboard link, and — when
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).
376
+ - Both: the calls in `rest/` are the ones a **visitor token** may make from a page — public reads
377
+ and the visitor's own actions. Anything elevated (writes to content, other people's data) runs
378
+ server-side per `references/shared/CUSTOM_OPERATIONS.md`; the seed's CLI token never belongs in
379
+ a page. A static site has no SSR; neither case has owner-editable item-page SEO through
380
+ `@wix/seo` (tags come from the entity's `seoData`) — say so in the closing message; managed
381
+ Astro stays the recommendation for a public site.
137
382
 
138
383
  ## Verticals
139
384
 
@@ -151,10 +396,10 @@ comes from the shipped code, and real errors surface at build/release.
151
396
  | Restaurant: menu with photos, online ordering, table reservations | **restaurants** | `references/restaurants/INSTRUCTIONS.md` |
152
397
 
153
398
  Verticals compose: a brief that spans several (a restaurant with a blog, a store with member
154
- 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
155
400
  `node <SKILL_ROOT>/install/deploy.mjs <vertical…>` from the project root before the install
156
401
  starts, and run each vertical's seed. A request that doesn't match any shipped vertical isn't
157
- 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
158
403
  vertical here.
159
404
 
160
405
  ## Adding a vertical (structure contract)
@@ -164,10 +409,11 @@ New verticals follow the same layout — the deploy script discovers them automa
164
409
 
165
410
  ```
166
411
  references/<vertical>/
167
- INSTRUCTIONS.md # playbook: file map, wiring per stack, what you build, hard rules, verify
412
+ INSTRUCTIONS.md # playbook: file map, wiring per stack, what you build, hard rules
168
413
  app/ # framework-agnostic core — disjoint paths so verticals never collide:
169
414
  wix/<vertical>/ # types.ts (DTOs) + data layer (calls via ../sdk, images via ../media)
170
- hooks/<vertical>/ # React hooks (SSR-friendly: accept initial data)
415
+ # + *-store.ts: the state machines, framework-free (ship on every stack)
416
+ hooks/<vertical>/ # React hooks — thin bindings of the stores (SSR-friendly: accept initial data)
171
417
  components/<vertical>/ # routing-free components (plain <a> default + LinkComponent prop)
172
418
  styles/global.css # Tailwind v4 + the @theme design tokens (shared token family)
173
419
  app-astro/ # Astro overlay importing ONLY from the core:
@@ -176,9 +422,14 @@ references/<vertical>/
176
422
  # (storefront ships no pages — its INSTRUCTIONS carries their skeletons)
177
423
  layouts/… # (reuse SiteLayout when it fits)
178
424
  seed/ # seed-<vertical>.mjs (REST, mints its own CLI token) + SEED.md
425
+ rest/ # the REST twin of app/wix/<vertical>/: same exports over fetch, importing
426
+ # the same *-core.ts (rules + DTO mappers, type-only imports) and types.ts;
427
+ # flat ./x.js imports — deploy --stack static composes and strips it
179
428
  ```
180
429
 
181
- Core rules the structure encodes: raw API entities never leave the data layer (DTOs only);
430
+ Core rules the structure encodes: a rule or mapper lives once, in `app/wix/<vertical>/*-core.ts`,
431
+ imported by both transports (a call added to `app/` gets its `rest/` twin in the same PR; `tsc`
432
+ over both is the parity check); raw API entities never leave the data layer (DTOs only);
182
433
  client-shared state uses a module-scope store (never React context — it can't span Astro
183
434
  islands); every image URL is resolved through `src/wix/media.ts`; every money value is a
184
435
  formatted string by the time a component sees it.
@@ -28,18 +28,27 @@ This entry gets a cold environment to the point where the real skill can run, th
28
28
  2. **Hand off (agentic).** Install the skills, then open `wix-headless-fast/SKILL.md` and
29
29
  follow it — it resolves the stack and operation and owns the whole build.
30
30
 
31
- Three starting points come through here, all handled the same way — run the bootstrap, then
31
+ Four starting points come through here, all handled the same way — run the bootstrap, then
32
32
  hand off:
33
33
 
34
34
  - **new** — a prompt with no project (empty CWD)
35
35
  - **connect** — an existing frontend/design not yet on Wix (a project on disk without
36
36
  `wix.config.json`, or a brought-in zip/URL)
37
37
  - **iterate** — a project already connected to Wix (`.wix/` or `wix.config.json` present)
38
+ - **existing site** — the prompt names a Wix site that already exists (by its site id) and asks
39
+ for a new frontend for it; the site keeps its content, the frontend is built here
38
40
 
39
41
  The bootstrap only verifies the CLI and logs you in, so it's fine to run in every case (an
40
42
  existing session just reports `logged_in`).
41
43
 
42
- ## Phase 0 — Node (the one manual prerequisite)
44
+ ## Phase 0 — The project's folder, and Node
45
+
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
50
+ bootstrap, the skills, the scaffold — lands in this folder, so a later session opened in the project
51
+ finds all of it.
43
52
 
44
53
  The Wix CLI requires **Node ≥ 20.11**. Check `node -v`; if it errors or prints a lower
45
54
  version, install or upgrade Node first — do **not** work around it:
@@ -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
+ }