@wix/agent-skills 1.21.0 → 1.22.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 (258) hide show
  1. package/package.json +1 -1
  2. package/skills/wix-app/SKILL.md +60 -4
  3. package/skills/wix-app/references/DASHBOARD_PAGE.md +11 -25
  4. package/skills/wix-app/references/DATA_COLLECTION.md +16 -219
  5. package/skills/wix-app/references/dashboard-page/DATA_SOURCES.md +182 -0
  6. package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE.md +97 -0
  7. package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE_COLLECTION.md +184 -0
  8. package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE_ROUTER.md +203 -0
  9. package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE_SETTINGS.md +44 -0
  10. package/skills/wix-app/references/dashboard-page/QUERY_AND_PAGING.md +182 -0
  11. package/skills/wix-app/references/dashboard-page/TABLE_STATE.md +133 -0
  12. package/skills/wix-app/references/dashboard-page/UX_SUCCESS_MODEL.md +10 -5
  13. package/skills/wix-app/references/data-collection/LIFECYCLE.md +68 -0
  14. package/skills/wix-app/references/data-collection/PERMISSIONS.md +47 -0
  15. package/skills/wix-app/references/data-collection/SCHEMA.md +181 -0
  16. package/skills/wix-app/references/data-collection/WIX_DATA.md +38 -66
  17. package/skills/wix-headless-fast/SKILL.md +61 -223
  18. package/skills/wix-headless-fast/cold-start/bootstrap.mjs +156 -0
  19. package/skills/wix-headless-fast/{entry/skill.md → cold-start/cold-start.md} +11 -12
  20. package/skills/wix-headless-fast/guides/existing-site.md +76 -0
  21. package/skills/wix-headless-fast/guides/reference-mode.md +97 -0
  22. package/skills/wix-headless-fast/install/AGENTS.md +6 -3
  23. package/skills/wix-headless-fast/install/attach.mjs +15 -47
  24. package/skills/wix-headless-fast/install/deploy.mjs +21 -60
  25. package/skills/wix-headless-fast/install/lock.mjs +55 -0
  26. package/skills/wix-headless-fast/install/setup.mjs +32 -12
  27. package/skills/wix-headless-fast/install/templates.mjs +168 -0
  28. package/skills/wix-manage/references/google-ads/google-ads-dashboard-navigation.md +27 -0
  29. package/skills/wix-manage/references/google-ads/manage-campaign-success-guide.md +83 -37
  30. package/skills/wix-headless-fast/references/blog/INSTRUCTIONS.md +0 -303
  31. package/skills/wix-headless-fast/references/blog/app/components/blog/BlogFeedView.tsx +0 -136
  32. package/skills/wix-headless-fast/references/blog/app/components/blog/PostView.tsx +0 -112
  33. package/skills/wix-headless-fast/references/blog/app/components/blog/RichContent.tsx +0 -42
  34. package/skills/wix-headless-fast/references/blog/app/hooks/blog/useBlogFeed.ts +0 -31
  35. package/skills/wix-headless-fast/references/blog/app/hooks/blog/usePost.ts +0 -22
  36. package/skills/wix-headless-fast/references/blog/app/wix/blog/blog-feed-store.ts +0 -137
  37. package/skills/wix-headless-fast/references/blog/app/wix/blog/post-store.ts +0 -78
  38. package/skills/wix-headless-fast/references/blog/app/wix/blog/posts-core.ts +0 -117
  39. package/skills/wix-headless-fast/references/blog/app/wix/blog/posts.ts +0 -52
  40. package/skills/wix-headless-fast/references/blog/app/wix/blog/taxonomy-core.ts +0 -47
  41. package/skills/wix-headless-fast/references/blog/app/wix/blog/taxonomy.ts +0 -58
  42. package/skills/wix-headless-fast/references/blog/app/wix/blog/types.ts +0 -62
  43. package/skills/wix-headless-fast/references/blog/app-astro/layouts/SiteLayout.astro +0 -40
  44. package/skills/wix-headless-fast/references/blog/app-astro/pages/blog/[...slug].astro +0 -97
  45. package/skills/wix-headless-fast/references/blog/app-astro/pages/blog.astro +0 -24
  46. package/skills/wix-headless-fast/references/blog/lock/astro/package-lock.json +0 -16156
  47. package/skills/wix-headless-fast/references/blog/rest/posts.ts +0 -42
  48. package/skills/wix-headless-fast/references/blog/rest/taxonomy.ts +0 -62
  49. package/skills/wix-headless-fast/references/blog/seed/SEED.md +0 -81
  50. package/skills/wix-headless-fast/references/blog/seed/read-site.mjs +0 -22
  51. package/skills/wix-headless-fast/references/blog/seed/seed-blog.mjs +0 -287
  52. package/skills/wix-headless-fast/references/bookings/INSTRUCTIONS.md +0 -277
  53. package/skills/wix-headless-fast/references/bookings/app/components/bookings/ServiceBookingView.tsx +0 -144
  54. package/skills/wix-headless-fast/references/bookings/app/components/bookings/ServicesView.tsx +0 -119
  55. package/skills/wix-headless-fast/references/bookings/app/hooks/bookings/useBookingFlow.ts +0 -32
  56. package/skills/wix-headless-fast/references/bookings/app/hooks/bookings/useServices.ts +0 -23
  57. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/booking-core.ts +0 -218
  58. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/booking-flow-store.ts +0 -169
  59. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/booking.ts +0 -121
  60. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/services-core.ts +0 -92
  61. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/services-store.ts +0 -90
  62. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/services.ts +0 -57
  63. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/types.ts +0 -72
  64. package/skills/wix-headless-fast/references/bookings/app-astro/layouts/SiteLayout.astro +0 -40
  65. package/skills/wix-headless-fast/references/bookings/app-astro/pages/services/[slug].astro +0 -76
  66. package/skills/wix-headless-fast/references/bookings/app-astro/pages/services.astro +0 -22
  67. package/skills/wix-headless-fast/references/bookings/lock/astro/package-lock.json +0 -11962
  68. package/skills/wix-headless-fast/references/bookings/rest/booking.ts +0 -113
  69. package/skills/wix-headless-fast/references/bookings/rest/services.ts +0 -55
  70. package/skills/wix-headless-fast/references/bookings/seed/SEED.md +0 -71
  71. package/skills/wix-headless-fast/references/bookings/seed/read-site.mjs +0 -28
  72. package/skills/wix-headless-fast/references/bookings/seed/seed-bookings.mjs +0 -302
  73. package/skills/wix-headless-fast/references/cms/INSTRUCTIONS.md +0 -355
  74. package/skills/wix-headless-fast/references/cms/app/hooks/cms/useCollection.ts +0 -50
  75. package/skills/wix-headless-fast/references/cms/app/hooks/cms/useItem.ts +0 -37
  76. package/skills/wix-headless-fast/references/cms/app/wix/cms/collection-store.ts +0 -158
  77. package/skills/wix-headless-fast/references/cms/app/wix/cms/item-store.ts +0 -93
  78. package/skills/wix-headless-fast/references/cms/app/wix/cms/items-core.ts +0 -177
  79. package/skills/wix-headless-fast/references/cms/app/wix/cms/items.ts +0 -123
  80. package/skills/wix-headless-fast/references/cms/app/wix/cms/types.ts +0 -75
  81. package/skills/wix-headless-fast/references/cms/app-astro/layouts/SiteLayout.astro +0 -41
  82. package/skills/wix-headless-fast/references/cms/lock/astro/package-lock.json +0 -11262
  83. package/skills/wix-headless-fast/references/cms/rest/items.ts +0 -125
  84. package/skills/wix-headless-fast/references/cms/seed/SEED.md +0 -112
  85. package/skills/wix-headless-fast/references/cms/seed/read-site.mjs +0 -20
  86. package/skills/wix-headless-fast/references/cms/seed/seed-cms.mjs +0 -324
  87. package/skills/wix-headless-fast/references/events/INSTRUCTIONS.md +0 -307
  88. package/skills/wix-headless-fast/references/events/app/components/events/EventConfirmationView.tsx +0 -66
  89. package/skills/wix-headless-fast/references/events/app/components/events/EventRegistrationView.tsx +0 -178
  90. package/skills/wix-headless-fast/references/events/app/components/events/EventsView.tsx +0 -118
  91. package/skills/wix-headless-fast/references/events/app/hooks/events/useEventRegistration.ts +0 -35
  92. package/skills/wix-headless-fast/references/events/app/hooks/events/useEvents.ts +0 -24
  93. package/skills/wix-headless-fast/references/events/app/wix/events/events-core.ts +0 -130
  94. package/skills/wix-headless-fast/references/events/app/wix/events/events-store.ts +0 -97
  95. package/skills/wix-headless-fast/references/events/app/wix/events/events.ts +0 -55
  96. package/skills/wix-headless-fast/references/events/app/wix/events/registration-core.ts +0 -113
  97. package/skills/wix-headless-fast/references/events/app/wix/events/registration-store.ts +0 -156
  98. package/skills/wix-headless-fast/references/events/app/wix/events/registration.ts +0 -97
  99. package/skills/wix-headless-fast/references/events/app/wix/events/types.ts +0 -61
  100. package/skills/wix-headless-fast/references/events/app-astro/layouts/SiteLayout.astro +0 -40
  101. package/skills/wix-headless-fast/references/events/app-astro/pages/event-confirmation.astro +0 -12
  102. package/skills/wix-headless-fast/references/events/app-astro/pages/events/[slug].astro +0 -80
  103. package/skills/wix-headless-fast/references/events/app-astro/pages/events.astro +0 -21
  104. package/skills/wix-headless-fast/references/events/lock/astro/package-lock.json +0 -11884
  105. package/skills/wix-headless-fast/references/events/rest/events.ts +0 -57
  106. package/skills/wix-headless-fast/references/events/rest/registration.ts +0 -83
  107. package/skills/wix-headless-fast/references/events/seed/SEED.md +0 -95
  108. package/skills/wix-headless-fast/references/events/seed/read-site.mjs +0 -26
  109. package/skills/wix-headless-fast/references/events/seed/seed-events.mjs +0 -276
  110. package/skills/wix-headless-fast/references/forms/INSTRUCTIONS.md +0 -340
  111. package/skills/wix-headless-fast/references/forms/app/hooks/forms/useWixForm.ts +0 -85
  112. package/skills/wix-headless-fast/references/forms/app/wix/forms/form-store.ts +0 -332
  113. package/skills/wix-headless-fast/references/forms/app/wix/forms/forms-core.ts +0 -238
  114. package/skills/wix-headless-fast/references/forms/app/wix/forms/forms.ts +0 -54
  115. package/skills/wix-headless-fast/references/forms/app/wix/forms/submissions-core.ts +0 -216
  116. package/skills/wix-headless-fast/references/forms/app/wix/forms/submissions.ts +0 -59
  117. package/skills/wix-headless-fast/references/forms/app/wix/forms/types.ts +0 -135
  118. package/skills/wix-headless-fast/references/forms/lock/astro/package-lock.json +0 -10593
  119. package/skills/wix-headless-fast/references/forms/rest/forms.ts +0 -34
  120. package/skills/wix-headless-fast/references/forms/rest/submissions.ts +0 -56
  121. package/skills/wix-headless-fast/references/forms/seed/SEED.md +0 -116
  122. package/skills/wix-headless-fast/references/forms/seed/read-site.mjs +0 -20
  123. package/skills/wix-headless-fast/references/forms/seed/seed-forms.mjs +0 -327
  124. package/skills/wix-headless-fast/references/members/INSTRUCTIONS.md +0 -316
  125. package/skills/wix-headless-fast/references/members/app/components/members/AccountView.tsx +0 -60
  126. package/skills/wix-headless-fast/references/members/app/components/members/LoginForm.tsx +0 -155
  127. package/skills/wix-headless-fast/references/members/app/components/members/MemberMenu.tsx +0 -78
  128. package/skills/wix-headless-fast/references/members/app/components/members/RequireAuth.tsx +0 -47
  129. package/skills/wix-headless-fast/references/members/app/hooks/members/useMember.ts +0 -66
  130. package/skills/wix-headless-fast/references/members/app/wix/members/auth-core.ts +0 -105
  131. package/skills/wix-headless-fast/references/members/app/wix/members/auth.ts +0 -59
  132. package/skills/wix-headless-fast/references/members/app/wix/members/client.ts +0 -53
  133. package/skills/wix-headless-fast/references/members/app/wix/members/member-store.ts +0 -122
  134. package/skills/wix-headless-fast/references/members/app/wix/members/members-core.ts +0 -43
  135. package/skills/wix-headless-fast/references/members/app/wix/members/members.ts +0 -29
  136. package/skills/wix-headless-fast/references/members/app/wix/members/types.ts +0 -21
  137. package/skills/wix-headless-fast/references/members/app-astro/layouts/SiteLayout.astro +0 -42
  138. package/skills/wix-headless-fast/references/members/app-astro/pages/account.astro +0 -10
  139. package/skills/wix-headless-fast/references/members/app-astro/pages/login.astro +0 -11
  140. package/skills/wix-headless-fast/references/members/lock/astro/package-lock.json +0 -10329
  141. package/skills/wix-headless-fast/references/members/rest/auth.ts +0 -215
  142. package/skills/wix-headless-fast/references/members/rest/members.ts +0 -26
  143. package/skills/wix-headless-fast/references/members/seed/SEED.md +0 -39
  144. package/skills/wix-headless-fast/references/members/seed/read-site.mjs +0 -15
  145. package/skills/wix-headless-fast/references/members/seed/seed-members.mjs +0 -94
  146. package/skills/wix-headless-fast/references/portfolio/INSTRUCTIONS.md +0 -315
  147. package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/CollectionProjectsView.tsx +0 -110
  148. package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/CollectionsView.tsx +0 -90
  149. package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/GalleryMedia.tsx +0 -35
  150. package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/ProjectDetailView.tsx +0 -85
  151. package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useCollectionProjects.ts +0 -32
  152. package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useCollections.ts +0 -21
  153. package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useProjectDetail.ts +0 -31
  154. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/collection-projects-store.ts +0 -82
  155. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/collections-store.ts +0 -58
  156. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/portfolio-core.ts +0 -177
  157. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/portfolio.ts +0 -78
  158. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/project-detail-store.ts +0 -81
  159. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/types.ts +0 -55
  160. package/skills/wix-headless-fast/references/portfolio/app-astro/layouts/SiteLayout.astro +0 -40
  161. package/skills/wix-headless-fast/references/portfolio/app-astro/pages/portfolio/[slug].astro +0 -30
  162. package/skills/wix-headless-fast/references/portfolio/app-astro/pages/portfolio.astro +0 -21
  163. package/skills/wix-headless-fast/references/portfolio/app-astro/pages/projects/[slug].astro +0 -29
  164. package/skills/wix-headless-fast/references/portfolio/lock/astro/package-lock.json +0 -10197
  165. package/skills/wix-headless-fast/references/portfolio/rest/portfolio.ts +0 -75
  166. package/skills/wix-headless-fast/references/portfolio/seed/SEED.md +0 -86
  167. package/skills/wix-headless-fast/references/portfolio/seed/read-site.mjs +0 -20
  168. package/skills/wix-headless-fast/references/portfolio/seed/seed-portfolio.mjs +0 -256
  169. package/skills/wix-headless-fast/references/pricing-plans/INSTRUCTIONS.md +0 -296
  170. package/skills/wix-headless-fast/references/pricing-plans/app/components/pricing-plans/PlanDetailView.tsx +0 -47
  171. package/skills/wix-headless-fast/references/pricing-plans/app/components/pricing-plans/PlansView.tsx +0 -101
  172. package/skills/wix-headless-fast/references/pricing-plans/app/components/pricing-plans/SubscribeButton.tsx +0 -41
  173. package/skills/wix-headless-fast/references/pricing-plans/app/hooks/pricing-plans/usePlanPurchase.ts +0 -16
  174. package/skills/wix-headless-fast/references/pricing-plans/app/hooks/pricing-plans/usePlans.ts +0 -22
  175. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plan-purchase-store.ts +0 -54
  176. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plans-core.ts +0 -106
  177. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plans-store.ts +0 -64
  178. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plans.ts +0 -27
  179. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/purchase-core.ts +0 -43
  180. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/purchase.ts +0 -22
  181. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/types.ts +0 -30
  182. package/skills/wix-headless-fast/references/pricing-plans/app-astro/layouts/SiteLayout.astro +0 -41
  183. package/skills/wix-headless-fast/references/pricing-plans/app-astro/pages/plans/[slug].astro +0 -40
  184. package/skills/wix-headless-fast/references/pricing-plans/app-astro/pages/plans.astro +0 -21
  185. package/skills/wix-headless-fast/references/pricing-plans/lock/astro/package-lock.json +0 -11226
  186. package/skills/wix-headless-fast/references/pricing-plans/rest/plans.ts +0 -31
  187. package/skills/wix-headless-fast/references/pricing-plans/rest/purchase.ts +0 -20
  188. package/skills/wix-headless-fast/references/pricing-plans/seed/SEED.md +0 -79
  189. package/skills/wix-headless-fast/references/pricing-plans/seed/read-site.mjs +0 -21
  190. package/skills/wix-headless-fast/references/pricing-plans/seed/seed-pricing-plans.mjs +0 -279
  191. package/skills/wix-headless-fast/references/restaurants/INSTRUCTIONS.md +0 -360
  192. package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/MenuView.tsx +0 -142
  193. package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/OrderCartButton.tsx +0 -26
  194. package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/OrderCartDrawer.tsx +0 -121
  195. package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/ReservationView.tsx +0 -155
  196. package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useMenus.ts +0 -34
  197. package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useOrderCart.ts +0 -43
  198. package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useReservation.ts +0 -34
  199. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/menu-core.ts +0 -155
  200. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/menu-store.ts +0 -89
  201. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/menu.ts +0 -71
  202. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/order-store.ts +0 -103
  203. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/ordering-core.ts +0 -124
  204. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/ordering.ts +0 -185
  205. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/reservation-store.ts +0 -193
  206. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/reservations-core.ts +0 -94
  207. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/reservations.ts +0 -74
  208. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/types.ts +0 -168
  209. package/skills/wix-headless-fast/references/restaurants/app-astro/layouts/SiteLayout.astro +0 -47
  210. package/skills/wix-headless-fast/references/restaurants/app-astro/pages/menu.astro +0 -22
  211. package/skills/wix-headless-fast/references/restaurants/app-astro/pages/reservations.astro +0 -12
  212. package/skills/wix-headless-fast/references/restaurants/lock/astro/package-lock.json +0 -12560
  213. package/skills/wix-headless-fast/references/restaurants/rest/menu.ts +0 -60
  214. package/skills/wix-headless-fast/references/restaurants/rest/ordering.ts +0 -169
  215. package/skills/wix-headless-fast/references/restaurants/rest/reservations.ts +0 -68
  216. package/skills/wix-headless-fast/references/restaurants/seed/SEED.md +0 -89
  217. package/skills/wix-headless-fast/references/restaurants/seed/read-site.mjs +0 -25
  218. package/skills/wix-headless-fast/references/restaurants/seed/seed-restaurants.mjs +0 -499
  219. package/skills/wix-headless-fast/references/shared/CONTENT.md +0 -22
  220. package/skills/wix-headless-fast/references/shared/CUSTOM_OPERATIONS.md +0 -73
  221. package/skills/wix-headless-fast/references/shared/DESIGN.md +0 -26
  222. package/skills/wix-headless-fast/references/shared/SUPPLIED-CONTENT.md +0 -23
  223. package/skills/wix-headless-fast/references/shared/app/styles/global.css +0 -52
  224. package/skills/wix-headless-fast/references/shared/app/wix/config.ts +0 -15
  225. package/skills/wix-headless-fast/references/shared/app/wix/media.ts +0 -81
  226. package/skills/wix-headless-fast/references/shared/app/wix/money.ts +0 -24
  227. package/skills/wix-headless-fast/references/shared/app/wix/sdk.ts +0 -89
  228. package/skills/wix-headless-fast/references/shared/capabilities/media-upload/app/wix/media-upload/client.ts +0 -46
  229. package/skills/wix-headless-fast/references/shared/capabilities/media-upload/app-astro/pages/api/wix/media-upload.ts +0 -46
  230. package/skills/wix-headless-fast/references/shared/rest/client.ts +0 -155
  231. package/skills/wix-headless-fast/references/shared/rest/config.ts +0 -3
  232. package/skills/wix-headless-fast/references/shared/rest/media.ts +0 -65
  233. package/skills/wix-headless-fast/references/shared/seed/images.mjs +0 -145
  234. package/skills/wix-headless-fast/references/shared/seed/read-site.mjs +0 -99
  235. package/skills/wix-headless-fast/references/storefront/INSTRUCTIONS.md +0 -612
  236. package/skills/wix-headless-fast/references/storefront/app/components/storefront/CartButton.tsx +0 -26
  237. package/skills/wix-headless-fast/references/storefront/app/components/storefront/CartDrawer.tsx +0 -155
  238. package/skills/wix-headless-fast/references/storefront/app/components/storefront/FilterPanel.tsx +0 -266
  239. package/skills/wix-headless-fast/references/storefront/app/components/storefront/OptionPicker.tsx +0 -95
  240. package/skills/wix-headless-fast/references/storefront/app/components/storefront/QuickAdd.tsx +0 -136
  241. package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useCart.ts +0 -48
  242. package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useProductDetail.ts +0 -39
  243. package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useShop.ts +0 -34
  244. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/cart-core.ts +0 -121
  245. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/cart-store.ts +0 -107
  246. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/cart.ts +0 -138
  247. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/catalog-core.ts +0 -314
  248. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/catalog.ts +0 -133
  249. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/product-detail-store.ts +0 -147
  250. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/shop-store.ts +0 -289
  251. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/types.ts +0 -169
  252. package/skills/wix-headless-fast/references/storefront/app-astro/layouts/SiteLayout.astro +0 -65
  253. package/skills/wix-headless-fast/references/storefront/lock/astro/package-lock.json +0 -12247
  254. package/skills/wix-headless-fast/references/storefront/rest/cart.ts +0 -132
  255. package/skills/wix-headless-fast/references/storefront/rest/catalog.ts +0 -123
  256. package/skills/wix-headless-fast/references/storefront/seed/SEED.md +0 -130
  257. package/skills/wix-headless-fast/references/storefront/seed/read-site.mjs +0 -38
  258. package/skills/wix-headless-fast/references/storefront/seed/seed-store.mjs +0 -561
