@wix/agent-skills 1.13.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 (250) 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 -244
  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/Footer.astro +0 -27
  157. package/skills/wix-headless/references/astro/templates/Layout.astro +0 -132
  158. package/skills/wix-headless/references/astro/templates/Navigation.astro +0 -38
  159. package/skills/wix-headless/references/astro/templates/astro.config.mjs +0 -41
  160. package/skills/wix-headless/references/astro/templates/bookings/AvailabilityCalendar.tsx +0 -374
  161. package/skills/wix-headless/references/astro/templates/bookings/BookingForm.tsx +0 -136
  162. package/skills/wix-headless/references/astro/templates/bookings/SeoTags.astro +0 -25
  163. package/skills/wix-headless/references/astro/templates/bookings/ServiceBookingFlow.tsx +0 -71
  164. package/skills/wix-headless/references/astro/templates/bookings/ServiceCard.astro +0 -54
  165. package/skills/wix-headless/references/astro/templates/bookings/booking-confirmation.astro +0 -49
  166. package/skills/wix-headless/references/astro/templates/bookings/bookingDriver.ts +0 -245
  167. package/skills/wix-headless/references/astro/templates/bookings/components-bookings.css +0 -424
  168. package/skills/wix-headless/references/astro/templates/bookings/services/[slug].astro +0 -176
  169. package/skills/wix-headless/references/astro/templates/bookings/services/index.astro +0 -181
  170. package/skills/wix-headless/references/astro/templates/ecom/CartBadge.tsx +0 -84
  171. package/skills/wix-headless/references/astro/templates/ecom/CartView.tsx +0 -543
  172. package/skills/wix-headless/references/astro/templates/ecom/cart.astro +0 -13
  173. package/skills/wix-headless/references/astro/templates/ecom/components-ecom.css +0 -302
  174. package/skills/wix-headless/references/astro/templates/ecom/discounts.ts +0 -71
  175. package/skills/wix-headless/references/astro/templates/ecom/thank-you.astro +0 -24
  176. package/skills/wix-headless/references/astro/templates/gift-cards/GiftCardPurchase.tsx +0 -172
  177. package/skills/wix-headless/references/astro/templates/gift-cards/_home-teaser-snippet.astro +0 -42
  178. package/skills/wix-headless/references/astro/templates/gift-cards/_nav-snippet.astro +0 -11
  179. package/skills/wix-headless/references/astro/templates/gift-cards/components-gift-cards.css +0 -220
  180. package/skills/wix-headless/references/astro/templates/gift-cards/gift-cards.astro +0 -51
  181. package/skills/wix-headless/references/astro/templates/gift-cards/gift-cards.ts +0 -75
  182. package/skills/wix-headless/references/astro/templates/global.css +0 -288
  183. package/skills/wix-headless/references/astro/templates/index.astro +0 -56
  184. package/skills/wix-headless/references/astro/templates/stores/AddToCartButton.tsx +0 -77
  185. package/skills/wix-headless/references/astro/templates/stores/BackInStockForm.tsx +0 -176
  186. package/skills/wix-headless/references/astro/templates/stores/CategoryRail.astro +0 -69
  187. package/skills/wix-headless/references/astro/templates/stores/ProductCard.astro +0 -79
  188. package/skills/wix-headless/references/astro/templates/stores/ProductPurchase.tsx +0 -397
  189. package/skills/wix-headless/references/astro/templates/stores/SeoTags.astro +0 -21
  190. package/skills/wix-headless/references/astro/templates/stores/back-in-stock.ts +0 -67
  191. package/skills/wix-headless/references/astro/templates/stores/categories.ts +0 -155
  192. package/skills/wix-headless/references/astro/templates/stores/category/[slug].astro +0 -130
  193. package/skills/wix-headless/references/astro/templates/stores/components-stores.css +0 -400
  194. package/skills/wix-headless/references/astro/templates/stores/products/[slug].astro +0 -128
  195. package/skills/wix-headless/references/astro/templates/stores/products/index.astro +0 -101
  196. package/skills/wix-headless/references/blog/BLOG_CONTENT.md +0 -161
  197. package/skills/wix-headless/references/blog/INSTRUCTIONS.md +0 -32
  198. package/skills/wix-headless/references/bookings/FLOW.md +0 -246
  199. package/skills/wix-headless/references/bookings/INSTRUCTIONS.md +0 -95
  200. package/skills/wix-headless/references/bookings/SERVICES_DATA.md +0 -355
  201. package/skills/wix-headless/references/cms/CMS_FOUNDATIONS.md +0 -176
  202. package/skills/wix-headless/references/cms/INSTRUCTIONS.md +0 -71
  203. package/skills/wix-headless/references/commands/known-apps.json +0 -6
  204. package/skills/wix-headless/references/custom/CONNECTION_PLAN.md +0 -142
  205. package/skills/wix-headless/references/custom/INSTRUCTIONS.md +0 -88
  206. package/skills/wix-headless/references/custom/blog/WIRING.md +0 -52
  207. package/skills/wix-headless/references/custom/bookings/WIRING.md +0 -197
  208. package/skills/wix-headless/references/custom/cms/WIRING.md +0 -97
  209. package/skills/wix-headless/references/custom/ecom/WIRING.md +0 -67
  210. package/skills/wix-headless/references/custom/forms/WIRING.md +0 -101
  211. package/skills/wix-headless/references/custom/stores/WIRING.md +0 -80
  212. package/skills/wix-headless/references/ecom/INSTRUCTIONS.md +0 -59
  213. package/skills/wix-headless/references/forms/INSTRUCTIONS.md +0 -43
  214. package/skills/wix-headless/references/gift-cards/INSTRUCTIONS.md +0 -51
  215. package/skills/wix-headless/references/images/INSTRUCTIONS.md +0 -357
  216. package/skills/wix-headless/references/seed-recipes.md +0 -49
  217. package/skills/wix-headless/references/shared/AGENTS_MD.md +0 -47
  218. package/skills/wix-headless/references/shared/AUTHENTICATION.md +0 -108
  219. package/skills/wix-headless/references/shared/BUILD_NOISE.md +0 -8
  220. package/skills/wix-headless/references/shared/DESIGN_MD.md +0 -84
  221. package/skills/wix-headless/references/shared/DOCS_SEARCH.md +0 -41
  222. package/skills/wix-headless/references/shared/IMAGE_GENERATION.md +0 -186
  223. package/skills/wix-headless/references/shared/IMPLEMENTER.md +0 -206
  224. package/skills/wix-headless/references/shared/PRODUCTION_SHARP_EDGES.md +0 -97
  225. package/skills/wix-headless/references/shared/RETURN_CONTRACT.md +0 -143
  226. package/skills/wix-headless/references/shared/STYLING.md +0 -141
  227. package/skills/wix-headless/references/stores/INSTRUCTIONS.md +0 -126
  228. package/skills/wix-headless/references/stores/PRODUCT_CATALOG_DATA.md +0 -252
  229. package/skills/wix-headless/references/verticals/_schema.json +0 -74
  230. package/skills/wix-headless/references/verticals/_schema.md +0 -95
  231. package/skills/wix-headless/references/verticals/blog.md +0 -31
  232. package/skills/wix-headless/references/verticals/bookings.md +0 -41
  233. package/skills/wix-headless/references/verticals/cms.md +0 -30
  234. package/skills/wix-headless/references/verticals/ecom.md +0 -25
  235. package/skills/wix-headless/references/verticals/forms.md +0 -26
  236. package/skills/wix-headless/references/verticals/gift-cards.md +0 -24
  237. package/skills/wix-headless/references/verticals/stores.md +0 -33
  238. package/skills/wix-headless/scripts/check-manifest.mjs +0 -335
  239. package/skills/wix-headless/scripts/compose.mjs +0 -525
  240. package/skills/wix-headless/scripts/emit-design-tokens.mjs +0 -157
  241. package/skills/wix-headless/scripts/flatten.sh +0 -61
  242. package/skills/wix-headless/scripts/generate-images.mjs +0 -242
  243. package/skills/wix-headless/scripts/patch-decorative-slots.mjs +0 -148
  244. package/skills/wix-headless/scripts/plan-entity-image-waves.mjs +0 -190
  245. package/skills/wix-headless/scripts/scaffold.sh +0 -139
  246. package/skills/wix-headless/scripts/seed-utilities.sh +0 -93
  247. package/skills/wix-headless/scripts/write-decorative-json.mjs +0 -62
  248. package/skills/wix-headless/shared-utilities/analytics.ts +0 -40
  249. package/skills/wix-headless/shared-utilities/ricos.ts +0 -179
  250. package/skills/wix-headless/shared-utilities/wix-image.ts +0 -72
