@wix/agent-skills 1.0.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 (220) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +111 -0
  3. package/package.json +29 -0
  4. package/skills/wix-app/SKILL.md +344 -0
  5. package/skills/wix-app/references/APP_IDENTIFIERS.md +35 -0
  6. package/skills/wix-app/references/APP_MARKET_REVIEW.md +311 -0
  7. package/skills/wix-app/references/APP_VALIDATION.md +171 -0
  8. package/skills/wix-app/references/BACKEND_API.md +233 -0
  9. package/skills/wix-app/references/BACKEND_EVENT.md +116 -0
  10. package/skills/wix-app/references/CODE_QUALITY.md +33 -0
  11. package/skills/wix-app/references/CUSTOM_ELEMENT_WIDGET.md +587 -0
  12. package/skills/wix-app/references/DASHBOARD_MENU_PLUGIN.md +157 -0
  13. package/skills/wix-app/references/DASHBOARD_MODAL.md +283 -0
  14. package/skills/wix-app/references/DASHBOARD_PAGE.md +403 -0
  15. package/skills/wix-app/references/DASHBOARD_PLUGIN.md +205 -0
  16. package/skills/wix-app/references/DATA_COLLECTION.md +451 -0
  17. package/skills/wix-app/references/DOCUMENTATION.md +42 -0
  18. package/skills/wix-app/references/EDITOR_REACT_COMPONENT.md +65 -0
  19. package/skills/wix-app/references/EMBEDDED_SCRIPT.md +468 -0
  20. package/skills/wix-app/references/EXTENSION_REGISTRATION.md +96 -0
  21. package/skills/wix-app/references/SERVICE_PLUGIN.md +235 -0
  22. package/skills/wix-app/references/SITE_PLUGIN.md +436 -0
  23. package/skills/wix-app/references/STORES_VERSIONING.md +334 -0
  24. package/skills/wix-app/references/backend-event/COMMON-EVENTS.md +84 -0
  25. package/skills/wix-app/references/custom-element-widget/SETTINGS_PANEL.md +345 -0
  26. package/skills/wix-app/references/dashboard-menu-plugin/blog-slots.md +71 -0
  27. package/skills/wix-app/references/dashboard-menu-plugin/bookings-slots.md +58 -0
  28. package/skills/wix-app/references/dashboard-menu-plugin/crm-slots.md +8 -0
  29. package/skills/wix-app/references/dashboard-menu-plugin/ecommerce-slots.md +17 -0
  30. package/skills/wix-app/references/dashboard-menu-plugin/events-slots.md +29 -0
  31. package/skills/wix-app/references/dashboard-menu-plugin/restaurants-slots.md +27 -0
  32. package/skills/wix-app/references/dashboard-menu-plugin/stores-slots.md +35 -0
  33. package/skills/wix-app/references/dashboard-page/API_SPEC.md +138 -0
  34. package/skills/wix-app/references/dashboard-page/DASHBOARD_API.md +573 -0
  35. package/skills/wix-app/references/dashboard-page/DYNAMIC_PARAMETERS.md +269 -0
  36. package/skills/wix-app/references/dashboard-page/ECOM_NAVIGATION.md +164 -0
  37. package/skills/wix-app/references/dashboard-plugin/SLOTS.md +294 -0
  38. package/skills/wix-app/references/data-collection/WIX_DATA.md +270 -0
  39. package/skills/wix-app/references/data-collection/extension-template.ts +107 -0
  40. package/skills/wix-app/references/editor-react-component/ACCESSIBILITY.md +138 -0
  41. package/skills/wix-app/references/editor-react-component/COMPONENT-API.md +454 -0
  42. package/skills/wix-app/references/editor-react-component/COMPONENT-CONFIGURATION.md +165 -0
  43. package/skills/wix-app/references/editor-react-component/CSS-GUIDELINES.md +576 -0
  44. package/skills/wix-app/references/editor-react-component/DIRECTIONALITY.md +170 -0
  45. package/skills/wix-app/references/editor-react-component/EDIT-FLOW.md +6 -0
  46. package/skills/wix-app/references/editor-react-component/PARTS.md +25 -0
  47. package/skills/wix-app/references/editor-react-component/PROPS-VS-CSS.md +203 -0
  48. package/skills/wix-app/references/editor-react-component/REACT-GUIDELINES.md +167 -0
  49. package/skills/wix-app/references/editor-react-component/REACT-PATTERNS.md +137 -0
  50. package/skills/wix-app/references/service-plugin/ADDITIONAL-FEES.md +112 -0
  51. package/skills/wix-app/references/service-plugin/BOOKINGS-STAFF-SORTING.md +118 -0
  52. package/skills/wix-app/references/service-plugin/DISCOUNT-TRIGGERS.md +87 -0
  53. package/skills/wix-app/references/service-plugin/GIFT-CARDS.md +86 -0
  54. package/skills/wix-app/references/service-plugin/PAYMENT-SETTINGS.md +135 -0
  55. package/skills/wix-app/references/service-plugin/SHIPPING-RATES.md +79 -0
  56. package/skills/wix-app/references/service-plugin/VALIDATIONS.md +68 -0
  57. package/skills/wix-app/references/site-plugin/EXAMPLES.md +311 -0
  58. package/skills/wix-app/references/site-plugin/SLOTS.md +263 -0
  59. package/skills/wix-design-system/SKILL.md +129 -0
  60. package/skills/wix-design-system/references/file-structure.md +56 -0
  61. package/skills/wix-design-system/scripts/wds.cjs +531 -0
  62. package/skills/wix-headless/SKILL.md +418 -0
  63. package/skills/wix-headless/references/DISCOVERY.md +332 -0
  64. package/skills/wix-headless/references/ORCHESTRATION.md +269 -0
  65. package/skills/wix-headless/references/SETUP.md +154 -0
  66. package/skills/wix-headless/references/blog/BLOG_CONTENT.md +152 -0
  67. package/skills/wix-headless/references/blog/BLOG_PAGES.md +299 -0
  68. package/skills/wix-headless/references/blog/BLOG_SETUP.md +218 -0
  69. package/skills/wix-headless/references/blog/INSTRUCTIONS.md +32 -0
  70. package/skills/wix-headless/references/cms/CMS_FOUNDATIONS.md +373 -0
  71. package/skills/wix-headless/references/cms/FAQ_KNOWLEDGE_BASE.md +229 -0
  72. package/skills/wix-headless/references/cms/INSTRUCTIONS.md +40 -0
  73. package/skills/wix-headless/references/cms/PORTFOLIO.md +454 -0
  74. package/skills/wix-headless/references/cms/RESOURCE_LIBRARY.md +356 -0
  75. package/skills/wix-headless/references/cms/TEAM_DIRECTORY.md +299 -0
  76. package/skills/wix-headless/references/commands/install-app.md +42 -0
  77. package/skills/wix-headless/references/commands/known-apps.json +5 -0
  78. package/skills/wix-headless/references/commands/mcp-bootstrap.md +28 -0
  79. package/skills/wix-headless/references/designer/INSTRUCTIONS.md +828 -0
  80. package/skills/wix-headless/references/ecom/CART_PAGES.md +120 -0
  81. package/skills/wix-headless/references/ecom/CART_WIRING.md +103 -0
  82. package/skills/wix-headless/references/ecom/COMPONENTS_CSS.md +132 -0
  83. package/skills/wix-headless/references/ecom/INSTRUCTIONS.md +59 -0
  84. package/skills/wix-headless/references/forms/CONTACT_FORM.md +477 -0
  85. package/skills/wix-headless/references/forms/INSTRUCTIONS.md +43 -0
  86. package/skills/wix-headless/references/gift-cards/COMPONENTS.md +119 -0
  87. package/skills/wix-headless/references/gift-cards/INSTRUCTIONS.md +51 -0
  88. package/skills/wix-headless/references/gift-cards/PAGES.md +129 -0
  89. package/skills/wix-headless/references/images/INSTRUCTIONS.md +359 -0
  90. package/skills/wix-headless/references/shared/BUILD_NOISE.md +8 -0
  91. package/skills/wix-headless/references/shared/IMAGE_GENERATION.md +185 -0
  92. package/skills/wix-headless/references/shared/IMPLEMENTER.md +155 -0
  93. package/skills/wix-headless/references/shared/MCP_PREFIX.md +105 -0
  94. package/skills/wix-headless/references/shared/PRODUCTION_SHARP_EDGES.md +97 -0
  95. package/skills/wix-headless/references/shared/RETURN_CONTRACT.md +423 -0
  96. package/skills/wix-headless/references/shared/STYLING.md +117 -0
  97. package/skills/wix-headless/references/stores/BACK_IN_STOCK.md +178 -0
  98. package/skills/wix-headless/references/stores/CATEGORY_PAGES.md +86 -0
  99. package/skills/wix-headless/references/stores/COMPONENTS_CSS.md +129 -0
  100. package/skills/wix-headless/references/stores/HOME_AND_NAV.md +227 -0
  101. package/skills/wix-headless/references/stores/INSTRUCTIONS.md +96 -0
  102. package/skills/wix-headless/references/stores/PRODUCT_CATALOG_DATA.md +249 -0
  103. package/skills/wix-headless/references/stores/PRODUCT_PAGES.md +213 -0
  104. package/skills/wix-headless/references/stores/SHARED_WIRING.md +164 -0
  105. package/skills/wix-headless/references/verticals/_schema.json +160 -0
  106. package/skills/wix-headless/references/verticals/_schema.md +185 -0
  107. package/skills/wix-headless/references/verticals/blog.md +125 -0
  108. package/skills/wix-headless/references/verticals/cms.md +121 -0
  109. package/skills/wix-headless/references/verticals/ecom.md +96 -0
  110. package/skills/wix-headless/references/verticals/forms.md +106 -0
  111. package/skills/wix-headless/references/verticals/gift-cards.md +121 -0
  112. package/skills/wix-headless/references/verticals/stores.md +167 -0
  113. package/skills/wix-headless/scripts/check-manifest.mjs +198 -0
  114. package/skills/wix-headless/scripts/copy-utility-templates.mjs +153 -0
  115. package/skills/wix-headless/scripts/emit-design-tokens.mjs +77 -0
  116. package/skills/wix-headless/scripts/finalize-run-json.mjs +141 -0
  117. package/skills/wix-headless/scripts/init-site-json.mjs +63 -0
  118. package/skills/wix-headless/scripts/patch-decorative-slots.mjs +124 -0
  119. package/skills/wix-headless/scripts/plan-entity-image-waves.mjs +190 -0
  120. package/skills/wix-headless/scripts/preview.sh +45 -0
  121. package/skills/wix-headless/scripts/release.sh +73 -0
  122. package/skills/wix-headless/scripts/scaffold.sh +53 -0
  123. package/skills/wix-headless/scripts/seed-utilities.sh +55 -0
  124. package/skills/wix-headless/shared-utilities/analytics.ts +40 -0
  125. package/skills/wix-headless/shared-utilities/ricos.ts +179 -0
  126. package/skills/wix-headless/shared-utilities/wix-image.ts +72 -0
  127. package/skills/wix-headless/templates/ecom/CartBadge.tsx +84 -0
  128. package/skills/wix-headless/templates/ecom/CartView.tsx +543 -0
  129. package/skills/wix-headless/templates/ecom/cart.astro +13 -0
  130. package/skills/wix-headless/templates/ecom/components-ecom.css +215 -0
  131. package/skills/wix-headless/templates/ecom/discounts.ts +71 -0
  132. package/skills/wix-headless/templates/ecom/thank-you.astro +24 -0
  133. package/skills/wix-headless/templates/gift-cards/GiftCardPurchase.tsx +172 -0
  134. package/skills/wix-headless/templates/gift-cards/_home-teaser-snippet.astro +42 -0
  135. package/skills/wix-headless/templates/gift-cards/_nav-snippet.astro +11 -0
  136. package/skills/wix-headless/templates/gift-cards/components-gift-cards.css +219 -0
  137. package/skills/wix-headless/templates/gift-cards/gift-cards.astro +51 -0
  138. package/skills/wix-headless/templates/gift-cards/gift-cards.ts +75 -0
  139. package/skills/wix-headless/templates/stores/AddToCartButton.tsx +77 -0
  140. package/skills/wix-headless/templates/stores/BackInStockForm.tsx +176 -0
  141. package/skills/wix-headless/templates/stores/CategoryRail.astro +69 -0
  142. package/skills/wix-headless/templates/stores/ProductCard.astro +79 -0
  143. package/skills/wix-headless/templates/stores/ProductPurchase.tsx +397 -0
  144. package/skills/wix-headless/templates/stores/SeoTags.astro +21 -0
  145. package/skills/wix-headless/templates/stores/back-in-stock.ts +67 -0
  146. package/skills/wix-headless/templates/stores/categories.ts +155 -0
  147. package/skills/wix-headless/templates/stores/category/[slug].astro +130 -0
  148. package/skills/wix-headless/templates/stores/components-stores.css +295 -0
  149. package/skills/wix-headless/templates/stores/products/[slug].astro +128 -0
  150. package/skills/wix-headless/templates/stores/products/index.astro +101 -0
  151. package/skills/wix-manage/SKILL.md +280 -0
  152. package/skills/wix-manage/references/app-installation/install-wix-apps.md +155 -0
  153. package/skills/wix-manage/references/app-installation/list-installed-apps.md +124 -0
  154. package/skills/wix-manage/references/blog/how-to-create-blog-posts.md +226 -0
  155. package/skills/wix-manage/references/bookings/booking-service-policy-setup.md +95 -0
  156. package/skills/wix-manage/references/bookings/booking-system-integration-gaps.md +416 -0
  157. package/skills/wix-manage/references/bookings/bookings-staff-setup.md +255 -0
  158. package/skills/wix-manage/references/bookings/create-and-update-booking-services.md +462 -0
  159. package/skills/wix-manage/references/bookings/end-to-end-booking-flow.md +278 -0
  160. package/skills/wix-manage/references/bookings/external-calendar-integration.md +258 -0
  161. package/skills/wix-manage/references/bookings/multi-resource-service-creation.md +231 -0
  162. package/skills/wix-manage/references/calendar/configure-default-business-hours.md +226 -0
  163. package/skills/wix-manage/references/cms/cms-data-items-crud.md +422 -0
  164. package/skills/wix-manage/references/cms/cms-data-operations-extended.md +263 -0
  165. package/skills/wix-manage/references/cms/cms-ecommerce-catalog-integration.md +136 -0
  166. package/skills/wix-manage/references/cms/cms-references-and-relationships.md +160 -0
  167. package/skills/wix-manage/references/cms/cms-schema-management.md +143 -0
  168. package/skills/wix-manage/references/contacts/bulk-delete-contacts.md +73 -0
  169. package/skills/wix-manage/references/contacts/bulk-label-and-unlabel-contacts.md +67 -0
  170. package/skills/wix-manage/references/domains/domain-search-and-purchase.md +434 -0
  171. package/skills/wix-manage/references/ecommerce/api-recommendation-tracking.md +420 -0
  172. package/skills/wix-manage/references/ecommerce/flow-add-free-shipping.md +267 -0
  173. package/skills/wix-manage/references/ecommerce/flow-bundle-and-save.md +290 -0
  174. package/skills/wix-manage/references/ecommerce/flow-fix-coverage-gaps.md +300 -0
  175. package/skills/wix-manage/references/ecommerce/flow-optimize-shipping-rates.md +364 -0
  176. package/skills/wix-manage/references/ecommerce/flow-seasonal-promotion.md +315 -0
  177. package/skills/wix-manage/references/ecommerce/flow-stock-mover.md +308 -0
  178. package/skills/wix-manage/references/ecommerce/flow-upsell-boost.md +271 -0
  179. package/skills/wix-manage/references/ecommerce/goal-clear-inventory.md +118 -0
  180. package/skills/wix-manage/references/ecommerce/goal-drive-cross-sells.md +122 -0
  181. package/skills/wix-manage/references/ecommerce/goal-increase-aov.md +132 -0
  182. package/skills/wix-manage/references/ecommerce/goal-reduce-cart-abandonment.md +148 -0
  183. package/skills/wix-manage/references/ecommerce/goal-seasonal-revenue.md +146 -0
  184. package/skills/wix-manage/references/ecommerce/guardrail-discount-conflicts.md +118 -0
  185. package/skills/wix-manage/references/ecommerce/guardrail-margin-protection.md +88 -0
  186. package/skills/wix-manage/references/ecommerce/guardrail-rate-pricing-sanity.md +108 -0
  187. package/skills/wix-manage/references/ecommerce/guardrail-shipping-health.md +124 -0
  188. package/skills/wix-manage/references/ecommerce/recipe-apply-shipping-recommendations.md +299 -0
  189. package/skills/wix-manage/references/ecommerce/recommend-ecommerce-strategy.md +582 -0
  190. package/skills/wix-manage/references/ecommerce/setup-coupons.md +338 -0
  191. package/skills/wix-manage/references/ecommerce/setup-discount-rules.md +444 -0
  192. package/skills/wix-manage/references/ecommerce/setup-shipping-rates.md +86 -0
  193. package/skills/wix-manage/references/ecommerce/setup-shipping-regions.md +56 -0
  194. package/skills/wix-manage/references/ecommerce/setup-store-pickup-location.md +209 -0
  195. package/skills/wix-manage/references/ecommerce/skill-graph.md +139 -0
  196. package/skills/wix-manage/references/ecommerce/troubleshoot-checkout-delivery-dropoff.md +124 -0
  197. package/skills/wix-manage/references/ecommerce/troubleshoot-discount-not-applying.md +95 -0
  198. package/skills/wix-manage/references/events/list-events.md +203 -0
  199. package/skills/wix-manage/references/forms/create-form.md +260 -0
  200. package/skills/wix-manage/references/get-paid/create-payment-links.md +212 -0
  201. package/skills/wix-manage/references/get-paid/how-to-setup-wix-payments.md +57 -0
  202. package/skills/wix-manage/references/get-paid/payment-links-for-bookings.md +101 -0
  203. package/skills/wix-manage/references/media/upload-media-to-wix.md +216 -0
  204. package/skills/wix-manage/references/pricing-plans/create-and-update-pricing-plans.md +77 -0
  205. package/skills/wix-manage/references/pricing-plans/pricing-plans-bookings-integration.md +166 -0
  206. package/skills/wix-manage/references/restaurants/wix-restaurants-setup.md +336 -0
  207. package/skills/wix-manage/references/rich-content/ricos-converter-service.md +295 -0
  208. package/skills/wix-manage/references/site-properties/change-payment-currency-site-properties.md +59 -0
  209. package/skills/wix-manage/references/sites/create-site-from-template.md +183 -0
  210. package/skills/wix-manage/references/sites/query-sites.md +125 -0
  211. package/skills/wix-manage/references/stores/add-store-pages-to-site.md +57 -0
  212. package/skills/wix-manage/references/stores/bulk-create-products-with-options.md +1041 -0
  213. package/skills/wix-manage/references/stores/create-product-catalog-v1.md +125 -0
  214. package/skills/wix-manage/references/stores/create-product-from-image.md +824 -0
  215. package/skills/wix-manage/references/stores/create-product-with-options-catalog-v3.md +566 -0
  216. package/skills/wix-manage/references/stores/find-products-query-and-search-catalog-v3.md +194 -0
  217. package/skills/wix-manage/references/stores/query-products-catalog-v1.md +80 -0
  218. package/skills/wix-manage/references/stores/setup-online-store-catalog-v3.md +99 -0
  219. package/skills/wix-manage/references/stores/update-product-pre-order.md +213 -0
  220. package/skills/wix-manage/references/stores/update-product-with-options.md +318 -0
