@wix/agent-skills 1.14.0 → 1.15.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 (247) hide show
  1. package/README.md +4 -1
  2. package/package.json +1 -1
  3. package/skills/README.md +23 -0
  4. package/skills/wix-app/SKILL.md +10 -2
  5. package/skills/wix-app/references/AUTO_PATTERNS_DASHBOARD.md +326 -0
  6. package/skills/wix-app/references/CODE_QUALITY.md +1 -0
  7. package/skills/wix-app/references/CUSTOM_ELEMENT_WIDGET.md +124 -115
  8. package/skills/wix-app/references/DASHBOARD_PAGE.md +3 -0
  9. package/skills/wix-app/references/EDITOR_REACT_COMPONENT.md +23 -9
  10. package/skills/wix-app/references/SITE_PLUGIN.md +1 -1
  11. package/skills/wix-app/references/auto-patterns-dashboard/action-cell.md +115 -0
  12. package/skills/wix-app/references/auto-patterns-dashboard/app-config-structure.md +264 -0
  13. package/skills/wix-app/references/auto-patterns-dashboard/app-context.md +37 -0
  14. package/skills/wix-app/references/auto-patterns-dashboard/bulk-actions.md +86 -0
  15. package/skills/wix-app/references/auto-patterns-dashboard/collection-page-actions.md +119 -0
  16. package/skills/wix-app/references/auto-patterns-dashboard/collection-page.md +103 -0
  17. package/skills/wix-app/references/auto-patterns-dashboard/custom-actions-override.md +76 -0
  18. package/skills/wix-app/references/auto-patterns-dashboard/custom-columns-override.md +82 -0
  19. package/skills/wix-app/references/auto-patterns-dashboard/custom-components-override.md +89 -0
  20. package/skills/wix-app/references/auto-patterns-dashboard/custom-header-override.md +124 -0
  21. package/skills/wix-app/references/auto-patterns-dashboard/custom-sections-override.md +91 -0
  22. package/skills/wix-app/references/auto-patterns-dashboard/custom-slots-override.md +71 -0
  23. package/skills/wix-app/references/auto-patterns-dashboard/entity-page-actions.md +70 -0
  24. package/skills/wix-app/references/auto-patterns-dashboard/entity-page-view-actions.md +73 -0
  25. package/skills/wix-app/references/auto-patterns-dashboard/entity-page.md +98 -0
  26. package/skills/wix-app/references/auto-patterns-dashboard/example-patterns.json +278 -0
  27. package/skills/wix-app/references/auto-patterns-dashboard/pages-configuration.md +94 -0
  28. package/skills/wix-app/references/auto-patterns-dashboard/resolved-action.md +43 -0
  29. package/skills/wix-app/references/auto-patterns-dashboard/sdk-utilities.md +66 -0
  30. package/skills/wix-app/references/auto-patterns-dashboard/views.md +76 -0
  31. package/skills/wix-app/references/editor-react-component/ACCESSIBILITY.md +1 -14
  32. package/skills/wix-app/references/editor-react-component/COMPONENT-API.md +54 -29
  33. package/skills/wix-app/references/editor-react-component/COMPONENT-CONFIGURATION.md +2 -2
  34. package/skills/wix-app/references/editor-react-component/CSS-GUIDELINES.md +17 -105
  35. package/skills/wix-app/references/editor-react-component/DESIGN-STATES.md +127 -0
  36. package/skills/wix-app/references/editor-react-component/PARTS.md +2 -1
  37. package/skills/wix-app/references/editor-react-component/REACT-GUIDELINES.md +15 -15
  38. package/skills/wix-app/references/editor-react-component/REACT-PATTERNS.md +25 -53
  39. package/skills/wix-app/scripts/generate-auto-patterns.js +510 -0
  40. package/skills/wix-auth/SKILL.md +12 -0
  41. package/skills/wix-auth/references/device-flow.md +140 -0
  42. package/skills/wix-docs/SKILL.md +188 -0
  43. package/skills/wix-docs/references/API_SPEC_SEARCH.md +213 -0
  44. package/skills/wix-docs/references/EXTRACTING.md +120 -0
  45. package/skills/wix-headless/SKILL.md +84 -130
  46. package/skills/wix-headless/entry/bootstrap.mjs +93 -0
  47. package/skills/wix-headless/entry/skill.md +78 -0
  48. package/skills/wix-headless/references/AI_FEATURES.md +178 -0
  49. package/skills/wix-headless/references/CAPABILITIES.md +84 -0
  50. package/skills/wix-headless/references/DISCOVERY.md +34 -56
  51. package/skills/wix-headless/references/DOC_DISCOVERY.md +37 -0
  52. package/skills/wix-headless/references/FEEDBACK.md +118 -0
  53. package/skills/wix-headless/references/IMAGE_GENERATION.md +69 -0
  54. package/skills/wix-headless/references/SDK_HANDOFF.md +97 -0
  55. package/skills/wix-headless/references/SEED.md +44 -188
  56. package/skills/wix-headless/references/SETUP.md +32 -103
  57. package/skills/wix-headless/references/astro.md +98 -0
  58. package/skills/wix-headless/references/inline-recipes/how-to-code-a-blog.md +196 -0
  59. package/skills/wix-headless/references/inline-recipes/how-to-code-a-store.md +236 -0
  60. package/skills/wix-headless/references/inline-recipes/how-to-code-bookings.md +279 -0
  61. package/skills/wix-headless/references/inline-recipes/how-to-code-cms.md +163 -0
  62. package/skills/wix-headless/references/inline-recipes/how-to-code-events.md +203 -0
  63. package/skills/wix-headless/references/inline-recipes/how-to-code-forms.md +222 -0
  64. package/skills/wix-headless/references/inline-recipes/how-to-code-members-astro.md +124 -0
  65. package/skills/wix-headless/references/inline-recipes/how-to-code-members-custom-login.md +160 -0
  66. package/skills/wix-headless/references/inline-recipes/how-to-code-members-non-astro.md +118 -0
  67. package/skills/wix-headless/references/inline-recipes/how-to-code-portfolio.md +132 -0
  68. package/skills/wix-headless/references/inline-recipes/how-to-code-pricing-plans.md +124 -0
  69. package/skills/wix-headless/references/inline-recipes/how-to-code-restaurant-orders.md +188 -0
  70. package/skills/wix-headless/references/inline-recipes/how-to-code-restaurant-reservations.md +173 -0
  71. package/skills/wix-headless/references/inline-recipes/how-to-code-restaurants.md +161 -0
  72. package/skills/wix-headless/references/inline-recipes/setup-blog.md +175 -0
  73. package/skills/wix-headless/references/inline-recipes/setup-bookings.md +228 -0
  74. package/skills/wix-headless/references/inline-recipes/setup-cms.md +200 -0
  75. package/skills/wix-headless/references/inline-recipes/setup-events.md +196 -0
  76. package/skills/wix-headless/references/inline-recipes/setup-forms.md +174 -0
  77. package/skills/wix-headless/references/inline-recipes/setup-online-store.md +176 -0
  78. package/skills/wix-headless/references/inline-recipes/setup-portfolio.md +153 -0
  79. package/skills/wix-headless/references/inline-recipes/setup-pricing-plans.md +229 -0
  80. package/skills/wix-headless/references/inline-recipes/setup-restaurant-orders.md +161 -0
  81. package/skills/wix-headless/references/inline-recipes/setup-restaurant-reservations.md +117 -0
  82. package/skills/wix-headless/references/inline-recipes/setup-restaurants.md +152 -0
  83. package/skills/wix-headless/references/managed/AUTHENTICATION.md +57 -0
  84. package/skills/wix-headless/references/managed/CONNECT.md +74 -0
  85. package/skills/wix-headless/references/managed/CREATE.md +130 -0
  86. package/skills/wix-headless/references/managed/DEPLOYMENT.md +57 -0
  87. package/skills/wix-headless/references/non-astro.md +59 -0
  88. package/skills/wix-headless/references/self-managed/AUTHENTICATION.md +22 -0
  89. package/skills/wix-headless/references/self-managed/DEPLOYMENT.md +7 -0
  90. package/skills/wix-headless/references/stripe/AUTHENTICATION.md +55 -0
  91. package/skills/wix-headless/references/stripe/DEPLOYMENT.md +63 -0
  92. package/skills/wix-manage/SKILL.md +24 -1
  93. package/skills/wix-manage/references/analytics/query-site-analytics.md +241 -0
  94. package/skills/wix-manage/references/bookings/create-and-update-booking-services.md +1 -1
  95. package/skills/wix-manage/references/bookings/diagnose-availability-issues.md +265 -0
  96. package/skills/wix-manage/references/marketing/create-and-publish-social-post.md +436 -0
  97. package/skills/wix-manage/references/marketing/generate-and-publish-marketing-plan.md +209 -0
  98. package/skills/wix-manage/references/rich-content/author-ricos-rich-content.md +249 -0
  99. package/skills/wix-manage/references/stores/create-product-with-options-catalog-v3.md +51 -0
  100. package/skills/wix-vibe-headless/SKILL.md +136 -0
  101. package/skills/wix-vibe-headless/references/blog/INSTRUCTIONS.md +128 -0
  102. package/skills/wix-vibe-headless/references/blog/wix-blog.js +217 -0
  103. package/skills/wix-vibe-headless/references/bookings/INSTRUCTIONS.md +153 -0
  104. package/skills/wix-vibe-headless/references/bookings/wix-bookings-checkout.js +147 -0
  105. package/skills/wix-vibe-headless/references/bookings/wix-bookings-services.js +215 -0
  106. package/skills/wix-vibe-headless/references/cms/INSTRUCTIONS.md +154 -0
  107. package/skills/wix-vibe-headless/references/cms/wix-cms.js +186 -0
  108. package/skills/wix-vibe-headless/references/events/INSTRUCTIONS.md +142 -0
  109. package/skills/wix-vibe-headless/references/events/wix-events-browse.js +135 -0
  110. package/skills/wix-vibe-headless/references/events/wix-events-registration.js +187 -0
  111. package/skills/wix-vibe-headless/references/members/INSTRUCTIONS.md +211 -0
  112. package/skills/wix-vibe-headless/references/members/wix-members-auth.js +387 -0
  113. package/skills/wix-vibe-headless/references/portfolio/INSTRUCTIONS.md +111 -0
  114. package/skills/wix-vibe-headless/references/portfolio/wix-portfolio.js +194 -0
  115. package/skills/wix-vibe-headless/references/pricing-plans/INSTRUCTIONS.md +127 -0
  116. package/skills/wix-vibe-headless/references/pricing-plans/wix-pricing-plans.js +157 -0
  117. package/skills/wix-vibe-headless/references/restaurants/INSTRUCTIONS.md +138 -0
  118. package/skills/wix-vibe-headless/references/restaurants/wix-restaurants-menu.js +224 -0
  119. package/skills/wix-vibe-headless/references/restaurants/wix-restaurants-ordering.js +156 -0
  120. package/skills/wix-vibe-headless/references/restaurants/wix-restaurants-reservations.js +107 -0
  121. package/skills/wix-vibe-headless/references/shared/wix-client.js +186 -0
  122. package/skills/wix-vibe-headless/references/storefront/INSTRUCTIONS.md +155 -0
  123. package/skills/wix-vibe-headless/references/storefront/wix-store-cart.js +147 -0
  124. package/skills/wix-vibe-headless/references/storefront/wix-store-catalog.js +142 -0
  125. package/skills/wix-headless/references/BUILD-astro.md +0 -253
  126. package/skills/wix-headless/references/BUILD-own-build.md +0 -167
  127. package/skills/wix-headless/references/BUILD.md +0 -105
  128. package/skills/wix-headless/references/DESIGN_SYSTEM.md +0 -165
  129. package/skills/wix-headless/references/DISCOVERY-connect.md +0 -55
  130. package/skills/wix-headless/references/DISCOVERY-create.md +0 -238
  131. package/skills/wix-headless/references/PLAN-connect.md +0 -19
  132. package/skills/wix-headless/references/PLAN-create.md +0 -17
  133. package/skills/wix-headless/references/PLAN.md +0 -92
  134. package/skills/wix-headless/references/astro/blog/BLOG_PAGES.md +0 -300
  135. package/skills/wix-headless/references/astro/blog/BLOG_SETUP.md +0 -218
  136. package/skills/wix-headless/references/astro/bookings/COMPONENTS.md +0 -45
  137. package/skills/wix-headless/references/astro/bookings/SERVICES_PAGES.md +0 -77
  138. package/skills/wix-headless/references/astro/cms/CMS_FOUNDATIONS.md +0 -214
  139. package/skills/wix-headless/references/astro/cms/FAQ_KNOWLEDGE_BASE.md +0 -231
  140. package/skills/wix-headless/references/astro/cms/PORTFOLIO.md +0 -453
  141. package/skills/wix-headless/references/astro/cms/RESOURCE_LIBRARY.md +0 -354
  142. package/skills/wix-headless/references/astro/cms/TEAM_DIRECTORY.md +0 -299
  143. package/skills/wix-headless/references/astro/designer/INSTRUCTIONS.md +0 -351
  144. package/skills/wix-headless/references/astro/ecom/CART_PAGES.md +0 -119
  145. package/skills/wix-headless/references/astro/ecom/CART_WIRING.md +0 -103
  146. package/skills/wix-headless/references/astro/ecom/COMPONENTS_CSS.md +0 -132
  147. package/skills/wix-headless/references/astro/forms/CONTACT_FORM.md +0 -463
  148. package/skills/wix-headless/references/astro/gift-cards/COMPONENTS.md +0 -119
  149. package/skills/wix-headless/references/astro/gift-cards/PAGES.md +0 -129
  150. package/skills/wix-headless/references/astro/stores/BACK_IN_STOCK.md +0 -178
  151. package/skills/wix-headless/references/astro/stores/CATEGORY_PAGES.md +0 -85
  152. package/skills/wix-headless/references/astro/stores/COMPONENTS_CSS.md +0 -129
  153. package/skills/wix-headless/references/astro/stores/HOME_AND_NAV.md +0 -229
  154. package/skills/wix-headless/references/astro/stores/PRODUCT_PAGES.md +0 -215
  155. package/skills/wix-headless/references/astro/stores/SHARED_WIRING.md +0 -165
  156. package/skills/wix-headless/references/astro/templates/Layout.astro +0 -132
  157. package/skills/wix-headless/references/astro/templates/astro.config.mjs +0 -41
  158. package/skills/wix-headless/references/astro/templates/bookings/AvailabilityCalendar.tsx +0 -374
  159. package/skills/wix-headless/references/astro/templates/bookings/BookingForm.tsx +0 -136
  160. package/skills/wix-headless/references/astro/templates/bookings/SeoTags.astro +0 -25
  161. package/skills/wix-headless/references/astro/templates/bookings/ServiceBookingFlow.tsx +0 -71
  162. package/skills/wix-headless/references/astro/templates/bookings/ServiceCard.astro +0 -54
  163. package/skills/wix-headless/references/astro/templates/bookings/booking-confirmation.astro +0 -49
  164. package/skills/wix-headless/references/astro/templates/bookings/bookingDriver.ts +0 -245
  165. package/skills/wix-headless/references/astro/templates/bookings/components-bookings.css +0 -424
  166. package/skills/wix-headless/references/astro/templates/bookings/services/[slug].astro +0 -176
  167. package/skills/wix-headless/references/astro/templates/bookings/services/index.astro +0 -181
  168. package/skills/wix-headless/references/astro/templates/ecom/CartBadge.tsx +0 -84
  169. package/skills/wix-headless/references/astro/templates/ecom/CartView.tsx +0 -543
  170. package/skills/wix-headless/references/astro/templates/ecom/cart.astro +0 -13
  171. package/skills/wix-headless/references/astro/templates/ecom/components-ecom.css +0 -302
  172. package/skills/wix-headless/references/astro/templates/ecom/discounts.ts +0 -71
  173. package/skills/wix-headless/references/astro/templates/ecom/thank-you.astro +0 -24
  174. package/skills/wix-headless/references/astro/templates/gift-cards/GiftCardPurchase.tsx +0 -172
  175. package/skills/wix-headless/references/astro/templates/gift-cards/_home-teaser-snippet.astro +0 -42
  176. package/skills/wix-headless/references/astro/templates/gift-cards/_nav-snippet.astro +0 -11
  177. package/skills/wix-headless/references/astro/templates/gift-cards/components-gift-cards.css +0 -220
  178. package/skills/wix-headless/references/astro/templates/gift-cards/gift-cards.astro +0 -51
  179. package/skills/wix-headless/references/astro/templates/gift-cards/gift-cards.ts +0 -75
  180. package/skills/wix-headless/references/astro/templates/global.css +0 -288
  181. package/skills/wix-headless/references/astro/templates/stores/AddToCartButton.tsx +0 -77
  182. package/skills/wix-headless/references/astro/templates/stores/BackInStockForm.tsx +0 -176
  183. package/skills/wix-headless/references/astro/templates/stores/CategoryRail.astro +0 -69
  184. package/skills/wix-headless/references/astro/templates/stores/ProductCard.astro +0 -79
  185. package/skills/wix-headless/references/astro/templates/stores/ProductPurchase.tsx +0 -397
  186. package/skills/wix-headless/references/astro/templates/stores/SeoTags.astro +0 -21
  187. package/skills/wix-headless/references/astro/templates/stores/back-in-stock.ts +0 -67
  188. package/skills/wix-headless/references/astro/templates/stores/categories.ts +0 -155
  189. package/skills/wix-headless/references/astro/templates/stores/category/[slug].astro +0 -130
  190. package/skills/wix-headless/references/astro/templates/stores/components-stores.css +0 -400
  191. package/skills/wix-headless/references/astro/templates/stores/products/[slug].astro +0 -128
  192. package/skills/wix-headless/references/astro/templates/stores/products/index.astro +0 -101
  193. package/skills/wix-headless/references/blog/BLOG_CONTENT.md +0 -161
  194. package/skills/wix-headless/references/blog/INSTRUCTIONS.md +0 -32
  195. package/skills/wix-headless/references/bookings/FLOW.md +0 -246
  196. package/skills/wix-headless/references/bookings/INSTRUCTIONS.md +0 -95
  197. package/skills/wix-headless/references/bookings/SERVICES_DATA.md +0 -355
  198. package/skills/wix-headless/references/cms/CMS_FOUNDATIONS.md +0 -176
  199. package/skills/wix-headless/references/cms/INSTRUCTIONS.md +0 -71
  200. package/skills/wix-headless/references/commands/known-apps.json +0 -6
  201. package/skills/wix-headless/references/custom/CONNECTION_PLAN.md +0 -142
  202. package/skills/wix-headless/references/custom/INSTRUCTIONS.md +0 -88
  203. package/skills/wix-headless/references/custom/blog/WIRING.md +0 -52
  204. package/skills/wix-headless/references/custom/bookings/WIRING.md +0 -197
  205. package/skills/wix-headless/references/custom/cms/WIRING.md +0 -97
  206. package/skills/wix-headless/references/custom/ecom/WIRING.md +0 -67
  207. package/skills/wix-headless/references/custom/forms/WIRING.md +0 -101
  208. package/skills/wix-headless/references/custom/stores/WIRING.md +0 -80
  209. package/skills/wix-headless/references/ecom/INSTRUCTIONS.md +0 -59
  210. package/skills/wix-headless/references/forms/INSTRUCTIONS.md +0 -43
  211. package/skills/wix-headless/references/gift-cards/INSTRUCTIONS.md +0 -51
  212. package/skills/wix-headless/references/images/INSTRUCTIONS.md +0 -357
  213. package/skills/wix-headless/references/seed-recipes.md +0 -49
  214. package/skills/wix-headless/references/shared/AGENTS_MD.md +0 -47
  215. package/skills/wix-headless/references/shared/AUTHENTICATION.md +0 -108
  216. package/skills/wix-headless/references/shared/BUILD_NOISE.md +0 -8
  217. package/skills/wix-headless/references/shared/DESIGN_MD.md +0 -84
  218. package/skills/wix-headless/references/shared/DOCS_SEARCH.md +0 -41
  219. package/skills/wix-headless/references/shared/IMAGE_GENERATION.md +0 -186
  220. package/skills/wix-headless/references/shared/IMPLEMENTER.md +0 -206
  221. package/skills/wix-headless/references/shared/PRODUCTION_SHARP_EDGES.md +0 -97
  222. package/skills/wix-headless/references/shared/RETURN_CONTRACT.md +0 -143
  223. package/skills/wix-headless/references/shared/STYLING.md +0 -140
  224. package/skills/wix-headless/references/stores/INSTRUCTIONS.md +0 -126
  225. package/skills/wix-headless/references/stores/PRODUCT_CATALOG_DATA.md +0 -252
  226. package/skills/wix-headless/references/verticals/_schema.json +0 -74
  227. package/skills/wix-headless/references/verticals/_schema.md +0 -95
  228. package/skills/wix-headless/references/verticals/blog.md +0 -31
  229. package/skills/wix-headless/references/verticals/bookings.md +0 -41
  230. package/skills/wix-headless/references/verticals/cms.md +0 -30
  231. package/skills/wix-headless/references/verticals/ecom.md +0 -25
  232. package/skills/wix-headless/references/verticals/forms.md +0 -26
  233. package/skills/wix-headless/references/verticals/gift-cards.md +0 -24
  234. package/skills/wix-headless/references/verticals/stores.md +0 -33
  235. package/skills/wix-headless/scripts/check-manifest.mjs +0 -335
  236. package/skills/wix-headless/scripts/compose.mjs +0 -520
  237. package/skills/wix-headless/scripts/emit-design-tokens.mjs +0 -157
  238. package/skills/wix-headless/scripts/flatten.sh +0 -61
  239. package/skills/wix-headless/scripts/generate-images.mjs +0 -242
  240. package/skills/wix-headless/scripts/patch-decorative-slots.mjs +0 -154
  241. package/skills/wix-headless/scripts/plan-entity-image-waves.mjs +0 -190
  242. package/skills/wix-headless/scripts/scaffold.sh +0 -139
  243. package/skills/wix-headless/scripts/seed-utilities.sh +0 -93
  244. package/skills/wix-headless/scripts/write-decorative-json.mjs +0 -62
  245. package/skills/wix-headless/shared-utilities/analytics.ts +0 -40
  246. package/skills/wix-headless/shared-utilities/ricos.ts +0 -179
  247. package/skills/wix-headless/shared-utilities/wix-image.ts +0 -72
