@wix/agent-skills 1.11.0 → 1.13.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 (37) hide show
  1. package/README.md +4 -0
  2. package/package.json +1 -1
  3. package/skills/wix-app/references/data-collection/WIX_DATA.md +10 -0
  4. package/skills/wix-design-system/SKILL.md +3 -1
  5. package/skills/wix-manage/SKILL.md +32 -54
  6. package/skills/wix-manage/references/ecommerce/api-recommendation-tracking.md +3 -2
  7. package/skills/wix-manage/references/ecommerce/ecom-load-context.md +144 -0
  8. package/skills/wix-manage/references/ecommerce/ecom-pricing.md +84 -0
  9. package/skills/wix-manage/references/ecommerce/ecom-shipping.md +64 -0
  10. package/skills/wix-manage/references/ecommerce/{setup-coupons.md → pricing-promotions/ecom-pricing-create-coupon.md} +20 -6
  11. package/skills/wix-manage/references/ecommerce/{setup-discount-rules.md → pricing-promotions/ecom-pricing-create-discount-rule.md} +31 -1
  12. package/skills/wix-manage/references/ecommerce/{flow-bundle-and-save.md → pricing-promotions/ecom-pricing-flow-bundle-and-save.md} +11 -52
  13. package/skills/wix-manage/references/ecommerce/{flow-seasonal-promotion.md → pricing-promotions/ecom-pricing-flow-seasonal-promotion.md} +17 -57
  14. package/skills/wix-manage/references/ecommerce/{flow-stock-mover.md → pricing-promotions/ecom-pricing-flow-stock-mover.md} +28 -70
  15. package/skills/wix-manage/references/ecommerce/{flow-upsell-boost.md → pricing-promotions/ecom-pricing-flow-upsell-boost.md} +15 -68
  16. package/skills/wix-manage/references/ecommerce/{goal-clear-inventory.md → pricing-promotions/ecom-pricing-goal-clear-inventory.md} +22 -13
  17. package/skills/wix-manage/references/ecommerce/{goal-drive-cross-sells.md → pricing-promotions/ecom-pricing-goal-drive-cross-sells.md} +26 -8
  18. package/skills/wix-manage/references/ecommerce/{goal-increase-aov.md → pricing-promotions/ecom-pricing-goal-increase-aov.md} +32 -25
  19. package/skills/wix-manage/references/ecommerce/{goal-seasonal-revenue.md → pricing-promotions/ecom-pricing-goal-seasonal-revenue.md} +21 -8
  20. package/skills/wix-manage/references/ecommerce/{troubleshoot-discount-not-applying.md → pricing-promotions/ecom-pricing-troubleshoot-not-applying.md} +1 -1
  21. package/skills/wix-manage/references/ecommerce/recommend-ecommerce-strategy.md +23 -47
  22. package/skills/wix-manage/references/ecommerce/{api-shipping.md → shipping/ecom-shipping-api.md} +4 -3
  23. package/skills/wix-manage/references/ecommerce/{flow-fix-coverage-gaps.md → shipping/ecom-shipping-fix-coverage.md} +23 -17
  24. package/skills/wix-manage/references/ecommerce/{flow-add-free-shipping.md → shipping/ecom-shipping-free-shipping.md} +23 -18
  25. package/skills/wix-manage/references/ecommerce/{flow-optimize-shipping-rates.md → shipping/ecom-shipping-optimize-rates.md} +19 -16
  26. package/skills/wix-manage/references/ecommerce/{setup-store-pickup-location.md → shipping/ecom-shipping-setup-pickup.md} +12 -10
  27. package/skills/wix-manage/references/ecommerce/{setup-shipping-rates.md → shipping/ecom-shipping-setup-rates.md} +1 -2
  28. package/skills/wix-manage/references/ecommerce/{setup-shipping-regions.md → shipping/ecom-shipping-setup-regions.md} +1 -2
  29. package/skills/wix-manage/references/sites/query-sites.md +104 -32
  30. package/skills/wix-manage/references/ecommerce/goal-reduce-cart-abandonment.md +0 -147
  31. package/skills/wix-manage/references/ecommerce/guardrail-discount-conflicts.md +0 -118
  32. package/skills/wix-manage/references/ecommerce/guardrail-margin-protection.md +0 -88
  33. package/skills/wix-manage/references/ecommerce/guardrail-rate-pricing-sanity.md +0 -108
  34. package/skills/wix-manage/references/ecommerce/guardrail-shipping-health.md +0 -124
  35. package/skills/wix-manage/references/ecommerce/recipe-apply-shipping-recommendations.md +0 -298
  36. package/skills/wix-manage/references/ecommerce/skill-graph.md +0 -139
  37. package/skills/wix-manage/references/ecommerce/troubleshoot-checkout-delivery-dropoff.md +0 -124
