@wix/agent-skills 1.21.0 → 1.23.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 (269) hide show
  1. package/package.json +1 -1
  2. package/skills/wix-app/SKILL.md +71 -7
  3. package/skills/wix-app/references/APP_VALIDATION.md +16 -10
  4. package/skills/wix-app/references/DASHBOARD_PAGE.md +11 -25
  5. package/skills/wix-app/references/DATA_COLLECTION.md +16 -219
  6. package/skills/wix-app/references/SDK_MODULE_MAP.md +2 -0
  7. package/skills/wix-app/references/dashboard-page/DATA_SOURCES.md +182 -0
  8. package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE.md +97 -0
  9. package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE_COLLECTION.md +184 -0
  10. package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE_ROUTER.md +203 -0
  11. package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE_SETTINGS.md +44 -0
  12. package/skills/wix-app/references/dashboard-page/QUERY_AND_PAGING.md +182 -0
  13. package/skills/wix-app/references/dashboard-page/TABLE_STATE.md +133 -0
  14. package/skills/wix-app/references/dashboard-page/UX_SUCCESS_MODEL.md +10 -5
  15. package/skills/wix-app/references/data-collection/LIFECYCLE.md +68 -0
  16. package/skills/wix-app/references/data-collection/PERMISSIONS.md +47 -0
  17. package/skills/wix-app/references/data-collection/SCHEMA.md +181 -0
  18. package/skills/wix-app/references/data-collection/WIX_DATA.md +38 -66
  19. package/skills/wix-headless-fast/SKILL.md +95 -230
  20. package/skills/wix-headless-fast/cold-start/bootstrap.mjs +156 -0
  21. package/skills/wix-headless-fast/{entry/skill.md → cold-start/cold-start.md} +17 -14
  22. package/skills/wix-headless-fast/guides/existing-site.md +78 -0
  23. package/skills/wix-headless-fast/guides/migration.md +43 -0
  24. package/skills/wix-headless-fast/guides/reference-mode.md +100 -0
  25. package/skills/wix-headless-fast/install/AGENTS.md +9 -4
  26. package/skills/wix-headless-fast/install/agents-md.mjs +5 -1
  27. package/skills/wix-headless-fast/install/attach.mjs +25 -47
  28. package/skills/wix-headless-fast/install/check.mjs +87 -0
  29. package/skills/wix-headless-fast/install/context.mjs +126 -0
  30. package/skills/wix-headless-fast/install/deploy.mjs +106 -80
  31. package/skills/wix-headless-fast/install/lock.mjs +55 -0
  32. package/skills/wix-headless-fast/install/setup.mjs +83 -23
  33. package/skills/wix-headless-fast/install/templates.mjs +168 -0
  34. package/skills/wix-manage/SKILL.md +3 -3
  35. package/skills/wix-manage/references/app-installation/install-wix-apps.md +68 -2
  36. package/skills/wix-manage/references/contacts/bulk-label-and-unlabel-contacts.md +37 -4
  37. package/skills/wix-manage/references/ecommerce/ecom-pricing.md +29 -3
  38. package/skills/wix-manage/references/google-ads/google-ads-dashboard-navigation.md +27 -0
  39. package/skills/wix-manage/references/google-ads/manage-campaign-success-guide.md +83 -37
  40. package/skills/wix-manage/references/sites/site-import.md +101 -37
  41. package/skills/wix-headless-fast/references/blog/INSTRUCTIONS.md +0 -303
  42. package/skills/wix-headless-fast/references/blog/app/components/blog/BlogFeedView.tsx +0 -136
  43. package/skills/wix-headless-fast/references/blog/app/components/blog/PostView.tsx +0 -112
  44. package/skills/wix-headless-fast/references/blog/app/components/blog/RichContent.tsx +0 -42
  45. package/skills/wix-headless-fast/references/blog/app/hooks/blog/useBlogFeed.ts +0 -31
  46. package/skills/wix-headless-fast/references/blog/app/hooks/blog/usePost.ts +0 -22
  47. package/skills/wix-headless-fast/references/blog/app/wix/blog/blog-feed-store.ts +0 -137
  48. package/skills/wix-headless-fast/references/blog/app/wix/blog/post-store.ts +0 -78
  49. package/skills/wix-headless-fast/references/blog/app/wix/blog/posts-core.ts +0 -117
  50. package/skills/wix-headless-fast/references/blog/app/wix/blog/posts.ts +0 -52
  51. package/skills/wix-headless-fast/references/blog/app/wix/blog/taxonomy-core.ts +0 -47
  52. package/skills/wix-headless-fast/references/blog/app/wix/blog/taxonomy.ts +0 -58
  53. package/skills/wix-headless-fast/references/blog/app/wix/blog/types.ts +0 -62
  54. package/skills/wix-headless-fast/references/blog/app-astro/layouts/SiteLayout.astro +0 -40
  55. package/skills/wix-headless-fast/references/blog/app-astro/pages/blog/[...slug].astro +0 -97
  56. package/skills/wix-headless-fast/references/blog/app-astro/pages/blog.astro +0 -24
  57. package/skills/wix-headless-fast/references/blog/lock/astro/package-lock.json +0 -16156
  58. package/skills/wix-headless-fast/references/blog/rest/posts.ts +0 -42
  59. package/skills/wix-headless-fast/references/blog/rest/taxonomy.ts +0 -62
  60. package/skills/wix-headless-fast/references/blog/seed/SEED.md +0 -81
  61. package/skills/wix-headless-fast/references/blog/seed/read-site.mjs +0 -22
  62. package/skills/wix-headless-fast/references/blog/seed/seed-blog.mjs +0 -287
  63. package/skills/wix-headless-fast/references/bookings/INSTRUCTIONS.md +0 -277
  64. package/skills/wix-headless-fast/references/bookings/app/components/bookings/ServiceBookingView.tsx +0 -144
  65. package/skills/wix-headless-fast/references/bookings/app/components/bookings/ServicesView.tsx +0 -119
  66. package/skills/wix-headless-fast/references/bookings/app/hooks/bookings/useBookingFlow.ts +0 -32
  67. package/skills/wix-headless-fast/references/bookings/app/hooks/bookings/useServices.ts +0 -23
  68. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/booking-core.ts +0 -218
  69. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/booking-flow-store.ts +0 -169
  70. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/booking.ts +0 -121
  71. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/services-core.ts +0 -92
  72. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/services-store.ts +0 -90
  73. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/services.ts +0 -57
  74. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/types.ts +0 -72
  75. package/skills/wix-headless-fast/references/bookings/app-astro/layouts/SiteLayout.astro +0 -40
  76. package/skills/wix-headless-fast/references/bookings/app-astro/pages/services/[slug].astro +0 -76
  77. package/skills/wix-headless-fast/references/bookings/app-astro/pages/services.astro +0 -22
  78. package/skills/wix-headless-fast/references/bookings/lock/astro/package-lock.json +0 -11962
  79. package/skills/wix-headless-fast/references/bookings/rest/booking.ts +0 -113
  80. package/skills/wix-headless-fast/references/bookings/rest/services.ts +0 -55
  81. package/skills/wix-headless-fast/references/bookings/seed/SEED.md +0 -71
  82. package/skills/wix-headless-fast/references/bookings/seed/read-site.mjs +0 -28
  83. package/skills/wix-headless-fast/references/bookings/seed/seed-bookings.mjs +0 -302
  84. package/skills/wix-headless-fast/references/cms/INSTRUCTIONS.md +0 -355
  85. package/skills/wix-headless-fast/references/cms/app/hooks/cms/useCollection.ts +0 -50
  86. package/skills/wix-headless-fast/references/cms/app/hooks/cms/useItem.ts +0 -37
  87. package/skills/wix-headless-fast/references/cms/app/wix/cms/collection-store.ts +0 -158
  88. package/skills/wix-headless-fast/references/cms/app/wix/cms/item-store.ts +0 -93
  89. package/skills/wix-headless-fast/references/cms/app/wix/cms/items-core.ts +0 -177
  90. package/skills/wix-headless-fast/references/cms/app/wix/cms/items.ts +0 -123
  91. package/skills/wix-headless-fast/references/cms/app/wix/cms/types.ts +0 -75
  92. package/skills/wix-headless-fast/references/cms/app-astro/layouts/SiteLayout.astro +0 -41
  93. package/skills/wix-headless-fast/references/cms/lock/astro/package-lock.json +0 -11262
  94. package/skills/wix-headless-fast/references/cms/rest/items.ts +0 -125
  95. package/skills/wix-headless-fast/references/cms/seed/SEED.md +0 -112
  96. package/skills/wix-headless-fast/references/cms/seed/read-site.mjs +0 -20
  97. package/skills/wix-headless-fast/references/cms/seed/seed-cms.mjs +0 -324
  98. package/skills/wix-headless-fast/references/events/INSTRUCTIONS.md +0 -307
  99. package/skills/wix-headless-fast/references/events/app/components/events/EventConfirmationView.tsx +0 -66
  100. package/skills/wix-headless-fast/references/events/app/components/events/EventRegistrationView.tsx +0 -178
  101. package/skills/wix-headless-fast/references/events/app/components/events/EventsView.tsx +0 -118
  102. package/skills/wix-headless-fast/references/events/app/hooks/events/useEventRegistration.ts +0 -35
  103. package/skills/wix-headless-fast/references/events/app/hooks/events/useEvents.ts +0 -24
  104. package/skills/wix-headless-fast/references/events/app/wix/events/events-core.ts +0 -130
  105. package/skills/wix-headless-fast/references/events/app/wix/events/events-store.ts +0 -97
  106. package/skills/wix-headless-fast/references/events/app/wix/events/events.ts +0 -55
  107. package/skills/wix-headless-fast/references/events/app/wix/events/registration-core.ts +0 -113
  108. package/skills/wix-headless-fast/references/events/app/wix/events/registration-store.ts +0 -156
  109. package/skills/wix-headless-fast/references/events/app/wix/events/registration.ts +0 -97
  110. package/skills/wix-headless-fast/references/events/app/wix/events/types.ts +0 -61
  111. package/skills/wix-headless-fast/references/events/app-astro/layouts/SiteLayout.astro +0 -40
  112. package/skills/wix-headless-fast/references/events/app-astro/pages/event-confirmation.astro +0 -12
  113. package/skills/wix-headless-fast/references/events/app-astro/pages/events/[slug].astro +0 -80
  114. package/skills/wix-headless-fast/references/events/app-astro/pages/events.astro +0 -21
  115. package/skills/wix-headless-fast/references/events/lock/astro/package-lock.json +0 -11884
  116. package/skills/wix-headless-fast/references/events/rest/events.ts +0 -57
  117. package/skills/wix-headless-fast/references/events/rest/registration.ts +0 -83
  118. package/skills/wix-headless-fast/references/events/seed/SEED.md +0 -95
  119. package/skills/wix-headless-fast/references/events/seed/read-site.mjs +0 -26
  120. package/skills/wix-headless-fast/references/events/seed/seed-events.mjs +0 -276
  121. package/skills/wix-headless-fast/references/forms/INSTRUCTIONS.md +0 -340
  122. package/skills/wix-headless-fast/references/forms/app/hooks/forms/useWixForm.ts +0 -85
  123. package/skills/wix-headless-fast/references/forms/app/wix/forms/form-store.ts +0 -332
  124. package/skills/wix-headless-fast/references/forms/app/wix/forms/forms-core.ts +0 -238
  125. package/skills/wix-headless-fast/references/forms/app/wix/forms/forms.ts +0 -54
  126. package/skills/wix-headless-fast/references/forms/app/wix/forms/submissions-core.ts +0 -216
  127. package/skills/wix-headless-fast/references/forms/app/wix/forms/submissions.ts +0 -59
  128. package/skills/wix-headless-fast/references/forms/app/wix/forms/types.ts +0 -135
  129. package/skills/wix-headless-fast/references/forms/lock/astro/package-lock.json +0 -10593
  130. package/skills/wix-headless-fast/references/forms/rest/forms.ts +0 -34
  131. package/skills/wix-headless-fast/references/forms/rest/submissions.ts +0 -56
  132. package/skills/wix-headless-fast/references/forms/seed/SEED.md +0 -116
  133. package/skills/wix-headless-fast/references/forms/seed/read-site.mjs +0 -20
  134. package/skills/wix-headless-fast/references/forms/seed/seed-forms.mjs +0 -327
  135. package/skills/wix-headless-fast/references/members/INSTRUCTIONS.md +0 -316
  136. package/skills/wix-headless-fast/references/members/app/components/members/AccountView.tsx +0 -60
  137. package/skills/wix-headless-fast/references/members/app/components/members/LoginForm.tsx +0 -155
  138. package/skills/wix-headless-fast/references/members/app/components/members/MemberMenu.tsx +0 -78
  139. package/skills/wix-headless-fast/references/members/app/components/members/RequireAuth.tsx +0 -47
  140. package/skills/wix-headless-fast/references/members/app/hooks/members/useMember.ts +0 -66
  141. package/skills/wix-headless-fast/references/members/app/wix/members/auth-core.ts +0 -105
  142. package/skills/wix-headless-fast/references/members/app/wix/members/auth.ts +0 -59
  143. package/skills/wix-headless-fast/references/members/app/wix/members/client.ts +0 -53
  144. package/skills/wix-headless-fast/references/members/app/wix/members/member-store.ts +0 -122
  145. package/skills/wix-headless-fast/references/members/app/wix/members/members-core.ts +0 -43
  146. package/skills/wix-headless-fast/references/members/app/wix/members/members.ts +0 -29
  147. package/skills/wix-headless-fast/references/members/app/wix/members/types.ts +0 -21
  148. package/skills/wix-headless-fast/references/members/app-astro/layouts/SiteLayout.astro +0 -42
  149. package/skills/wix-headless-fast/references/members/app-astro/pages/account.astro +0 -10
  150. package/skills/wix-headless-fast/references/members/app-astro/pages/login.astro +0 -11
  151. package/skills/wix-headless-fast/references/members/lock/astro/package-lock.json +0 -10329
  152. package/skills/wix-headless-fast/references/members/rest/auth.ts +0 -215
  153. package/skills/wix-headless-fast/references/members/rest/members.ts +0 -26
  154. package/skills/wix-headless-fast/references/members/seed/SEED.md +0 -39
  155. package/skills/wix-headless-fast/references/members/seed/read-site.mjs +0 -15
  156. package/skills/wix-headless-fast/references/members/seed/seed-members.mjs +0 -94
  157. package/skills/wix-headless-fast/references/portfolio/INSTRUCTIONS.md +0 -315
  158. package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/CollectionProjectsView.tsx +0 -110
  159. package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/CollectionsView.tsx +0 -90
  160. package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/GalleryMedia.tsx +0 -35
  161. package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/ProjectDetailView.tsx +0 -85
  162. package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useCollectionProjects.ts +0 -32
  163. package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useCollections.ts +0 -21
  164. package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useProjectDetail.ts +0 -31
  165. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/collection-projects-store.ts +0 -82
  166. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/collections-store.ts +0 -58
  167. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/portfolio-core.ts +0 -177
  168. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/portfolio.ts +0 -78
  169. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/project-detail-store.ts +0 -81
  170. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/types.ts +0 -55
  171. package/skills/wix-headless-fast/references/portfolio/app-astro/layouts/SiteLayout.astro +0 -40
  172. package/skills/wix-headless-fast/references/portfolio/app-astro/pages/portfolio/[slug].astro +0 -30
  173. package/skills/wix-headless-fast/references/portfolio/app-astro/pages/portfolio.astro +0 -21
  174. package/skills/wix-headless-fast/references/portfolio/app-astro/pages/projects/[slug].astro +0 -29
  175. package/skills/wix-headless-fast/references/portfolio/lock/astro/package-lock.json +0 -10197
  176. package/skills/wix-headless-fast/references/portfolio/rest/portfolio.ts +0 -75
  177. package/skills/wix-headless-fast/references/portfolio/seed/SEED.md +0 -86
  178. package/skills/wix-headless-fast/references/portfolio/seed/read-site.mjs +0 -20
  179. package/skills/wix-headless-fast/references/portfolio/seed/seed-portfolio.mjs +0 -256
  180. package/skills/wix-headless-fast/references/pricing-plans/INSTRUCTIONS.md +0 -296
  181. package/skills/wix-headless-fast/references/pricing-plans/app/components/pricing-plans/PlanDetailView.tsx +0 -47
  182. package/skills/wix-headless-fast/references/pricing-plans/app/components/pricing-plans/PlansView.tsx +0 -101
  183. package/skills/wix-headless-fast/references/pricing-plans/app/components/pricing-plans/SubscribeButton.tsx +0 -41
  184. package/skills/wix-headless-fast/references/pricing-plans/app/hooks/pricing-plans/usePlanPurchase.ts +0 -16
  185. package/skills/wix-headless-fast/references/pricing-plans/app/hooks/pricing-plans/usePlans.ts +0 -22
  186. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plan-purchase-store.ts +0 -54
  187. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plans-core.ts +0 -106
  188. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plans-store.ts +0 -64
  189. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plans.ts +0 -27
  190. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/purchase-core.ts +0 -43
  191. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/purchase.ts +0 -22
  192. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/types.ts +0 -30
  193. package/skills/wix-headless-fast/references/pricing-plans/app-astro/layouts/SiteLayout.astro +0 -41
  194. package/skills/wix-headless-fast/references/pricing-plans/app-astro/pages/plans/[slug].astro +0 -40
  195. package/skills/wix-headless-fast/references/pricing-plans/app-astro/pages/plans.astro +0 -21
  196. package/skills/wix-headless-fast/references/pricing-plans/lock/astro/package-lock.json +0 -11226
  197. package/skills/wix-headless-fast/references/pricing-plans/rest/plans.ts +0 -31
  198. package/skills/wix-headless-fast/references/pricing-plans/rest/purchase.ts +0 -20
  199. package/skills/wix-headless-fast/references/pricing-plans/seed/SEED.md +0 -79
  200. package/skills/wix-headless-fast/references/pricing-plans/seed/read-site.mjs +0 -21
  201. package/skills/wix-headless-fast/references/pricing-plans/seed/seed-pricing-plans.mjs +0 -279
  202. package/skills/wix-headless-fast/references/restaurants/INSTRUCTIONS.md +0 -360
  203. package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/MenuView.tsx +0 -142
  204. package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/OrderCartButton.tsx +0 -26
  205. package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/OrderCartDrawer.tsx +0 -121
  206. package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/ReservationView.tsx +0 -155
  207. package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useMenus.ts +0 -34
  208. package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useOrderCart.ts +0 -43
  209. package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useReservation.ts +0 -34
  210. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/menu-core.ts +0 -155
  211. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/menu-store.ts +0 -89
  212. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/menu.ts +0 -71
  213. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/order-store.ts +0 -103
  214. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/ordering-core.ts +0 -124
  215. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/ordering.ts +0 -185
  216. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/reservation-store.ts +0 -193
  217. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/reservations-core.ts +0 -94
  218. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/reservations.ts +0 -74
  219. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/types.ts +0 -168
  220. package/skills/wix-headless-fast/references/restaurants/app-astro/layouts/SiteLayout.astro +0 -47
  221. package/skills/wix-headless-fast/references/restaurants/app-astro/pages/menu.astro +0 -22
  222. package/skills/wix-headless-fast/references/restaurants/app-astro/pages/reservations.astro +0 -12
  223. package/skills/wix-headless-fast/references/restaurants/lock/astro/package-lock.json +0 -12560
  224. package/skills/wix-headless-fast/references/restaurants/rest/menu.ts +0 -60
  225. package/skills/wix-headless-fast/references/restaurants/rest/ordering.ts +0 -169
  226. package/skills/wix-headless-fast/references/restaurants/rest/reservations.ts +0 -68
  227. package/skills/wix-headless-fast/references/restaurants/seed/SEED.md +0 -89
  228. package/skills/wix-headless-fast/references/restaurants/seed/read-site.mjs +0 -25
  229. package/skills/wix-headless-fast/references/restaurants/seed/seed-restaurants.mjs +0 -499
  230. package/skills/wix-headless-fast/references/shared/CONTENT.md +0 -22
  231. package/skills/wix-headless-fast/references/shared/CUSTOM_OPERATIONS.md +0 -73
  232. package/skills/wix-headless-fast/references/shared/DESIGN.md +0 -26
  233. package/skills/wix-headless-fast/references/shared/SUPPLIED-CONTENT.md +0 -23
  234. package/skills/wix-headless-fast/references/shared/app/styles/global.css +0 -52
  235. package/skills/wix-headless-fast/references/shared/app/wix/config.ts +0 -15
  236. package/skills/wix-headless-fast/references/shared/app/wix/media.ts +0 -81
  237. package/skills/wix-headless-fast/references/shared/app/wix/money.ts +0 -24
  238. package/skills/wix-headless-fast/references/shared/app/wix/sdk.ts +0 -89
  239. package/skills/wix-headless-fast/references/shared/capabilities/media-upload/app/wix/media-upload/client.ts +0 -46
  240. package/skills/wix-headless-fast/references/shared/capabilities/media-upload/app-astro/pages/api/wix/media-upload.ts +0 -46
  241. package/skills/wix-headless-fast/references/shared/rest/client.ts +0 -155
  242. package/skills/wix-headless-fast/references/shared/rest/config.ts +0 -3
  243. package/skills/wix-headless-fast/references/shared/rest/media.ts +0 -65
  244. package/skills/wix-headless-fast/references/shared/seed/images.mjs +0 -145
  245. package/skills/wix-headless-fast/references/shared/seed/read-site.mjs +0 -99
  246. package/skills/wix-headless-fast/references/storefront/INSTRUCTIONS.md +0 -612
  247. package/skills/wix-headless-fast/references/storefront/app/components/storefront/CartButton.tsx +0 -26
  248. package/skills/wix-headless-fast/references/storefront/app/components/storefront/CartDrawer.tsx +0 -155
  249. package/skills/wix-headless-fast/references/storefront/app/components/storefront/FilterPanel.tsx +0 -266
  250. package/skills/wix-headless-fast/references/storefront/app/components/storefront/OptionPicker.tsx +0 -95
  251. package/skills/wix-headless-fast/references/storefront/app/components/storefront/QuickAdd.tsx +0 -136
  252. package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useCart.ts +0 -48
  253. package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useProductDetail.ts +0 -39
  254. package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useShop.ts +0 -34
  255. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/cart-core.ts +0 -121
  256. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/cart-store.ts +0 -107
  257. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/cart.ts +0 -138
  258. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/catalog-core.ts +0 -314
  259. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/catalog.ts +0 -133
  260. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/product-detail-store.ts +0 -147
  261. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/shop-store.ts +0 -289
  262. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/types.ts +0 -169
  263. package/skills/wix-headless-fast/references/storefront/app-astro/layouts/SiteLayout.astro +0 -65
  264. package/skills/wix-headless-fast/references/storefront/lock/astro/package-lock.json +0 -12247
  265. package/skills/wix-headless-fast/references/storefront/rest/cart.ts +0 -132
  266. package/skills/wix-headless-fast/references/storefront/rest/catalog.ts +0 -123
  267. package/skills/wix-headless-fast/references/storefront/seed/SEED.md +0 -130
  268. package/skills/wix-headless-fast/references/storefront/seed/read-site.mjs +0 -38
  269. package/skills/wix-headless-fast/references/storefront/seed/seed-store.mjs +0 -561
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: wix-headless-fast
3
- description: "Build a Wix Headless site fast by wiring SHIPPED, verified @wix/sdk code instead of authoring the integration from recipes. Each Wix business vertical ships a typed, framework-agnostic React core (data layer returning plain DTOs, hooks, headless components) plus an Astro overlay (SSR pages with owner-editable SEO pre-wired) and a build-time REST seed script — the agent scaffolds via the Wix CLI, deploys the shipped code, seeds the backend, designs the presentation layer itself on the shipped hooks (product card/grid, PDP, home, theme), and releases to Wix hosting. Works on Wix-managed Astro (ambient auth, the default) and on any React-based project (Vite, non-Astro) over the public OAuth client id. Verticals: stores/storefront (products, categories, variants, cart, hosted checkout), bookings (services, appointment/class time slots, staff, booking form, checkout-or-place), blog (posts, categories/tags, rich content), cms (structured content collections), forms (schema-driven visitor forms: render, validate, submit), events (listing, RSVP, ticket sales), members (login, gated pages, account), portfolio (project collections, media galleries), pricing-plans (plan grid, hosted purchase), restaurants (menus, online ordering, table reservations). Triggers: build me a store/blog/booking/event/restaurant/portfolio site fast, take appointments fast, sell tickets or membership plans headless, wix headless fast, connect a Wix business app with ready-made SDK code."
3
+ description: "Build a Wix Headless site fast by wiring SHIPPED, verified @wix/sdk code instead of authoring the integration from recipes. Each Wix business vertical ships a typed, framework-agnostic React core (data layer returning plain DTOs, hooks, headless components) plus an Astro overlay (SSR pages with owner-editable SEO pre-wired) and a build-time REST seed script — the agent scaffolds via the Wix CLI, deploys the shipped code, seeds the backend, designs the presentation layer itself on the shipped hooks (product card/grid, PDP, home, theme), and releases to Wix hosting. Works on Wix-managed Astro (ambient auth, the default) and on any React-based project (Vite, non-Astro) over the public OAuth client id. Verticals: stores/storefront (products, categories, variants, cart, hosted checkout), bookings (services, appointment/class time slots, staff, booking form, checkout-or-place), blog (posts, categories/tags, rich content), cms (structured content collections), forms (schema-driven visitor forms: render, validate, submit), events (listing, RSVP, ticket sales), members (login, gated pages, account), portfolio (project collections, media galleries), pricing-plans (plan grid, hosted purchase), restaurants (menus, online ordering, table reservations), faq (categorized questions and answers, search, a link per question), donations (campaign pages, goal progress, one-time and recurring donations via hosted checkout). Triggers: build me a store/blog/booking/event/restaurant/portfolio/FAQ/donation site fast, take appointments fast, sell tickets or membership plans headless, collect donations headless, wix headless fast, connect a Wix business app with ready-made SDK code."
4
4
  ---