@@ -0,0 +1,88 @@
1
+ ---
2
+ name: "Guardrail: Margin Protection"
3
+ description: Safety constraints for discount percentages — global discount cap, minimum margin requirements, user override protocol, and percentage sanity checks.
4
+ layer: guardrail
5
+ ---
6
+ # Guardrail: Margin Protection
7
+
8
+ ## When to apply
9
+
10
+ Run before EVERY discount rule creation or update. Check both the new rule's discount AND the cumulative effect with existing active rules (stacking).
11
+
12
+ ---
13
+
14
+ ## Constraint 1: Global discount cap
15
+
16
+ The default maximum discount percentage (`discountMargin`) is **25%**.
17
+
18
+ Any discount rule that exceeds this cap should be flagged before creation:
19
+
20
+ > "This discount ({pct}%) exceeds the default cap of 25%. Proceeding only because you explicitly requested it."
21
+
22
+ Respect the cap unless user input explicitly overrides it.
23
+
24
+ ---
25
+
26
+ ## Constraint 2: Minimum margin requirement
27
+
28
+ The default minimum margin percentage (`minMarginPct`) is **15%**.
29
+
30
+ Never create a discount that would push the effective margin below 15% unless the user explicitly overrides this constraint.
31
+
32
+ If cost data is available, calculate:
33
+ - `effective_margin = (price - cost - discount_amount) / price × 100`
34
+ - If `effective_margin < minMarginPct` → block and explain the margin impact.
35
+
36
+ ---
37
+
38
+ ## Constraint 3: Percentage sanity checks
39
+
40
+ | Discount value | Action |
41
+ |---|---|
42
+ | Discount > 50% | Warn — "This discount is {pct}% off. A $100 product would sell for ${100 - pct}. Are you sure?" |
43
+ | Discount = 100% | Block unless explicitly confirmed — "This makes the product free." |
44
+ | Discount > 100% | Block always — "A discount cannot exceed 100%." |
45
+
46
+ ---
47
+
48
+ ## Constraint 4: User input override protocol (ABSOLUTE PRIORITY)
49
+
50
+ User input overrides ALL constraints — margin caps, discount caps, naming conventions, percentage limits.
51
+
52
+ **How it works:**
53
+
54
+ - If the user says "50% discount" and the cap is 25%, honor 50%.
55
+ - If the user says "set margin to 5%" and the minimum is 15%, honor 5%.
56
+ - Document which constraints were overridden in reasoning so there is a clear audit trail.
57
+
58
+ **Example reasoning output:**
59
+
60
+ > "Creating a 50% discount as requested. Note: this overrides the default 25% discount cap. The effective margin on a product with 60% gross margin would drop to 10%, below the default 15% minimum margin threshold. Proceeding per explicit user instruction."
61
+
62
+ ---
63
+
64
+ ## Constraint 5: Stacking cumulative check
65
+
66
+ When creating a new discount, also check the cumulative effect with existing active rules:
67
+
68
+ 1. Query all active discount rules that overlap in scope with the new rule.
69
+ 2. Calculate the combined discount percentage (accounting for multiplicative stacking).
70
+ 3. If the combined discount exceeds the global cap or violates the minimum margin, warn the merchant:
71
+
72
+ > "Combined with the existing '{existingRuleName}' ({existingPct}%), the total effective discount would be approximately {combinedPct}%. This exceeds the {cap}% cap / pushes margin below {minMarginPct}%."
73
+
74
+ ---
75
+
76
+ ## Summary: Decision matrix
77
+
78
+ | Scenario | Action |
79
+ |---|---|
80
+ | Discount ≤ 25% and margin ≥ 15% | Proceed |
81
+ | Discount > 25% but ≤ 50%, no user override | Warn, ask for confirmation |
82
+ | Discount > 25%, user explicitly requested | Proceed, document override |
83
+ | Discount > 50% | Warn with dollar example, ask for confirmation |
84
+ | Discount = 100% | Block unless explicitly confirmed |
85
+ | Discount > 100% | Block always |
86
+ | Combined stacking exceeds cap | Warn about cumulative effect |
87
+ | Margin drops below 15%, no user override | Block, explain margin impact |
88
+ | Margin drops below 15%, user override | Proceed, document override |
@@ -0,0 +1,108 @@
1
+ ---
2
+ name: "Guardrail: Rate Pricing Sanity"
3
+ description: Validates shipping rate pricing against AOV and catalog data. Flags excessive rates, per-item penalties, unreachable free shipping thresholds, and backup rate sticker shock.
4
+ layer: guardrail
5
+ ---
6
+ # Guardrail: Rate Pricing Sanity
7
+
8
+ ## When to use
9
+
10
+ Run these checks when evaluating existing shipping rates or before creating/updating shipping rate configurations. All thresholds are relative to the store's Average Order Value (AOV).
11
+
12
+ ---
13
+
14
+ ## Check 1: Excessive shipping cost
15
+
16
+ **Threshold**: Any rate `amount` > AOV x 0.15 (15%)
17
+
18
+ **Why**: Shipping costs above 15% of order value are a top reason for cart abandonment. Customers who see disproportionately high shipping fees frequently abandon their carts.
19
+
20
+ **Detection**:
21
+ - For each shipping rate, compare `amount` against `AOV × 0.15`
22
+ - If exceeded → flag:
23
+
24
+ > "Shipping rate '{title}' charges ${amount}, which is {pct}% of your average order value (${AOV}). Shipping costs above 15% of order value are a top reason for cart abandonment."
25
+
26
+ ---
27
+
28
+ ## Check 2: Per-item penalty (multiplyByQuantity)
29
+
30
+ **Trigger**: `multiplyByQuantity: true` on any shipping rate
31
+
32
+ **Why**: Per-item shipping charges penalize larger orders and discourage customers from adding more items to cart.
33
+
34
+ **Detection**:
35
+ - Find all rates with `multiplyByQuantity: true`
36
+ - Calculate the impact for a typical multi-item order:
37
+
38
+ > "Your '{title}' rate charges per item (${amount} x quantity). A 5-item order costs ${amount x 5}. Switch to a flat rate or tiered pricing to encourage larger orders."
39
+
40
+ ---
41
+
42
+ ## Check 3: Free shipping threshold too high
43
+
44
+ **Threshold**: Free shipping threshold > AOV x 2
45
+
46
+ **Why**: If the free shipping minimum is more than double the average order, very few customers will ever qualify. The threshold should be achievable — close enough to the AOV to encourage customers to add one more item.
47
+
48
+ **Detection**:
49
+ - Compare free shipping `threshold` against `AOV × 2`
50
+ - If exceeded → flag:
51
+
52
+ > "Your free shipping threshold (${threshold}) is {X}x your average order (${AOV}). Most customers won't reach it. Lower to ${AOV x 1.2} to make it achievable and drive larger orders."
53
+
54
+ ---
55
+
56
+ ## Check 4: Free shipping threshold too low
57
+
58
+ **Threshold**: Free shipping threshold < AOV x 0.8
59
+
60
+ **Why**: If the threshold is below the average order value, most customers already qualify for free shipping without adding anything to their cart. This provides no upsell incentive and may erode margins unnecessarily.
61
+
62
+ **Detection**:
63
+ - Compare free shipping `threshold` against `AOV × 0.8`
64
+ - If below → flag:
65
+
66
+ > "Your free shipping threshold (${threshold}) is below your average order value (${AOV}). Most customers already qualify, so this threshold isn't driving larger orders. Consider raising it to ${AOV x 1.2} to encourage add-on purchases."
67
+
68
+ ---
69
+
70
+ ## Check 5: Backup rate sticker shock
71
+
72
+ **Threshold**: `backupRate.amount` > effective AOV x 0.15
73
+
74
+ **Why**: Backup rates apply when the primary carrier can't fulfill (e.g., remote address, service outage). If the backup rate is dramatically higher than normal shipping, customers experience sticker shock at checkout.
75
+
76
+ **Detection**:
77
+ - For each carrier's `backupRate`, compare `amount` against `effective_aov × 0.15`
78
+ - If exceeded → flag:
79
+
80
+ > "Backup rate of ${amount} is {pct}% of your average order value. When triggered, this will surprise customers with unexpectedly high shipping. Set the backup rate to 5-10% of average order value (${effective_aov x 0.05} - ${effective_aov x 0.10})."
81
+
82
+ ---
83
+
84
+ ## Check 6: Hidden surcharges
85
+
86
+ **Threshold**: Total `additionalCharges` across all carriers > AOV x 0.10
87
+
88
+ **Why**: Carrier surcharges (fuel, residential delivery, handling fees) add up. If the total surcharge burden exceeds 10% of the order value, it may negate the perceived value of the base shipping rate.
89
+
90
+ **Detection**:
91
+ - Sum all `additionalCharges` across active carriers
92
+ - Compare total against `AOV × 0.10`
93
+ - If exceeded → flag:
94
+
95
+ > "Carrier surcharges add ${total} to shipping costs. Combined with base rates, total shipping cost may deter customers. Review each surcharge to determine if it's necessary."
96
+
97
+ ---
98
+
99
+ ## Summary: Pricing sanity thresholds
100
+
101
+ | Check | Threshold | Action |
102
+ |---|---|---|
103
+ | Excessive rate | Rate > 15% of AOV | Flag — cart abandonment risk |
104
+ | Per-item penalty | `multiplyByQuantity: true` | Flag — discourages larger orders |
105
+ | Free threshold too high | Threshold > 2x AOV | Flag — unreachable for most customers |
106
+ | Free threshold too low | Threshold < 0.8x AOV | Flag — no upsell incentive, margin erosion |
107
+ | Backup rate shock | Backup > 15% of AOV | Flag — recommend 5-10% of AOV |
108
+ | Hidden surcharges | Total surcharges > 10% of AOV | Flag — review necessity |
@@ -0,0 +1,124 @@
1
+ ---
2
+ name: "Guardrail: Shipping Health"
3
+ description: Shipping health score calculation (CRITICAL/POOR/FAIR/GOOD/EXCELLENT) with exact scoring criteria. Includes the mandatory business context filter for international shipping recommendations.
4
+ layer: guardrail
5
+ references:
6
+ - name: "Troubleshoot: Checkout Delivery Drop-off"
7
+ path: ecommerce/troubleshoot-checkout-delivery-dropoff.md
8
+ load: false
9
+ ---
10
+ # Guardrail: Shipping Health
11
+
12
+ > **Related skills** (read with `ReadFullDocsArticle` if needed):
13
+ > - [Troubleshoot: Checkout Delivery Drop-off](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/troubleshoot-checkout-delivery-drop-off)
14
+
15
+ ## When to use
16
+
17
+ Calculate the shipping health score whenever evaluating a store's shipping configuration. Use this score to prioritize recommendations and determine urgency of shipping issues.
18
+
19
+ ---
20
+
21
+ ## Health score levels
22
+
23
+ ### CRITICAL
24
+
25
+ Any of the following conditions:
26
+
27
+ - `delivery_profiles` is empty AND `shipping_options` is empty
28
+ - All regions across all profiles have `active: false`
29
+
30
+ **Implication**: The store cannot ship any orders. Immediate action required.
31
+
32
+ ### POOR
33
+
34
+ Any of the following conditions:
35
+
36
+ - Only 1 delivery profile with empty regions
37
+ - Only 1 shipping option total
38
+ - `delivery_step_cvr` < 50% with shipping issues detected
39
+ - All carriers have `backupRate.active: false`
40
+
41
+ **Implication**: Shipping is minimally functional but has significant gaps that are likely causing lost sales.
42
+
43
+ ### FAIR
44
+
45
+ All of the following conditions:
46
+
47
+ - 1-2 delivery profiles with 1-2 active regions
48
+ - 2-4 shipping options
49
+ - No free shipping option available
50
+ - OR: `delivery_step_cvr` between 50-65%
51
+
52
+ **Implication**: Basic shipping is working but missing key elements that drive conversion.
53
+
54
+ ### GOOD
55
+
56
+ All of the following conditions:
57
+
58
+ - 1+ delivery profiles with both domestic and international regions
59
+ - 3-5 shipping options including at least one free shipping option
60
+ - 1+ active carriers
61
+ - `delivery_step_cvr` between 65-75%
62
+
63
+ **Implication**: Solid shipping setup. Optimization opportunities exist but fundamentals are covered.
64
+
65
+ ### EXCELLENT
66
+
67
+ All of the following conditions:
68
+
69
+ - Multiple active regions
70
+ - Tiered shipping rates
71
+ - Free shipping option available
72
+ - Multiple carriers with backup rates enabled
73
+ - Pickup and/or local delivery options configured
74
+ - `delivery_step_cvr` ≥ 75%
75
+ - No `multiplyByQuantity` pricing on any rate
76
+
77
+ **Implication**: Best-in-class shipping configuration. Focus on maintaining and fine-tuning.
78
+
79
+ ---
80
+
81
+ ## Business context filter (MANDATORY)
82
+
83
+ **This filter MUST be applied before recommending any international shipping action.**
84
+
85
+ ### Check business type
86
+
87
+ Inspect the store's `industry` and `businessType` fields (case-insensitive match) for any of the following keywords:
88
+
89
+ - food
90
+ - restaurant
91
+ - grocery
92
+ - bakery
93
+ - catering
94
+ - perishable
95
+ - fresh
96
+ - meat
97
+ - produce
98
+ - dairy
99
+ - drink
100
+ - beverage
101
+
102
+ ### If matched
103
+
104
+ **DO NOT recommend any international shipping action.** Perishable/food businesses face regulatory, spoilage, and logistics barriers that make international shipping impractical as a default recommendation.
105
+
106
+ ### Identifying international regions
107
+
108
+ A region is considered "international" if any of the following are true:
109
+
110
+ - Region `name` contains "international" or "internacional" (case-insensitive)
111
+ - Region `destinations[]` is empty (wildcard / all countries)
112
+ - Region `destinations` include countries outside the store's home country
113
+
114
+ ---
115
+
116
+ ## Summary: Score decision table
117
+
118
+ | Score | Key indicator | Action |
119
+ |---|---|---|
120
+ | CRITICAL | No profiles/options or all regions inactive | Immediate setup required |
121
+ | POOR | Minimal config, low CVR, or no backup rates | Address fundamental gaps |
122
+ | FAIR | Basic setup, no free shipping, moderate CVR | Add free shipping, expand regions |
123
+ | GOOD | Domestic + international, free shipping, good CVR | Optimize rates and carriers |
124
+ | EXCELLENT | Full coverage, tiered rates, high CVR | Maintain and fine-tune |
@@ -0,0 +1,299 @@
1
+ ---
2
+ name: "Recipe: Apply Shipping Recommendations"
3
+ description: Applies AI-generated shipping recommendations to a Wix e-commerce store. Reads the current delivery profile and shipping options, then creates or updates shipping options based on recommendation data. Supports creating new options with conditional rates, updating existing options, and querying delivery profiles for region/carrier context.
4
+ ---
5
+ # Apply Shipping Recommendations
6
+
7
+ ## Prerequisites
8
+
9
+ - Wix Stores (or another eCommerce business solution) installed on the site
10
+ - Shipping recommendations data available (from the AI recommendation system or provided directly)
11
+
12
+ ## Required APIs
13
+
14
+ - [Query Delivery Profiles](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/shipping-delivery/delivery-profiles/query-delivery-profiles)
15
+ - [Get Delivery Profile](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/shipping-delivery/delivery-profiles/get-delivery-profile)
16
+
17
+ ---
18
+
19
+ ## Step 1: Query the current shipping configuration
20
+
21
+ Call [Query Delivery Profiles](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/shipping-delivery/delivery-profiles/query-delivery-profiles) to understand the site's delivery setup — profiles, regions, carriers, and backup rates.
22
+
23
+ **Endpoint**: `POST https://www.wixapis.com/ecom/v1/delivery-profiles/query`
24
+
25
+ **Request**:
26
+ ```json
27
+ {
28
+ "query": {
29
+ "cursorPaging": {
30
+ "limit": 100
31
+ }
32
+ }
33
+ }
34
+ ```
35
+
36
+ **Response**:
37
+ ```json
38
+ {
39
+ "deliveryProfiles": [
40
+ {
41
+ "id": "6a9b2f9b-533a-4d0d-ac8d-64ec3f32fcbd",
42
+ "name": "General profile",
43
+ "default": true,
44
+ "deliveryRegions": [
45
+ {
46
+ "id": "42b0ed3b-fc54-4ac0-89cf-5d2d17ec441c",
47
+ "name": "Domestic",
48
+ "active": true,
49
+ "deliveryCarriers": [
50
+ {
51
+ "appId": "45c44b27-ca7b-4891-8c0d-1747d588b835",
52
+ "additionalCharges": []
53
+ }
54
+ ],
55
+ "destinations": [
56
+ {
57
+ "countryCode": "GB",
58
+ "subdivisions": []
59
+ }
60
+ ]
61
+ }
62
+ ],
63
+ "revision": "43",
64
+ "createdDate": "2025-10-26T11:05:10.774Z",
65
+ "updatedDate": "2026-04-14T14:43:25.397Z"
66
+ }
67
+ ],
68
+ "pagingMetadata": {
69
+ "count": 1,
70
+ "cursors": {},
71
+ "hasNext": false
72
+ }
73
+ }
74
+ ```
75
+
76
+ Save the profile `id`, `revision`, and each region's `id` and `active` status. Identify which regions have carriers with missing backup rates (`backupRate` absent or `backupRate.active: false`).
77
+
78
+ ---
79
+
80
+ ## Step 2: Query existing shipping options
81
+
82
+ **Endpoint**: `POST https://www.wixapis.com/ecom/v1/shipping-options/query`
83
+
84
+ **Request**:
85
+ ```json
86
+ {
87
+ "query": {
88
+ "cursorPaging": {
89
+ "limit": 100
90
+ }
91
+ }
92
+ }
93
+ ```
94
+
95
+ **Response**:
96
+ ```json
97
+ {
98
+ "shippingOptions": [
99
+ {
100
+ "id": "c0e5be8f-5266-4720-a732-5f571e4750db",
101
+ "revision": "1",
102
+ "createdDate": "2026-04-14T14:43:24.804Z",
103
+ "updatedDate": "2026-04-14T14:43:24.804Z",
104
+ "deliveryRegionId": "42b0ed3b-fc54-4ac0-89cf-5d2d17ec441c",
105
+ "deliveryRegionIds": [],
106
+ "title": "Standard Shipping",
107
+ "estimatedDeliveryTime": "5-7 business days",
108
+ "rates": [
109
+ {
110
+ "amount": "15.00",
111
+ "conditions": [],
112
+ "multiplyByQuantity": false
113
+ }
114
+ ]
115
+ }
116
+ ],
117
+ "pagingMetadata": {
118
+ "count": 1,
119
+ "cursors": {},
120
+ "hasNext": false
121
+ }
122
+ }
123
+ ```
124
+
125
+ Note: The response uses `deliveryRegionId` (singular) as the primary field linking an option to a region.
126
+
127
+ ---
128
+
129
+ ## Step 3: Apply recommendation — Create a new shipping option
130
+
131
+ When the recommendation action is `create_shipping_option`, create a new option linked to a specific delivery region.
132
+
133
+ **Endpoint**: `POST https://www.wixapis.com/ecom/v1/shipping-options`
134
+
135
+ **Request** — flat rate example:
136
+ ```json
137
+ {
138
+ "shippingOption": {
139
+ "title": "Express Shipping",
140
+ "estimatedDeliveryTime": "1-2 business days",
141
+ "deliveryRegionId": "42b0ed3b-fc54-4ac0-89cf-5d2d17ec441c",
142
+ "rates": [
143
+ {
144
+ "amount": "12.99",
145
+ "multiplyByQuantity": false,
146
+ "conditions": []
147
+ }
148
+ ]
149
+ }
150
+ }
151
+ ```
152
+
153
+ **Response**:
154
+ ```json
155
+ {
156
+ "shippingOption": {
157
+ "id": "dece6160-4e72-4fcc-adcc-7607215edab0",
158
+ "revision": "1",
159
+ "createdDate": "2026-04-15T13:14:01.214Z",
160
+ "updatedDate": "2026-04-15T13:14:01.214Z",
161
+ "deliveryRegionId": "42b0ed3b-fc54-4ac0-89cf-5d2d17ec441c",
162
+ "deliveryRegionIds": [],
163
+ "title": "Express Shipping",
164
+ "estimatedDeliveryTime": "1-2 business days",
165
+ "rates": [
166
+ {
167
+ "amount": "12.99",
168
+ "conditions": [],
169
+ "multiplyByQuantity": false
170
+ }
171
+ ]
172
+ }
173
+ }
174
+ ```
175
+
176
+ **Request** — free shipping with price threshold:
177
+ ```json
178
+ {
179
+ "shippingOption": {
180
+ "title": "Free Shipping",
181
+ "estimatedDeliveryTime": "5-7 business days",
182
+ "deliveryRegionId": "42b0ed3b-fc54-4ac0-89cf-5d2d17ec441c",
183
+ "rates": [
184
+ {
185
+ "amount": "0",
186
+ "multiplyByQuantity": false,
187
+ "conditions": [
188
+ {
189
+ "type": "BY_TOTAL_PRICE",
190
+ "operator": "GTE",
191
+ "value": "75"
192
+ }
193
+ ]
194
+ }
195
+ ]
196
+ }
197
+ }
198
+ ```
199
+
200
+ **Key field rules:**
201
+
202
+ | Field | Required | Notes |
203
+ |---|---|---|
204
+ | `title` | Yes | Display name at checkout |
205
+ | `estimatedDeliveryTime` | Yes | Free text shown to customers |
206
+ | `deliveryRegionId` | Yes | Region UUID from Step 1. Must use **singular** field, not `deliveryRegionIds` |
207
+ | `rates` | Yes | Array of rate objects |
208
+ | `rates[].amount` | Yes | Decimal string (`"5.99"`, `"0"` for free) |
209
+ | `rates[].multiplyByQuantity` | Yes | Almost always `false` |
210
+ | `rates[].conditions` | Yes | Empty array for flat rate; see condition types below |
211
+
212
+ **Condition types** (for tiered/conditional rates):
213
+
214
+ | Type | Description | Example |
215
+ |---|---|---|
216
+ | `BY_TOTAL_PRICE` | Cart total threshold | `"operator": "GTE", "value": "75"` |
217
+ | `BY_TOTAL_WEIGHT` | Weight threshold | `"operator": "LTE", "value": "10"` |
218
+ | `BY_TOTAL_QUANTITY` | Item count threshold | `"operator": "GTE", "value": "3"` |
219
+
220
+ Operators: `EQ`, `GT`, `GTE`, `LT`, `LTE`
221
+
222
+ ---
223
+
224
+ ## Step 4: Apply recommendation — Update an existing shipping option
225
+
226
+ When the recommendation action is `update_shipping_option`, update an existing option's title, delivery time, or rates.
227
+
228
+ **Endpoint**: `PATCH https://www.wixapis.com/ecom/v1/shipping-options/{shippingOptionId}`
229
+
230
+ Replace `{shippingOptionId}` with the option's `id` from Step 2.
231
+
232
+ **Request**:
233
+ ```json
234
+ {
235
+ "shippingOption": {
236
+ "id": "c0e5be8f-5266-4720-a732-5f571e4750db",
237
+ "revision": "1",
238
+ "title": "Updated Standard Shipping",
239
+ "estimatedDeliveryTime": "3-5 business days",
240
+ "rates": [
241
+ {
242
+ "amount": "9.99",
243
+ "multiplyByQuantity": false,
244
+ "conditions": []
245
+ }
246
+ ]
247
+ }
248
+ }
249
+ ```
250
+
251
+ **Response**:
252
+ ```json
253
+ {
254
+ "shippingOption": {
255
+ "id": "c0e5be8f-5266-4720-a732-5f571e4750db",
256
+ "revision": "2",
257
+ "createdDate": "2026-04-14T14:43:24.804Z",
258
+ "updatedDate": "2026-04-15T13:14:13.716Z",
259
+ "deliveryRegionId": "42b0ed3b-fc54-4ac0-89cf-5d2d17ec441c",
260
+ "deliveryRegionIds": [],
261
+ "title": "Updated Standard Shipping",
262
+ "estimatedDeliveryTime": "3-5 business days",
263
+ "rates": [
264
+ {
265
+ "amount": "9.99",
266
+ "conditions": [],
267
+ "multiplyByQuantity": false
268
+ }
269
+ ]
270
+ }
271
+ }
272
+ ```
273
+
274
+ The `revision` field is required and must match the current revision. The response returns the incremented revision.
275
+
276
+ ---
277
+
278
+ ## Step 5: Verify the changes
279
+
280
+ After applying recommendations, query shipping options again (Step 2) to confirm the changes took effect. Verify:
281
+
282
+ - New options appear in the list with the correct title, rates, and region link
283
+ - Updated options reflect the new values and incremented revision
284
+ - The option is linked to the correct `deliveryRegionId`
285
+
286
+ ---
287
+
288
+ ## Error Handling
289
+
290
+ | Error | Cause | Fix |
291
+ |---|---|---|
292
+ | `deliveryRegionId is not a valid GUID` | Used `deliveryRegionIds` (plural) instead of `deliveryRegionId` (singular) in create request | Use the singular `deliveryRegionId` field |
293
+ | `SHIPPING_OPTION_NOT_FOUND` | The shipping option ID doesn't exist | Re-query shipping options to get current IDs |
294
+ | `REVISION_MISMATCH` | The `revision` doesn't match the current version | Re-fetch the option to get the latest revision, then retry |
295
+
296
+ ## References
297
+
298
+ - [Delivery Profiles API](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/shipping-delivery/delivery-profiles/introduction)
299
+ - [Shipping Options API](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/shipping-delivery/shipping-options/introduction)