@@ -1,28 +1,16 @@
1
1
  ---
2
2
  name: "Flow: Bundle and Save"
3
- description: Creates a discount campaign promoting product discovery and cross-selling by requiring minimum item quantities. Targets high-margin categories with complementary products.
4
- layer: flow
5
- references:
6
- - name: "Guardrail: Discount Conflicts"
7
- path: ecommerce/guardrail-discount-conflicts.md
8
- load: true
9
- - name: "Setup: Discount Rules"
10
- path: ecommerce/setup-discount-rules.md
11
- load: true
3
+ description: BUNDLE_AND_SAVE sub-flow — load [Goal: Drive Cross-Sells] FIRST (it owns classification and routing); this is a sub-step, NOT a direct entry from README.
12
4
  ---
13
5
  # Flow: Bundle & Save Campaign
14
6
 
15
- > **Before executing this skill**, read these referenced skills with `ReadFullDocsArticle`:
16
- > - [Guardrail: Discount Conflicts](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/guardrail-discount-conflicts)
17
- > - [Setup: Discount Rules](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/setup-discount-rules)
7
+ > **Before executing this skill**, read [Create Discount Rule](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/pricing-create-discount-rule) with `ReadFullDocsArticle` — it contains the discount-rule mechanics **and** the pre-create guardrails (conflict/stacking, margin floor, %-sanity).
18
8
 
19
9
  Creates a discount that rewards customers for purchasing multiple items, encouraging product discovery and cross-selling. The discount activates when the cart contains a minimum number of items, and targets categories or products where bundling makes strategic sense.
20
10
 
21
11
  ## Prerequisites
22
12
 
23
- - Wix Stores installed on the site
24
- - Products exist in the catalog across multiple categories
25
- - Access to `getCatalogAnalytics` and `getProductCatalogData` tools
13
+ - Products exist in the catalog across multiple categories (`siteData.hasCatalog === true`, checked at context load)
26
14
  - Categories with 2+ products suitable for bundling
27
15
 
28
16
  ## Required APIs
@@ -32,25 +20,18 @@ Creates a discount that rewards customers for purchasing multiple items, encoura
32
20
 
33
21
  ---
34
22
 
35
- ## Step 1: Gather catalog data
23
+ ## Step 1: Use pre-loaded catalog data
36
24
 
37
- Call `getCatalogAnalytics` and `getProductCatalogData` concurrently to assess the catalog's bundle potential.
25
+ Catalog analytics and product data are already in conversation context — do NOT re-fetch:
38
26
 
39
- **getCatalogAnalytics** call:
40
- ```
41
- aggregates: min(price), max(price), avg(profitMargin), count
42
- ```
43
-
44
- **getProductCatalogData** call:
45
- ```
46
- ordered: price DESC, ordersCount DESC
47
- ```
27
+ - `siteData.catalogAnalytics` — category groups with `min(price)`, `max(price)`, `avg(profitMargin)`, `count()`. Loaded by the eCommerce Load Context.
28
+ - `siteData.productCatalogData` — per-product list sorted `price DESC, ordersCount DESC` for BUNDLE_AND_SAVE goal. Loaded by the run-a-sale orchestrator Step 5.
48
29
 
49
- Save the following values:
50
- - `min_price`, `max_price` — price range determines viable bundle combinations
30
+ Extract the following from context:
31
+ - `min_price`, `max_price` — from the "All Products" group in `siteData.catalogAnalytics`
51
32
  - `avg_profit_margin` — sets the discount ceiling
52
33
  - `count` — catalog breadth; more products = more bundling options
53
- - Top products by price and order count — identifies popular items for bundle anchoring
34
+ - Top products by price and order count — from `siteData.productCatalogData`
54
35
 
55
36
  ---
56
37
 
@@ -118,29 +99,7 @@ If scope is CATEGORY, call `getCategoryIds` to convert category names to GUIDs.
118
99
 
119
100
  ## Step 7: Run guardrail checks
120
101
 
121
- **Run the Guardrail: Discount Conflicts checks before creating the rule.**
122
-
123
- 1. Query existing active discount rules:
124
-
125
- **Endpoint**: `POST https://www.wixapis.com/ecom/v1/discount-rules/query`
126
-
127
- **Request**:
128
- ```json
129
- {
130
- "query": {
131
- "filter": {
132
- "active": true
133
- },
134
- "paging": {
135
- "limit": 100
136
- }
137
- }
138
- }
139
- ```
140
-
141
- 2. Check for scope overlap with existing rules. Bundle discounts are especially prone to stacking — a customer buying 3 items in a category with both a bundle discount and a catalog-wide sale would get both.
142
- 3. Check for coupon stacking risks.
143
- 4. If conflicts found, present to merchant and get confirmation.
102
+ **Run the pre-create guardrails in [Create Discount Rule](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/pricing-create-discount-rule) → "Guardrails" before creating the rule.** Bundle discounts are especially prone to **scope-overlap stacking** (a customer buying 3 items in a category with both a bundle discount and a catalog-wide sale gets both) and **coupon stacking** — present any conflicts to the merchant and confirm.
144
103
 