5
5
 
6
6
  # Wix Headless Fast
@@ -21,7 +21,12 @@ doesn't express — or once the site exists and the work turns to managing or ex
21
21
 
22
22
  ## The model
23
23
 
24
- - **Shipped code is the implementation.** Every vertical ships under `references/<vertical>/`:
24
+ - **Shipped code is the implementation.** Every vertical ships under `templates/<vertical>/` in
25
+ the skill's repository, not in the skill folder: `node <SKILL_ROOT>/install/templates.mjs`
26
+ fetches all of it once into `<SKILL_ROOT>/templates/` (a second) and prints the path; every
27
+ script below fetches it itself when the folder is missing. The folder stays with the project
28
+ (only the composed `project/` scaffolds are left out of its repository), so a later session
29
+ reads the version the project was built from. Each vertical holds:
25
30
  - `app/` — the framework-agnostic core (TypeScript): a data layer that returns **plain,
26
31
  serializable DTOs** (images resolved to https URLs, prices pre-formatted), React hooks, and
27
32
  routing-free headless components. Works in Astro islands, Vite SPAs, and Next.
@@ -30,6 +35,9 @@ doesn't express — or once the site exists and the work turns to managing or ex
30
35
  - `seed/` — a build-time REST seed script (plain-data plan in, created content out) plus its