@@ -0,0 +1,76 @@
1
+ # An existing site: a new frontend for a site that already has its content
2
+
3
+ Read when the brief names a Wix site by its id. Nothing here is seeded: the site owns its content
4
+ and the frontend reads it live. `<SKILL_ROOT>` is the installed skill folder; the shipped code is
5
+ under `<SKILL_ROOT>/templates/` (SKILL.md, "The run").
6
+
7
+ **Read the site, then run attach.** First, one call tells you what
8
+ the site is — its name, currency, and the Wix apps installed on it:
9
+
10
+ ```bash
11
+ curl -sS -X POST 'https://www.wixapis.com/_api/dynamic-context/v1/dynamic-context/markdown' \
12
+ -H "Authorization: $(npx -y @wix/cli@latest token)" -H 'Content-Type: application/json' \
13
+ -d '{"siteId": "<siteId>"}'
14
+ ```
15
+
16
+ The installed apps name the verticals (Wix Stores → storefront, Wix Bookings → bookings, and
17
+ so on per the Verticals table); the brief picks among them. Then one deterministic call, same
18
+ shape as setup (SKILL.md step 3):
19
+
20
+ ```bash
21
+ node <SKILL_ROOT>/install/attach.mjs --site <siteId> --business-name "<site name>" --vertical <vertical>[,<vertical>]
22
+ ```
23
+
24
+ `init`/`wix create` always create a site, so they are not used here. attach does what they do
25
+ after creating one — the site's OAuth app, Wix hosting, `wix.config.json` — against the site
26
+ given, copies the first vertical's composed template, deploys the rest, and starts the install
27
+ detached. No seed runs and nothing on the site changes: the content is the site's own, read
28
+ live through the deployed data layer. `attached` also says whether a frontend is already
29
+ serving at the site's address (`frontend.serving`, with the release date). When it is, a
30
+ `wix release` from this project replaces it — the old deployment keeps its own address and
31
+ production can be pointed back, but the user's site changes. Tell the user before you release,
32
+ with the address and the date; if the brief did not ask for a new frontend, ask first and
33
+ wait. Say it again when you close.
34
+
35
+ **Get the measure of the site before you design.** Enough to know what you are building
36
+ for: what the chosen verticals will render, roughly how much of it, and what it is like —
37
+ six items in three groups design differently from six hundred. Run the vertical's reader:
38
+
39
+ ```bash
40
+ node <SKILL_ROOT>/templates/<vertical>/seed/read-site.mjs --site <siteId> [--limit <n>]
41
+ ```
42
+
43
+ It prints one JSON: whether the vertical's app is installed, counts, one page of each entity
44
+ with the fields the pages render, and `calls`, the requests it made with their documentation
45
+ URLs. The lists are one page; the counts are the site.
46
+
47
+ When the brief needs a read the script does not make, it is a build-time call with the
48
+ **site's** token, sent raw as the `Authorization` header (the account token from the call
49
+ above does not scope to a site), minted inline in each command —
50
+ `-H "Authorization: $(npx -y @wix/cli@latest token --site <siteId>)"` — and never written to
51
+ a file, not in the project and not in `/tmp`.
52
+ **The rule above applies in full: not one of these calls comes from memory.** Read the
53
+ request where it is written, then call. Where to read, in this order:
54
+ - **The reader**, `templates/<vertical>/seed/read-site.mjs` — the reads the pages make, as
55
+ literal calls with their documentation URLs.
56
+ - **`wix-manage`**, at `.agents/skills/wix-manage/` — REST recipes for managing a site's
57
+ business solutions: exact endpoint, method and payload per operation, curl included. Its
58
+ SKILL.md is the index, by solution; open the recipe for the vertical's solution.
59
+ - **`wix-docs`**, at `.agents/skills/wix-docs/` — the Wix API reference, reached by
60
+ **search, not by browsing files**: the skill folder holds the how-to, not the pages. Open
61
+ its SKILL.md; it gives one `curl` to semantic search (`POST
62
+ /mcp-docs-search/v1/docs/search/markdown`, natural-language `search_term`) that returns
63
+ condensed method docs — endpoint, request example, response shape — and the rule that any
64
+ `dev.wix.com/docs/…` URL plus `.md` is the full page. Progressive: search first, read the
65
+ full document only when the hit lacks what you need.
66
+ If what you opened does not have the call, go to the next; do not try a variant, and do not
67
+ build one from a call you did find: the path and body you send are copied from the output
68
+ you read or they are not sent.
69
+
70
+ **In a folder that already holds a project** (a `package.json` or `index.html`, no
71
+ `wix.config.json`), attach writes the config into it and deploys for `--stack` instead of
72
+ scaffolding; pass the stack resolved in SKILL.md step 1. **A frontend that will be hosted
73
+ elsewhere** (Vercel, your own server) runs attach with `--hosting self --origin <url>[,<url>]`: no
74
+ Wix hosting is created, and the origins go on the OAuth app's allow-list so checkout can return
75
+ to them; add the public origin when it goes live. Then SKILL.md steps 4 and 5 as for any run,
76
+ with the install marker the only one to wait on.
@@ -0,0 +1,97 @@
1
+ # Reference mode: a static site, or a server-rendered app in another language
2
+
3
+ Read when SKILL.md step 1 resolves to a stack that cannot run `app/`. `<SKILL_ROOT>` is the
4
+ installed skill folder; the shipped code is under `<SKILL_ROOT>/templates/`. Steps 2 to 5 of
5
+ SKILL.md still apply; this file is the mechanics that differ.
6
+
7
+ The data layer ships a second time as a **REST layer**: `templates/shared/rest/` (the auth seam
8
+ `client.ts`, `media.ts`, `config.ts`) and `templates/<vertical>/rest/` (the same exports as the
9
+ vertical's `app/wix/<vertical>/` data layer, over `fetch`), typed against the same `types.ts` and
10
+ importing the same `*-core.ts` rule files as the SDK layer — one implementation of the rules, two
11
+ transports. The vertical's `INSTRUCTIONS.md` names its modules and what each surface does with
12
+ them; this section is the mechanics, the same for every vertical.
13
+
14
+ - **Static site (no bundler).** Step 3's setup with `--stack static` runs `init` in the project
15
+ folder (site, OAuth app, `wix.config.json`), points `site.outputDirectory` at `"./site"`, and
16
+ runs `deploy.mjs <vertical> --stack static --out site`, which composes the REST layer and the
17
+ vertical's framework-free stores flat into `site/js/wix/` and strips them to browser ESM
18
+ (comments kept, the `.ts` kept beside the `.js` to read). The site lives in that **subfolder**,
19
+ `site/`, holding only the pages, styles, assets and `js/`: `wix release` uploads it whole, so the
20
+ project root (config, `plan.json`, seed output, the skills) must not be it; move the pages in.
21
+ (On a project that already has its config, the same `deploy.mjs` call does the deploy.) Pages
22
+ import the vertical's modules from `./js/wix/` in a `<script type="module">`: the stores hold
23
+ the state machines (subscribe, render from `getState()`, call actions), the page holds the
24
+ rendering. The visitor token lives in `localStorage` and is the
25
+ visitor's identity across Wix — never mint one per page. A route is a page plus a query-string
26
+ slug (`item.html?slug=…`). Wix static hosting serves files, not directories: `/shop` does not
27
+ resolve to `shop/index.html`, and there is no routes configuration — name the file and link
28
+ to it. Seed per the vertical's `SEED.md` (Node + the CLI token, no project dependencies).
29
+ Release with `npx @wix/cli@latest release` — no build. Item-page tags come from the entity's
30
+ `seoData`, set after the fetch (`document.title`, the meta description).
31
+ - **Server-rendered, another language (Flask, Laravel, Rails, …).** The same shape as managed
32
+ Astro — pages rendered on the server, the interactive surfaces in the browser — with hosting and
33
+ SEO plumbing theirs. `init` still runs in the project folder; run `deploy.mjs <vertical> --stack
34
+ static` there too: it only needs `wix.config.json` and writes `js/wix/`. Split by where the call
35
+ runs:
36
+ - **Reads render on the server.** Port the vertical's `rest/` read module and its `*-core.ts` to
37
+ the server language: each function is one HTTP call with a literal URL and JSON body, and the
38
+ core carries the rules. That code is tested and proven against live sites — carry its bodies
39
+ over as they are, `fields` arrays and filter keys included (they are not guessable, and a
40
+ near-miss returns empty or unformatted data with no error), and render what Wix returns
41
+ (`formattedAmount`, never a number you format yourself). The shipped JS runs: when in doubt,
42
+ run the module with Node against the same site and compare one entity with your port. Public
43
+ reads need no visitor identity — one anonymous visitor token per server process, refreshed per
44
+ `client.ts`, is enough for them.
45
+ - **Visitor-specific state runs in the browser.** Whatever the vertical does on the visitor's
46
+ behalf (a store's cart and checkout, a booking, an RSVP, a form submit) loads the vertical's
47
+ `js/wix/` module in the templates and talks to Wix from the page, exactly as a static site
48
+ does: the browser owns the visitor token in `localStorage`, so the server handles no
49
+ per-visitor tokens. If that state must run server-side anyway, `client.ts`'s header applies:
50
+ one token set per visitor in the visitor's session, never one process-wide token (that is one
51
+ identity shared by everyone).
52
+ - **A Wix-hosted flow returns to the origin that started it, and only to one it knows.**
53
+ Checkout, a booking payment, a plan purchase all open on Wix and come back to your server;
54
+ the return works only for an origin on the site's OAuth app allow-list. Add the server's
55
+ origin — the dev one while verifying (`http://localhost:<port>`), the public https one when it
56
+ goes live — before the first checkout test: wix-manage's *Manage OAuth Apps* recipe, "Update an
57
+ OAuth App", field `allowedRedirectDomains`, on the app whose id is `appId` in
58
+ `wix.config.json`. Without it the Wix page opens and cannot return. Do it; do not only say it.
59
+ - **Pre-rendered → Wix-hosted.** If the project builds to static HTML (Frozen-Flask, Pelican,
60
+ Hugo, Eleventy, any static-site generator), Wix can host the output: run `deploy.mjs
61
+ <vertical> --stack static --out <build dir>` so `js/wix/` lands inside the build output (or
62
+ copy it there after each build), make the generator emit a page for **every** entity slug the
63
+ vertical's list read returns (walk it by cursor, never only the first page), point
64
+ `site.outputDirectory` at the build folder, `wix release`. The build's own reads use one
65
+ anonymous visitor token for the duration of the build. What Wix hosts is exactly the contents
66
+ of that folder after your last build, served as files: every asset a page references must be
67
+ in there and current — if the pipeline has more than one build step (templates, then a CSS or
68
+ asset bundle), they all run, in order, on every rebuild, or the release carries a stale piece.
69
+ a clean path does not resolve to a folder's `index.html`; name the file and link to it. Generated pages
70
+ sit at different depths, so reference `js/wix/` through one base path (a template variable,
71
+ or root-relative `/js/wix/…`), never `./js/wix/` — a relative path breaks one level down. **The generated page
72
+ is the first paint, not the whole surface**: the vertical's interactive behaviour (a store's
73
+ sort, filters, and cart; a blog's search; a booking flow) still runs client-side on top of it
74
+ from the same `js/wix/` modules, so the vertical's surface contracts in `INSTRUCTIONS.md`
75
+ apply unchanged. Close with the rebuild + release command and one line for the owner: content
76
+ edits made in the dashboard reach the site when that command runs; the browser-side flows are
77
+ live regardless. A running server (live reads on every request) stays theirs to host.
78
+ Then read the vertical's `INSTRUCTIONS.md` for the surfaces and hard rules, and the shared
79
+ `DESIGN.md`/`CONTENT.md`. **Before writing any surface, read the vertical's shipped hooks and
80
+ components** — its `INSTRUCTIONS.md` lists which files and what to take from each. They don't
81
+ deploy on this stack, and they are working, tested code for exactly the behaviour you are about
82
+ to write in your own; rewriting them from prose is where the bugs come from (the runs that
83
+ skipped them shipped a broken quick-add, the run that read them didn't). Both were written for
84
+ the stacks that receive the code, so they speak that stack's dialect: the Tailwind classes in the
85
+ skeletons and the components are one spelling of layout and behaviour rules that hold everywhere
86
+ (a bounded image band on phones, name and price on separate lines, the buy control pinned to the
87
+ tile's bottom, an overlay that locks scroll and returns focus). Take the rules; write them in the
88
+ CSS your stack uses, on a token set you define — nothing here asks you to add Tailwind. Close with run (or
89
+ rebuild) instructions, the live URL when Wix hosts the output, the dashboard link, and — when
90
+ hosting is theirs — which origins are on the OAuth app's allow-list and that the public one
91
+ must be added when the server moves (the step above).
92
+ - Both: the calls in `rest/` are the ones a **visitor token** may make from a page — public reads
93
+ and the visitor's own actions. Anything elevated (writes to content, other people's data) runs
94
+ server-side per `templates/shared/CUSTOM_OPERATIONS.md`; the seed's CLI token never belongs in
95
+ a page. A static site has no SSR; neither case has owner-editable item-page SEO through
96
+ `@wix/seo` (tags come from the entity's `seoData`) — say so in the closing message; managed
97
+ Astro stays the recommendation for a public site.
@@ -20,9 +20,12 @@ call is memory, and an empty or error reply to it says nothing about the site.
20
20
  Installed at `.agents/skills/`. If missing, restore with:
21
21
  `CI=1 npx skills@latest add wix/skills --skill {{SKILL}} --skill wix-docs --skill wix-manage --yes`
22
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
23
+ - `{{SKILL}}` — the code in this app and how to extend it. The shipped code sits in
24
+ `.agents/skills/{{SKILL}}/templates/`, fetched once from the skill's repository and kept with this
25
+ project at the commit it was built from (`templates/.source`); if that folder is missing,
26
+ `node .agents/skills/{{SKILL}}/install/templates.mjs` fetches it. Each business solution has a playbook at
27
+ `templates/<solution>/INSTRUCTIONS.md`; `node .agents/skills/{{SKILL}}/install/deploy.mjs <solution> --stack {{STACK}}`
28
+ adds one; `node .agents/skills/{{SKILL}}/templates/<solution>/seed/read-site.mjs` reads what the
26
29
  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
30
  - `wix-docs` — how to discover the Wix APIs and their docs: search first, then read only the page
28
31
  you need. Every endpoint, body, field and enum you did not get from the deployed code or a recipe
@@ -21,8 +21,8 @@
21
21
  // --business-name the site's name (names the folder, the hosting slug and the app project).
22
22
  // --vertical which shipped code deploys (no seed runs — the site owns its content). Both are
23
23
  // the caller's decision, read off the site before calling this (SKILL.md step 3).
24
- // --stack astro (default) in a folder without a project: scaffolds the CLI's blank Astro
25
- // template with the hosting adapter. react|static there: writes wix.config.json
24
+ // --stack astro (default) in a folder without a project: copies the first vertical's
25
+ // composed template (templates/<vertical>/project). react|static there: writes wix.config.json
26
26
  // and stops — the caller scaffolds (Vite / plain HTML) per SKILL.md. In a folder
27
27
  // that holds a project, --stack is required and nothing is scaffolded.
28
28
  //
@@ -41,18 +41,19 @@
41
41
  // ready_for_brand_layer, or error). Requires a logged-in Wix CLI (`npx @wix/cli@latest whoami`)
42
42
  // whose account owns or co-manages the site.
43
43
  import { spawn, spawnSync, execFileSync } from "node:child_process";
44
- import { cpSync, existsSync, mkdirSync, mkdtempSync, openSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync } from "node:fs";
45
- import { tmpdir } from "node:os";
44
+ import { cpSync, existsSync, mkdirSync, openSync, readFileSync, writeFileSync } from "node:fs";
46
45
  import { basename, dirname, join, resolve } from "node:path";
47
46
  import { fileURLToPath } from "node:url";
48
47
  import { writeAgentsMd } from "./agents-md.mjs";
48
+ import { listVerticals, templatesDir } from "./templates.mjs";
49
49
 
50
50
  const SKILL_ROOT = resolve(dirname(fileURLToPath(import.meta.url)), "..");
51
51
  const MANAGE = "https://manage.wix.com";
52
52
  const API = "https://www.wixapis.com";
53
53
  const HEADLESS_PROJECT_TYPE_ID = "eb363dea-85a0-4159-9b05-949542be5079";
54
- const TEMPLATES_REPO = "https://github.com/wix/headless-templates.git";
55
- const TEMPLATE_PATH = "astro/blank";
54
+ // The shipped code: the repository's templates/ (a checkout, the cache, or fetched now, in a second).
55
+ let TEMPLATES;
56
+ try { TEMPLATES = templatesDir(); } catch (e) { fail("templates", e.message); }
56
57
 
57
58
  const emit = (event, extra = {}) => console.log(JSON.stringify({ event, ...extra }));
58
59
  const fail = (step, detail) => {
@@ -77,9 +78,7 @@ const cwdConfig = has("wix.config.json") ? JSON.parse(readFileSync(join(cwd, "wi
77
78
  const hasProject = has("package.json") || has("index.html");
78
79
  const siteId = flag("site") ?? cwdConfig?.siteId ?? cwdConfig?.projectId ?? null;
79
80
  const stack = stackFlag ?? "astro";
80
- const knownVerticals = readdirSync(join(SKILL_ROOT, "references"), { withFileTypes: true })
81
- .filter((d) => d.isDirectory() && d.name !== "shared" && existsSync(join(SKILL_ROOT, "references", d.name, "app")))
82
- .map((d) => d.name);
81
+ const knownVerticals = listVerticals(TEMPLATES);
83
82
  const verticals = argv
84
83
  .flatMap((a, i) => (a === "--vertical" && argv[i + 1] ? argv[i + 1].split(",") : []))
85
84
  .map((v) => v.trim())
@@ -246,46 +245,15 @@ emit("attached", { siteId, appId, baseUrl, hosting, frontend, origins: hosting0
246
245
  // ---- 2 · scaffold (only where there is no project) -------------------------------------------------
247
246
  mkdirSync(projectDir, { recursive: true });
248
247
  if (stack === "astro" && mode === "scaffold") {
249
- // The CLI's own blank template (what `wix create` copies), then what its extender adds: the
250
- // hosting adapter, React islands, the `wix` scripts. Pinned like a freshly created project.
251
- const tmp = mkdtempSync(join(tmpdir(), "wix-template-"));
252
- const clone = spawnSync("git", ["clone", "--quiet", "--depth", "1", "--filter=blob:none", "--sparse", TEMPLATES_REPO, tmp], { encoding: "utf8", timeout: 120_000 });
253
- if (clone.status !== 0) fail("scaffold", clone.stderr || "git clone of the template repo failed");
254
- const sparse = spawnSync("git", ["-C", tmp, "sparse-checkout", "set", TEMPLATE_PATH], { encoding: "utf8", timeout: 60_000 });
255
- if (sparse.status !== 0 || !existsSync(join(tmp, TEMPLATE_PATH, "package.json"))) fail("scaffold", sparse.stderr || `template ${TEMPLATE_PATH} not found in ${TEMPLATES_REPO}`);
256
- cpSync(join(tmp, TEMPLATE_PATH), projectDir, { recursive: true, force: false, errorOnExist: false });
257
- rmSync(tmp, { recursive: true, force: true });
248
+ // The first vertical's composed template: the CLI's blank scaffold with the vertical deployed
249
+ // and its lockfile, the same folder `wix create --template-path` copies for a new site. Copied
250
+ // here because the CLI's create makes a new site and this folder gets an existing one. Further
251
+ // verticals are deployed below.
252
+ cpSync(join(templatesDir({ need: `${verticals[0]}/project` }), verticals[0], "project"), projectDir, { recursive: true, force: false, errorOnExist: false });
258
253
  const pkgPath = join(projectDir, "package.json");
259
254
  const pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
260
255
  pkg.name = folderName;
261
- pkg.scripts = { astro: "astro", dev: "wix dev", build: "wix build", wix: "wix", preview: "wix preview", release: "wix release", generate: "wix generate", env: "wix env", skills: "wix skills" };
262
- pkg.devDependencies = {
263
- ...(pkg.devDependencies ?? {}),
264
- "@astrojs/react": "^4.3.0",
265
- "@types/react": "^18.3.1",
266
- "@types/react-dom": "^18.3.1",
267
- "@wix/cli": "^1.1.92",
268
- "@wix/astro-wix-hosting-adapter": "^2.0.0",
269
- react: "18.3.1",
270
- "react-dom": "18.3.1",
271
- };
272
256
  writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + "\n");
273
- writeFileSync(join(projectDir, "astro.config.mjs"), `// @ts-check
274
- import { defineConfig } from "astro/config";
275
- import wix from "@wix/astro";
276
- import wixPages from "@wix/astro-pages";
277
- import react from "@astrojs/react";
278
- import wixHostingAdapter from "@wix/astro-wix-hosting-adapter";
279
-
280
- // https://astro.build/config
281
- export default defineConfig({
282
- integrations: [wix(), wixPages(), react()],
283
- security: { checkOrigin: false },
284
- adapter: wixHostingAdapter(),
285
- image: { domains: ["static.wixstatic.com"] },
286
- output: "server",
287
- });
288
- `);
289
257
  const gi = join(projectDir, ".gitignore");
290
258
  const cur = existsSync(gi) ? readFileSync(gi, "utf8") : "";
291
259
  if (!/\.env/.test(cur)) writeFileSync(gi, cur + "\n# local env (pulled from Wix)\n.env.local\n.env\n");
@@ -302,7 +270,7 @@ writeFileSync(join(projectDir, ".env.local"), [
302
270
  `WIX_CLIENT_SECRET=${quote(secrets.appSecret)}`,
303
271
  "",
304
272
  ].join("\n"));
305
- emit(mode === "link" ? "linked" : mode === "config-only" ? "configured" : "scaffolded", { folder: folderName, stack, template: mode === "scaffold" && stack === "astro" ? `${TEMPLATES_REPO}#${TEMPLATE_PATH}` : null });
273
+ emit(mode === "link" ? "linked" : mode === "config-only" ? "configured" : "scaffolded", { folder: folderName, stack, template: mode === "scaffold" && stack === "astro" ? join(TEMPLATES, verticals[0], "project") : null });
306
274
  // the agent config files `wix create` writes (attach never runs the CLI's scaffold at all); fill-only
307
275
  emit("agent_configs", writeAgentsMd(projectDir, { skill: basename(SKILL_ROOT), stack }));
308
276
 
@@ -313,7 +281,7 @@ if (mode !== "link" && (stack !== "astro" || mode === "config-only")) {
313
281
  process.exit(0);
314
282
  }
315
283
 
316
- // ---- 3 · deploy shipped code + deps + lockfile ---------------------------------------------------
284
+ // ---- 3 · deploy shipped code + deps (adds nothing to a scaffold from the template) --------------
317
285
  let deployResult = {};
318
286
  {
319
287
  const deploy = spawnSync("node", [join(SKILL_ROOT, "install", "deploy.mjs"), ...verticals, "--stack", stack], { cwd: projectDir, encoding: "utf8", timeout: 60_000 });
@@ -43,21 +43,25 @@ import {
43
43
  } from "node:fs";
44
44
  import { dirname, join, resolve } from "node:path";
45
45
  import { fileURLToPath } from "node:url";
46
+ import { templatesDir } from "./templates.mjs";
47
+ import { syncLockRoot } from "./lock.mjs";
46
48
 
47
49
  const SKILL_ROOT = resolve(dirname(fileURLToPath(import.meta.url)), "..");
48
- const REF = join(SKILL_ROOT, "references");
50
+ // The shipped code: the repository's templates/ (a checkout, the cache, or fetched now).
51
+ const REF = templatesDir();
49
52
  const PROJECT = process.cwd();
50
53
  const SRC = join(PROJECT, "src");
51
54
  const CONFIG_TS = join(SRC, "wix", "config.ts");
52
55
  const PKG_JSON = join(PROJECT, "package.json");
53
56
 
54
- // The vertical registry: every directory under references/ that ships an app/ is a vertical.
57
+ // The vertical registry: every directory under templates/ that ships an app/ is a vertical.
55
58
  const VERTICALS = readdirSync(REF, { withFileTypes: true })
56
59
  .filter(
57
60
  (d) =>
58
61
  d.isDirectory() &&
59
62
  existsSync(join(REF, d.name, "app")) &&
60
- d.name !== "shared",
63
+ d.name !== "shared" &&
64
+ d.name !== "blank",
61
65
  )
62
66
  .map((d) => d.name);
63
67
 
@@ -73,8 +77,6 @@ const SHARED_DEPS = {
73
77
  };
74
78
  const CAPABILITY_DEPS = {
75
79
  "media-upload": {
76
- // All shipped Astro locks already carry @wix/media >= 1.0.271 transitively. Keep this
77
- // range compatible with them, then promote it to a root lock dependency below.
78
80
  "@wix/media": "^1.0.271",
79
81
  "@wix/essentials": "^1.0.10",
80
82
  },
@@ -179,7 +181,7 @@ const flagArgs = new Set(
179
181
  );
180
182
  const requested = [...new Set(argv.filter((a) => !flagArgs.has(a)))];
181
183
 
182
- const result = { stack, verticals: [], skillRoot: SKILL_ROOT };
184
+ const result = { stack, verticals: [], skillRoot: SKILL_ROOT, templates: REF };
183
185
 
184
186
  if (!["astro", "react", "lib", "static"].includes(stack)) {
185
187
  console.log(
@@ -362,13 +364,6 @@ if (result.verticals.length && existsSync(PKG_JSON)) {
362
364
  if (added.length)
363
365
  writeFileSync(PKG_JSON, JSON.stringify(pkg, null, 2) + "\n");
364
366
  result.depsAdded = added.map(([name]) => name);
365
- if (added.length)
366
- result.note = [
367
- result.note,
368
- "run `npm install --ignore-scripts` to pick up depsAdded",
369
- ]
370
- .filter(Boolean)
371
- .join("; ");
372
367
  } else if (result.verticals.length) {
373
368
  result.depsAdded = [];
374
369
  result.note = [
@@ -379,54 +374,20 @@ if (result.verticals.length && existsSync(PKG_JSON)) {
379
374
  .join("; ");
380
375
  }
381
376
 
382
- // ---- shipped lockfile (single vertical only) ------------------------------------------------------
383
- // A pre-resolved package-lock.json covering the scaffold + this vertical's deps ships at
384
- // references/<vertical>/lock/<stack>/package-lock.json. Placing it lets `npm ci` skip the whole
385
- // resolution phase (seconds instead of minutes). URLs are canonical registry.npmjs.org form —
386
- // npm substitutes the locally configured registry (mirrors/proxies) at fetch time. Placed only
387
- // when the project has no lock of its own; if it ever drifts out of sync, `npm ci` fails fast
388
- // and the `|| npm install` fallback self-heals.
377
+ // ---- the project's lockfile ---------------------------------------------------------------------
378
+ // A project created from a composed template (templates/<vertical>/project) carries that
379
+ // template's package-lock.json, so `npm ci` installs it without resolving. When this run added
380
+ // dependencies to package.json, the lock's root entry is brought in line where the tree already
381
+ // holds the package (install/lock.mjs); anything the tree lacks makes `npm ci` fail fast and the
382
+ // `|| npm install` fallback resolve it. A project without a lock installs with `npm install`.
389
383
  const PROJECT_LOCK = join(PROJECT, "package-lock.json");
390
- if (
391
- result.verticals.length === 1 &&
392
- existsSync(PKG_JSON) &&
393
- !existsSync(PROJECT_LOCK)
394
- ) {
395
- const shippedLock = join(
396
- REF,
397
- result.verticals[0],
398
- "lock",
399
- stack,
400
- "package-lock.json",
401
- );
402
- if (existsSync(shippedLock)) {
403
- cpSync(shippedLock, PROJECT_LOCK);
404
- if (uploadPolicies.length) {
405
- // The supplied per-vertical lock already resolves Media + Essentials transitively. Add
406
- // them to its root package entry too, so npm ci accepts package.json's new direct
407
- // dependency without falling back to a slow dependency-resolution install.
408
- const lock = JSON.parse(readFileSync(PROJECT_LOCK, "utf8"));
409
- lock.packages ??= {};
410
- lock.packages[""] ??= {};
411
- lock.packages[""].dependencies ??= {};
412
- const rootDeps = lock.packages[""].dependencies;
413
- for (const [name, range] of Object.entries(CAPABILITY_DEPS["media-upload"])) {
414
- if (!lock.packages?.[`node_modules/${name}`]) {
415
- result.lockCapability = `UNPATCHED — supplied lock lacks ${name}; npm install will resolve it`;
416
- break;
417
- }
418
- rootDeps[name] = range;
419
- }
420
- writeFileSync(PROJECT_LOCK, JSON.stringify(lock, null, 2) + "\n");
421
- if (!result.lockCapability) result.lockCapability = "media_upload_promoted";
422
- }
423
- result.lockDeployed = true;
424
- result.note = [
425
- result.note,
426
- "install with `npm ci --ignore-scripts || npm install --ignore-scripts`",
427
- ]
428
- .filter(Boolean)
429
- .join("; ");
384
+ if (result.verticals.length && existsSync(PKG_JSON)) {
385
+ if (existsSync(PROJECT_LOCK)) {
386
+ const sync = syncLockRoot(PROJECT);
387
+ if (sync && (sync.promoted.length || sync.missing.length)) result.lock = sync;
388
+ result.note = [result.note, "install with `npm ci --ignore-scripts || npm install --ignore-scripts`"].filter(Boolean).join("; ");
389
+ } else if (result.depsAdded?.length) {
390
+ result.note = [result.note, "run `npm install --ignore-scripts` to pick up depsAdded"].filter(Boolean).join("; ");
430
391
  }
431
392
  }
432
393
 
@@ -0,0 +1,55 @@
1
+ // Keep a project's package-lock.json valid for `npm ci` after package.json gained dependencies.
2
+ // `npm ci` refuses a lock whose root entry disagrees with package.json. When the dependency deploy
3
+ // added is already in the lock's tree (pulled in by something else), declaring it in the root entry
4
+ // too is all `npm ci` needs; a dependency the tree lacks is left for `npm install` to resolve.
5
+ import { existsSync, readFileSync, writeFileSync } from "node:fs";
6
+ import { join } from "node:path";
7
+
8
+ const parse = (v) => {
9
+ const m = String(v).match(/^(\d+)\.(\d+)\.(\d+)/);
10
+ return m ? m.slice(1).map(Number) : null;
11
+ };
12
+ const cmp = (a, b) => a[0] - b[0] || a[1] - b[1] || a[2] - b[2];
13
+
14
+ // The ranges deploy writes: exact, ^x.y.z, ~x.y.z, >=x.y.z. Anything else is "not known to fit".
15
+ export function satisfies(version, range) {
16
+ const v = parse(version);
17
+ const m = String(range).trim().match(/^(\^|~|>=)?\s*v?(\d+\.\d+\.\d+)/);
18
+ if (!v || !m) return false;
19
+ const r = parse(m[2]);
20
+ const op = m[1] ?? "";
21
+ if (op === "") return cmp(v, r) === 0;
22
+ if (cmp(v, r) < 0) return false;
23
+ if (op === ">=") return true;
24
+ if (op === "~") return v[0] === r[0] && v[1] === r[1];
25
+ // caret: same major; for 0.x, same minor
26
+ return r[0] > 0 ? v[0] === r[0] : v[0] === 0 && v[1] === r[1];
27
+ }
28
+
29
+ // Returns null when there is no lock; else {promoted, missing}. Writes the lock only when it changed.
30
+ export function syncLockRoot(projectDir) {
31
+ const lockPath = join(projectDir, "package-lock.json");
32
+ const pkgPath = join(projectDir, "package.json");
33
+ if (!existsSync(lockPath) || !existsSync(pkgPath)) return null;
34
+ const pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
35
+ const lock = JSON.parse(readFileSync(lockPath, "utf8"));
36
+ lock.packages ??= {};
37
+ const root = (lock.packages[""] ??= {});
38
+ const promoted = [], missing = [];
39
+ let changed = false;
40
+ for (const field of ["dependencies", "devDependencies"]) {
41
+ for (const [name, range] of Object.entries(pkg[field] ?? {})) {
42
+ if (root[field]?.[name] === range) continue;
43
+ const inTree = lock.packages[`node_modules/${name}`];
44
+ if (inTree && satisfies(inTree.version, range)) {
45
+ (root[field] ??= {})[name] = range;
46
+ promoted.push(name);
47
+ changed = true;
48
+ } else {
49
+ missing.push(name);
50
+ }
51
+ }
52
+ }
53
+ if (changed) writeFileSync(lockPath, JSON.stringify(lock, null, 2) + "\n");
54
+ return { promoted, missing };
55
+ }
@@ -9,8 +9,9 @@
9
9
  // this skill's code or a solution to it, then one install, then the seed if there is content.
10
10
  // - a project but no `wix.config.json` (a package.json, or an index.html at the root) → CONNECT:
11
11
  // `npm create @wix/new@latest init` in place creates the site and the config, then deploy.
12
- // - otherwise (empty, or loose files such as a CSV or a brief) → CREATE: scaffold the Wix CLI's
13
- // Astro template and place it in the current directory (`--business-name` required).
12
+ // - otherwise (empty, or loose files such as a CSV or a brief) → CREATE: `wix create` with the
13
+ // vertical's composed template (templates/<vertical>/project: the CLI's blank scaffold with the
14
+ // vertical deployed and a lockfile), placed in the current directory (`--business-name` required).
14
15
  //
15
16
  // The script reads file markers only (wix.config.json, a package.json or index.html); everything
16
17
  // else is the agent's call: when connecting, `--stack` is required and comes from SKILL.md step 1,
@@ -22,10 +23,11 @@
22
23
  // steps — the dependency install and the seed — running detached in the background (logs and
23
24
  // completion markers in the final event), so the caller can build the brand layer while they finish.
24
25
  import { spawn, spawnSync } from "node:child_process";
25
- import { existsSync, openSync, readFileSync, readdirSync, renameSync, rmSync } from "node:fs";
26
+ import { existsSync, openSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync } from "node:fs";
26
27
  import { basename, dirname, join, resolve } from "node:path";
27
28
  import { fileURLToPath } from "node:url";
28
29
  import { AGENT_CONFIG_FILES, writeAgentsMd } from "./agents-md.mjs";
30
+ import { listVerticals, templatesDir } from "./templates.mjs";
29
31
 
30
32
  const SKILL_ROOT = resolve(dirname(fileURLToPath(import.meta.url)), "..");
31
33
 
@@ -47,9 +49,10 @@ const vertical = flag("vertical");
47
49
  const stackFlag = flag("stack");
48
50
  // Opt-in: keep a CREATE's project in a subfolder instead of the current directory.
49
51
  const subfolder = argv.includes("--subfolder");
50
- const knownVerticals = readdirSync(join(SKILL_ROOT, "references"), { withFileTypes: true })
51
- .filter((d) => d.isDirectory() && d.name !== "shared" && existsSync(join(SKILL_ROOT, "references", d.name, "app")))
52
- .map((d) => d.name);
52
+ // The shipped code: the repository's templates/ (a checkout, the cache, or fetched now, in a second).
53
+ let TEMPLATES;
54
+ try { TEMPLATES = templatesDir(); } catch (e) { fail("templates", e.message); }
55
+ const knownVerticals = listVerticals(TEMPLATES);
53
56
  const usage = `usage: setup.mjs --vertical <${knownVerticals.join("|")}> [--plan plan.json] [--business-name "<Brand>"] [--stack astro|react|lib|static] [--subfolder]`;
54
57
  // --vertical is REQUIRED: a defaulted vertical deploys the wrong code and runs the wrong seed.
55
58
  if (!vertical) fail("args", usage);
@@ -92,7 +95,13 @@ if (mode === "create") {
92
95
  if (existsSync(join(projectDir, "wix.config.json"))) {
93
96
  emit("scaffold_skipped", { reason: "project already exists", folder: folderName });
94
97
  } else {
95
- emit("scaffolding", { folder: folderName });
98
+ // The composed template: the CLI copies it in place of its blank one, creates the site and
99
+ // writes wix.config.json; the vertical's code and its lockfile arrive with it. Any other
100
+ // stack takes the CLI's blank Astro scaffold, as before, and deploy below adds the code.
101
+ // The composed project is the one part of the templates a project's repository does not keep;
102
+ // a committed copy fetches it here, at the commit the rest came from.
103
+ const template = stack === "astro" ? join(templatesDir({ need: `${vertical}/project` }), vertical, "project") : null;
104
+ emit("scaffolding", { folder: folderName, template });
96
105
  const scaffold = spawnSync(
97
106
  "npm",
98
107
  // --skip-git: this wrapper composes its own steps and leaves version control to
@@ -102,7 +111,8 @@ if (mode === "create") {
102
111
  // same reason: deps install in a detached step below.
103
112
  ["create", "@wix/new@latest", "--", "headless",
104
113
  "--folder-name", folderName, "--business-name", businessName,
105
- "--site-template", "--skip-install", "--skip-git", "--no-publish"],
114
+ "--site-template", "blank", ...(template ? ["--template-path", template] : []),
115
+ "--skip-install", "--skip-git", "--no-publish"],
106
116
  { env: { ...process.env, CI: "1" }, encoding: "utf8", timeout: 300_000 },
107
117
  );
108
118
  if (scaffold.status !== 0 || !existsSync(join(projectDir, "wix.config.json"))) {
@@ -123,12 +133,22 @@ if (mode === "create") {
123
133
  }
124
134
  const wixConfig = JSON.parse(readFileSync(join(projectDir, "wix.config.json"), "utf8"));
125
135
  const siteId = wixConfig.siteId ?? wixConfig.projectId;
136
+ // Static: `wix release` uploads the output folder whole, so the project root (config, plan, seed
137
+ // output, the skills) must not be it. The site lives in site/: the config points there and the REST
138
+ // layer deploys into it; the pages, styles and assets are the agent's to move (the `next` says so).
139
+ const STATIC_OUT = "site";
140
+ if (stack === "static") {
141
+ wixConfig.site = { ...(wixConfig.site ?? {}), outputDirectory: `./${STATIC_OUT}` };
142
+ writeFileSync(join(projectDir, "wix.config.json"), JSON.stringify(wixConfig, null, 2) + "\n");
143
+ }
126
144
  emit(mode === "create" ? "scaffolded" : "connected", { folder: folderName ?? cwd, siteId, stack });
127
145
 
128
- // ---- 2 · deploy shipped code + deps + lockfile ---------------------------------------------------
146
+ // ---- 2 · deploy shipped code + deps ---------------------------------------------------------------
147
+ // A CREATE from the composed template already holds the code and the lock: deploy adds nothing and
148
+ // reports the project; a CONNECT gets the code and its dependencies here.
129
149
  const deploy = spawnSync(
130
150
  "node",
131
- [join(SKILL_ROOT, "install", "deploy.mjs"), vertical, "--stack", stack, ...(planPath ? ["--plan", resolve(planPath)] : [])],
151
+ [join(SKILL_ROOT, "install", "deploy.mjs"), vertical, "--stack", stack, ...(stack === "static" ? ["--out", STATIC_OUT] : []), ...(planPath ? ["--plan", resolve(planPath)] : [])],
132
152
  { cwd: projectDir, encoding: "utf8", timeout: 60_000 },
133
153
  );
134
154
  if (deploy.status !== 0) fail("deploy", deploy.stderr || deploy.stdout);
@@ -196,7 +216,7 @@ if (stack !== "static" && existsSync(join(projectDir, "package.json"))) {
196
216
  // additive: it never deletes or overwrites what the site holds.
197
217
  let seed = null;
198
218
  if (planPath) {
199
- const seedDir = join(SKILL_ROOT, "references", vertical, "seed");
219
+ const seedDir = join(TEMPLATES, vertical, "seed");
200
220
  const seedName = existsSync(seedDir)
201
221
  ? readdirSync(seedDir).find((f) => f.startsWith("seed-") && f.endsWith(".mjs"))
202
222
  : undefined;
@@ -218,7 +238,7 @@ const release = {
218
238
  astro: "npx @wix/cli@latest build, then npx @wix/cli@latest release",
219
239
  react: "the project's own build, then npx @wix/cli@latest release of the build folder named in wix.config.json (what Wix hosting serves and how routes must be shaped: SKILL.md step 1)",
220
240
  lib: "the project's own build, then npx @wix/cli@latest release of the build folder named in wix.config.json (SKILL.md step 1)",
221
- static: "npx @wix/cli@latest release — no build; wix.config.json site.outputDirectory points at the folder the pages live in",
241
+ static: `npx @wix/cli@latest release — no build; it uploads ${STATIC_OUT}/ whole (wix.config.json site.outputDirectory), so the pages, styles and assets move into ${STATIC_OUT}/ first and import the modules from ./js/wix/ there; the root keeps the config, the plan, the seed output and the skills`,
222
242
  }[stack];
223
243
  emit("ready_for_brand_layer", {
224
244
  mode,