145
104
  ---
146
105
 
@@ -1,30 +1,22 @@
1
1
  ---
2
2
  name: "Flow: Seasonal Promotion"
3
- description: Creates event-driven promotional campaigns tied to holidays or seasonal events. Uses country and date context to identify upcoming events, calculates optimal campaign windows, and targets relevant categories.
4
- layer: flow
5
- references:
6
- - name: "Guardrail: Discount Conflicts"
7
- path: ecommerce/guardrail-discount-conflicts.md
8
- load: true
9
- - name: "Setup: Discount Rules"
10
- path: ecommerce/setup-discount-rules.md
11
- load: true
3
+ description: SEASONAL sub-flow — load [Goal: Seasonal Revenue] FIRST (it owns classification and routing); this is a sub-step, NOT a direct entry from README.
12
4
  ---
13
5
  # Flow: Seasonal Promotion
14
6
 
15
- > **Before executing this skill**, read these referenced skills with `ReadFullDocsArticle`:
16
- > - [Guardrail: Discount Conflicts](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/guardrail-discount-conflicts)
17
- > - [Setup: Discount Rules](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/setup-discount-rules)
7
+ > ⛔ **Routing gate — [Goal: Seasonal Revenue](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/goal-seasonal-revenue) must be loaded before this flow.**
8
+ >
9
+ > This flow is a sub-step, not a direct entry point. If you have not yet called `ReadFullDocsArticle` on [Goal: Seasonal Revenue](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/goal-seasonal-revenue) in this conversation, **stop and load it now**. The goal skill owns the SEASONAL classification rule, the time-window presentation requirement, and the priority rule that gates access to this flow.
10
+ >
11
+ > **Before executing this flow**, also read [Create Discount Rule](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/pricing-create-discount-rule) with `ReadFullDocsArticle` — it contains the discount-rule mechanics **and** the pre-create guardrails (conflict/stacking, margin floor, %-sanity).
18
12
 
19
13
  Creates event-driven promotional discounts tied to holidays, shopping events, or seasonal milestones. The flow identifies upcoming events based on the site's country and current date, calculates optimal campaign start/end windows, and targets event-relevant product categories with appropriately sized discounts.
20
14
 
21
15
  ## Prerequisites
22
16
 
23
- - Wix Stores installed on the site
24
- - Products exist in the catalog
25
- - Access to `getCatalogAnalytics`, `getProductCatalogData`, and `getSiteData` tools
17
+ - Products exist in the catalog (`siteData.hasCatalog === true`, checked at context load)
26
18
  - `current_date` available for event scheduling
27
- - Site `country` known for region-specific event mapping
19
+ - Site `country` known for region-specific event mapping (`siteData.country`, loaded by eCommerce Load Context)
28
20
 
29
21
  ## Required APIs
30
22
 
@@ -82,27 +74,18 @@ For Black Friday + Cyber Monday, use a single extended window: start the precedi
82
74
 
83
75
  ---
84
76
 
85
- ## Step 3: Gather catalog data
77
+ ## Step 3: Use pre-loaded catalog data
86
78
 
87
- Call `getCatalogAnalytics` and `getProductCatalogData` concurrently.
79
+ Catalog analytics and product data are already in conversation context — do NOT re-fetch:
88
80
 
89
- **getCatalogAnalytics** call:
90
- ```
91
- aggregates: sum(ordersCount), quantiles([0.5, 0.9], price), avg(profitMargin)
92
- ```
93
-
94
- **getProductCatalogData** call:
95
- ```
96
- ordered: ordersCount DESC
97
- ```
98
-
99
- This sort order surfaces the best-selling products first — seasonal campaigns should lead with proven sellers to maximize revenue.
81
+ - `siteData.catalogAnalytics` — category groups with `sum(ordersCount)`, `quantiles([0.5,0.9], price)`, `avg(profitMargin)`. Loaded by the eCommerce Load Context.
82
+ - `siteData.productCatalogData` — per-product list sorted `ordersCount DESC` for SEASONAL goal. Loaded by the run-a-sale orchestrator Step 5.
100
83
 