31
36
  `SEED.md` contract.
32
37
  - `INSTRUCTIONS.md` — the vertical's playbook: file map, what you build, hard rules.
38
+ - `project/` — the vertical composed into the Wix CLI's blank Astro scaffold, with its
39
+ lockfile: what `wix create` copies for a new site, so the first vertical installs without
40
+ resolving.
33
41
  - **One auth seam.** All shipped code calls Wix through `src/wix/sdk.ts`: on Wix-managed Astro
34
42
  auth is ambient (no client, no id); on any other React setup the same file runs a manual
35
43
  visitor client off the public client id in `src/wix/config.ts`. The deploy step configures
@@ -40,7 +48,7 @@ doesn't express — or once the site exists and the work turns to managing or ex
40
48
  owns it and confirm the contract with `wix-docs`; never infer one from generated SDK types,
41
49
  package files, or `node_modules`. A normal caller-permitted operation belongs in a new
42
50
  data-layer function. A privileged operation belongs in a validated server endpoint — see
43
- `references/shared/CUSTOM_OPERATIONS.md`. The presentation **doesn't ship**: the vertical's
51
+ `templates/shared/CUSTOM_OPERATIONS.md`. The presentation **doesn't ship**: the vertical's
44
52
  INSTRUCTIONS names the surfaces you design and implement yourself on the shipped hooks,