@@ -0,0 +1,178 @@
1
+ # AI features — text, chat & embeddings (opt-in, all project types)
2
+
3
+ Add **generative-AI features** to a headless app using the **Wix AI APIs**: LLM text/chat completions
4
+ and text embeddings. Wix fronts the model providers (OpenAI, Anthropic) and handles auth + billing, so
5
+ you never hold a provider key. **For image generation, see `IMAGE_GENERATION.md`** — same gateway, same
6
+ rules; this file is text + embeddings and the rules that apply to *all* AI calls.
7
+
8
+ **Opt-in, by intent** — only build AI features when the intent calls for them (a support chatbot, AI
9
+ product descriptions, semantic search, summarization…). Like imagery, it's off by default; there's
10
+ no fixed slot list. **Status: Developer Preview** — the API shape can change; confirm models with
11
+ `/models` (below) rather than trusting a hardcoded list.
12
+
13
+ ## The one hard rule: AI runs server-side only
14
+
15
+ **Every AI call must be made from server code. Never from the browser.**
16
+
17
+ - A **visitor / member** identity (what a headless frontend holds in the browser) is **rejected** by
18
+ the gateway.
19
+ - The `@wix/ai` SDK **throws in browser environments** (*"AI calls from browser code are not supported.
20
+ Move your AI logic to backend code."*).
21
+
22
+ So the AI call always sits **behind a server boundary** — a Wix serverless/web-method backend
23
+ (managed), or the app's own server (self-managed/stripe). The browser calls *your* endpoint; your
24
+ endpoint calls Wix. That boundary is also where you enforce credits/abuse controls (see **Credits &
25
+ cost control**) — it's the security and billing perimeter, not optional plumbing.
26
+
27
+ ## Use the SDK (`@wix/ai`) — the path for app code
28
+
29
+ For the app you build (Astro-on-Wix, Node — any JS/TS server), **use the SDK**. It's built on the
30
+ [Vercel AI SDK](https://ai-sdk.dev) — typed, and auth is handled for you. **Backend only.**
31
+
32
+ ```bash
33
+ npm install @wix/ai "ai@>=6.0.26" "zod@>=4.1.8"
34
+ ```
35
+
36
+ ```js
37
+ // Wix-managed backend (Astro-on-Wix serverless / web method): auth is handled automatically.
38
+ import { generateText } from "ai";
39
+ import { openai } from "@wix/ai"; // also: anthropic, runware
40
+ const { text } = await generateText({ model: openai("gpt-5.2"), prompt: "…" });
41
+ ```
42
+
43
+ ```js
44
+ // Self-managed / stripe: pass an authenticated WixClient instead.
45
+ import { createOpenAI } from "@wix/ai";
46
+ import { createClient, AppStrategy } from "@wix/sdk"; // or ApiKeyStrategy
47
+ const openai = createOpenAI({ client: createClient({ auth: AppStrategy({ appId, appSecret, instanceId }) }) });
48
+ ```
49
+
50
+ `@wix/ai` exports `openai`, `anthropic`, `runware` (ambient, Wix-managed) and `createOpenAI`,
51
+ `createAnthropic`, `createRunware` (client-injected, self-managed). Methods come from `ai`:
52
+ `generateText` / `streamText`, `embed` / `embedMany`, `generateImage`. **Exact model selectors**
53
+ (verified — don't guess the method names):
54
+
55
+ - **Text:** `openai("gpt-5.2")` or `openai.responses(id)` / `openai.chat(id)`; `anthropic("claude-…")`.
56
+ - **Embeddings:** `openai.embeddingModel("text-embedding-3-small")` — **not** `textEmbeddingModel` (that
57
+ method doesn't exist and throws). Returns a `number[]` (1536 dims for `3-small`).
58
+ - **Images:** `runware.image("<air-id>")`. `generateImage` returns `{ image }` with `image.base64` +
59
+ `image.mediaType` — build a data URL (`data:${mediaType};base64,${base64}`) or import to Wix Media.
60
+ In `ai` v7 the fn may be exported as `experimental_generateImage`; fall back to it if `generateImage`
61
+ is undefined.
62
+
63
+ > **Runware via the SDK — model gotcha (verified):** `google:4@2` (Nano Banana) **fails via the SDK**
64
+ > ("Unknown Runware API error" — the Vercel provider injects params it rejects), even though it works
65
+ > on the raw REST proxy. Use **`bfl:5@1`** (FLUX.2 Pro) or **`runware:100@1`**. Runware is also
66
+ > **intermittently flaky** — wrap image calls in a **retry + model fallback** (`bfl:5@1` → `runware:100@1`)
67
+ > so a transient blip doesn't surface to the user.
68
+
69
+ **Wiring to the browser:** expose a **server route (or action) that returns plain JSON** and have the
70
+ browser `fetch` it — the AI runs in that route; the browser never touches the gateway.
71
+
72
+ ## Text & chat generation
73
+
74
+ ```js
75
+ import { generateText, streamText } from "ai";
76
+ import { openai, anthropic } from "@wix/ai";
77
+
78
+ const a = await generateText({ model: openai.responses("gpt-5.2"), prompt: "Invent a holiday." });
79
+ const b = await generateText({ model: anthropic("claude-sonnet-5"), prompt: "Tell me a story." });
80
+ // streamText(...) for token-by-token streaming to the client.
81
+ ```
82
+
83
+ ## Embeddings (semantic search, similarity)
84
+
85
+ ```js
86
+ import { embed, embedMany } from "ai";
87
+ import { openai } from "@wix/ai";
88
+ const model = openai.embeddingModel("text-embedding-3-small");
89
+
90
+ const { embeddings } = await embedMany({ model, values: products.map((p) => p.text) });
91
+ const { embedding } = await embed({ model, value: query });
92
+ // rank by cosine similarity; persist product vectors in a Wix Data collection to avoid re-embedding.
93
+ ```
94
+
95
+ ## Models — query, don't hardcode
96
+
97
+ `GET /{provider}/v1/models` is the **source of truth**. New provider models land on Wix a few days
98
+ after release; some ids are **date-stamped**. Tested-current picks (verify with `/models`):
99
+
100
+ - **OpenAI text**: `gpt-5.2`, `gpt-5.2-pro`, `gpt-5.1`, `gpt-5`, `gpt-5-mini`, `gpt-5-nano`, `gpt-4.1`,
101
+ `gpt-4.1-mini`, `gpt-4.1-nano`.
102
+ - **OpenAI embeddings**: `text-embedding-3-small` (1536), `text-embedding-3-large`, `text-embedding-ada-002`.
103
+ - **Anthropic**: `claude-opus-4-8`, `claude-sonnet-5`, `claude-opus-4-7`, `claude-sonnet-4-6`,
104
+ **`claude-haiku-4-5-20251001`** — the *dated* id. **`claude-haiku-4-5` (undated) → `400 Unsupported
105
+ model`**; use the dated id `/models` returns.
106
+
107
+ ## REST (provider pass-through) — when the SDK doesn't fit
108
+
109
+ Use REST if your backend **isn't JS/TS**, or when you want the **raw HTTP** API. The gateway is a
110
+ **transparent pass-through**: base URL `https://www.wixapis.com/{provider}/v1/...` with the
111
+ **provider's native request/response bodies** (model params, streaming, tool calls per the provider's
112
+ own docs). Authenticate with the skill's universal call shape (`SETUP.md` §1):
113
+
114
+ ```bash
115
+ curl -sS -X POST "https://www.wixapis.com/openai/v1/chat/completions" \
116
+ -H "Authorization: Bearer $TOKEN" -H "wix-site-id: $SITE_ID" -H "Content-Type: application/json" \
117
+ -d '{"model":"gpt-5-nano","messages":[{"role":"user","content":"Write a 1-line product tagline"}]}'
118
+ ```
119
+
120
+ Endpoints: OpenAI `POST /openai/v1/responses` · `/chat/completions` · `/embeddings`; Anthropic
121
+ `POST /anthropic/v1/messages`.
122
+
123
+ - **Anthropic requires `-H "anthropic-version: 2023-06-01"`.** Omitting it → `400 anthropic-version:
124
+ header is required` (the public doc's curl example omits it — don't copy that).
125
+ - **Streaming**: set `"stream": true` — response is SSE (`data:` lines), provider-native.
126
+ - `wix-site-id` is accepted-but-not-required for AI calls (the token is already site-scoped) — include
127
+ it for consistency with every other call in the skill.
128
+
129
+ ## Credits & cost control — the gap you MUST design for
130
+
131
+ **AI usage is billed to the site *owner's* account, never to the end user.** This is structural, not
132
+ a setting:
133
+
134
+ - AI credits belong to the **account's Premium plan**, shared across the whole account; monthly
135
+ allowance by tier, **no rollover** (free plan ≈ 30/day, 120/mo). Each call ≈ **1 credit** (varies
136
+ by model/size); the platform meters every call and **blocks when the account balance runs out**.
137
+ - Because every AI call runs under the **owner/app identity** (the only identity the gateway accepts),
138
+ **there is no per-visitor or per-member credit pool.** A visitor who triggers an AI feature spends
139
+ the *owner's* credits.
140
+
141
+ **Consequence:** any AI feature exposed to end-users (a public chatbot, "generate my bio", etc.) lets
142
+ anonymous traffic **drain the owner's credits** — and gives you no built-in way to attribute or cap
143
+ usage per end-user. The platform will not solve this for you. **The app must own a metering layer.**
144
+
145
+ When AI is exposed to end-users, build these into the **server boundary** — don't ship AI to end-users
146
+ without them:
147
+
148
+ 1. **Gate access** — require an authenticated member (or your own key) for anything that costs
149
+ credits; don't wire AI to a fully-open public route by default.
150
+ 2. **Rate-limit & quota per identity** — track calls per member/session/IP in a Wix Data/CMS
151
+ collection; **check-and-decrement before the AI call**, reject over quota (re-check after, since
152
+ the credit balance is account-wide).
153
+ 3. **Cap inputs** — bound prompt/`max_tokens`/`input` size; large requests cost more credits.
154
+ 4. **Cache / dedupe** — memoize identical prompts (product description for the same product, etc.);
155
+ static AI content is best computed **once, ahead of time** and stored, not regenerated per request.
156
+ 5. **Fail soft** — on a rejected/quota/insufficient-credits response, degrade gracefully (cached/canned
157
+ copy), never hard-error the page; surface cost transparently to the owner.
158
+
159
+ > If the user wants true **per-end-user AI budgets** (e.g. "each member gets N generations/month"),
160
+ > that is an **applicative feature to build** — a usage-ledger collection keyed by member, enforced
161
+ > server-side — because Wix bills only the owner and offers no per-visitor pool. Call this out to the
162
+ > user rather than implying the platform meters end-users.
163
+
164
+ ## Failure ladder
165
+
166
+ | Symptom | Cause → fix |
167
+ |---|---|
168
+ | Call rejected from the browser / with a visitor or member identity | **Move the call server-side.** AI never runs in the browser. |
169
+ | `403 Forbidden` (server identity) | Building a Wix **app**: add the `Invoke AI Models` permission to the app (see the AI-APIs doc). |
170
+ | `400 anthropic-version: header is required` | REST only — add `-H "anthropic-version: 2023-06-01"` (the SDK sets it for you). |
171
+ | `400 Unsupported model` | Use the exact id from `/{provider}/v1/models` (Anthropic ids are often date-stamped, e.g. `claude-haiku-4-5-20251001`). |
172
+ | `Unknown Runware API error` (images) | Transient, or the model rejects SDK params (`google:4@2`). Retry + fall back to `bfl:5@1` / `runware:100@1`. |
173
+ | insufficient credits / quota | Account is out of AI credits — degrade soft; tell the owner. |
174
+
175
+ ## See also
176
+ - `IMAGE_GENERATION.md` — image generation (Runware) via the same gateway.
177
+ - Live docs: `dev.wix.com/docs/api-reference/articles/ai-tools/ai-apis/about-the-wix-ai-apis` (+ `…/set-up-the-wix-ai-sdk`).
178
+ - Provider request/response params: OpenAI & Anthropic API references (the gateway is pass-through).
@@ -0,0 +1,84 @@
1
+ # Wix vertical index
2
+
3
+ A catalog of the Wix business verticals. It does two jobs:
4
+
5
+ 1. **Discovery** maps the user's words to the right vertical(s) — read every *Intent* line against what they asked for, and pick each vertical that genuinely fits.
6
+ 2. For the verticals this skill builds end-to-end, it also says **what a complete site for that vertical looks like** — the features it must have and the details that make it feel finished.
7
+
8
+ > **Read this against the operation — `create` vs `connect`.**
9
+ > - **Intent** matching (job 1) always applies — it picks the capabilities to install and seed, no matter the operation.
10
+ > - **Required site features** and **Implementation checklist** (job 2) describe a site **built from scratch** — they are the target for **`create`**, and they tell **backend-only** what to ask the host to build. They are **not a spec to impose on `connect`.** In `connect` the user brought a finished design; **wire only what that design actually needs** (e.g. a single wedding page with an RSVP → set up the RSVP and wire it; do *not* add an events-listing page or per-event pages just because the vertical's required-features list names them). Use the checklist there only as a soft hint for what an already-present surface should show — never to add surfaces the design doesn't have.
11
+
12
+ This file is **the what, never the how** — plain language only. No endpoints, methods, payloads, appDefIds, or SDK packages. The *how* lives in the live docs (Seed navigates the REST docs; the Handoff navigates the SDK docs); the *which apps to install* lives in `SETUP.md`.
13
+
14
+ Each built vertical has three parts (the latter two scoped to `create`/backend-only per the note above):
15
+
16
+ - **Intent** — the words that point to it.
17
+ - **Required site features** — the surfaces and capabilities the site must have to be usable. These are non-negotiable for a complete site; if one needs a backend feature switched on, Seed sets it up, and the Handoff tells the host to build the rest.
18
+ - **Implementation checklist** — the presentation details a finished site shows, so it doesn't feel half-built. The Handoff carries these into the guide it returns.
19
+
20
+ ## Built verticals — installed, seeded, and described in the Handoff
21
+
22
+ The verticals the skill operates end-to-end today: **stores · blog · cms · forms · events · bookings · pricing-plans · restaurants · portfolio** (with `forms` as the floor when nothing richer is named).
23
+
24
+ ### stores — sell products
25
+ - **Intent:** sell / shop / products / catalog / merch / store.
26
+ - **Required site features:** a product list or grid; a page per product; categories to browse by; a cart; a checkout.
27
+ - **Implementation checklist:** show each product's image, name, and price; show options and variants (size, colour…) where they exist; show availability / out-of-stock; a quantity picker and an add-to-cart that updates a visible cart; the product description; link each product to its category.
28
+
29
+ ### blog — publish posts
30
+ - **Intent:** blog / posts / articles / publication / news.
31
+ - **Required site features:** a list of posts; a page per post; categories or tags to browse by topic.
32
+ - **Optional (intent-gated):** reader **comments** on a post — build **only if the brief asks for discussion/interaction.** Comments hard-depend on members/login, so adding them unrequested drags in an unrequested login gate; they are **not** part of the baseline blog surface (see `inline-recipes/how-to-code-a-blog.md` §Comments).
33
+ - **Implementation checklist:** show the **author** (name and photo) on each post; show the publish date and the reading time; show the cover image; render the full formatted content — headings, images, quotes, lists — not flattened to plain text; show the post's category and tags; a clear path back to the full list.
34
+
35
+ ### cms — structured content collections
36
+ - **Intent:** collection / directory / portfolio-as-data / structured content / "persist my app's data".
37
+ - **Required site features:** an index/list view of the collection; a detail page per item. (Visitor reads are public; visitor writes go through a form.) **(Opt-in, with members)** when the brief asks for per-user-private data ("my saved items", a personal list) or member-only content **and** members login is in the run, a collection can instead be **member-scoped** — each member sees/edits only their own rows, or any logged-in member reads shared member-only content. Added only on that intent, never by default; see the members cross-cutting entry and `setup-cms.md`.
38
+ - **Implementation checklist:** show each item's main fields with clear labels; link the list to each item's detail page; show a sensible empty state when there are no items yet.
39
+
40
+ ### forms — capture leads
41
+ - **Intent:** contact / lead / signup / waitlist / "let people reach me" / generic custom data capture / nothing dynamic named. **Not for RSVP** — confirming attendance to an event or occasion (a wedding, party, or gathering) is the **events** vertical, which has a built-in RSVP registration form; route there even when it's a single occasion with no tickets. Use `forms` only when no event is involved.
42
+ - **Required site features:** a visible form; a confirmation after submitting; basic field validation.
43
+ - **Implementation checklist:** render every field with a clear label; mark which fields are required; a clear submit button; show a thank-you / success state after sending; show a friendly message if the submit fails.
44
+
45
+ ### events — events and registration
46
+ - **Intent:** event / ticket / RSVP / registration / attendees / "confirm attendance" / a wedding, party, or gathering people respond to. **Covers RSVP to a single occasion** (one wedding, one party) — not only multi-event listings, and not only ticketed events. An invitation with an RSVP is this vertical, not `forms`.
47
+ - **Required site features:** the event's details and a way to register or RSVP. **RSVP events come with a built-in registration form** (name + email are always included), so the site needs an RSVP action — *not* a hand-built form with custom fields. For a multi-event site, also a list of events and a page per event.
48
+ - **Implementation checklist:** show the event's title, date and time, and location; show the description; show ticket types where they exist (ticketed events); a register/RSVP action; collect additional-guest names where extra guests are allowed; a confirmation after registering.
49
+
50
+ ### bookings — appointments and classes
51
+ - **Intent:** book / appointment / schedule / class / session / reserve a slot / reserve a table.
52
+ - **Required site features:** a list of services; a page per service; a way to pick a time and book it.
53
+ - **Implementation checklist:** show each service's name, duration, and price; show the staff or provider; show the available time slots; a book action; a confirmation after booking.
54
+
55
+ ### pricing-plans — memberships and subscriptions
56
+ - **Intent:** membership / subscription / plans / paid tiers.
57
+ - **Required site features:** a plans / pricing page; a way to choose and subscribe to a plan. **Subscribing requires a logged-in member** — the plans grid is public, but the *subscribe* action and any *my subscription* surface need the **members** cross-cutting capability (below); it's a hard dependency, not optional.
58
+ - **Implementation checklist:** show each plan's name, price, and billing cycle; list what each plan includes (the perks); a clear "choose plan" action; highlight a recommended tier where it makes sense.
59
+
60
+ ### restaurants — menus and food
61
+ - **Intent:** menu / restaurant / cafe / food / dish list / order food / dine-in.
62
+ - **Required site features:** a menu organized into sections; each item with a name, description, and price. (Online ordering and table reservations are optional add-ons — separate apps; see `SETUP.md`.)
63
+ - **Implementation checklist:** show the menu grouped into sections in order; each item's name, description, price, and labels (vegan, spicy…) and modifiers / variants where they exist; an order action if online ordering is wired; a reserve-a-table action if reservations are wired.
64
+
65
+ ### portfolio — showcase projects
66
+ - **Intent:** portfolio / showcase / gallery of projects / creative work / case studies.
67
+ - **Required site features:** a gallery of projects; projects grouped by collection; a page per project.
68
+ - **Implementation checklist:** show each project's cover, title, and description; group / filter by collection; on the project page show its details (role, year…) and media in order with a viewer / lightbox; a clear path back to the gallery. (Text-only seed shows the structure; media is omitted.)
69
+
70
+ ## Cross-cutting capabilities — usable, but ride on a parent vertical
71
+
72
+ These are **not standalone verticals** — they aren't seeded on their own and don't go in `verticals[]`. Most have no app to install (eCommerce installs as a dependency; coupons need no install; members' identity layer is the OAuth app). But they **are fully usable**, and the agent should reach for them when a built vertical is present and intent calls for them. They attach to whatever catalog vertical the run already set up. Don't list these as "not-yet-wired" — they're wired *through* their parent. (One conditional install exists: the **members** *profile* layer needs the Wix Members Area app — see its entry and `SETUP.md`.)
73
+
74
+ - **eCommerce** — the shared cart, checkout, orders, and payments layer. It has no catalog of its own; it's **installed automatically as a dependency** by Stores, Bookings, and Events, and it's how every purchase actually completes. The frontend uses it via `@wix/ecom` (+ `@wix/redirects`) — already carried in the Handoff for those verticals. Reach for the eCommerce Cart/Checkout APIs (find the *how* in the docs) whenever a purchase flow needs to be built or customized. *Intent: checkout / cart / "let people buy".*
75
+ - **coupons** — discount codes and promotions applied at checkout. **No standalone app** — requires a parent already installed (stores / bookings / events / pricing-plans). When intent calls for discounts and such a parent is present, **create coupons on demand** scoped to that parent — find the create method in the docs (`DOC_DISCOVERY.md`) and surface `@wix/marketing` in the Handoff. *Intent: coupon / promo code / discount.*
76
+ - **members** — the **identity layer**: member sign-up / log-in / log-out and member-gated surfaces. **Not seeded, and login needs no app install** (it's the headless OAuth app) — so it doesn't go in `verticals[]`. **Reading member profile data** (name / photo / roles / badges, an editable my-account page), however, needs the **Wix Members Area app installed** (`SETUP.md`) — keep the identity layer and the profile layer separate. Sign-up and log-in are the **same** mechanism (one login page logs in *or* registers). Two things vary. **(1) The frontend axis** — Astro ships built-in `/api/auth/login` routes, non-Astro drives a manual `OAuthStrategy` handshake (the two `how-to-code-members-*.md` recipes). **(2) The login *surface*, chosen by intent — not by project type.** The default is the **Wix-hosted login page** (zero UI to build); reach for a **custom login page** (you build a branded/in-app form, and can collect custom sign-up fields like full name / username / address) **only when the brief explicitly asks for a custom login form or custom sign-up fields** (`how-to-code-members-custom-login.md`). Custom login works on **any** project type (managed or self-managed) — the choice is the user's stated intent, so don't gate it on managed-vs-self-managed. **Hard dependency edge → pricing-plans**: subscribing to a plan requires a logged-in member, so whenever `pricing-plans` is present, members is implied (surface login + my-subscription). **Soft edges** to the other verticals' "my …" surfaces (my orders / my bookings / my registrations) and to **blog comments** (see the blog recipe) — the action runs as an anonymous visitor; only the account view of it needs a member. A logged-in member reading **their own** data needs **no `auth.elevate`** (that's the separate admin/permission axis). *Intent: login / sign up / account / my profile / members area / member-only / gated content / subscriber / paywall — plus any pricing-plans intent (membership / subscription / paid tiers), which can't be purchased without it.*
77
+
78
+ ## Other verticals — recognized for intent, not yet wired
79
+
80
+ If a user's intent points squarely at one of these, surface it plainly as **not-yet-wired** rather than forcing a poor fit. Extending the skill to one means adding its install in `SETUP.md` and its seed *what* in `SEED.md`, then giving it a full section above. Each entry below names the **blocker** that kept it out — read it before promising anything. Where an API path genuinely exists, the agent **may wire it ad hoc from the live Wix docs** (find the REST create method via `DOC_DISCOVERY.md`, and the SDK module as in `SDK_HANDOFF.md`), but it must state the blocker honestly rather than promise a complete site.
81
+
82
+ - **forum** — community discussion boards: categories, threads, member posts. **Deprecated** — the Forum APIs are being discontinued and there's no headless create-post path; the Groups replacement exposes no public create-post API. Don't wire; if discussion is essential, suggest blog comments or a custom solution. *Intent: forum / community / discussion board.*
83
+ - **benefit-programs** — Wix Loyalty: points, rewards, and tiers that grant members perks. **Program activation is dashboard-only** — it can't be fully bootstrapped headlessly — but once loyalty is active, rewards/tiers have REST/SDK (`@wix/loyalty`) the agent can seed from the docs. *Intent: loyalty / rewards / member perks / benefits.*
84
+ - **suppliers-hub** — supplier-side B2B product catalog management. **Partner-only** — requires a signed business agreement with Wix and isn't installable on a normal metasite; out of scope unless the user is an approved Wix partner. *Intent: supplier / wholesale / B2B catalog.*
@@ -1,76 +1,54 @@
1
- # Discovery
1
+ # Discovery — infer, don't interview
2
2
 
3
- Capture brand + vibe + imagery + the per-vertical intent inferred from the user's prompt, present a slim plan, get approval, hold the captured contract in orchestrator scratch.
3
+ The run starts here. **Infer** the Wix capability set, the brand, and per-capability intent from the user's words (and, optionally, the project on disk). Inference is just the first step — its output **drives Setup (install apps) and Seed (create content)**, which are the actual work; flow straight through into them. The host already has the user's buy-in to add Wix, so resolve everything from what's given and keep moving; when something isn't specified, use the defaults below.
4
4
 
5
- Infer as much as possible from the user's opening message; ask only what's genuinely unknown. Target: **~1:30 of discovery** including user think-time, **≤ 80 s** excluding it.
5
+ Discovery is pure inference — it needs **no authentication** and is **agnostic to the project type**. The token and metasite id are obtained later, at Setup, via the provided authentication mechanism.
6
6
 
7
- This phase owns the *domain* of discovery only. Run FLOW — when background work is dispatched, what waits on what, batching, and the transition into Setup/Seed — is owned by `references/PLAN.md` (pre-approval, which routes on **operation** to `PLAN-create.md` / `PLAN-connect.md`) and `references/BUILD.md` (post-approval, which routes on **framework**).
7
+ ## 1 · Resolve the capability set
8
8
 
9
- **This file is the discovery router, and it routes on OPERATION.** It holds the two things every run does regardless of operation — **Wave 0 field resolution** and the **CLI-auth pre-flight** — then opens the operation-specific discovery file. The actual interview/parse + plan content lives in `DISCOVERY-create.md` (create) or `DISCOVERY-connect.md` (connect). Read only the matching one.
9
+ Read the **user intent** (+ optional project signals: `package.json` name, README, visible copy) against the vertical index in `references/CAPABILITIES.md` — each entry there carries the intent signals that point to it. Pick every vertical that genuinely fits → `verticals[]`. Multiple signals → multiple capabilities. On ambiguity, prefer the more specific vertical; if nothing dynamic is named, fall to the **forms** floor (a contact form). **Never return an empty set.**
10
10
 
11
- ## Wave 0 — Resolve `operation`, then `frontend` (BEFORE any user-facing question)
11
+ Resolve to the skill's operational set — **stores · blog · cms · forms · events · bookings · pricing-plans · restaurants · portfolio** (`CAPABILITIES.md` § "Built verticals"). If intent points squarely at a vertical outside that set, note it plainly as not-yet-wired (per the index) and resolve the rest; don't force an unrelated capability in its place.
12
12
 
13
- Discovery routes on **operation** — *create* (the skill writes a new site from a prompt) vs *connect* (the user brings a finished design to wire to Wix). Resolve `operation` **first** from the user's prompt AND the working directory, then derive `frontend` (and `frontendBuild`) *within* that operation. Operation and framework are **orthogonal axes**: `frontendBuild` (`wix`/`none`/`own`) is derived inside the chosen operation, not implied by it — *create + framework-keyword* → `own`, *connect + SPA* → `own`, *connect + static HTML* → `none`, *create + default* → `wix`. Resolving operation first (then framework within it) is the seam that keeps the operation router untouched as frameworks are added (the framework-SPA plan; the extend plan).
13
+ ## 2 · Infer brand
14
14
 
15
- > **Intent is primary; the directory only confirms.** The bug to avoid: an *empty* CWD does **not** automatically mean create. If the prompt brings a design to connect — even one that will be **fetched into the empty dir** — it's connect. Read the prompt first.
15
+ A short brand object for seeded-content naming: `{ name, description, vibe? }`. Source from the intent text and any project signals (the package name, a README title/tagline, headline copy). If nothing is available, derive a neutral name from the project directory. This is only used to make seeded content read naturally — keep it light.
16
16
 
17
- ```
18
- Read the prompt, then inspect CWD — resolve OPERATION:
17
+ ## 3 · Derive per-capability intent
19
18
 
20
- 1. CONNECT/IMPLEMENT-AN-EXISTING-DESIGN intent in the prompt → operation: connect,
21
- EVEN IF THE CWD IS EMPTY. Signals: "connect this to wix", "implement this design",
22
- "host/deploy this site", "this is a working site", or a design-file URL to fetch +
23
- implement (Claude Design / v0 / Lovable / any tool). The design arrives by fetch into
24
- the empty dir — emptiness at check time does not make it create.
25
- 2. CWD already contains a working frontend (`index.html`, `*.html`, `*.jsx`/`*.tsx`/`*.vue`,
26
- a design-handoff bundle) → operation: connect — connect the brought-in site.
27
- 3. CWD contains `wix.config.json` → an existing wix-headless project (resume/extend; see
28
- SKILL.md § "When NOT to use this skill" — out of pivot scope for now; the extend plan
29
- adds `operation: extend` here, ahead of the emptiness tests).
30
- 4. Otherwise — empty CWD AND a CREATE-A-NEW-SITE prompt ("build me a store", "I want to
31
- sell tables online", "make a blog") with no design to connect → operation: create.
32
- ```
19
+ For each capability, build its `intent.<cap>` block — the inputs the seed step translates into REST calls. Use sensible brand-appropriate defaults when the user didn't specify counts:
33
20
 
34
- Then derive `frontend` and `frontendBuild` **within** the chosen operation, and capture all three in session scratch (the Plan→Build contract core, `PLAN.md` § "The Plan→Build contract"):
21
+ | Capability | `intent.<cap>` shape | Defaults when unspecified |
22
+ |---|---|---|
23
+ | stores | `{ productCount, categoriesNamed: [] }` | `productCount: 3`, `categoriesNamed: []` (no categories) |
24
+ | blog | `{ postCount, topics: [] }` | `postCount: 3`, topics derived from `brand.description` |
25
+ | cms | `{ collections: [{ name, purpose, itemCount, fields? }] }` | one collection inferred from intent, `itemCount: 5` |
26
+ | forms | `{ forms: [{ purpose, fields: [...] }] }` | one `contact` form: name, email, message |
27
+ | events | `{ eventCount, titles: [] }` | `eventCount: 2`, titles brand-derived, future dates |
28
+ | bookings | `{ serviceCount, servicesNamed: [] }` | `serviceCount: 2`, brand-derived service names |
29
+ | pricing-plans | `{ planCount, tiersNamed: [] }` | `planCount: 2` (e.g. Basic / Pro), monthly billing |
30
+ | restaurants | `{ menuName, sections: [{ name, itemCount }] }` | one menu, 2 sections, `itemCount: 3` each |
31
+ | portfolio | `{ collections: [{ name }], projectCount }` | one brand-derived collection, `projectCount: 3` |
35
32
 
36
- > **Within `create`, branch `frontendBuild` on an explicit framework keyword.** A create prompt that **explicitly names a client-build framework** — `vite`, `react`, `vue`, `svelte`, "SPA", or similar (the same keyword set the connect SPA detector uses) — resolves to **`frontend: custom`, `frontendBuild: own`** (scaffold that framework, then connect via the SPA spine). A create prompt with **no** framework keyword stays **`frontend: astro`, `frontendBuild: wix`** — astro remains the default for a bare *"create a bakery site"*. **Only an explicit keyword flips it** — never infer a framework the user didn't ask for. A framework keyword on a *connect* prompt still routes to connect (the brought-in SPA), per `DISCOVERY-connect.md` § 1.5.
33
+ Counts are deliberately small (the seed shows the shape, not a full catalog).
37
34
 
38
- | `operation` | `frontend` | `frontendBuild` | Wave 0 next |
39
- |---|---|---|---|
40
- | `connect` — connect/implement an existing design, OR a working site on disk | `custom` | `none` (static HTML) **or** `own` (framework SPA) — resolved from disk in `DISCOVERY-connect.md` § 1.5 | Pre-flight, then **`DISCOVERY-connect.md`** |
41
- | `create` — create-a-new-site prompt, **no** framework keyword (the default) | `astro` | `wix` | Pre-flight, then **`DISCOVERY-create.md`** (astro branch) |
42
- | `create` — create-a-new-site prompt that **explicitly names a client-build framework** (*"…using vite"*) | `custom` | `own` | Pre-flight, then **`DISCOVERY-create.md`** (own branch — minimal scaffold; runs vibe + Designer for brand tokens, but not astro `compose.mjs`) |
35
+ ## 4 · Imagery (opt-in)
43
36
 
44
- > **No `AskUserQuestion` for operation/frontend detection.** They are inferred from the prompt + directory, never asked. When intent is unclear, default to `operation: connect` — connecting/implementing what the user brings is the safe interpretation; creating a brand-new site over their intent is the destructive one. **A prompt that fetches or names a design to "connect"/"implement" is `connect` regardless of whether the CWD is empty.**
37
+ Resolve an `imagery` flag — whether to generate AI images for seeded content (and, when building a frontend, for page surfaces). **Default OFF** (text-only): seed with no imagery; the user can add images later.
45
38
 
46
- These flow into:
47
- - The **Plan→Build contract** held in orchestrator scratch (`PLAN.md` § "The Plan→Build contract"). `frontend`, `operation`, and `frontendBuild` all live in scratch — **none** is persisted to disk. The conductor reads `frontendBuild` from scratch to decide whether to run `wix build` before release — `wix` builds, `none` doesn't.
48
- - **Bootstrap is (operation × framework)-keyed** (`BUILD.md` § "Bootstrap cell"): create+astro runs `scaffold.sh --frontend astro`; create+own runs the framework's own create command (`npm create vite`/…) then `init`; connect (own/none) does **not** scaffold — it bootstraps via `npm create @wix/new@latest init` over the brought-in/scaffolded source.
49
- - Orchestrator session scratch — every downstream branch reads the scratch values. For `connect`, the frontend track runs the connect flow (`references/custom/INSTRUCTIONS.md`); the create-only project-prep (`seed-utilities.sh`) and the Designer/Composer do not run. (Business-track steps — app install, seeders — never read these fields.)
39
+ - If the prompt **signals imagery** ("with photos", "product photos", "AI images", "hero image"), set `imagery: on`.
40
+ - Otherwise **ask one question** — text-only (default) vs AI-generated images, noting it costs ~1 Wix AI credit per image. Default to off on no answer.
50
41
 
51
- ## Pre-flight — Verify CLI auth (BEFORE any user-facing question)
42
+ **Bound the *cost*, not just the on/off decision.** `imagery: on` authorizes the *feature*, not unlimited *volume* — a single "imagery throughout" phrase can otherwise fan out to dozens of images (≈1 Wix AI credit each) with the spend never surfaced. So when imagery resolves on:
52
43
 
53
- The first Wix touch is the post-approval project bootstrap — create/astro: `scaffold.sh` → `npm create @wix/new@latest headless`; connect: `npm create @wix/new@latest init` — which creates a business + project against the user's Wix account and so requires an active CLI session. Without one it fails — and because the bootstrap runs **after** approval (`BUILD-astro.md` run-step 0 / the connect bootstrap cell, `BUILD.md` § "Bootstrap cell"), a logged-out user wouldn't find out until they'd done discovery *and* approved, only to have it fail immediately. Run the auth check foreground here (both operations) so a logged-out user sees the login prompt first.
44
+ - **Surface the projected cost** in the brief pre-work line (§5): state the plan in credits — *"~N images ≈ N Wix AI credits"* — so the spend is visible even when nobody asked about volume. Always safe, no interactivity.
45
+ - **Apply a per-run image cap** (`imageCap`, default **~12**). Generate up to the cap; for surfaces/entities beyond it, render the **themed-block fallback** instead of generating (see below). Log what was capped so it's not silently dropped.
46
+ - **Confirm only when interactive *and* over the cap** — never a mandatory "always ask" gate. A non-interactive run honors the cap and fills the rest with themed blocks; it never stalls.
54
47
 
55
- ```bash
56
- npx @wix/cli@latest whoami >/dev/null 2>&1
57
- ```
48
+ **Themed-block fallback (the not-generating path).** Whenever an image is *not* generated — imagery off, over the cap, declined, or a generation failure — a **frontend** image slot renders a **styled `div` that follows the site's own design tokens** (palette, radius, spacing, maybe a label or gradient), *not* an empty slot or a broken `<img>`. The layout stays intentional and on-brand at **zero credits**, and it's deterministic/headless-safe. (This applies to page surfaces; a *seeded entity* with no image simply stays text-only — `SEED.md` § "Entity images".)
58
49
 
59
- - Exit 0 → open the matching operation discovery file (create → `DISCOVERY-create.md` Step 0; connect → `DISCOVERY-connect.md`).
60
- - Exit non-zero → **run `npx @wix/cli@latest login` yourself; do NOT punt to the user.** Steps:
61
- 1. `Bash` tool with command `npx @wix/cli@latest login`, `run_in_background: true`. No shell `&`, no `mktemp` redirect, no chaining.
62
- 2. Read the harness output-file path from the tool reply's `<bash-stdout>` (or use `TaskOutput`).
63
- 3. Parse line 1 for `{"event":"awaiting_user","userCode":"…","verificationUri":"…"}` (ignore any `TimeoutNaNWarning` on later lines).
64
- 4. Surface in one plain-prose message — *not* `AskUserQuestion`: *"Open `<verificationUri>` in your browser and enter the code `<userCode>` — I'll continue once you've completed the login."*
65
- 5. Wait for the harness `task-notification` with `<status>completed</status>`; confirm with `whoami`, then open the matching operation discovery file.
50
+ When `imagery` is on, `SEED.md` attaches images to seeded entities and `IMAGE_GENERATION.md` is used for any page images a frontend build calls for (including the cap + themed-block mechanics). Hold `imageCap` alongside `imagery` in scratch. This flag is project-type-agnostic.
66
51
 
67
- Full recovery reference: [`shared/AUTHENTICATION.md`](shared/AUTHENTICATION.md#wix-login-from-a-non-interactive-agent).
52
+ ## 5 · Hold the contract, proceed
68
53
 
69
- ## Next — open the operation-specific discovery
70
-
71
- With `operation` (and the derived `frontend`/`frontendBuild`) resolved and auth confirmed:
72
-
73
- - **`create`** → `DISCOVERY-create.md` — the interview (Steps 0–2.5) → plan → approval → hold the contract in scratch.
74
- - **`connect`** → `DISCOVERY-connect.md` — parse the brought-in site → infer domain → light plan → approval → hold the contract in scratch.
75
-
76
- Read only the matching file. The pre-approval funnel (`PLAN-create.md` / `PLAN-connect.md`) names *when* to apply each discovery step.
54
+ Hold in scratch: `verticals[]`, `brand`, `intent.<cap>` per capability, and `imagery`. The metasite id (`SITE_ID`) and the token are obtained at Setup via the provided authentication mechanism. Then **continue to `SETUP.md`** and install the apps — this is the start of the actual work, not a separate decision. A brief plain-prose line stating what will be set up is fine.
@@ -0,0 +1,37 @@
1
+ # Doc discovery — the shared fallback (seeding *and* code-writing)
2
+
3
+ You're here because a **pinned** page or recipe didn't cover what you need — a field, an endpoint,
4
+ an error, or an unpinned method. Doc discovery is the **fallback for both tracks**, never the first
5
+ move:
6
+
7
+ - **Seeding** → read the capability's **inline recipe** — `inline-recipes/setup-*.md`, mapped in
8
+ `SEED.md` § "What to seed per capability". Each built capability is a **self-contained local recipe** that inlines the calls
9
+ and **supersedes** the REST doc pages — seed from it alone. Only a capability with **no** inline
10
+ recipe (e.g. `coupons`) discovers from the live docs (below).
11
+ - **Code-writing** → try the pinned pages in `astro.md` / `non-astro.md` + `inline-recipes/*`.
12
+ - Only when those fall short, discover from the live docs (below).
13
+
14
+ The **`wix-docs`** skill is the full playbook (`../wix-docs/SKILL.md` when co-installed). The short
15
+ version:
16
+
17
+ **1. Find a page — semantic `curl` search (no MCP required):**
18
+
19
+ ```bash
20
+ curl -sS -X POST 'https://www.wixapis.com/mcp-docs-search/v1/docs/search/markdown' \
21
+ -H 'Content-Type: application/json' \
22
+ --data-raw '{"search_term":"<what you need, in natural language>","document_type":"WIX_HEADLESS","maximum_results":3}'
23
+ ```
24
+
25
+ `document_type`: `SDK` / `WIX_HEADLESS` for code-writing, `REST` / `BUSINESS_SOLUTIONS` for seeding
26
+ (also `VELO` · `WDS` · `BUILD_APPS` · `CLI`). Drop `/markdown` for JSON hits.
27
+
28
+ **2. Read a page** — append `.md` to its docs URL. **For an SDK shape, append `.md?apiView=SDK`** —
29
+ the SDK view shows `_id` (what the frontend calls), the bare view shows `id`.
30
+
31
+ **3. Exact structured schema / enums (no MCP)** — `POST https://mcp.wix.com/api/code-mode/search`
32
+ with `getResourceSchemaByUrl(docsUrl)` (see `wix-docs`'s `API_SPEC_SEARCH.md`).
33
+
34
+ **If the host has the Wix MCP**, its `SearchWix*` / `SearchWixAPISpec → getResourceSchemaByUrl`
35
+ tools are richer (whole-resource schema in one payload) — prefer them, per `wix-docs` Lane 2.
36
+
37
+ **A page that IS pinned → read it directly; don't re-search for it.**
@@ -0,0 +1,118 @@
1
+ # Feedback — relay the user's building-with-Wix experience to Wix
2
+
3
+ A tiny, optional capability: send the **user's** feedback about the experience of *building with
4
+ Wix* to Wix, attributed to the authenticated user. Use it to close the loop when the skill itself,
5
+ the APIs, the docs, or the tooling got in the user's way — the signal is how Wix improves the
6
+ building flow.
7
+
8
+ This is **not** support, and not for the user's own site content. It is meta-feedback about
9
+ *building with Wix*.
10
+
11
+ ## When to offer it (user-approved only — never auto-send)
12
+
13
+ Sending is always the user's call. Offer once, in plain prose, in any of these situations; send only
14
+ after an explicit yes:
15
+
16
+ - The user **explicitly asks** to send feedback / report something to Wix ("tell Wix that…", "report
17
+ this", "send feedback"). Then just confirm the wording and send.
18
+ - The user **complains, is frustrated, or reports a Wix bug** in the course of the work ("this API is
19
+ broken", "the docs are wrong", "why is this so hard"). Acknowledge, then offer to pass it on.
20
+ - **The run hit substantial friction** — repeated API failures, wrong/missing docs, a tooling dead
21
+ end, or a workaround you had to invent. When you notice the pattern, offer: *"This tripped us up a
22
+ few times — want me to send it to Wix as feedback?"*
23
+
24
+ When you offer, invite the user to add anything in their own words — whatever they give you goes
25
+ into the message verbatim, in its own "In the user's words" section.
26
+
27
+ Do **not** send on a single transient error, on the user's behalf without a yes, or more than once
28
+ for the same issue. When unsure, ask rather than send.
29
+
30
+ ## Compose a useful message
31
+
32
+ Wix receives only free text, so a bare sentence is low-signal. Send a
33
+ **summary of the whole run**, not just the last error — you have the full session context that Wix
34
+ does not. Structure it in three layers — **provenance → narrative → attribution** — so Wix can
35
+ triage and route without chasing you.
36
+
37
+ **1. Provenance** — labelled lines. A starting point, not a schema: omit lines that don't apply,
38
+ add any field or value that would help Wix understand the run:
39
+
40
+ ```
41
+ Agent / model: <e.g. Claude Code · Opus, Cursor, … / whatever you are>
42
+ Wix tooling used: <MCP tools, Wix CLI, REST via curl, … or other/none>
43
+ Platform / hosting: <headless, Velo, Wix-hosted, self-hosted, …>
44
+ Wix areas / APIs: <account & site management, CMS, media, auth, … — whatever the run touched>
45
+ Wix products: <stores, bookings, events, blog, … or none — plain API work is a valid answer>
46
+ Project type / frontend: <managed | self-managed | stripe | other> · <Astro, Next.js, …>
47
+ Metasite / siteId: <id> · Public clientId (app id): <id>
48
+ Links: <any relevant URL helps — dashboard/editor, live or preview site, a docs page you read, a GitHub repo/PR, anything else useful>
49
+ Skill area(s): <recipe/file(s) involved, e.g. inline-recipes/setup-bookings.md STEP 5>
50
+ Other ids: <service / product / checkout / etc. ids created this run, as relevant>
51
+ ```
52
+
53
+ **2. Narrative:**
54
+
55
+ - **In the user's words** — anything the user added when you offered, quoted verbatim (redact
56
+ secrets only). Skip the section if they added nothing.
57
+ - **User intent + run summary** — what the user set out to build and the arc of the session in a
58
+ few sentences: what worked cleanly vs. what fought back.
59
+ - **Conversation & agent flow** — a condensed play-by-play of how the session actually unfolded:
60
+ the key user ↔ agent exchanges, and your own path through them — tool calls made, responses
61
+ received, decisions taken and course-corrections. Distilled, not a transcript dump — enough for
62
+ Wix to replay the flow.
63
+ - **Friction points** — the heart of it. Walk the flow and list every place something got in the
64
+ way, each with specifics: the step/endpoint, the HTTP status and error message, the gap, the
65
+ workaround you had to invent, and what you expected instead (minimal repro where there is one).
66
+ Include the ones you recovered from — a silent retry that eventually worked is exactly the
67
+ signal Wix wants.
68
+
69
+ **3. Attribution** — for each significant friction point, your best diagnosis of where the fault
70
+ lives, tagged with one of: **API behavior** (does the wrong thing) · **API schema** (shape/types
71
+ wrong or misleading) · **API reference docs** · **docs articles / examples** (missing, wrong, or no
72
+ working example) · **Wix harness** (CLI, MCP tools, auth flow…) · **this skill's recipes** ·
73
+ **other / unsure** — plus whether you *confirmed* it or are *assuming*. Don't force a tag; a wrong
74
+ route is worse than "unsure".
75
+
76
+ **Bottom line** — one or two sentences naming the single most important problem and its impact.
77
+ Lead with what was worst and don't soften it, bury it under what worked, or hedge diplomatically —
78
+ but keep a **professional register**: a concise engineering assessment, not a persona, jokes, or
79
+ theatrics.
80
+
81
+ Write it as a scannable few paragraphs or a short bulleted list — thorough on the friction, distilled
82
+ from the conversation rather than a raw transcript dump, and professional throughout. Confirm the
83
+ final wording with the user before sending. **Never include secrets** — no bearer tokens, refresh
84
+ tokens, API keys, or credentials — and no personal data beyond what the feedback needs.
85
+
86
+ ## Send it
87
+
88
+ This call identifies **you** (the human account), so it needs a **user-scoped** bearer — mint it
89
+ with the bare command: `npx @wix/cli@latest token`. The site-scoped bearer `AUTHENTICATION.md`
90
+ mints for the content APIs (`token --site …`) carries a `metaSiteId`, so the feedback service
91
+ resolves it to the site's app/visitor identity and rejects the send as anonymous (the `500` case
92
+ below). Send the bearer alone — the `Authorization` header is the only one this call needs beyond
93
+ `Content-Type`. If the CLI isn't logged in yet (e.g. feedback comes up before any site exists),
94
+ authenticate first (`AUTHENTICATION.md` §1), then run `token`.
95
+
96
+ ```bash
97
+ TOKEN=$(npx @wix/cli@latest token) # bare token command → user-scoped bearer
98
+ curl -sS -w "\nHTTP_STATUS:%{http_code}" \
99
+ -X POST "https://www.wixapis.com/mcp-serverless/v1/headless-feedback" \
100
+ -H "Authorization: Bearer $TOKEN" \
101
+ -H "Content-Type: application/json" \
102
+ -d '{"message":"<composed feedback>"}'
103
+ ```
104
+
105
+ - **Success = `HTTP_STATUS:200`** with an empty body `{}`. Tell the user it was sent.
106
+ - **`500` `"Unable to determine target user id, anonymous messages are not allowed"`** — the token
107
+ was site-scoped. Re-mint user-scoped (`npx @wix/cli@latest token`, bare) and retry once.
108
+ - **`401`/`403`** — the CLI session expired or the token isn't user-identifiable; re-authenticate
109
+ (`AUTHENTICATION.md` §1), re-mint user-scoped, retry once. If it still fails, surface the response
110
+ and stop — do not loop.
111
+
112
+ ## Hard rules
113
+
114
+ - ✅ Offer proactively whenever the run warrants it; send only after an explicit user yes.
115
+ - ✅ One submission per issue; never spam with retries or duplicates.
116
+ - ✅ Compose a specific, factual message; confirm the wording first.
117
+ - ❌ Never include tokens, secrets, credentials, or unnecessary personal data in the message.
118
+ - ❌ Never use this for the user's site content or as a support channel — it's feedback about the experience of building with Wix.