101
- Save the following values:
102
- - `total_orders` — overall sales volume
103
- - `price_p50`, `price_p90` — price distribution for discount sizing
84
+ Extract from context:
85
+ - `total_orders` — `sum(ordersCount)` from the "All Products" group in `siteData.catalogAnalytics`
86
+ - `price_p50`, `price_p90` — from quantiles in `siteData.catalogAnalytics`
104
87
  - `avg_profit_margin` — sets discount ceiling
105
- - Top products by sales volume
88
+ - Top products by sales volume — from `siteData.productCatalogData`
106
89
 
107
90
  ---
108
91
 
@@ -160,30 +143,7 @@ If scope is CATEGORY, call `getCategoryIds` to convert category names to GUIDs.
160
143
 
161
144
  ## Step 8: Run guardrail checks
162
145
 
163
- **Run the Guardrail: Discount Conflicts checks before creating the rule.**
164
-
165
- 1. Query existing active discount rules:
166
-
167
- **Endpoint**: `POST https://www.wixapis.com/ecom/v1/discount-rules/query`
168
-
169
- **Request**:
170
- ```json
171
- {
172
- "query": {
173
- "filter": {
174
- "active": true
175
- },
176
- "paging": {
177
- "limit": 100
178
- }
179
- }
180
- }
181
- ```
182
-
183
- 2. Check for time overlap — seasonal promotions have defined windows, so check that no existing rule covers the same period on the same scope.
184
- 3. Check for scope overlap — a seasonal category discount stacking with an existing catalog-wide discount could create unexpectedly deep combined discounts.
185
- 4. Check for coupon stacking — seasonal events often have high coupon usage.
186
- 5. If conflicts found, present to merchant and get confirmation.
146
+ **Run the pre-create guardrails in [Create Discount Rule](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/pricing-create-discount-rule) → "Guardrails" before creating the rule.** For seasonal campaigns the most relevant are **time overlap** (defined windows — ensure no existing rule covers the same period/scope), **scope overlap** (a category discount stacking with a catalog-wide one), and **coupon stacking** (seasonal events drive high coupon usage). Present any conflicts to the merchant and get confirmation.
187
147
 
188
148
  ---
189
149
 
@@ -1,32 +1,18 @@
1
1
  ---
2
2
  name: "Flow: Stock Mover"
3
- description: Creates discount campaigns to clear slow-moving inventory by targeting products with high stock levels and low sales velocity. Uses deeper discounts proportional to inventory urgency.
4
- layer: flow
5
- references:
6
- - name: "Guardrail: Discount Conflicts"
7
- path: ecommerce/guardrail-discount-conflicts.md
8
- load: true
9
- - name: "Guardrail: Margin Protection"
10
- path: ecommerce/guardrail-margin-protection.md
11
- load: true
12
- - name: "Setup: Discount Rules"
13
- path: ecommerce/setup-discount-rules.md
14
- load: true
3
+ description: Stock-mover clearance sub-flow — load [Goal: Clear Inventory] FIRST (it owns the routing); this is a sub-step.
15
4
  ---
16
5
  # Flow: Stock Mover Clearance
17
6
 
18
- > **Before executing this skill**, read these referenced skills with `ReadFullDocsArticle`:
19
- > - [Guardrail: Discount Conflicts](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/guardrail-discount-conflicts)
20
- > - [Guardrail: Margin Protection](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/guardrail-margin-protection)
21
- > - [Setup: Discount Rules](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/setup-discount-rules)
7
+ > **Routing rule (READ FIRST).** This recipe is a sub-step of [Goal: Clear Inventory](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/goal-clear-inventory). If you arrived here directly from the WixREADME index, load the goal recipe NOW before executing — it owns the velocity scoring, classification cues, and the per-recommendation presentation rules (including the **margin-floor guardrail** surfacing requirement).
8
+ >
9
+ > **Then** read [Create Discount Rule](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/pricing-create-discount-rule) with `ReadFullDocsArticle` — it contains the discount-rule mechanics **and** the pre-create guardrails (conflict/stacking, margin floor, %-sanity).
22
10
 
23
11
  Creates a discount targeting slow-moving inventory — products with high stock levels and low sales velocity. The discount depth is proportional to how overstocked the product is, with deeper discounts for the most stagnant items. Margin protection guardrails are especially important here since clearance discounts tend to push closer to cost.
24
12
 
25
13
  ## Prerequisites
26
14
 
27
- - Wix Stores installed on the site
28
- - Products exist in the catalog with inventory (quantity) data
29
- - Access to `getCatalogAnalytics` and `getProductCatalogData` tools
15
+ - Products exist in the catalog with inventory (quantity) data (`siteData.hasCatalog === true`, checked at context load)
30
16
  - Inventory tracking enabled for target products
31
17
 
32
18
  ## Required APIs
@@ -36,27 +22,18 @@ Creates a discount targeting slow-moving inventory — products with high stock
36
22
 