45
53
  with a skeleton carrying each surface's contract (for storefront: the shop and PDP pages
46
54
  with their islands, and home).
@@ -65,11 +73,35 @@ doesn't express — or once the site exists and the work turns to managing or ex
65
73
  capability without copying sensitive code. For a normal file upload, add a named
66
74
  `capabilities.mediaUpload.policies` entry to the plan; Fast ships its client helper, Astro
67
75
  endpoint, dependencies, and generated policy module once. Read
68
- `references/shared/CUSTOM_OPERATIONS.md` before choosing it. The agent wires the helper to
69
- the product UI; it never authors or widens the endpoint.
76
+ `templates/shared/CUSTOM_OPERATIONS.md` before choosing it. The agent wires the helper to
77
+ the product UI; it never authors or widens the endpoint. For a site-wide search (a header box
78
+ with suggestions, a `/search?q=` page over the deployed verticals' products, services, posts
79
+ and events), add a `capabilities.siteSearch` entry; Fast ships its data layer, stores, hooks,
80
+ components and search page once. Enabling it means the Wix Site Search app is installed on the
81
+ site by the seed step (`install: true`; the capability's `seed/install.mjs`, run after the
82
+ content seed) — the index fills within about half a minute of the install. Playbook:
83
+ `templates/shared/capabilities/site-search/INSTRUCTIONS.md`.
70
84
 