@@ -1,67 +0,0 @@
1
- ---
2
- name: custom-ecom-wiring
3
- description: "Integration-mode wiring subagent for the ecom capability. Wires add-to-cart + checkout into a brought-in static site — @wix/ecom currentCart + a redirect to Wix-hosted checkout, client-side via @wix/sdk from CDN. No SSR cart-persistence (deferred); cart lives in the visitor session + a checkout redirect."
4
- ---
5
-
6
- # Ecom wiring (integration mode)
7
-
8
- You wire the **ecom capability** (add-to-cart + checkout) into a brought-in static site (`frontend = "custom"`). Pairs with the **stores** guide (which renders products). Client-side vanilla JS, `@wix/sdk` from CDN, no build. Read `INSTRUCTIONS.md` § "The technical spine" + § "Wiring discipline" first.
9
-
10
- > **Scope.** Beta does **add-to-cart + redirect-to-Wix-hosted-checkout** via the visitor session. A persistent on-page cart UI across reloads needs the server runtime (`@wix/astro`) — **deferred**. Checkout itself happens on Wix's hosted page, so payment/fulfillment need no client work.
11
-
12
- ## Inputs
13
-
14
- - **`appId`** — `OAuthStrategy` `clientId`.
15
- - Binding-map / design controls: the "Add to cart" / "Buy" buttons (with the product/variant id available, e.g. from the stores wiring's `data-product-id`).
16
-
17
- ## Add to cart + checkout
18
-
19
- ```html
20
- <script type="module">
21
- import { createClient, OAuthStrategy } from "https://esm.sh/@wix/sdk@1";
22
- import { currentCart } from "https://esm.sh/@wix/ecom@1";
23
- import { redirects } from "https://esm.sh/@wix/redirects@1";
24
-
25
- const wix = createClient({ modules: { currentCart, redirects }, auth: OAuthStrategy({ clientId: "REPLACE_WITH_APP_ID" }) });
26
-
27
- // Add to cart — buttons carry data-product-id (set by the stores wiring)
28
- document.querySelectorAll("[data-add-to-cart]").forEach((btn) => {
29
- btn.addEventListener("click", async () => {
30
- btn.disabled = true;
31
- try {
32
- await wix.currentCart.addToCurrentCart({
33
- lineItems: [{
34
- catalogReference: {
35
- appId: "215238eb-22a5-4c36-9e7b-e7c08025e04e", // Wix Stores catalog appId (constant)
36
- catalogItemId: btn.dataset.productId,
37
- },
38
- quantity: 1,
39
- }],
40
- });
41
- document.querySelector("[data-cart-badge]")?.replaceChildren(document.createTextNode("•"));
42
- } catch (err) { console.error("[wix-ecom] add-to-cart failed:", err); }
43
- finally { btn.disabled = false; }
44
- });
45
- });
46
-
47
- // Checkout — create a checkout from the current cart, then redirect to Wix-hosted checkout
48
- document.querySelector("[data-checkout]")?.addEventListener("click", async () => {
49
- try {
50
- const { checkoutId } = await wix.currentCart.createCheckoutFromCurrentCart({ channelType: "WEB" });
51
- const { redirectSession } = await wix.redirects.createRedirectSession({
52
- ecomCheckout: { checkoutId },
53
- callbacks: { postFlowUrl: location.href },
54
- });
55
- if (redirectSession?.fullUrl) location.assign(redirectSession.fullUrl);
56
- } catch (err) { console.error("[wix-ecom] checkout failed:", err); }
57
- });
58
- </script>
59
- ```
60
-
61
- - **`currentCart`** APIs only — never the `cart` namespace that needs a cart ID.
62
- - The Wix Stores catalog `appId` (`215238eb-…`) is a platform constant (the catalog provider), distinct from the site's OAuth `appId`/`clientId`.
63
- - Cart badge is a minimal indicator; a full cart-contents page is out of Beta scope (no SSR persistence).
64
-
65
- ## Discipline & return
66
-
67
- Additive; inline the site `appId`; guard calls. Return per `shared/RETURN_CONTRACT.md`: files edited, controls wired (add-to-cart count, checkout button), and note that persistent cart UI is deferred.
@@ -1,101 +0,0 @@
1
- ---
2
- name: custom-forms-wiring
3
- description: "Integration-mode wiring subagent for the forms capability. Connects a brought-in static site to Wix Forms — wires an existing <form> to submit via @wix/forms, OR injects a new connected form (RSVP / lead / contact) styled from the design's CSS tokens. Client-side @wix/sdk + OAuthStrategy visitor session, loaded from CDN. The universal connection floor for integration mode."
4
- ---
5
-
6
- # Forms wiring (integration mode)
7
-
8
- You wire the **forms capability** into a brought-in static site for `wix-headless` integration mode (`frontend = "custom"`). Forms is the **universal connection floor** — when a design has no dynamic content, a domain-appropriate form (RSVP, lead, contact) is the connection that makes it live.
9
-
10
- You write **client-side, vanilla JS** — no React, no build step. `@wix/sdk` + `@wix/forms` load from a CDN; the HTML *is* the deployable. Read `INSTRUCTIONS.md` § "The technical spine" and § "Wiring discipline" before starting.
11
-
12
- ## Inputs (inlined by the orchestrator)
13
-
14
- - **`appId`** — from `wix.config.json`; the `OAuthStrategy` `clientId`.
15
- - **`formId`** — the Wix Form created at Seed time (Seed creates the form definition from the augmentation spec's `fields`, with `postSubmissionTriggers.upsertContact` so submissions create CRM contacts). Never hardcode or invent a form ID — if it's missing, fail loudly.
16
- - **`fields`** — each `{ name, label, type, required, options?, target }`. The **`target`** is the Wix field key the submission map uses (from the created form's schema). If only `name` is known, the orchestrator resolves `target` from the seeded form schema before dispatch.
17
- - **The augmentation spec** (`injectAt`, `styleFrom`) and/or a binding-map entry (an existing `<form>` to wire).
18
- - **`tokens`** — the design's resolved CSS custom properties for styling.
19
-
20
- ## Two cases
21
-
22
- ### A. Augment — inject a new connected form (the static-design path)
23
-
24
- The design has no form (e.g. a wedding invitation). Inject one at `augmentation.injectAt`.
25
-
26
- 1. **Build the `<form>` markup** from `fields`, styled with the design's tokens. Use the site's existing CSS custom properties (`var(--…)`) and font/spacing variables verbatim so the form reads as designed-in. Reuse the page's section/heading rhythm (match an existing `section`'s padding, an existing heading's font). Each input's `name` attribute = the field's `target`.
27
- 2. **Insert** at `injectAt` (e.g. `position: "before"` the `section.closing`). Additive only — do not alter surrounding markup or the global `<style>`. Put the form's own CSS in a single scoped `<style>` block that references the design tokens.
28
- 3. **Wire submission** with the script below.
29
-
30
- ### B. Wire — connect an existing `<form>` (the form-shaped-design path)
31
-
32
- The design already has a `<form>` (binding-map entry, `entity: "forms.submit"`). Map its inputs' `name`/`id` to the form's field `target`s, intercept submit, and post via the SDK. Keep the existing markup and styling; only add the submit handler script.
33
-
34
- ## The submission script (both cases)
35
-
36
- Append one `<script type="module">` (before `</body>`). Inline the literal `appId` and `formId`.
37
-
38
- ```html
39
- <script type="module">
40
- import { createClient, OAuthStrategy } from "https://esm.sh/@wix/sdk@1";
41
- import { submissions } from "https://esm.sh/@wix/forms@1";
42
-
43
- const wix = createClient({
44
- modules: { submissions },
45
- auth: OAuthStrategy({ clientId: "REPLACE_WITH_APP_ID" }), // appId from wix.config.json
46
- });
47
-
48
- const FORM_ID = "REPLACE_WITH_FORM_ID";
49
- const form = document.querySelector("#wix-rsvp-form"); // the injected/targeted form
50
-
51
- form?.addEventListener("submit", async (e) => {
52
- e.preventDefault();
53
- const btn = form.querySelector("[type=submit]");
54
- if (btn) btn.disabled = true;
55
-
56
- // keys MUST be the Wix field `target`s (input name="<target>")
57
- const data = Object.fromEntries(new FormData(form).entries());
58
-
59
- try {
60
- const result = await wix.submissions.createSubmission({
61
- formId: FORM_ID,
62
- submissions: data,
63
- });
64
- if (result.status === "PENDING" || result.status === "CONFIRMED") {
65
- form.querySelector("[data-wix-success]")?.removeAttribute("hidden");
66
- form.reset();
67
- } else {
68
- throw new Error("unexpected submission status: " + result.status);
69
- }
70
- } catch (err) {
71
- console.error("[wix-forms] submission failed:", err);
72
- form.querySelector("[data-wix-error]")?.removeAttribute("hidden");
73
- // surface field-level violations if present
74
- const violations = err?.details?.validationError?.fieldViolations ?? [];
75
- for (const v of violations) {
76
- for (const fe of (v?.data?.errors ?? [])) {
77
- const el = form.querySelector(`[name="${fe.errorPath}"]`);
78
- if (el) el.setAttribute("aria-invalid", "true");
79
- }
80
- }
81
- } finally {
82
- if (btn) btn.disabled = false;
83
- }
84
- });
85
- </script>
86
- ```
87
-
88
- - Include a hidden success node (`<p data-wix-success hidden>…</p>`) and error node (`<p data-wix-error hidden>…</p>`) in the form markup, styled with the tokens.
89
- - The submission `data` keys are the field **`target`s** — set each input's `name` to its `target`.
90
- - Pin the CDN versions (`@1`) in the import URLs; do not float `@latest` in shipped HTML.
91
-
92
- ## Discipline (from `INSTRUCTIONS.md`)
93
-
94
- - **Additive only** — never restructure the design or edit the global stylesheet; the injected form is self-contained.
95
- - **Style from tokens** — use `var(--…)` from the site's `:root`; never introduce a foreign palette/font.
96
- - **Guard the call** — try/catch; on failure show the error node, keep the form usable.
97
- - **Inline `appId` + `formId` literally** — no env vars, no build-time substitution.
98
-
99
- ## Return
100
-
101
- Per `shared/RETURN_CONTRACT.md`: report the file(s) edited, the inject anchor used, the `formId` wired, and the form's `target`→input mapping. If `formId` was missing, return `status: "failed"` with `errors: [{ code: "FORM_NOT_SEEDED" }]` — do not invent one.
@@ -1,80 +0,0 @@
1
- ---
2
- name: custom-stores-wiring
3
- description: "Integration-mode wiring subagent for the stores capability. Connects a brought-in static site's product markup to Wix Stores — replaces hard-coded product cards with live productsV3 queries rendered into the existing DOM template, client-side via @wix/sdk + @wix/stores from CDN. Cart-add + checkout via the ecom guide."
4
- ---
5
-
6
- # Stores wiring (integration mode)
7
-
8
- You wire the **stores capability** into a brought-in static site (`frontend = "custom"`). The design already shows products as **hard-coded sample cards**; you replace the sample data with live `@wix/stores` queries, rendering into the **existing card markup** the design provides. Client-side vanilla JS, `@wix/sdk` from CDN, no build. Read `INSTRUCTIONS.md` § "The technical spine" + § "Wiring discipline" first.
9
-
10
- ## Inputs (inlined by the orchestrator)
11
-
12
- - **`appId`** — `OAuthStrategy` `clientId` (from `wix.config.json`).
13
- - **Binding-map entries** for `stores.products` regions: `{ file, anchor, shape, template, bindings, sampleCount }`.
14
- - **Seeded `productIds` / slugs** (from Seed) — so the wired query shows the seeded catalog.
15
- - **`tokens`** — design CSS custom properties (only needed if you add an empty-state node).
16
-
17
- ## The read-and-render pattern (this is the core; blog/cms reuse it)
18
-
19
- For each binding-map list region:
20
-
21
- 1. **Keep the first sample child as the template.** The region (`anchor`) holds `sampleCount` near-identical children matching `template` (e.g. `article.product-card`). Clone that node per result; remove the remaining static samples. Do **not** restyle — the existing classes carry the design.
22
- 2. **Query live data** and **bind fields** by the binding-map `bindings` map (DOM selector relative to template → entity field path).
23
- 3. **Render on load**, guard with try/catch; on error leave the original samples visible.
24
-
25
- ```html
26
- <script type="module">
27
- import { createClient, OAuthStrategy } from "https://esm.sh/@wix/sdk@1";
28
- import { productsV3 } from "https://esm.sh/@wix/stores@1"; // V3 — never the V1 `products`
29
-
30
- const wix = createClient({
31
- modules: { productsV3 },
32
- auth: OAuthStrategy({ clientId: "REPLACE_WITH_APP_ID" }),
33
- });
34
-
35
- const grid = document.querySelector("section.product-grid"); // binding-map anchor
36
- const tpl = grid?.querySelector("article.product-card"); // binding-map template
37
- if (grid && tpl) {
38
- try {
39
- const { items } = await wix.productsV3
40
- .queryProducts({ fields: ["CURRENCY"] })
41
- .limit(12)
42
- .find();
43
-
44
- const proto = tpl.cloneNode(true);
45
- grid.replaceChildren(...items.map((p) => {
46
- const card = proto.cloneNode(true);
47
- // bindings: selector@attr → field path (e.g. "img.thumb@src" → media.mainMedia.image.url)
48
- const img = card.querySelector("img.thumb"); if (img) img.src = p.media?.mainMedia?.image?.url ?? "";
49
- const name = card.querySelector("h3.name"); if (name) name.textContent = p.name ?? "";
50
- const price = card.querySelector("span.price"); if (price) price.textContent = p.priceData?.formatted?.price ?? "";
51
- // description is RICH TEXT — bind plainDescription, never the HTML `description` (see note below)
52
- const desc = card.querySelector(".description"); if (desc) desc.textContent = p.plainDescription ?? (p.description ?? "").replace(/<[^>]*>/g, "");
53
- // link to a detail page if the design has one (see "Detail" below)
54
- const link = card.querySelector("a"); if (link && p.slug) link.href = `/product/${p.slug}`;
55
- return card;
56
- }));
57
- } catch (err) {
58
- console.error("[wix-stores] product query failed:", err); // leave samples visible
59
- }
60
- }
61
- </script>
62
- ```
63
-
64
- - **Use `productsV3`**, never V1 `products` (V1 silently returns 0 on V3 catalogs).
65
- - **Description is rich text — bind `p.plainDescription`, never `p.description`.** `description` is HTML/ricos; binding it into `textContent` (or a framework `{…}` expression) renders literal `<p>…</p>` tags. Use `plainDescription` (a plain string), falling back to `description.replace(/<[^>]*>/g, "")` if absent.
66
- - **(create × own only — N/A for brought-in static sites.)** When you *own* the markup (the SPA is generated, not brought in), size every image: Wix media URLs are full-resolution, so an `<img>` with no sizing overflows its card onto the text. Put each image in a fixed `aspect-ratio`/`height` slot with `width:100%; height:100%; object-fit:cover`. A brought-in static site is already sized by its own design — skip this.
67
- - Apply the binding-map's actual selectors/field paths — the snippet's `img.thumb`/`h3.name`/`span.price`/`.description` are illustrative.
68
- - **Categories:** if a region is `categoriesV3`, query `wix.categoriesV3.queryCategories().eq("visible", true).find()` (the builder rejects empty filters — always chain at least one predicate).
69
-
70
- ## Detail (`shape: "detail"`)
71
-
72
- If the design has a product-detail page keyed by slug, read the slug from the URL (`location.pathname`), `queryProducts().eq("slug", slug).find()`, and bind the single result into the detail markup. If there is no detail page, link cards to the catalog or omit links.
73
-
74
- ## Buy / cart
75
-
76
- Add-to-cart and checkout are the **ecom** capability — see `references/custom/ecom/WIRING.md`. If a card has a "Buy"/"Add" control and ecom is in the capability set, the ecom guide wires it; otherwise leave it inert or link to the product.
77
-
78
- ## Discipline & return
79
-
80
- Additive only; render into the existing template; inline `appId`; guard every call (samples are the error fallback). Return per `shared/RETURN_CONTRACT.md`: files edited, anchors wired, query used, seeded IDs surfaced. Missing seeded catalog → note it; the empty query still wires (Seed should have populated it).
@@ -1,59 +0,0 @@
1
- ---
2
- name: ecom-implementer
3
- description: "Implements vertical-agnostic ecommerce — cart page, checkout redirect, thank-you page, cart badge. Scopes: components, components-css, pages. Extends references/shared/IMPLEMENTER.md."
4
- ---
5
-
6
- # Ecom Implementer
7
-
8
- Extends `references/shared/IMPLEMENTER.md`. Read that file first for phase routing, REST auth + doc lookups, prompt-inlined inputs (read only your `.wix/seeded.json` slice), return contract, style conventions, and common failure modes.
9
-
10
- ## Scope routing
11
-
12
- | Scope | Phase | Reference |
13
- |-------|-------|-----------|
14
- | `components` | Components (CartView, CartBadge — TSX only, **no CSS**) — `src/utils/discounts.ts` is pre-copied by the orchestrator | `../astro/ecom/CART_WIRING.md` |
15
- | ~~`components-css`~~ | **Do not dispatch.** `src/styles/components-ecom.css` is copied from `<SKILL_ROOT>/references/astro/templates/ecom/components-ecom.css` by the orchestrator's pre-Step-4.5 batch (see BUILD-astro.md § Step 4.5). The template uses direct `var(--token)` CSS, so it works against any designer-published vocabulary without per-run rewrites. `COMPONENTS_CSS.md` documents that CSS for reference — there is no `components-css` subagent to dispatch. | — |
16
- | `pages` | Pages (cart.astro, thank-you.astro, Navigation CartBadge mount) | `../astro/ecom/CART_PAGES.md` |
17
-
18
- > **Why `components` is TSX-only.** The scoped CSS (`src/styles/components-ecom.css`) has no runtime coupling to the TSX components — it's referenced only by class name at build time — so it ships pre-copied from the template by the orchestrator (see the `components-css` scope-routing row above) rather than being written by an agent. Mirrors the stores split. See `../astro/ecom/COMPONENTS_CSS.md` § "What this scope owns".
19
-
20
- Note: `ecom` is never triggered independently — it's co-loaded by verticals that require it (`stores` today; `bookings`, `events` in the future). No `seed` scope — ecom has no data of its own; it works off line items from whichever catalog app is installed.
21
-
22
- ## Files this vertical creates / contributes
23
-
24
- See `<SKILL_ROOT>/references/verticals/ecom.md` frontmatter.
25
-
26
- ## Templates
27
-
28
- Components (`components` scope — TSX only):
29
- - `<SKILL_ROOT>/references/astro/templates/ecom/CartView.tsx`
30
- - `<SKILL_ROOT>/references/astro/templates/ecom/CartBadge.tsx`
31
-
32
- Components CSS (pre-copied by the orchestrator — no agent writes it):
33
- - `<SKILL_ROOT>/references/astro/templates/ecom/components-ecom.css`
34
-
35
- ### Pre-copied by the orchestrator (do NOT write this yourself)
36
-
37
- - `src/utils/discounts.ts` — pre-copied from `<SKILL_ROOT>/references/astro/templates/ecom/discounts.ts` BEFORE your `components` scope dispatches. Wix Ecom Discount Rules fetch + per-product match utility; consumers are stores `pages-products` / `pages-home-and-nav` (ProductCard ribbon + product-detail offer callout). Uses `auth.elevate()` from `@wix/essentials` — `discountRules.queryDiscountRules` requires `ECOM.DISCOUNT_RULES_READ`, a visitor client returns empty silently without elevation.
38
-
39
- Just import from this path; never rewrite the file. Regenerating it has shipped a no-op stub that satisfied the manifest but caused the discount ribbon to silently never render. The pre-copy makes that regression structurally impossible.
40
-
41
- ## CSS ownership — ecom pack
42
-
43
- Ecom-specific component CSS lives in `src/styles/components-ecom.css` (pre-copied from the template by the orchestrator before Step 4.5 — see the `components-css` scope-routing row above; your `components` scope imports it, never writes it), NOT in the designer's `global.css`. The classes the pack owns:
44
-
45
- - `.cart-summary` — the bordered/sticky summary panel on `/cart`. Compound bordered card; sticky on desktop.
46
- - `.cart-total` — the row inside the summary that anchors the total amount with a top rule and display-serif typography.
47
- - `.cart-empty` — the centered empty-state on `/cart` when the cart is empty. Includes the inline override of `.checkout-btn` so the "Browse Products" CTA isn't a full-width brick.
48
- - `.checkout-btn` — primary checkout button with `:disabled` and `:hover:not(:disabled)` states. Composes from `.btn-primary` (which IS designer-owned in `global.css`).
49
- - `.cart-item-*` — row, image, name, qty controls — all live here. Most are utility-only; the few that need scoped rules (e.g. line-item separator borders) belong here, not in `global.css`.
50
-
51
- The designer's `global.css` declares only tokens, the `.btn` family, decorative slots, the editorial-rule, and the site-shell shells. If `global.css` ships with a partial rule for any class above, that's a designer bug — flag it in your return JSON's `errors` array (`{code: "GLOBAL_CSS_LEAK", class: "<name>"}`) and override with the complete rule in `components-ecom.css`.
52
-
53
- See `references/shared/STYLING.md` § "Component-specific CSS is owned by the component, not the designer" for the boundary rule.
54
-
55
- ## Cross-vertical event contract
56
-
57
- `cart-updated` CustomEvent on `window`:
58
- - **Dispatchers:** `AddToCartButton` (stores), `CartView` (ecom)
59
- - **Listener:** `CartBadge` (ecom)
@@ -1,43 +0,0 @@
1
- ---
2
- name: forms-implementer
3
- description: "Implements contact, lead, and signup forms via @wix/forms. Scopes: seed, components, pages. Extends references/shared/IMPLEMENTER.md."
4
- ---
5
-
6
- # Forms Implementer
7
-
8
- Extends `references/shared/IMPLEMENTER.md`. Read that file first for phase routing, REST auth + doc lookups, prompt-inlined inputs (read only your `.wix/seeded.json` slice), return contract, style conventions, and common failure modes.
9
-
10
- ## Scope routing
11
-
12
- | Scope | Phase | Reference |
13
- |-------|-------|-----------|
14
- | `seed` | Seed (Forms app install + form creation + postSubmissionTriggers PATCH) | `../astro/forms/CONTACT_FORM.md` (§ Form Setup) |
15
- | `components` | Components (ContactForm.tsx React island) | `../astro/forms/CONTACT_FORM.md` (§ React island) |
16
- | `pages` | Pages (contact.astro wire with formId from seeded data) | `../astro/forms/CONTACT_FORM.md` (§ Page wiring) |
17
-
18
- ## Files this vertical creates / contributes
19
-
20
- Each scope's files are enumerated in `../astro/forms/CONTACT_FORM.md` (§ Form Setup, § React island, § Page wiring).
21
-
22
- ## Form purpose variants
23
-
24
- The `seed` scope adapts field selection based on business purpose from the functional plan:
25
-
26
- | Purpose | Fields | Layout |
27
- |---------|--------|--------|
28
- | Waitlist / newsletter | EMAIL + SUBMIT | Single column |
29
- | Lead capture | FIRST_NAME + EMAIL + SUBMIT | Single column |
30
- | Contact (full) | FIRST_NAME + LAST_NAME + EMAIL + PHONE + MESSAGE + SUBMIT | First+last side-by-side, rest stacked |
31
- | Registration | FIRST_NAME + LAST_NAME + EMAIL + custom | Single column |
32
-
33
- ## Forms-specific failure modes
34
-
35
- | Wrong | Right |
36
- |---|---|
37
- | Skip `postSubmissionTriggers` PATCH after form creation | Always PATCH — the POST silently drops triggers; without them, submissions are silently lost (no CRM Contact created) |
38
- | Include triggers in POST body and assume it worked | POST drops `postSubmissionTriggers`; always follow up with PATCH |
39
- | Fall back to hardcoded fields on `UNSUPPORTED_FORM_NAMESPACE` | Wait 10s and retry up to 3 times — namespace propagation delay after Forms app install |
40
- | Skip `auth.elevate` when listing forms | `listForms` requires elevated permissions |
41
- | Submit forms from server-side code | Form submission must be client-side (React island with `client:load`) |
42
- | Detect textarea by `componentType === "TEXT_AREA"` | Check `identifier === "TEXT_AREA"` or `target === "message"` |
43
- | Hardcode form field IDs or form ID | Use `forms.listForms("wix.form_app.form")` with `auth.elevate` for runtime discovery |
@@ -1,51 +0,0 @@
1
- ---
2
- name: gift-cards-implementer
3
- description: "Implements the passive Wix Gift Cards vertical — runtime probe util, GiftCardPurchase island, /gift-cards page, and conditional nav/home contributions. Scopes: components, pages. Extends references/shared/IMPLEMENTER.md."
4
- ---
5
-
6
- # Gift Cards Implementer
7
-
8
- Extends `references/shared/IMPLEMENTER.md`. Read that file first for phase routing, REST auth + doc lookups, prompt-inlined inputs (read only your `.wix/seeded.json` slice), return contract, style conventions, and common failure modes.
9
-
10
- ## Scope routing
11
-
12
- | Scope | Phase | Reference |
13
- |-------|-------|-----------|
14
- | `components` | Components (probe util, React island, scoped CSS) | `../astro/gift-cards/COMPONENTS.md` |
15
- | `pages` | Pages (gift-cards landing + Navigation/index patches) | `../astro/gift-cards/PAGES.md` |
16
-
17
- This pack has **no `seed` scope** — the dashboard's eGift Card template is the source of truth and we never seed denominations from code.
18
-
19
- ## Files this vertical creates / contributes
20
-
21
- See the § "Templates" list below for the files each scope produces (and the nav/home contributions it patches).
22
-
23
- ## Pre-return file-existence assertion (pages scope)
24
-
25
- Before returning `status: "complete"` from the `pages` scope, verify every file the scope produces (the page templates in § "Templates" below, plus the patched `Navigation.astro` / `index.astro`) exists on disk. If a declared file is missing, return `status: "partial"` with `errors: [{ code: "PHASE4_FILE_MISSING", path: "<expected path>" }]` rather than claiming success.
26
-
27
- ## Templates
28
-
29
- Canonical templates live at `<SKILL_ROOT>/references/astro/templates/gift-cards/`. Your `components` and `pages` scopes read these and adapt them — don't invent markup or logic.
30
-
31
- Components (`components` scope):
32
- - `<SKILL_ROOT>/references/astro/templates/gift-cards/gift-cards.ts`
33
- - `<SKILL_ROOT>/references/astro/templates/gift-cards/GiftCardPurchase.tsx`
34
- - `<SKILL_ROOT>/references/astro/templates/gift-cards/components-gift-cards.css`
35
-
36
- Pages (`pages` scope):
37
- - `<SKILL_ROOT>/references/astro/templates/gift-cards/gift-cards.astro`
38
- - `<SKILL_ROOT>/references/astro/templates/gift-cards/_nav-snippet.astro` — exact contribution to insert at `<!-- nav:links -->` in `Navigation.astro`
39
- - `<SKILL_ROOT>/references/astro/templates/gift-cards/_home-teaser-snippet.astro` — exact contribution to insert at `<!-- home:gift-cards -->` in `index.astro`
40
-
41
- ## Gift-cards-specific failure modes
42
-
43
- | Wrong | Right |
44
- |---|---|
45
- | Hardcode denominations in code | Always read `presetVariants` from the live API (`getGiftCardProduct()`) |
46
- | Call `createGiftCardProduct` or any seeding op | Never seed; the dashboard owns the template |
47
- | Wrap calls in `auth.elevate(...)` | The probe is visitor-scoped already; elevation breaks it |
48
- | Forget to import `getGiftCardProduct` when patching `Navigation.astro` or `index.astro` | When inserting at a marker, also add the corresponding import + frontmatter call to that file |
49
- | Drop or rename the marker comment after inserting | Preserve the marker line — future re-runs and other verticals depend on it |
50
- | Render the page when probe returns `null` | Redirect to `/` (`Astro.redirect("/", 302)`) so users following stale links never see a broken page |
51
- | Skip memoization of `getGiftCardProduct()` | Module-level cache promise — Navigation, home, and page render in the same request and must coalesce to one fetch |