37
23
  ---
38
24
 
39
- ## Step 1: Gather inventory and sales data
25
+ ## Step 1: Use pre-loaded catalog data
40
26
 
41
- Call `getCatalogAnalytics` and `getProductCatalogData` concurrently to assess stock levels and sales velocity.
27
+ Catalog analytics and product data are already in conversation context — do NOT re-fetch:
42
28
 
43
- **getCatalogAnalytics** call:
44
- ```
45
- aggregates: sum(quantity), sum(ordersCount), avg(profitMargin)
46
- ```
29
+ - `siteData.catalogAnalytics` — category groups with `sum(quantity)`, `sum(ordersCount)`, `avg(profitMargin)`. Loaded by the eCommerce Load Context.
30
+ - `siteData.productCatalogData` — per-product list sorted `quantity DESC, ordersCount ASC` for STOCK_MOVER goal. Loaded by the run-a-sale orchestrator Step 5.
47
31
 
48
- **getProductCatalogData** call:
49
- ```
50
- ordered: quantity DESC, ordersCount ASC
51
- ```
52
-
53
- This sort order surfaces products with the most stock and the fewest sales first — the primary candidates for clearance.
54
-
55
- Save the following values:
56
- - `total_quantity` — total stock across catalog
57
- - `total_orders` — total sales across catalog
58
- - `avg_profit_margin` — average profit margin (sets discount ceiling)
59
- - Per-product: `quantity`, `ordersCount`, `price`, `name`, `id`, `categoryId`
32
+ Extract from context:
33
+ - `total_quantity` — `sum(quantity)` from the "All Products" group in `siteData.catalogAnalytics`
34
+ - `total_orders` — `sum(ordersCount)` from the "All Products" group
35
+ - `avg_profit_margin` — sets the discount ceiling
36
+ - Per-product: `quantity`, `ordersCount`, `price`, `name`, `id`, `categoryId` — from `siteData.productCatalogData`
60
37
 
61
38
  ---
62
39
 
@@ -122,38 +99,7 @@ If scope is CATEGORY, call `getCategoryIds` to convert category names to GUIDs.
122
99
 
123
100
  ## Step 6: Run guardrail checks
124
101
 
125
- **IMPORTANT: Run both guardrail checks before creating the discount rule. Clearance discounts are the most likely to trigger margin warnings.**
126
-
127
- ### 6a: Discount Conflicts
128
-
129
- 1. Query existing active discount rules:
130
-
131
- **Endpoint**: `POST https://www.wixapis.com/ecom/v1/discount-rules/query`
132
-
133
- **Request**:
134
- ```json
135
- {
136
- "query": {
137
- "filter": {
138
- "active": true
139
- },
140
- "paging": {
141
- "limit": 100
142
- }
143
- }
144
- }
145
- ```
146
-
147
- 2. Check for scope overlap. Clearance items that already have an active discount would stack — warn the merchant about combined discount depth.
148
- 3. Check for coupon stacking risks. A customer combining a clearance discount with a coupon code could get an unexpectedly deep total discount.
149
-
150
- ### 6b: Margin Protection
151
-
152
- This check is especially critical for clearance:
153
-
154
- - Verify `discount_percentage <= avg_profit_margin - 15%` for each candidate product.
155
- - If the discount would push effective margin below 15%, warn the merchant: "This clearance discount of {discount}% on {product_name} would reduce the effective margin to {remaining_margin}%. The minimum margin threshold is 15%. Proceed?"
156
- - If margin data is unavailable, apply extra caution — cap at 15% unless the merchant explicitly overrides.
102
+ **Run the pre-create guardrails in [Create Discount Rule](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/pricing-create-discount-rule) → "Guardrails" before creating the rule** (conflict/stacking, %-sanity, margin floor). Clearance is the **most margin-sensitive** case: discounts push closest to cost, so the margin-floor check (effective margin ≥ 15% unless the merchant overrides) is the one most likely to fire here — verify it per candidate product.
157
103
 
158
104
  ---
159
105
 
@@ -278,7 +224,19 @@ Save the returned `id` and `revision` for later management.
278
224
  1. Query discount rules to confirm the new rule exists and is `active: true`
279
225
  2. Verify the correct products or category are targeted
280
226
  3. Report to the merchant:
281
- > "Clearance discount is live: {discount}% off {number_of_products} slow-moving items. These products had a velocity ratio of {avg_velocity}, indicating high stock relative to sales. Monitor inventory levels — once stock clears, consider deactivating the rule."
227
+ > "Clearance discount is live: {discount}% off {number_of_products} slow-moving items. These products had a velocity ratio of {avg_velocity}, indicating high stock relative to sales. **Margin floor enforced — effective margin stays ≥ 15% on every targeted SKU.** Monitor inventory levels — once stock clears, consider deactivating the rule."
228
+
229
+ ---
230
+
231
+ ## Presentation requirement — margin guardrail line is mandatory
232
+
233
+ When generating recommendations for the merchant (whether persisted as PROPOSED via the tracking API or returned inline), **every clearance recommendation MUST include explicit margin-floor language in its `reasoning` / `why` field.** Examples:
234
+
235
+ - "Discount keeps effective margin ≥ 15% (minMarginPct floor)."
236
+ - "Pre-discount margin {X}%, post-discount {Y}% — above 15% breakeven floor."
237
+ - "Margin protected: 20% off does NOT push `{product}` below the 15% floor."
238
+
239
+ Urgency labels, stock level, capital tied up, and the "Why {N}%" velocity rationale are NOT substitutes — the merchant must see a per-item margin protection statement on every clearance line. If you cannot meet the floor at the velocity-tier discount, either reduce the discount or drop the item; never silently breach the floor.
282
240
 
283
241
  ---
284
242
 
@@ -1,33 +1,17 @@
1
1
  ---
2
2
  name: "Flow: Upsell Boost"
3
- description: Creates a discount campaign to increase average order value by setting minimum subtotal conditions above current AOV. Uses margin-based discount tiers and targets high-margin categories.
4
- layer: flow
5
- references:
6
- - name: "Guardrail: Discount Conflicts"
7
- path: ecommerce/guardrail-discount-conflicts.md
8
- load: true
9
- - name: "Guardrail: Margin Protection"
10
- path: ecommerce/guardrail-margin-protection.md
11
- load: true
12
- - name: "Setup: Discount Rules"
13
- path: ecommerce/setup-discount-rules.md
14
- load: true
3
+ description: UPSELL_BOOST sub-flow — load [Goal: Increase AOV] FIRST (it owns classification and routing); this is a sub-step, NOT a direct entry from README.
15
4
  ---
16
5
  # Flow: Upsell Boost Campaign
17
6
 
18
- > **Before executing this skill**, read these referenced skills with `ReadFullDocsArticle`:
19
- > - [Guardrail: Discount Conflicts](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/guardrail-discount-conflicts)
20
- > - [Guardrail: Margin Protection](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/guardrail-margin-protection)
21
- > - [Setup: Discount Rules](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/setup-discount-rules)
7
+ > **Before executing this skill**, read [Create Discount Rule](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/pricing-create-discount-rule) with `ReadFullDocsArticle` — it contains the discount-rule mechanics **and** the pre-create guardrails (conflict/stacking, margin floor, %-sanity).
22
8
 
23
9
  Creates a discount that incentivizes customers to spend more per order by setting a minimum subtotal threshold above the store's current AOV. The discount percentage is scaled to the store's average profit margin, and the scope targets high-margin categories or products.
24
10
 
25
11
  ## Prerequisites
26
12
 
27
- - Wix Stores installed on the site
28
- - Products exist in the catalog with price data
29
- - Access to `getCatalogAnalytics` and `getProductCatalogData` tools
30
- - AOV data available from site metrics (revenue / ordersCount)
13
+ - Products exist in the catalog with price data (`siteData.hasCatalog === true`, checked at context load)
14
+ - AOV data available from site metrics (`siteData.aov`, loaded by eCommerce Load Context)
31
15
 
32
16
  ## Required APIs
33
17
 
@@ -36,27 +20,19 @@ Creates a discount that incentivizes customers to spend more per order by settin
36
20
 
37
21
  ---
38
22
 
39
- ## Step 1: Gather catalog data and site metrics
23
+ ## Step 1: Use pre-loaded catalog data
40
24
 
41
- Call `getCatalogAnalytics` and `getProductCatalogData` concurrently to collect pricing, margin, and product data.
25
+ Catalog analytics and product data are already in conversation context — do NOT re-fetch:
42
26
 
43
- **getCatalogAnalytics** call:
44
- ```
45
- aggregates: count, quantiles([0.5, 0.75, 0.9], price), avg(profitMargin)
46
- ```
47
-
48
- **getProductCatalogData** call:
49
- ```
50
- ordered: price DESC, ordersCount DESC
51
- ```
27
+ - `siteData.catalogAnalytics` — category groups with `count()`, `quantiles([0.5,0.75,0.9], price)`, `avg(profitMargin)`. Loaded by the eCommerce Load Context.
28
+ - `siteData.productCatalogData` — per-product list sorted `price DESC, ordersCount DESC` for UPSELL_BOOST goal. Loaded by the run-a-sale orchestrator Step 5.
29
+ - `siteData.aov` — site-level AOV (revenue / ordersCount). Loaded by eCommerce Load Context.
52
30
 