71
85
  ## The run
72
86
 
87
+ Needed throughout: Node ≥ 20.11, git, a logged-in Wix CLI (`npx @wix/cli@latest whoami`;
88
+ `npx @wix/cli@latest login` is a device-code flow: surface the URL and code to the user, never
89
+ read tokens into context), and the two companion skills beside this one, `wix-docs` and
90
+ `wix-manage` (if `.agents/skills/` lacks them:
91
+ `CI=1 npx skills@latest add wix/skills --skill wix-docs --skill wix-manage --yes`). The cold-start
92
+ page, `cold-start/cold-start.md`, gets a machine with none of this to that point. In a folder that
93
+ already holds a `wix.config.json`, `node <SKILL_ROOT>/install/context.mjs` first: it runs
94
+ `wix env pull` when `.env.local` is missing and prints the two identities a project has — the
95
+ deploy site (the config, where `wix release` goes) and the content site (the env, whose app the SDK
96
+ client runs as and whose dashboard manages the business). They are one site, except on a
97
+ **migration preview** (`guides/migration.md`), where the env names the site being migrated.
98
+ Every script here reads that context; the site a call targets is never guessed from the config
99
+ alone. Then fetch the shipped
100
+ code once: `node <SKILL_ROOT>/install/templates.mjs`. It prints the folder;
101
+ the `templates/…` paths below are relative to `<SKILL_ROOT>`, where it lands.
102
+ `node <SKILL_ROOT>/install/check.mjs` says whether the skill or its templates have a newer version
103
+ and prints the update commands; it changes nothing.
104
+
73
105
  1. **Resolve the stack.** Default is **Wix-managed Astro** — take it unless the user names
74
106
  another framework or the directory already holds one. Then, by what the shipped code can run
75
107
  there:
@@ -84,8 +116,9 @@ doesn't express — or once the site exists and the work turns to managing or ex
84
116
  don't apply: `--stack lib`. The agent binds the stores and writes its framework's components
85
117
  against the same contracts.
86
118
  - **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.
119
+ app (Flask, Laravel, Rails, …): **reference mode** (its section below, and
120
+ `<SKILL_ROOT>/guides/reference-mode.md`). Nothing from `app/` deploys; the REST layer
121
+ deploys for the browser side, and the server side ports it for its reads.
89
122
 
90
123
  **What Wix hosting takes, and what each stack needs to be released there.** `wix release`
91
124
  uploads the folder named in `wix.config.json` (`site.outputDirectory`) and serves it as
@@ -109,19 +142,17 @@ doesn't express — or once the site exists and the work turns to managing or ex
109
142
  `outputDirectory: { client, server }`; otherwise it is self-hosted, with its domain added to
110
143
  the OAuth app's allowed domains before checkout can return to it.
111
144
  - **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).
145
+ page plus a query-string slug (reference mode).
113
146
  2. **The seed plan.** When the brief supplies the content in any form — a CSV, JSON or
114
147
  spreadsheet, a list in the prompt, a PDF price list, a folder of photos and a text file, a
115
148
  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`
149
+ it into `plan.json` per `templates/shared/SUPPLIED-CONTENT.md` and the vertical's `SEED.md`
117
150
  ("Supplied content"), every entry, names and prices verbatim, their images and no others.
118
151
  Draft a plan from the brief only when nothing was supplied (read only the vertical's
119
152
  `SEED.md` for this — it depends only on the brief; save the vertical's `INSTRUCTIONS.md` for
120
153
  step 4, where it's needed). **An existing site has no plan**: when the brief names a site by
121
154
  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
123
- (`npx @wix/cli@latest whoami`; login via the device-code flow — surface the URL+code, never
124
- read tokens into context).
155
+ is there (step 3's attach path).
125
156
  3. **Set up the project, in its folder** — one deterministic call, the same for an empty folder
126
157
  and for a project already on disk; **the folder decides** what it does:
127
158
 
@@ -129,28 +160,35 @@ doesn't express — or once the site exists and the work turns to managing or ex
129
160
  node <SKILL_ROOT>/install/setup.mjs --vertical <vertical> [--plan plan.json] [--business-name "<Brand>"]
130
161
  ```