53
- Also retrieve site-level AOV from `getSiteData` (AOV = revenue / ordersCount). Run the AOV sanity check: if AOV < price_p25, override with price_p50 as the effective AOV.
54
-
55
- Save the following values:
56
- - `effective_aov` — the validated average order value
57
- - `avg_profit_margin` — average profit margin across the catalog
58
- - `price_p50`, `price_p75`, `price_p90` — pricing quantiles
59
- - Top products by price and order volume
31
+ Extract from context:
32
+ - `effective_aov` — use `siteData.aov`; run AOV sanity check: if AOV < price_p25, override with price_p50 as effective AOV
33
+ - `avg_profit_margin` — from the "All Products" group in `siteData.catalogAnalytics`
34
+ - `price_p50`, `price_p75`, `price_p90` — from quantiles in `siteData.catalogAnalytics`
35
+ - Top products by price and order volume — from `siteData.productCatalogData`
60
36
 
61
37
  ---
62
38
 
@@ -114,36 +90,7 @@ Max 3 categoryIds per discount rule.
114
90
 
115
91
  ## Step 6: Run guardrail checks
116
92
 
117
- **IMPORTANT: Run both guardrail checks before creating the discount rule.**
118
-
119
- ### 6a: Discount Conflicts
120
-
121
- 1. Query existing active discount rules:
122
-
123
- **Endpoint**: `POST https://www.wixapis.com/ecom/v1/discount-rules/query`
124
-
125
- **Request**:
126
- ```json
127
- {
128
- "query": {
129
- "filter": {
130
- "active": true
131
- },
132
- "paging": {
133
- "limit": 100
134
- }
135
- }
136
- }
137
- ```
138
-
139
- 2. Check for scope overlap, time overlap, and coupon stacking risks with the planned upsell discount.
140
- 3. If conflicts found, present to merchant and get confirmation before proceeding.
141
-
142
- ### 6b: Margin Protection
143
-
144
- Verify that `discount_percentage <= avg_profit_margin - 15%` (minMarginPct). If the discount would push effective margin below 15%, warn the merchant.
145
-
146
- The global discount cap is 25%. Do not exceed this unless the merchant explicitly overrides it.
93
+ **Run the pre-create guardrails in [Create Discount Rule](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/pricing-create-discount-rule) → "Guardrails" before creating the rule** — conflict/stacking (scope, time, coupon cross-stacking), the 25% cap, the 15% margin floor, and %-sanity. Present any warnings to the merchant and get confirmation before proceeding.
147
94
 
148
95
  ---
149
96
 
@@ -1,22 +1,16 @@
1
1
  ---
2
2
  name: "Goal: Clear Inventory"
3
- description: Maps the STOCK_MOVER business goal to inventory turnover KPIs and clearance discount flows.
4
- layer: goal
5
- references:
6
- - name: "Flow: Stock Mover"
7
- path: ecommerce/flow-stock-mover.md
8
- load: true
9
- - name: "Guardrail: Margin Protection"
10
- path: ecommerce/guardrail-margin-protection.md
11
- load: false
3
+ description: STOCK_MOVER clearance goal — always load BEFORE recommending any clearance / overstock / slow-stock / dead-inventory action.
12
4
  ---
13
5
  # Goal: Clear Slow-Moving Inventory
14
6
 
15
- > **Before executing this skill**, read these referenced skills with `ReadFullDocsArticle`:
16
- > - [Flow: Stock Mover](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/flow-stock-mover)
7
+ > **Routing rule (READ FIRST).** Any merchant query about clearing slow / overstocked / dead / stagnant inventory MUST load this recipe before any other clearance recipe. Do NOT route directly to [Flow: Stock Mover](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/flow-stock-mover) from the WixREADME index — this goal owns the velocity scoring, discount tiers, **margin-floor guardrail**, and the per-recommendation presentation rules. The flow is a sub-step.
17
8
  >
18
- > **Related skills** (read with `ReadFullDocsArticle` if needed):
19
- > - [Guardrail: Margin Protection](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/guardrail-margin-protection)
9
+ > ⛔ **MANDATORY — call this NOW before any API call or recommendation generation:**
10
+ > ```
11
+ > ReadFullDocsArticle("https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/flow-stock-mover")
12
+ > ```
13
+ > The guardrail is also enforced in [Pricing: Create Discount Rule](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/pricing-create-discount-rule) → "Guardrails".
20
14
 
21
15
  Automate clearance discounts for products with high stock levels and low sales velocity, converting stagnant inventory into revenue before it becomes a carrying cost liability.
22
16
 
@@ -79,6 +73,21 @@ The sole action for this goal. Identifies slow-moving products using the velocit
79
73
 