131
162
 
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.
163
+ - **Empty** (or only loose files: a CSV, a brief) → **create**: `wix create` with the
164
+ vertical's composed template, here; `--business-name` names the site.
134
165
  - **A project without `wix.config.json`** (a `package.json`, or an `index.html` at the root:
135
166
  someone's Astro, Vite, Next, plain HTML) → **connect**: `init` in place links the folder
136
167
  to a new site (the site is named after the folder), then the shipped code deploys into
137
168
  the project as it is. Pass `--stack` for the stack you resolved in step 1, and make the
138
169
  project what that stack needs on Wix hosting (step 1) before or right after the call.
170
+ With `--stack static` setup also makes `site/` the folder `wix release` uploads and deploys
171
+ the REST layer into `site/js/wix/`; you move the pages, styles and assets in (`guides/reference-mode.md`).
139
172
  - **`wix.config.json` and a project** → refuses: the folder is already a Wix project with a
140
173
  frontend, whether the CLI made it, a hand wrote it, or this skill built it. Three commands
141
174
  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
175
+ adds this skill's code or a solution (the client id comes from `.env.local`, the config as
176
+ the fallback), then ONE
143
177
  `npm install`, then the seed module if there is content to create. A project this skill
144
178
  built needs only the first, for a new solution; a change to what is built is file edits
145
179
  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.
180
+ - **`wix.config.json` and no project, and `.env.local` declares a migration** (a project
181
+ downloaded from Wix for a site being moved to headless; the config names a site that only
182
+ hosts the deployment, the env the site being migrated) → **migrate**: setup copies the
183
+ vertical's composed template in around the config, deploys with the migrated site's app as
184
+ the client, starts the install, seeds nothing. `ready_for_brand_layer` says `mode: "migrate"`,
185
+ the parent as `siteId` and the child as `deploySiteId`. `guides/migration.md` has the rules.
186
+ - **`wix.config.json` and no project**, no migration (what `init` leaves in an empty folder) →
187
+ the site exists and has no frontend yet: `attach.mjs` (below), which takes the site from the
188
+ config, reuses its hosting, scaffolds and deploys. No seed: the site owns its content.
189
+ - The brief names a site by id → not this call: read `<SKILL_ROOT>/guides/existing-site.md`
190
+ and follow it (read the site, then `attach.mjs`, which does what setup does against the
191
+ site given; self-hosting and a project already on disk are in there too).
154
192
 
155
193
  `--vertical` is required and picks which shipped code deploys AND which seed runs — use
156
194
  the vertical you resolved from the Verticals table. **`--plan` decides whether anything is
@@ -169,79 +207,15 @@ doesn't express — or once the site exists and the work turns to managing or ex
169
207
  write. `--subfolder` creates it in a new folder named after the business instead, for a current
170
208
  folder that must stay as it is; the skills then sit one level above the project.
171
209
 
172
- It emits one JSON event per line and returns in **~35s**: **scaffolds** the project,
173
- **deploys** the shipped code (patching `package.json` with every dependency the code
174
- imports, and placing the pre-resolved lockfile), then **starts two detached background
175
- jobs** — the dependency install (`npm ci --ignore-scripts || npm install --ignore-scripts`)
210
+ It emits one JSON event per line and returns in **~35s**: **scaffolds** the project from the
211
+ vertical's composed template (`wix create` copies it: the code and its lockfile arrive with
212
+ the scaffold), **deploys** whatever the folder still lacks (patching `package.json` with every
213
+ dependency the code imports), then **starts two detached background jobs** — the dependency install (`npm ci --ignore-scripts || npm install --ignore-scripts`)
176
214
  and the **seed** — whose logs and completion markers are in the events. The final
177
215
  `ready_for_brand_layer` event carries the project dir, siteId, ready-made dashboard links,
178
216
  and both markers. Relay notable events. On an `error` event, recover just that step via the
179
217
  manual path below, then continue.
180
218
 
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
219
  **Recovering one step, or adding a solution later:** the pieces run on their own from the
246
220
  project root — `node <SKILL_ROOT>/install/deploy.mjs <vertical…> --stack <stack>` (the client
247
221
  id is read from `wix.config.json`), ONE `npm ci --ignore-scripts || npm install
@@ -257,14 +231,14 @@ doesn't express — or once the site exists and the work turns to managing or ex
257
231
  tokens, brand the chrome, and implement the vertical's creative surfaces yourself on the
258
232
  shipped hooks (for storefront: your product card + grid, shop surface, PDP surface, and the
259
233
  home page) — designed to fit the brief, not copied from the reference components. Read the
260
- INSTRUCTIONS and the shared floors — `references/shared/DESIGN.md` +
261
- `references/shared/CONTENT.md` — now (not earlier — their contracts matter only from this
234
+ INSTRUCTIONS and the shared floors — `templates/shared/DESIGN.md` +
235
+ `templates/shared/CONTENT.md` — now (not earlier — their contracts matter only from this
262
236
  step on); the hook/DTO
263
237
  contracts are inlined there, so don't open the shipped files themselves. **Author your
264
238
  surfaces in as few messages as possible** — batch multiple Write calls in one message
265
239
  (components are independent files); don't pay a round-trip per file.
266
240
  If the brief needs a core operation that shipped code does not cover, read
267
- `references/shared/CUSTOM_OPERATIONS.md` before writing it. Use one documented path and
241
+ `templates/shared/CUSTOM_OPERATIONS.md` before writing it. Use one documented path and
268
242
  implement it; do not reverse-engineer SDK internals.
269
243
  5. **When both background jobs have completed** — the install's marker
270
244
  (`node_modules/.package-lock.json`) and the seed's (`.seed-exit`) both exist — **verify the
@@ -283,153 +257,44 @@ doesn't express — or once the site exists and the work turns to managing or ex
283
257
  build+release mid-flow; backend content is fetched at
284
258
  runtime, so a re-release never "refreshes" seeded data. The run is complete only when the
285
259
  site is released — close with the live URL and the dashboard link
286
- `https://manage.wix.com/dashboard/<siteId>`. **Copy the live URL verbatim from the
260
+ `https://manage.wix.com/dashboard/<siteId>` (the `siteId` of the `ready_for_brand_layer`
261
+ event: on a migration preview that is the migrated site's dashboard, the release URL is the
262
+ preview's, the original site is unchanged, and completing the migration is the user's next
263
+ step in the Wix CLI once they approve — say all three). **Copy the live URL verbatim from the
287
264
  `wix release` output — never retype it from memory** (a mistyped subdomain hands the user
288
265
  a 404).
289
266
 
290
267
  ## Reference mode — a static site, or a server-rendered app in another language