80
74
  ---
81
75
 
76
+ ## Presentation requirement — surface the margin guardrail
77
+
78
+ **Every clearance recommendation presented to the merchant MUST explicitly reference the margin-floor guardrail in its `reasoning` / `why` field.** Clearance discounts push closest to cost, so the merchant needs to see — per item — that the discount stays above the floor.
79
+
80
+ Acceptable phrasings:
81
+ - "Discount keeps effective margin ≥ 15% (minMarginPct floor)."
82
+ - "Stays above breakeven — current margin {X}%, post-discount {Y}%, floor 15%."
83
+ - "Margin protected: this discount does NOT push below the 15% floor on `{product}`."
84
+
85
+ If a candidate item would violate the floor at the velocity-tier discount, **either** lower the discount to stay above the floor and say so, **or** drop the item and note "skipped — would breach margin floor."
86
+
87
+ Do NOT present a clearance recommendation that omits margin language. Urgency / stock level / "why this %" are not substitutes — the guardrail line is required.
88
+
89
+ ---
90
+
82
91
  ## Measurement Plan
83
92
 
84
93
  ### Before campaign launch
@@ -1,16 +1,16 @@
1
1
  ---
2
2
  name: "Goal: Drive Cross-Sells"
3
- description: Maps the BUNDLE_AND_SAVE business goal to multi-item purchase KPIs and bundling flows.
4
- layer: goal
5
- references:
6
- - name: "Flow: Bundle and Save"
7
- path: ecommerce/flow-bundle-and-save.md
8
- load: true
3
+ description: BUNDLE_AND_SAVE goal — always load BEFORE recommending bundling / cross-sell / multi-item / "buy together" actions.
9
4
  ---
10
5
  # Goal: Drive Cross-Sells and Product Discovery
11
6
 
12
- > **Before executing this skill**, read these referenced skills with `ReadFullDocsArticle`:
13
- > - [Flow: Bundle and Save](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/flow-bundle-and-save)
7
+ > **Routing rule (READ FIRST).** Any merchant query about cross-sells, bundling, "buy together", multi-item purchases, or items-per-order MUST load this recipe before any flow-* recipe. Do NOT route directly to [Flow: Bundle and Save](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/flow-bundle-and-save) from the WixREADME index — this goal owns the catalog-profile→bundle-shape matrix and the **per-recommendation multi-item-structure requirement** (every recommendation MUST use `minItemQuantity` or an equivalent multi-item condition — plain single-item percent-off recommendations FAIL this goal). The flow is a sub-step.
8
+ >
9
+ > ⛔ **MANDATORY — call this NOW before any API call or recommendation generation:**
10
+ > ```
11
+ > ReadFullDocsArticle("https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/skills/flow-bundle-and-save")
12
+ > ```
13
+ > The flow defines the required discount-rule mechanics (minItemQuantity condition, catalog data steps, guardrails). Without it, your recommendations will lack the correct structure.
14
14
 
15
15
  Promote product discovery and multi-item purchases by creating bundle-based discounts that reward customers for buying across categories or adding complementary items to their cart.
16
16
 
@@ -81,6 +81,24 @@ The sole action for this goal. Creates a percentage discount with a `minItemQuan
81
81
 
82
82
  ---
83
83
 
84
+ ## Presentation requirement — every recommendation MUST carry a multi-item condition
85
+
86
+ **Every cross-sell recommendation presented to the merchant MUST use a `minItemQuantity` (or equivalent multi-item) condition** — plain single-item percentage discounts FAIL this goal's intent. The merchant must be able to see, per recommendation, the quantity threshold that triggers the discount and the scope it applies to.
87
+
88
+ Acceptable shapes:
89
+ - `apply_discount` with `conditions.minItemQuantity: 2` (or 3, 4) scoped to a category or specific products
90
+ - "Buy 2+ accessories, save 15%" — minItemQuantity 2 on the accessories category
91
+ - "Buy any 3 items, save 10%" — minItemQuantity 3 site-wide
92
+ - "Buy these 2 together, save 15%" — minItemQuantity 2 on ITEMS scope with specific productIds
93
+
94
+ NOT acceptable for this goal:
95
+ - "20% off accessories" — no quantity threshold, defeats the cross-sell mechanic
96
+ - "Site-wide 10% off" — no multi-item incentive
97
+
98
+ State the quantity threshold and scope per recommendation in the `reasoning` / `why` field (e.g., "Buy 3+ items → 10% off site-wide; targets the multi-category catalog profile"). If you cannot construct a multi-item condition for a candidate, drop it; never present a plain percent-off as a cross-sell recommendation.
99
+
100
+ ---
101
+
84
102
  ## Measurement Plan
85
103
 
86
104
  ### Before campaign launch