291
268
 
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.
269
+ The shipped data layer exists a second time as a **REST layer** over `fetch`, for the stacks that
270
+ cannot run `app/`: a static site with no bundler, or a server-rendered app in another language
271
+ (Flask, Laravel, Rails). The REST layer deploys for the browser side; the server side ports its
272
+ reads. When step 1 resolves to one of these stacks, read `<SKILL_ROOT>/guides/reference-mode.md`
273
+ before step 3: it holds the mechanics (the `site/` layout and setup's part in it, what runs in the
274
+ browser versus the server, the OAuth allow-list for a self-hosted origin, pre-rendered output) and
275
+ how to close such a run. A public site is still better served by managed Astro; say so when you
276
+ close.
382
277
 
383
278
  ## Verticals
384
279
 
385
280
  | The user wants… | Vertical | Playbook |
386
281
  | -------------------------------------------------------------------------------------------- | ----------------- | ------------------------------------------ |
387
- | Online store: products, categories, variants, cart, checkout | **storefront** | `references/storefront/INSTRUCTIONS.md` |
388
- | Appointments/classes: services, time slots, staff, booking, checkout | **bookings** | `references/bookings/INSTRUCTIONS.md` |
389
- | Blog: post feed, categories/tags, rich-content post pages | **blog** | `references/blog/INSTRUCTIONS.md` |
390
- | Structured content collections (directory, recipes, listings) with pages designed per schema | **cms** | `references/cms/INSTRUCTIONS.md` |
391
- | Any visitor-fillable form: contact/enquiry, signup, application, survey — rendered from the live schema | **forms** | `references/forms/INSTRUCTIONS.md` |
392
- | Events: listing, event pages, free RSVP, ticket sales via hosted checkout | **events** | `references/events/INSTRUCTIONS.md` |
393
- | Member accounts: custom in-app login/sign-up, gated pages, account page | **members** | `references/members/INSTRUCTIONS.md` |
394
- | Portfolio/showcase: collections of projects, project pages with media galleries | **portfolio** | `references/portfolio/INSTRUCTIONS.md` |
395
- | Membership/subscription plans: pricing page, plan detail, hosted purchase | **pricing-plans** | `references/pricing-plans/INSTRUCTIONS.md` |
396
- | Restaurant: menu with photos, online ordering, table reservations | **restaurants** | `references/restaurants/INSTRUCTIONS.md` |
282
+ | Online store: products, categories, variants, cart, checkout | **storefront** | `templates/storefront/INSTRUCTIONS.md` |
283
+ | Appointments/classes: services, time slots, staff, booking, checkout | **bookings** | `templates/bookings/INSTRUCTIONS.md` |
284
+ | Blog: post feed, categories/tags, rich-content post pages | **blog** | `templates/blog/INSTRUCTIONS.md` |
285
+ | Structured content collections (directory, recipes, listings) with pages designed per schema | **cms** | `templates/cms/INSTRUCTIONS.md` |
286
+ | Any visitor-fillable form: contact/enquiry, signup, application, survey — rendered from the live schema | **forms** | `templates/forms/INSTRUCTIONS.md` |
287
+ | Events: listing, event pages, free RSVP, ticket sales via hosted checkout | **events** | `templates/events/INSTRUCTIONS.md` |
288
+ | Member accounts: custom in-app login/sign-up, gated pages, account page | **members** | `templates/members/INSTRUCTIONS.md` |
289
+ | Portfolio/showcase: collections of projects, project pages with media galleries | **portfolio** | `templates/portfolio/INSTRUCTIONS.md` |
290
+ | Membership/subscription plans: pricing page, plan detail, hosted purchase | **pricing-plans** | `templates/pricing-plans/INSTRUCTIONS.md` |
291
+ | Restaurant: menu with photos, online ordering, table reservations | **restaurants** | `templates/restaurants/INSTRUCTIONS.md` |
292
+ | FAQ: questions grouped by category, search, expandable answers, a link per question | **faq** | `templates/faq/INSTRUCTIONS.md` |
293
+ | Donations: campaign pages, goal progress, one-time and recurring giving via hosted checkout | **donations** | `templates/donations/INSTRUCTIONS.md` |
397
294
 
398
295
  Verticals compose: a brief that spans several (a restaurant with a blog, a store with member
399
296
  accounts) deploys them together — setup takes one vertical; deploy the rest with
400
297
  `node <SKILL_ROOT>/install/deploy.mjs <vertical…>` from the project root before the install
401
- starts, and run each vertical's seed. A request that doesn't match any shipped vertical isn't
402
- this skill's shipped code — route it to `wix-headless` rather than improvising an unshipped
403
- vertical here.
404
-
405
- ## Adding a vertical (structure contract)
406
-
407
- New verticals follow the same layout — the deploy script discovers them automatically (any
408
- `references/<name>/app/` directory is a vertical):
409
-
410
- ```
411
- references/<vertical>/
412
- INSTRUCTIONS.md # playbook: file map, wiring per stack, what you build, hard rules
413
- app/ # framework-agnostic core — disjoint paths so verticals never collide:
414
- wix/<vertical>/ # types.ts (DTOs) + data layer (calls via ../sdk, images via ../media)
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)
417
- components/<vertical>/ # routing-free components (plain <a> default + LinkComponent prop)
418
- styles/global.css # Tailwind v4 + the @theme design tokens (shared token family)
419
- app-astro/ # Astro overlay importing ONLY from the core:
420
- pages/… # SSR fetch → DTO props → client:load islands; item pages carry
421
- # wixMetadata + <SEO.Tags>; chrome islands are client:only
422
- # (storefront ships no pages — its INSTRUCTIONS carries their skeletons)
423
- layouts/… # (reuse SiteLayout when it fits)
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
428
- ```
429
-
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);
433
- client-shared state uses a module-scope store (never React context — it can't span Astro
434
- islands); every image URL is resolved through `src/wix/media.ts`; every money value is a
435
- formatted string by the time a component sees it.
298
+ starts, and run each vertical's seed. A request that matches no shipped vertical has no shipped
299
+ code: it is built from the Wix API reference through `wix-docs` (search, then the method page),
300
+ with the same rule as every other call, on the same project and stack.
@@ -0,0 +1,156 @@
1
+ #!/usr/bin/env node
2
+ import { spawn, spawnSync } from 'node:child_process';
3
+ import { existsSync, mkdirSync, openSync, readFileSync, writeFileSync } from 'node:fs';
4
+ import { tmpdir } from 'node:os';
5
+ import { join } from 'node:path';
6
+
7
+ // ── tiny event protocol (one JSON object per line) ───────────────────────────
8
+ const emit = (event, extra = {}) =>
9
+ process.stdout.write(JSON.stringify({ event, ...extra }) + '\n');
10
+ const fail = (event, extra = {}) => {
11
+ emit(event, { ok: false, ...extra });
12
+ process.exit(1);
13
+ };
14
+
15
+ // ── platform-safe binary names (npm/npx are .cmd on Windows) ─────────────────
16
+ const isWin = process.platform === 'win32';
17
+ const bin = (name) => (isWin ? `${name}.cmd` : name);
18
+ const WIX = [bin('npx'), '-y', '@wix/cli@latest']; // run the CLI via npx — no global install/mutation
19
+
20
+ // Force the CLI into non-interactive "agent" mode. Without an agent signal in
21
+ // the env, `wix login` renders an interactive Ink TUI (device code + keypress)
22
+ // that needs a raw TTY and crashes in an agent sandbox — and it never emits the
23
+ // JSON login events this script forwards. The CLI uses @vercel/detect-agent,
24
+ // whose first check is the AI_AGENT env var, so setting it guarantees agent mode
25
+ // (and the awaiting_user/success/logged_in events) for every child we spawn.
26
+ // Respect an existing value so a known runner (claude, cursor, …) keeps its name.
27
+ const AGENT_ENV = { ...process.env, AI_AGENT: process.env.AI_AGENT || 'wix-headless-fast-skill' };
28
+
29
+ // Where the detached login parks its output between runs. It has to outlive this
30
+ // process, so it can't be a pipe and can't live in the project.
31
+ const STATE_DIR = join(tmpdir(), 'wix-headless-fast-login');
32
+ const LOG = join(STATE_DIR, 'login.log');
33
+ const PIDFILE = join(STATE_DIR, 'login.pid');
34
+
35
+ // run a command, capture stdout+stderr (combined), return {status, out}
36
+ function capture(cmd, args, opts = {}) {
37
+ const r = spawnSync(cmd, args, { encoding: 'utf8', shell: isWin, env: AGENT_ENV, ...opts });
38
+ return { status: r.status ?? 1, out: `${r.stdout || ''}${r.stderr || ''}`, error: r.error };
39
+ }
40
+
41
+ // ── 1. CLI reachable (via npx — no install) ──────────────────────────────────
42
+ function checkCli() {
43
+ const r = capture(WIX[0], [...WIX.slice(1), '--version']);
44
+ if (r.status !== 0) fail('cli_unreachable', { detail: r.out.trim().slice(0, 400) });
45
+ // npx interleaves "npm notice …" lines with the version, so don't just take the
46
+ // last line — pick the first semver-looking token, falling back to the last line.
47
+ const version = (r.out.match(/\d+\.\d+\.\d+[^\s]*/) || [])[0] || r.out.trim().split('\n').pop();
48
+ emit('cli_ok', { version });
49
+ }
50
+
51
+ // ── 2. Reuse an existing session, or start device login ──────────────────────
52
+ const hasExistingSession = () => capture(WIX[0], [...WIX.slice(1), 'whoami']).status === 0;
53
+
54
+ function loginEvents() {
55
+ if (!existsSync(LOG)) return [];
56
+ return readFileSync(LOG, 'utf8')
57
+ .split('\n')
58
+ .map((l) => l.trim())
59
+ .filter(Boolean)
60
+ .map((l) => {
61
+ try {
62
+ return JSON.parse(l);
63
+ } catch {
64
+ return null; // non-JSON CLI chatter
65
+ }
66
+ })
67
+ .filter((e) => e && e.event);
68
+ }
69
+
70
+ const alive = (pid) => {
71
+ try {
72
+ process.kill(pid, 0);
73
+ return true;
74
+ } catch {
75
+ return false;
76
+ }
77
+ };
78
+
79
+ // A login this machine started earlier may still be waiting on the browser. Reuse
80
+ // its code instead of minting a second one — a new login invalidates nothing, but
81
+ // it hands the user a different code than the one already on their screen.
82
+ function pendingLogin() {
83
+ if (!existsSync(PIDFILE)) return null;
84
+ let state;
85
+ try {
86
+ state = JSON.parse(readFileSync(PIDFILE, 'utf8'));
87
+ } catch {
88
+ return null;
89
+ }
90
+ if (!state.pid || !alive(state.pid)) return null;
91
+ const ev = loginEvents().find((e) => e.event === 'awaiting_user');
92
+ if (!ev) return null;
93
+ // Don't hand back a code that's about to expire mid-typing.
94
+ const ageSeconds = Math.round((Date.now() - state.startedAt) / 1000);
95
+ if (ageSeconds > (ev.expiresInSeconds ?? 600) - 60) return null;
96
+ return ev;
97
+ }
98
+
99
+ // Detach so the login keeps polling after this process exits. stdio goes to a
100
+ // file, not a pipe: a pipe dies with the parent, and the CLI would get EPIPE.
101
+ function startLogin() {
102
+ mkdirSync(STATE_DIR, { recursive: true });
103
+ writeFileSync(LOG, '');
104
+ const out = openSync(LOG, 'a');
105
+ const child = spawn(WIX[0], [...WIX.slice(1), 'login'], {
106
+ detached: true,
107
+ stdio: ['ignore', out, out],
108
+ env: AGENT_ENV,
109
+ shell: isWin,
110
+ });
111
+ child.on('error', (e) => fail('login_failed', { detail: String(e) }));
112
+ writeFileSync(PIDFILE, JSON.stringify({ pid: child.pid, startedAt: Date.now() }));
113
+ child.unref();
114
+ }
115
+
116
+ async function waitForCode(timeoutMs = 60000) {
117
+ const deadline = Date.now() + timeoutMs;
118
+ while (Date.now() < deadline) {
119
+ const events = loginEvents();
120
+ const ev = events.find((e) => e.event === 'awaiting_user');
121
+ if (ev) return ev;
122
+ const bad = events.find((e) => e.event === 'login_failed');
123
+ if (bad) fail('login_failed', bad);
124
+ await new Promise((r) => setTimeout(r, 500));
125
+ }
126
+ const detail = existsSync(LOG) ? readFileSync(LOG, 'utf8').trim().slice(-1500) : '';
127
+ fail('login_failed', {
128
+ detail: detail || `wix login produced no device code within ${timeoutMs / 1000}s.`,
129
+ });
130
+ }
131
+
132
+ // The next move is the user's, so hand the code back and exit rather than holding
133
+ // the caller open for a browser round-trip. `message` is the sentence to relay.
134
+ function surrenderTo(ev) {
135
+ emit('awaiting_user', {
136
+ ...ev,
137
+ message:
138
+ `To connect your Wix account, open ${ev.verificationUri} and enter the code ` +
139
+ `${ev.userCode}. Tell me once you're done and I'll continue.`,
140
+ });
141
+ process.exit(0);
142
+ }
143
+
144
+ // ── main ────────────────────────────────────────────────────────────────────
145
+ checkCli();
146
+
147
+ if (hasExistingSession()) {
148
+ emit('logged_in');
149
+ process.exit(0);
150
+ }
151
+
152
+ const pending = pendingLogin();
153
+ if (pending) surrenderTo(pending);
154
+
155
+ startLogin();
156
+ surrenderTo(await waitForCode());