@wix/agent-skills 1.5.0 → 1.7.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.
- package/README.md +2 -2
- package/package.json +1 -1
- package/skills/wix-app/SKILL.md +49 -42
- package/skills/wix-app/references/BACKEND_EVENT.md +10 -65
- package/skills/wix-app/references/CUSTOM_ELEMENT_WIDGET.md +101 -406
- package/skills/wix-app/references/DASHBOARD_MENU_PLUGIN.md +14 -111
- package/skills/wix-app/references/DASHBOARD_MODAL.md +56 -205
- package/skills/wix-app/references/DASHBOARD_PAGE.md +19 -98
- package/skills/wix-app/references/DASHBOARD_PLUGIN.md +6 -108
- package/skills/wix-app/references/DATA_COLLECTION.md +113 -198
- package/skills/wix-app/references/EDITOR_REACT_COMPONENT.md +15 -1
- package/skills/wix-app/references/EMBEDDED_SCRIPT.md +41 -268
- package/skills/wix-app/references/EXTENSION_REGISTRATION.md +27 -76
- package/skills/wix-app/references/SERVICE_PLUGIN.md +35 -188
- package/skills/wix-app/references/SITE_PLUGIN.md +8 -92
- package/skills/wix-app/references/backend-event/COMMON-EVENTS.md +0 -44
- package/skills/wix-app/references/custom-element-widget/SETTINGS_PANEL.md +19 -330
- package/skills/wix-app/references/dashboard-menu-plugin/bookings-slots.md +0 -12
- package/skills/wix-app/references/dashboard-menu-plugin/ecommerce-slots.md +7 -0
- package/skills/wix-app/references/dashboard-menu-plugin/restaurants-slots.md +0 -12
- package/skills/wix-app/references/dashboard-plugin/SLOTS.md +3 -15
- package/skills/wix-app/references/data-collection/WIX_DATA.md +1 -1
- package/skills/wix-app/references/editor-react-component/COMPONENT-API.md +1 -1
- package/skills/wix-app/references/service-plugin/ADDITIONAL-FEES.md +2 -18
- package/skills/wix-app/references/service-plugin/BOOKINGS-STAFF-SORTING.md +2 -42
- package/skills/wix-app/references/service-plugin/DISCOUNT-TRIGGERS.md +1 -11
- package/skills/wix-app/references/service-plugin/GIFT-CARDS.md +1 -11
- package/skills/wix-app/references/service-plugin/PAYMENT-SETTINGS.md +2 -40
- package/skills/wix-app/references/service-plugin/SHIPPING-RATES.md +2 -19
- package/skills/wix-app/references/service-plugin/VALIDATIONS.md +2 -18
- package/skills/wix-app/references/site-plugin/SLOTS.md +17 -68
- package/skills/wix-headless/SKILL.md +112 -368
- package/skills/wix-headless/references/BUILD.md +307 -0
- package/skills/wix-headless/references/DESIGN_SYSTEM.md +115 -0
- package/skills/wix-headless/references/DISCOVERY.md +237 -112
- package/skills/wix-headless/references/PLAN.md +82 -0
- package/skills/wix-headless/references/SEED.md +205 -0
- package/skills/wix-headless/references/SETUP.md +250 -94
- package/skills/wix-headless/references/astro/COMPOSE.md +142 -0
- package/skills/wix-headless/references/{blog → astro/blog}/BLOG_PAGES.md +1 -1
- package/skills/wix-headless/references/{blog → astro/blog}/BLOG_SETUP.md +2 -2
- package/skills/wix-headless/references/astro/cms/CMS_FOUNDATIONS.md +214 -0
- package/skills/wix-headless/references/{cms → astro/cms}/FAQ_KNOWLEDGE_BASE.md +6 -4
- package/skills/wix-headless/references/{cms → astro/cms}/PORTFOLIO.md +5 -5
- package/skills/wix-headless/references/{cms → astro/cms}/RESOURCE_LIBRARY.md +5 -5
- package/skills/wix-headless/references/{cms → astro/cms}/TEAM_DIRECTORY.md +5 -5
- package/skills/wix-headless/references/astro/designer/INSTRUCTIONS.md +331 -0
- package/skills/wix-headless/references/{ecom → astro/ecom}/CART_PAGES.md +1 -1
- package/skills/wix-headless/references/{ecom → astro/ecom}/CART_WIRING.md +1 -1
- package/skills/wix-headless/references/{ecom → astro/ecom}/COMPONENTS_CSS.md +3 -3
- package/skills/wix-headless/references/{forms → astro/forms}/CONTACT_FORM.md +13 -13
- package/skills/wix-headless/references/{gift-cards → astro/gift-cards}/COMPONENTS.md +1 -1
- package/skills/wix-headless/references/{gift-cards → astro/gift-cards}/PAGES.md +1 -1
- package/skills/wix-headless/references/{stores → astro/stores}/BACK_IN_STOCK.md +1 -1
- package/skills/wix-headless/references/{stores → astro/stores}/CATEGORY_PAGES.md +12 -13
- package/skills/wix-headless/references/{stores → astro/stores}/COMPONENTS_CSS.md +4 -4
- package/skills/wix-headless/references/{stores → astro/stores}/HOME_AND_NAV.md +11 -9
- package/skills/wix-headless/references/{stores → astro/stores}/PRODUCT_PAGES.md +5 -3
- package/skills/wix-headless/references/{stores → astro/stores}/SHARED_WIRING.md +3 -3
- package/skills/wix-headless/references/astro/templates/Footer.astro +27 -0
- package/skills/wix-headless/references/astro/templates/Layout.astro +132 -0
- package/skills/wix-headless/references/astro/templates/Navigation.astro +38 -0
- package/skills/wix-headless/references/astro/templates/astro.config.mjs +41 -0
- package/skills/wix-headless/references/astro/templates/ecom/components-ecom.css +302 -0
- package/skills/wix-headless/references/astro/templates/global.css +286 -0
- package/skills/wix-headless/references/astro/templates/index.astro +56 -0
- package/skills/wix-headless/{templates → references/astro/templates}/stores/back-in-stock.ts +1 -1
- package/skills/wix-headless/{templates → references/astro/templates}/stores/components-stores.css +138 -33
- package/skills/wix-headless/references/blog/BLOG_CONTENT.md +10 -11
- package/skills/wix-headless/references/blog/INSTRUCTIONS.md +5 -5
- package/skills/wix-headless/references/cms/CMS_FOUNDATIONS.md +31 -230
- package/skills/wix-headless/references/cms/INSTRUCTIONS.md +13 -8
- package/skills/wix-headless/references/custom/INSTRUCTIONS.md +38 -0
- package/skills/wix-headless/references/ecom/INSTRUCTIONS.md +10 -10
- package/skills/wix-headless/references/forms/INSTRUCTIONS.md +5 -5
- package/skills/wix-headless/references/gift-cards/INSTRUCTIONS.md +11 -11
- package/skills/wix-headless/references/images/INSTRUCTIONS.md +47 -50
- package/skills/wix-headless/references/seed-recipes.md +49 -0
- package/skills/wix-headless/references/shared/AUTHENTICATION.md +110 -0
- package/skills/wix-headless/references/shared/BUILD_NOISE.md +2 -2
- package/skills/wix-headless/references/shared/DOCS_SEARCH.md +41 -0
- package/skills/wix-headless/references/shared/IMAGE_GENERATION.md +17 -17
- package/skills/wix-headless/references/shared/IMPLEMENTER.md +20 -29
- package/skills/wix-headless/references/shared/PRODUCTION_SHARP_EDGES.md +1 -1
- package/skills/wix-headless/references/shared/RETURN_CONTRACT.md +25 -16
- package/skills/wix-headless/references/shared/STYLING.md +47 -10
- package/skills/wix-headless/references/stores/INSTRUCTIONS.md +25 -25
- package/skills/wix-headless/references/stores/PRODUCT_CATALOG_DATA.md +17 -17
- package/skills/wix-headless/references/verticals/_schema.json +31 -117
- package/skills/wix-headless/references/verticals/_schema.md +60 -150
- package/skills/wix-headless/references/verticals/blog.md +5 -99
- package/skills/wix-headless/references/verticals/cms.md +9 -100
- package/skills/wix-headless/references/verticals/ecom.md +5 -76
- package/skills/wix-headless/references/verticals/forms.md +5 -85
- package/skills/wix-headless/references/verticals/gift-cards.md +6 -103
- package/skills/wix-headless/references/verticals/stores.md +10 -144
- package/skills/wix-headless/scripts/check-manifest.mjs +5 -5
- package/skills/wix-headless/scripts/emit-design-tokens.mjs +29 -23
- package/skills/wix-headless/scripts/init-site-json.mjs +59 -21
- package/skills/wix-headless/scripts/patch-decorative-slots.mjs +67 -43
- package/skills/wix-headless/scripts/plan-entity-image-waves.mjs +3 -3
- package/skills/wix-headless/scripts/preview.sh +3 -3
- package/skills/wix-headless/scripts/release.sh +4 -4
- package/skills/wix-headless/scripts/scaffold.sh +75 -20
- package/skills/wix-headless/scripts/seed-utilities.sh +50 -12
- package/skills/wix-manage/SKILL.md +4 -8
- package/skills/wix-manage/references/blog/how-to-create-blog-posts.md +70 -1
- package/skills/wix-manage/references/cms/cms-data-items-crud.md +4 -0
- package/skills/wix-manage/references/cms/cms-references-and-relationships.md +2 -0
- package/skills/wix-manage/references/cms/cms-schema-management.md +4 -0
- package/skills/wix-manage/references/ecommerce/api-shipping.md +443 -0
- package/skills/wix-manage/references/ecommerce/flow-add-free-shipping.md +5 -6
- package/skills/wix-manage/references/ecommerce/flow-fix-coverage-gaps.md +4 -5
- package/skills/wix-manage/references/ecommerce/flow-optimize-shipping-rates.md +4 -5
- package/skills/wix-manage/references/ecommerce/goal-increase-aov.md +1 -1
- package/skills/wix-manage/references/ecommerce/goal-reduce-cart-abandonment.md +1 -2
- package/skills/wix-manage/references/ecommerce/guardrail-shipping-health.md +2 -2
- package/skills/wix-manage/references/ecommerce/recipe-apply-shipping-recommendations.md +4 -5
- package/skills/wix-manage/references/ecommerce/recommend-ecommerce-strategy.md +7 -7
- package/skills/wix-manage/references/ecommerce/setup-discount-rules.md +209 -72
- package/skills/wix-manage/references/ecommerce/setup-store-pickup-location.md +9 -10
- package/skills/wix-manage/references/ecommerce/skill-graph.md +4 -4
- package/skills/wix-manage/references/forms/create-form.md +2 -0
- package/skills/wix-manage/references/stores/bulk-create-products-with-options.md +2 -0
- package/skills/wix-manage/references/stores/create-product-from-image.md +91 -38
- package/skills/wix-manage/references/stores/setup-online-store-catalog-v3.md +14 -7
- package/skills/wix-app/references/data-collection/extension-template.ts +0 -107
- package/skills/wix-headless/references/ORCHESTRATION.md +0 -269
- package/skills/wix-headless/references/commands/install-app.md +0 -42
- package/skills/wix-headless/references/commands/mcp-bootstrap.md +0 -28
- package/skills/wix-headless/references/designer/INSTRUCTIONS.md +0 -828
- package/skills/wix-headless/references/shared/MCP_PREFIX.md +0 -105
- package/skills/wix-headless/scripts/copy-utility-templates.mjs +0 -153
- package/skills/wix-headless/templates/ecom/components-ecom.css +0 -215
- package/skills/wix-manage/references/events/list-events.md +0 -203
- /package/skills/wix-headless/{templates → references/astro/templates}/ecom/CartBadge.tsx +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/ecom/CartView.tsx +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/ecom/cart.astro +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/ecom/discounts.ts +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/ecom/thank-you.astro +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/GiftCardPurchase.tsx +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/_home-teaser-snippet.astro +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/_nav-snippet.astro +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/components-gift-cards.css +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/gift-cards.astro +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/gift-cards.ts +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/stores/AddToCartButton.tsx +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/stores/BackInStockForm.tsx +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/stores/CategoryRail.astro +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/stores/ProductCard.astro +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/stores/ProductPurchase.tsx +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/stores/SeoTags.astro +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/stores/categories.ts +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/stores/category/[slug].astro +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/stores/products/[slug].astro +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/stores/products/index.astro +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: images-agent
|
|
3
|
-
description: "Generates images for the site. Two scopes: image-phase-1-decorative (hero/about/background art
|
|
3
|
+
description: "Generates images for the site. Two scopes: image-phase-1-decorative (hero/about/background art) and image-phase-2-entity (product/blog/CMS item images, needs Phase 1 Seed entity IDs)."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Images Agent — Scope-Based Image Generation
|
|
7
7
|
|
|
8
|
-
Generates site images in two scopes
|
|
8
|
+
Generates site images in two scopes. Uses Wix AI (Runware) for generation and Wix Media for hosting — all via `curl` against `wixapis.com` using the CLI-minted REST token (see `../shared/AUTHENTICATION.md`).
|
|
9
9
|
|
|
10
10
|
**Nothing else blocks on image generation.** Phases 1–4 and the core pipeline all proceed independently. Products, posts, and pages work without images. Each image phase enriches them when it finishes.
|
|
11
11
|
|
|
@@ -13,21 +13,21 @@ Generates site images in two scopes dispatched separately by the parent skill. U
|
|
|
13
13
|
|
|
14
14
|
Your prompt includes `Scope: <name>`. Map it to an image phase:
|
|
15
15
|
|
|
16
|
-
| Scope |
|
|
17
|
-
|
|
18
|
-
| `image-phase-1-decorative` |
|
|
19
|
-
| `image-phase-2-entity` |
|
|
16
|
+
| Scope | Depends on | Output |
|
|
17
|
+
|---|---|---|
|
|
18
|
+
| `image-phase-1-decorative` | Brand context only | Decorative images for hero / about / backgrounds; slot→URL map returned in `data.slots` |
|
|
19
|
+
| `image-phase-2-entity` | Phase 1 Seed return data (entity IDs in prompt) | Entity images attached to products / blog posts / CMS items via REST PATCH |
|
|
20
20
|
|
|
21
21
|
If your prompt is missing a `Scope:` line, stop and ask the parent — do not guess.
|
|
22
22
|
|
|
23
23
|
## Self-Loading
|
|
24
24
|
|
|
25
25
|
1. Read `../shared/IMAGE_GENERATION.md` — Wix AI image generation + Wix Media import recipe (including the **required** batched-call pattern)
|
|
26
|
-
2. Read `../shared/
|
|
26
|
+
2. Read `../shared/DOCS_SEARCH.md` — REST auth for Wix API calls
|
|
27
27
|
3. **Prefer the inlined recipe below and `IMAGE_GENERATION.md` over external docs.** When a PATCH or API call fails:
|
|
28
28
|
1. **FIRST re-read your own recipe** in this file (INSTRUCTIONS.md § for that entity type) — it likely covers the error.
|
|
29
29
|
2. If the recipe covers it, follow the recipe. Do NOT look up external docs for errors your recipe already handles.
|
|
30
|
-
3. **ONLY** if you've re-read the recipe AND the error is genuinely not covered, fall back to `
|
|
30
|
+
3. **ONLY** if you've re-read the recipe AND the error is genuinely not covered, fall back to `docs-search REST (see DOCS_SEARCH.md)` / `raw-docs REST (see DOCS_SEARCH.md)`.
|
|
31
31
|
|
|
32
32
|
Known errors already covered by this recipe (do not look up externally):
|
|
33
33
|
- **428** from product PATCH → missing `options`/`variantsInfo` → see § "Products" step 1
|
|
@@ -38,17 +38,17 @@ If your prompt is missing a `Scope:` line, stop and ask the parent — do not gu
|
|
|
38
38
|
|
|
39
39
|
## Quick Reference: Generation Call Shape
|
|
40
40
|
|
|
41
|
-
Before the first
|
|
41
|
+
Before the first REST call, ensure the `curl` tool schema is loaded (the orchestrator's session auth covers this for the whole session per `<SKILL_ROOT>/references/commands/AUTHENTICATION.md` — only re-load if you hit a tool-not-found error). Use your runtime's AUTHENTICATION.md recovery ladder to look up the suffix.
|
|
42
42
|
|
|
43
43
|
**All generation tool calls for an image phase MUST be in one concurrent batch.** The exact shape depends on the model — see `../shared/IMAGE_GENERATION.md` § "Required: minimize round-trips" for the rule. In short:
|
|
44
44
|
|
|
45
|
-
- **`google:4@2` (the default):** N concurrent 1-task `
|
|
46
|
-
- **`bfl:5@1`, `runware:400@1`:** one batched `
|
|
45
|
+
- **`google:4@2` (the default):** N concurrent 1-task `curl` calls as siblings in one batch. (Batched N≥3 times out at 504 on this model.)
|
|
46
|
+
- **`bfl:5@1`, `runware:400@1`:** one batched `curl` call with N tasks in the body array.
|
|
47
47
|
|
|
48
48
|
Example task body (same for both patterns — only the distribution across tool calls changes):
|
|
49
49
|
|
|
50
50
|
```
|
|
51
|
-
|
|
51
|
+
REST: POST https://www.wixapis.com/runwareschemaless/v1/request
|
|
52
52
|
body: [
|
|
53
53
|
{
|
|
54
54
|
"taskType": "imageInference",
|
|
@@ -93,11 +93,11 @@ Concurrent siblings are safe across all three stages (gen, import, PATCH). Wix M
|
|
|
93
93
|
|
|
94
94
|
Image Phase 2 for N products + M CMS items: ~1 schema-load + 1 product query + 1 batched generate + (N+M) imports + (N+M) PATCHes ≈ 2(N+M) + 3 calls. For 4 entities that's ~11 calls. If above 20, check for unnecessary doc reads or re-queries.
|
|
95
95
|
|
|
96
|
-
## Scope: `image-phase-1-decorative` (
|
|
96
|
+
## Scope: `image-phase-1-decorative` (no dependencies)
|
|
97
97
|
|
|
98
98
|
Generate site-wide decorative images that don't depend on any entity. Used by the Phase 2 Design System agent + Phase 4 Pages agents for hero sections, about pages, and backgrounds.
|
|
99
99
|
|
|
100
|
-
**What to generate** is determined by the `decorativeSlots` list in your prompt — generate exactly those keys, no more, no less. Typical canonical keys: `hero`, `about`, `productsHeader`, `cmsHeader`. Do not invent additional keys (`background`, `aboutFeature`, etc.) — orphan keys ship as unused images and unfilled slots show as empty placeholders. The orchestrator composes this list from the loaded verticals + the designer's slot vocabulary (`references/designer/INSTRUCTIONS.md` § common rule #7); the two must agree.
|
|
100
|
+
**What to generate** is determined by the `decorativeSlots` list in your prompt — generate exactly those keys, no more, no less. Typical canonical keys: `hero`, `about`, `productsHeader`, `cmsHeader`. Do not invent additional keys (`background`, `aboutFeature`, etc.) — orphan keys ship as unused images and unfilled slots show as empty placeholders. The orchestrator composes this list from the loaded verticals + the designer's slot vocabulary (`references/astro/designer/INSTRUCTIONS.md` § common rule #7); the two must agree.
|
|
101
101
|
|
|
102
102
|
**Inputs (from your prompt):**
|
|
103
103
|
- Brand name, business type, aesthetic direction
|
|
@@ -109,24 +109,15 @@ Generate site-wide decorative images that don't depend on any entity. Used by th
|
|
|
109
109
|
|
|
110
110
|
1. **Craft all image prompts up front** using brand context — see `IMAGE_GENERATION.md` § "Prompt guidelines".
|
|
111
111
|
2. **Dispatch all generation tool calls in one concurrent batch** — siblings for `google:4@2` (1 task each, N blocks in parallel), or one batched call for other models (N tasks in `body`). Required, not optional — see `IMAGE_GENERATION.md` § "Required: minimize round-trips per image phase". Sequential 1-task calls across multiple turns is an anti-pattern; never do it.
|
|
112
|
-
3. **Import each to Wix Media** via
|
|
113
|
-
4. **
|
|
114
|
-
|
|
115
|
-
# Image URLs
|
|
112
|
+
3. **Import each to Wix Media** via `REST: POST https://www.wixapis.com/site-media/v1/files/import`.
|
|
113
|
+
4. **Collect the resolved URLs keyed by slot purpose** (e.g., `{"hero": "https://static.wixstatic.com/...", "about": "https://static.wixstatic.com/..."}`). This map goes into your return JSON under `data.slots` — see § Return below. Do NOT write `.wix/image-urls.md` or any other file; the orchestrator pipes your `data.slots` directly into `patch-decorative-slots.mjs` via stdin.
|
|
114
|
+
5. Return the structured JSON block per `../shared/RETURN_CONTRACT.md` (see § Return below). The JSON return is your sole output channel.
|
|
116
115
|
|
|
117
|
-
|
|
118
|
-
- url: https://static.wixstatic.com/media/...
|
|
116
|
+
The orchestrator runs `patch-decorative-slots.mjs` with your `data.slots` map piped in on stdin. The patch script injects `<img>` tags into the designer's `data-decorative-slot="<key>"` placeholders. If your return is missing or has no slots, the patch is a no-op and the placeholders fall back to the designer's solid-color rendering — nothing blocks.
|
|
119
117
|
|
|
120
|
-
|
|
121
|
-
- url: https://static.wixstatic.com/media/...
|
|
122
|
-
```
|
|
123
|
-
5. Return the structured JSON block per `../shared/RETURN_CONTRACT.md` (see § Return below).
|
|
124
|
-
|
|
125
|
-
Page design agents read `.wix/image-urls.md` and use the URLs. If the file doesn't exist when a page agent runs, the page agent uses placeholder styling instead — nothing blocks.
|
|
118
|
+
## Scope: `image-phase-2-entity` (Phase 1 Seed data inline)
|
|
126
119
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
Generate images for products, blog posts, and CMS items. Attach via MCP PATCH calls.
|
|
120
|
+
Generate images for products, blog posts, and CMS items. Attach via REST PATCH calls (`curl` against `wixapis.com`).
|
|
130
121
|
|
|
131
122
|
> **Parent must NOT paste a PATCH/Update body template.** This INSTRUCTIONS.md owns the recipe per entity type (Products, Blog Posts, CMS Items) — including the exact write-shape (`media.itemsInfo.items[].url` + echoed `options`/`variantsInfo` + `revision`, no `fieldMask`) and the failure-mode mappings. An inline template in the parent prompt causes drift; the wrong shape (e.g. `media.main.image` + `fieldMask`) returns `400 "Expected an object"` on every product. Parents should pass `Phase 1 Seed return data` and `Brand context` only.
|
|
132
123
|
|
|
@@ -135,13 +126,13 @@ Generate images for products, blog posts, and CMS items. Attach via MCP PATCH ca
|
|
|
135
126
|
- `collections: [{name, itemIds, fields}, ...]` — if cms pack loaded
|
|
136
127
|
- `blogPosts: [{id, title, ...}, ...]` — if blog pack loaded
|
|
137
128
|
|
|
138
|
-
**Do not poll for sidecars.** `.wix/logs/<feature>-data.md`
|
|
129
|
+
**Do not poll for sidecars.** Do not read `.wix/logs/<feature>-data.md` or any coordination file (see `../shared/RETURN_CONTRACT.md`). If the `Phase 1 Seed return data:` block is missing from your prompt, return `status: "failed"` with `reason: "Phase 1 Seed return data not provided; image-phase-2-entity cannot run without entity IDs"` — do not sleep, do not read sidecars, do not re-query Phase 1 Seed data.
|
|
139
130
|
|
|
140
131
|
**Process per entity type (must follow):**
|
|
141
132
|
|
|
142
133
|
1. **Craft all image prompts** for this entity type up front, using each entity's own context (name, description, title, etc.).
|
|
143
134
|
2. **Dispatch all generation tool calls in one concurrent batch** — same dispatch shape as Phase 1 Decorative:
|
|
144
|
-
- For `google:4@2` (default): N parallel sibling `
|
|
135
|
+
- For `google:4@2` (default): N parallel sibling `curl` tool calls, one task each.
|
|
145
136
|
- For `bfl:5@1` / `runware:400@1` / others: ONE batched call with all N tasks in `body`.
|
|
146
137
|
See `IMAGE_GENERATION.md` § "Required: minimize round-trips per image phase". Sequential 1-task calls across multiple turns is an anti-pattern.
|
|
147
138
|
|
|
@@ -149,7 +140,7 @@ Generate images for products, blog posts, and CMS items. Attach via MCP PATCH ca
|
|
|
149
140
|
|
|
150
141
|
**N≥6 entities — stagger.** When you have 6 or more entities of one type, split into pairs of 3 parallel siblings rather than 6+ in one shot. Runware throttles google:4@2 above ~4 concurrent tasks per request burst, and the timeout ladder gets steeper. Two messages with 3 siblings each is reliably faster than one message with 6 + multiple retries. (Heuristic — refine after more runs collect data.)
|
|
151
142
|
3. **Import each to Wix Media**. Imports can parallelize.
|
|
152
|
-
4. **PATCH each entity** with its image URL / file ID. PATCH calls can also parallelize (sibling `
|
|
143
|
+
4. **PATCH each entity** with its image URL / file ID. PATCH calls can also parallelize (sibling `curl` tool calls in one message).
|
|
153
144
|
|
|
154
145
|
### Products (if `products` is in your prompt)
|
|
155
146
|
|
|
@@ -161,9 +152,9 @@ Generate images for products, blog posts, and CMS items. Attach via MCP PATCH ca
|
|
|
161
152
|
|
|
162
153
|
> **Use per-product GET instead of bulk query:**
|
|
163
154
|
> ```
|
|
164
|
-
>
|
|
155
|
+
> REST: GET https://www.wixapis.com/stores/v3/products/{productId}
|
|
165
156
|
> ```
|
|
166
|
-
> GET returns both `options` and `variantsInfo` in one shot. Parallelize the N GETs as sibling `
|
|
157
|
+
> GET returns both `options` and `variantsInfo` in one shot. Parallelize the N GETs as sibling `curl` tool calls in one concurrent batch so they fan out without adding to the critical path.
|
|
167
158
|
|
|
168
159
|
> If you skip this and get a 428, re-read this section — do not look up external docs.
|
|
169
160
|
|
|
@@ -173,7 +164,7 @@ Generate images for products, blog posts, and CMS items. Attach via MCP PATCH ca
|
|
|
173
164
|
|
|
174
165
|
4. PATCH each product with its image + preserved options/variantsInfo + product `revision`:
|
|
175
166
|
```
|
|
176
|
-
|
|
167
|
+
REST: PATCH https://www.wixapis.com/stores/v3/products/{productId}
|
|
177
168
|
body: {
|
|
178
169
|
"product": {
|
|
179
170
|
"revision": "<product.revision from step 1's GET>",
|
|
@@ -197,7 +188,7 @@ Generate images for products, blog posts, and CMS items. Attach via MCP PATCH ca
|
|
|
197
188
|
|
|
198
189
|
**409 `INVALID_REVISION` recovery.** If a single PATCH returns 409 with `{"applicationError": {"code": "INVALID_REVISION", ...}}`, the product's actual revision has advanced past the value you cached in step 1's GET. This typically happens against an already-built site (re-runs, remediation runs) where the user edited products via the dashboard between builds. Recovery is per-failure, not whole-batch:
|
|
199
190
|
|
|
200
|
-
1. Re-fetch the failed product:
|
|
191
|
+
1. Re-fetch the failed product: `REST: GET https://www.wixapis.com/stores/v3/products/{productId}`.
|
|
201
192
|
2. Retry the PATCH once with the new revision.
|
|
202
193
|
3. If the retry also fails with 409, surface the error — something else is mutating the entity faster than we can react. Don't loop.
|
|
203
194
|
|
|
@@ -213,7 +204,7 @@ Generate images for products, blog posts, and CMS items. Attach via MCP PATCH ca
|
|
|
213
204
|
|
|
214
205
|
4. PATCH each draft post's cover image:
|
|
215
206
|
```
|
|
216
|
-
|
|
207
|
+
REST: PATCH https://www.wixapis.com/blog/v3/draft-posts/{draftPostId}
|
|
217
208
|
body: {
|
|
218
209
|
"draftPost": {
|
|
219
210
|
"media": { "wixMedia": { "image": { "id": "<file-id-from-fileUrl>" } } }
|
|
@@ -223,7 +214,7 @@ Generate images for products, blog posts, and CMS items. Attach via MCP PATCH ca
|
|
|
223
214
|
|
|
224
215
|
5. **Re-publish** each updated post (PATCHing a published post makes it unpublished):
|
|
225
216
|
```
|
|
226
|
-
|
|
217
|
+
REST: POST https://www.wixapis.com/blog/v3/draft-posts/{draftPostId}/publish
|
|
227
218
|
```
|
|
228
219
|
|
|
229
220
|
Re-publish calls parallelize — dispatch as concurrent sibling calls.
|
|
@@ -236,7 +227,7 @@ The `PATCH /wix-data/v2/items/{itemId}` endpoint exists but requires a JsonPatch
|
|
|
236
227
|
|
|
237
228
|
1. Your prompt lists `collections[].itemIds` for each collection with an image field. **Fetch the existing item data** once per collection via `POST /wix-data/v2/items/query` — you cannot skip this step because you need every existing field to merge-preserve.
|
|
238
229
|
```
|
|
239
|
-
|
|
230
|
+
REST: POST https://www.wixapis.com/wix-data/v2/items/query
|
|
240
231
|
body: {
|
|
241
232
|
"dataCollectionId": "<collection>",
|
|
242
233
|
"query": { "filter": { "_id": { "$in": ["<itemId1>", "<itemId2>", ...] } } }
|
|
@@ -250,7 +241,7 @@ The `PATCH /wix-data/v2/items/{itemId}` endpoint exists but requires a JsonPatch
|
|
|
250
241
|
|
|
251
242
|
4. **PUT each item's full record** with the image field merged into the existing `data`:
|
|
252
243
|
```
|
|
253
|
-
|
|
244
|
+
REST: PUT https://www.wixapis.com/wix-data/v2/items/{itemId}
|
|
254
245
|
body: {
|
|
255
246
|
"dataCollectionId": "<collection>",
|
|
256
247
|
"dataItem": {
|
|
@@ -269,15 +260,15 @@ body: { "dataCollectionId": "<c>", "dataItem": { "id": "...", "data": { "image":
|
|
|
269
260
|
```
|
|
270
261
|
Without the read-merge step, an `about-content` item loses its seeded `heading` and `body` when Image Phase 2 attaches the image — the About page then renders only its fallback copy.
|
|
271
262
|
|
|
272
|
-
PUT calls parallelize — dispatch all items across all collections as sibling `
|
|
263
|
+
PUT calls parallelize — dispatch all items across all collections as sibling `curl` tool calls in one concurrent batch.
|
|
273
264
|
|
|
274
|
-
##
|
|
265
|
+
## REST call discovery
|
|
275
266
|
|
|
276
|
-
Your prompt includes a `
|
|
267
|
+
Your prompt includes a `siteId (for token mint):` line. Use it for every Wix REST call. If an endpoint isn't covered by this recipe, fall back to the doc lookup endpoints in `../shared/DOCS_SEARCH.md`.
|
|
277
268
|
|
|
278
269
|
## Return Contract
|
|
279
270
|
|
|
280
|
-
At the end, emit a structured JSON block per `../shared/RETURN_CONTRACT.md`. Do **not** write `.wix/logs/images.md`
|
|
271
|
+
At the end, emit a structured JSON block per `../shared/RETURN_CONTRACT.md`. Do **not** write `.wix/logs/images.md` or any sidecar file; the parent reads your return JSON directly.
|
|
281
272
|
|
|
282
273
|
### `image-phase-1-decorative` return
|
|
283
274
|
|
|
@@ -286,14 +277,19 @@ At the end, emit a structured JSON block per `../shared/RETURN_CONTRACT.md`. Do
|
|
|
286
277
|
"status": "complete" | "partial" | "failed",
|
|
287
278
|
"phase": "image-phase-1-decorative",
|
|
288
279
|
"scope": "image-phase-1-decorative",
|
|
289
|
-
"summary": "Generated N decorative images; uploaded to Wix Media;
|
|
280
|
+
"summary": "Generated N decorative images; uploaded to Wix Media; returned slot→URL map",
|
|
290
281
|
"data": {
|
|
291
282
|
"decorativeCount": 3,
|
|
292
283
|
"purposes": ["hero", "about", "background"],
|
|
284
|
+
"slots": {
|
|
285
|
+
"hero": "https://static.wixstatic.com/media/...",
|
|
286
|
+
"about": "https://static.wixstatic.com/media/...",
|
|
287
|
+
"background": "https://static.wixstatic.com/media/..."
|
|
288
|
+
},
|
|
293
289
|
"model": "google:4@2",
|
|
294
290
|
"totalCredits": 0.297
|
|
295
291
|
},
|
|
296
|
-
"files": [
|
|
292
|
+
"files": [],
|
|
297
293
|
"errors": []
|
|
298
294
|
}
|
|
299
295
|
```
|
|
@@ -340,11 +336,11 @@ The JSON block MUST be the **last** content in your message (see `../shared/RETU
|
|
|
340
336
|
|
|
341
337
|
| WRONG | CORRECT |
|
|
342
338
|
|-------|---------|
|
|
343
|
-
| N sequential 1-task `
|
|
339
|
+
| N sequential 1-task `curl` generation calls across multiple turns | All generation tool calls in one concurrent batch — parallel siblings for `google:4@2`, or one batched call for other models. See IMAGE_GENERATION.md § "Required: minimize round-trips per image phase" |
|
|
344
340
|
| Poll `.wix/logs/<feature>-data.md` sidecars to learn Phase 1 Seed is done | Phase 1 Seed data is inline in your prompt — if missing, return `failed` |
|
|
345
341
|
| `sleep 60` loop to wait for Phase 1 Seed | No waiting, no polling — prompt has the data or the agent fails |
|
|
346
|
-
| Write `.wix/logs/images.md` sidecar |
|
|
347
|
-
| Re-query Phase 1 Seed entity IDs via
|
|
342
|
+
| Write `.wix/logs/images.md` or `.wix/image-urls.md` sidecar | Return structured JSON per `RETURN_CONTRACT.md` instead (decorative URLs go in `data.slots`) |
|
|
343
|
+
| Re-query Phase 1 Seed entity IDs via the REST API | IDs are in your prompt; re-querying wastes a round-trip |
|
|
348
344
|
| Generic prompts ("a product photo") | Use brand context, product name, aesthetic direction |
|
|
349
345
|
| Ignore color palette from prompt | Reference actual hex codes in image prompts |
|
|
350
346
|
| Request text in images | Always include "no text, no watermarks" |
|
|
@@ -352,8 +348,9 @@ The JSON block MUST be the **last** content in your message (see `../shared/RETU
|
|
|
352
348
|
| Use free-form sizes (e.g., `800×600`) | Use allowed dimensions only — `1024×1024`, `1376×768`, `1200×896` |
|
|
353
349
|
| Use blog post `file.url` for cover image | Blog posts need `file.fileUrl` (file ID) for `media.wixMedia.image.id` |
|
|
354
350
|
| Block on image failures | Skip failed images, continue with others |
|
|
351
|
+
| Write any coordination file (`.wix/image-urls.md`, sidecars) | Return slot→URL map in `data.slots`; the orchestrator pipes it to `patch-decorative-slots.mjs` via stdin |
|
|
355
352
|
| PATCH products without `options`/`variantsInfo` | Always query products first for these fields — PATCH returns 428 without them (see § "Products" step 1) |
|
|
356
353
|
| PUT a CMS item with only `{data: {image: "..."}}` | Read-merge-write: query the item, merge image into existing `data`, PUT the full record (see § "CMS Items" step 4). Writing only `image` erases seeded heading/body/etc. |
|
|
357
354
|
| Use `PATCH /wix-data/v2/items/{itemId}` with `{dataItem: {data}}` | PATCH requires JsonPatch `fieldModifications` — use read-merge-PUT instead (see § "CMS Items") |
|
|
358
355
|
| Hit a 428 → immediately search external docs | Re-read § "Products" step 1 first — it covers 428. Only use external docs if your recipe genuinely doesn't cover the error (see § "Self-Loading" step 3) |
|
|
359
|
-
| Default to `
|
|
356
|
+
| Default to `raw-docs REST (see DOCS_SEARCH.md)` for API errors already covered by your recipe | Re-read your own recipe first; fall back to the doc-lookup endpoints in `DOCS_SEARCH.md` only for errors genuinely not covered (see § "Self-Loading" step 3) |
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Seed recipe map
|
|
2
|
+
|
|
3
|
+
Per-vertical recipe lookup for the seed dispatch in `SEED.md`. Recipe paths are **relative to `<wix-manage-root>`**, the absolute path that `wix-manage`'s SKILL.md publishes when Phase 2 Step 4 loads it. The orchestrator joins `<wix-manage-root>` + the relative path at dispatch time. Do not pre-resolve, hardcode, or pre-validate the absolute paths at session start — fail at dispatch time if a recipe has moved.
|
|
4
|
+
|
|
5
|
+
| Pack | Recipes (relative to `<wix-manage-root>`) | Returns |
|
|
6
|
+
|---|---|---|
|
|
7
|
+
| stores | `references/stores/setup-online-store-catalog-v3.md` (idempotent catalog setup) + `references/stores/bulk-create-products-with-options.md` (single bulk call for N products) | `productIds[]`, `categoryIds[]` (when `intent.stores.categoriesNamed` is non-empty) |
|
|
8
|
+
| cms | `references/cms/cms-schema-management.md` (collection create) + `references/cms/cms-data-items-crud.md` (item create per collection) + `references/cms/cms-references-and-relationships.md` (only when a collection's `intent.cms.collections[N]` declares cross-references) | `collectionIds{}`, `itemIds{<collection>: []}` |
|
|
9
|
+
| blog | `references/blog/how-to-create-blog-posts.md` | `postIds[]`, `categoryIds[]` |
|
|
10
|
+
| forms | `references/forms/create-form.md` | `formIds[]` |
|
|
11
|
+
| gift-cards | — (no seed surface; activation lives in Phase 2 app-install) | `{status: "skipped"}` |
|
|
12
|
+
| ecom | — (cart/checkout vertical; no seed surface) | `{status: "skipped"}` |
|
|
13
|
+
|
|
14
|
+
The orchestrator dispatches one subagent per pack with a recipe. `gift-cards` and `ecom` get a phase entry of `{phase: "seed-<pack>", status: "skipped"}` recorded directly by the orchestrator without dispatching a subagent.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Per-pack input notes
|
|
19
|
+
|
|
20
|
+
These notes reduce dispatch-time guesswork. The recipe itself is the source of truth for the API shape — these notes are about how to translate `intent.<pack>` + `brand` into the recipe's input.
|
|
21
|
+
|
|
22
|
+
### stores
|
|
23
|
+
|
|
24
|
+
- The bulk recipe wants `products: [{name, slug, sku, price, options?, variants?}]`. Populate `name` and `slug` from `intent.stores.productCount` and `brand` (e.g. for a coffee shop with `productCount: 3`, generate three product names that fit the brand vibe).
|
|
25
|
+
- `sku` defaults to `<slug>-001` when not otherwise constrained.
|
|
26
|
+
- `price` is a positive number; pick brand-appropriate values (don't default to $1).
|
|
27
|
+
- When `intent.stores.categoriesNamed` is non-empty, the subagent creates those categories via the Categories API after the bulk product create and assigns products into them. When the array is empty, skip categories entirely (do not invent a default set).
|
|
28
|
+
- The recipe documents a 5-product cap on the bulk endpoint. If `intent.stores.productCount` exceeds it, fan out into batches of 5.
|
|
29
|
+
- Text-only seeding: do not generate or attach product images. The `media` field follows the recipe's documented placeholder pattern.
|
|
30
|
+
|
|
31
|
+
### cms
|
|
32
|
+
|
|
33
|
+
- The schema recipe wants one `POST /wix-data/v2/collections` call per collection in `intent.cms.collections`. Field shape comes from `collection.purpose` — e.g. `purpose: "about"` → a single-row text collection with `title` + `body`; `purpose: "faq"` → repeated `question` + `answer` rows.
|
|
34
|
+
- After all collections exist, the items recipe (`cms-data-items-crud.md`) inserts `intent.cms.collections[N].itemCount` rows per collection, with content generated from `brand`.
|
|
35
|
+
- `cms-references-and-relationships.md` is consulted **only** when a collection's intent block declares cross-references (e.g. `references: ["products"]`). Otherwise skip it.
|
|
36
|
+
- Return shape: `collectionIds: { <purpose>: <id> }` and `itemIds: { <purpose>: [<id>, ...] }`. Keying by `purpose` (not by collection display name) lets Phase 4 wire pages without re-deriving slug ↔ id.
|
|
37
|
+
|
|
38
|
+
### blog
|
|
39
|
+
|
|
40
|
+
- The recipe's Part 0 (member ID lookup) is mandatory — third-party app installs require `draftPost.memberId`. The subagent issues one `GET /members/v1/members?paging.limit=1` and uses the returned id for every post.
|
|
41
|
+
- `intent.blog.postCount` posts are created. Topics come from `intent.blog.topics` when present; otherwise the subagent picks brand-appropriate topics from `brand.description`.
|
|
42
|
+
- Text-only seeding: cover images use the recipe's documented placeholder pattern; do not call Media Manager import.
|
|
43
|
+
- `categoryIds[]` returned only when the recipe creates categories during seeding (the recipe handles category-on-create automatically when the post payload references one).
|
|
44
|
+
|
|
45
|
+
### forms
|
|
46
|
+
|
|
47
|
+
- One `POST /form-schema-service/v4/forms` call per entry in `intent.forms.forms`. The subagent maps `intent.forms.forms[N].fields` (a string array like `["name", "email", "message"]`) into the recipe's `formFields` payload using the recipe's documented field templates (`CONTACTS_FIRST_NAME`, `CONTACTS_EMAIL`, etc.).
|
|
48
|
+
- `purpose` ("contact", "lead", "signup") drives the form's `name` field — e.g. `"contact"` → `"Contact Form"`.
|
|
49
|
+
- Wix Forms app is usually pre-installed via Phase 2 — the recipe notes this and the seeder does not need to install it again.
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Authentication
|
|
2
|
+
|
|
3
|
+
Every Wix API call this skill makes goes through `@wix/cli` + `curl` — no MCP, no SDK. This file documents the auth shape (header layout, token minting, recovery ladder) so individual phase docs don't have to repeat it.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
- `@wix/cli` resolvable via `npx`. The scaffold installs it project-local, so `npx @wix/cli …` works without a global install.
|
|
8
|
+
- An authenticated CLI session. Test with `npx @wix/cli@latest whoami` — exits **0** when logged in (prints the authenticated email + user id), **non-zero** when logged out.
|
|
9
|
+
|
|
10
|
+
The primary place this check runs is DISCOVERY.md § "Pre-flight" — foreground, before any `AskUserQuestion`. `scaffold.sh` repeats the check defensively for its standalone-invocation path. **If the check fails, run `npx @wix/cli@latest login` yourself with `run_in_background: true`** per the next section — do not tell the user "run wix login and retry" and stop. Punting to the user breaks the flow: the harness backgrounds the user-issued command, the agent doesn't know which output file to read, and you end up paying ~60 s + a manual user interrupt to recover.
|
|
11
|
+
|
|
12
|
+
The "stop and tell the user" path is a **last-resort fallback** for when the background-run mechanism itself is broken (e.g. the harness rejects `run_in_background: true`, or the task output file never gets created). Try the agent-driven flow first.
|
|
13
|
+
|
|
14
|
+
## `wix login` from a non-interactive agent
|
|
15
|
+
|
|
16
|
+
`wix login` (or `npx @wix/cli@latest login`) emits one JSON event per line on **stdout** and blocks until the human finishes the browser step. The first event you care about is `awaiting_user`:
|
|
17
|
+
|
|
18
|
+
```json
|
|
19
|
+
{"event":"awaiting_user","expiresInSeconds":600,"userCode":"TPV5HUG5","verificationUri":"https://users.wix.com/login/device-login?color=developer&studio=true"}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
(Earlier revisions of this doc claimed the CLI wrote human-readable prose to stderr with no JSON events — that was wrong. The events are JSON on stdout. There may be incidental Node warnings interleaved; line-by-line JSON parsing with a `try` around each line handles that cleanly.)
|
|
23
|
+
|
|
24
|
+
### How to invoke — exact shape
|
|
25
|
+
|
|
26
|
+
The Bash command is just the CLI invocation, **nothing else**:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npx @wix/cli@latest login
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Pass `run_in_background: true` on the Bash tool call. **Do not** add shell `&`, **do not** redirect to your own `mktemp` file, **do not** chain with `echo`/`sleep`. The harness wraps the process for you and writes stdout+stderr to its own task output file at `/tmp/claude-<uid>/<project>/tasks/<task-id>.output`. The tool's `<bash-stdout>` reply gives you that path verbatim — that's the file you read. Stacking shell `&` on top of `run_in_background` creates two layers of backgrounding: the harness captures only the parent shell's `pid:` / `file:` echoes while wix-login's actual JSON events write somewhere else.
|
|
33
|
+
|
|
34
|
+
### Reading the output
|
|
35
|
+
|
|
36
|
+
Poll the harness's task-output file until the `awaiting_user` JSON line appears. Use `Read` on the path returned in `<bash-stdout>` — `TaskOutput` also works. The first useful event is on line 1 (a Node `TimeoutNaNWarning` may follow on lines 3-5; ignore it, the agent only cares about the JSON line). Parse the JSON, extract `verificationUri` + `userCode`.
|
|
37
|
+
|
|
38
|
+
### The critical step: surface, don't re-invoke
|
|
39
|
+
|
|
40
|
+
When you see the `awaiting_user` event:
|
|
41
|
+
|
|
42
|
+
1. **Surface URL + code to the user in plain prose. Send the message. Do not write more Bash. Do not re-invoke wix-login "to do it properly this time".** Seeing the `awaiting_user` event means the first invocation is working correctly — reading its output is the right next step. Restarting wix-login throws away the live device-login session and the second instance has nothing to wait for (the user never sees the new code because by the time it's emitted, you've already messaged them the first one or are mid-restart). One invocation, one read, one message, one wait.
|
|
43
|
+
2. The message shape:
|
|
44
|
+
|
|
45
|
+
> *"You need to authenticate with Wix. Open `<verificationUri>` in your browser and enter the code `<userCode>` — I'll continue once you've completed the login."*
|
|
46
|
+
|
|
47
|
+
3. **Then wait** for the harness `task-notification` with `<status>completed</status>`. That's the terminal signal that the wix-login process exited (the user finished the browser flow). Do not re-run `whoami` in a sleep loop while waiting; the notification is the only signal you need.
|
|
48
|
+
|
|
49
|
+
On `<status>completed</status>` with exit 0, run `whoami` once to confirm and proceed. On non-zero exit (rare — typically a timeout if the user took >600 s, or a network error), surface the tail of the output file to the user and stop.
|
|
50
|
+
|
|
51
|
+
## Token minting
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
SITE_ID="<siteId>" # from wix.config.json after scaffold
|
|
55
|
+
TOKEN=$(npx @wix/cli@latest token --site "$SITE_ID")
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
- Mints a **site-scoped REST token**. **Mint it exactly once per run and never re-mint.** The CLI returns a **byte-identical** token on every call within a run (it caches internally), so re-minting buys nothing — it only costs ~1.25 s of CLI startup per call. Cache the value in session scratch and inline it into every `curl`. This holds on errors too: a re-minted token is the same string and will produce the same result, so re-minting is never a useful reaction to a failed call (the one exception is after a fresh `wix login`, which establishes a new CLI session — see the recovery ladder).
|
|
59
|
+
- Use `npx @wix/cli@latest token …` rather than bare `wix token …`. `@wix/cli` may not be globally installed in every harness; `npx` resolves the project-local copy the scaffold produced. The first invocation auto-fetches the CLI (~3–5 s) if missing; subsequent calls are instant.
|
|
60
|
+
- The first `--site "$SITE_ID"` invocation in a run is the source of truth for `SITE_ID`. Bind it in session scratch; do not re-derive from `wix.config.json` mid-run.
|
|
61
|
+
|
|
62
|
+
## REST call shape
|
|
63
|
+
|
|
64
|
+
Every call against `wixapis.com` uses two headers:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
curl -sS -X POST "https://www.wixapis.com/<endpoint>" \
|
|
68
|
+
-H "Authorization: Bearer $TOKEN" \
|
|
69
|
+
-H "wix-site-id: $SITE_ID" \
|
|
70
|
+
-H "Content-Type: application/json" \
|
|
71
|
+
-d '<body>'
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
- **`Authorization: Bearer $TOKEN`** — the `Bearer` prefix is required. Variants (`Authorization: $TOKEN`, lowercase `bearer`) are not accepted by all endpoints; standardising on `Bearer` avoids the per-endpoint guessing game.
|
|
75
|
+
- **`wix-site-id: $SITE_ID`** — required by site-scoped REST families (Stores v3, CMS v2, Blog v3, Forms v4, Categories v1, Apps-Installer v1, etc.). Harmless on the few endpoints that don't read it, so include it on every call by default rather than discovering its absence via a 403.
|
|
76
|
+
- **`Content-Type: application/json`** — required on every POST/PATCH body. The CLI token does not set it.
|
|
77
|
+
|
|
78
|
+
The body is the recipe's documented JSON payload, with `siteId` inlined where the recipe documents it as a field. Wrapper fields from MCP-era recipes (`reason`, `sourceDocUrl`, `siteId` as an outer arg) are not part of the REST shape and drop on the floor.
|
|
79
|
+
|
|
80
|
+
## Recovery ladder
|
|
81
|
+
|
|
82
|
+
**Do not re-mint the token as a recovery step** (see token-minting note above — a re-minted token is byte-identical). Retry the *same* call with the *same* cached token.
|
|
83
|
+
|
|
84
|
+
| Symptom | First response | If it still fails |
|
|
85
|
+
|---|---|---|
|
|
86
|
+
| `401 Unauthorized` | Retry the same call once with the cached token. | The CLI session expired — run `wix login` per the flow above (that establishes a *new* session, so the token minted afterward genuinely differs). Re-minting without a fresh login returns the same expired-context token and will not help. |
|
|
87
|
+
| `403 Forbidden` | Retry the same call once. | The token shape is fine but the caller lacks the permission. The two real causes: (a) the relevant app is not installed yet (re-check `apps-installer-service` returned 200 for that app in Setup Step 4a), (b) the resource requires a provisioning step the recipe doesn't run. Surface the response body; do not loop on retries. |
|
|
88
|
+
| `404 Not Found` on a documented URL | Re-read the recipe — URL path segments are easy to typo (e.g. `/blog/v3/bulk/draft-posts/create`, **not** `/blog/v3/draft-posts/bulk/create`). | Recipe bug; surface and stop. |
|
|
89
|
+
|
|
90
|
+
**Do not** spend turns A/B-testing the header shape (Bearer vs no-Bearer, with/without `wix-site-id`) or cycling tokens. The shape above is the contract; if a single retry with the cached token doesn't fix it, the issue is upstream and recipe-level debugging will not recover it.
|
|
91
|
+
|
|
92
|
+
## Account-scoped calls
|
|
93
|
+
|
|
94
|
+
`npx @wix/cli@latest token` (no flags) mints an **account-scoped** token. `npx @wix/cli@latest token --site "$SITE_ID"` mints a **site-scoped** token. The CLI's `--site` flag is what toggles between the two scopes; there is no separate `--account` flag because omitting `--site` is itself the account-scoped form.
|
|
95
|
+
|
|
96
|
+
The account-scoped token authenticates against `manage.wix.com` endpoints (e.g. `POST /credit-transactions/v1/credit-transactions/get-account-balance`).
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
# Account-scoped — for /credit-transactions, /accounts, /subscriptions, etc.
|
|
100
|
+
ACCOUNT_TOKEN=$(npx @wix/cli@latest token)
|
|
101
|
+
|
|
102
|
+
# Site-scoped — for everything site-operating (apps install, products, blog, cms, …)
|
|
103
|
+
SITE_TOKEN=$(npx @wix/cli@latest token --site "$SITE_ID")
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
**Do not share tokens across scopes.** Site-operating calls (`wixapis.com/stores/v3/...`, `/blog/v3/...`, `/wix-data/v2/...`) need the **site** token + `wix-site-id` header; using the account token returns `403 SITE_TOKEN_REQUIRED`. Account-level calls (`manage.wix.com/credit-transactions/...`, `/subscriptions/...`) need the **account** token alone — no `wix-site-id` header; using the site token returns `403 ACCOUNT_TOKEN_REQUIRED`.
|
|
107
|
+
|
|
108
|
+
Today the only account-scoped call in the skill is the Discovery Q3 balance lookup (`DISCOVERY.md` § 2.5.2). If a future phase needs another, mint a fresh account token at the call site (do not cache across the run alongside the site token — keep them in separate scratch slots so misuse is hard).
|
|
109
|
+
|
|
110
|
+
**Historical note.** Earlier revisions of this file said the CLI did not expose an account-scoped primitive and concluded the balance lookup was unrecoverable. That was a misreading of `wix token --help` — the help output reads `Get a site-scoped access token` against `--site`, implying (correctly) that omitting `--site` returns the default, account-scoped token. The balance lookup was disabled for no good reason for several runs.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Build-output noise — known false positives
|
|
2
2
|
|
|
3
|
-
Read this only if `npx @wix/cli build` surfaces warnings or errors and you're trying to decide whether they're real. A clean build emits a few warnings that are NOT real failures:
|
|
3
|
+
Read this only if `npx @wix/cli@latest build` surfaces warnings or errors and you're trying to decide whether they're real. A clean build emits a few warnings that are NOT real failures:
|
|
4
4
|
|
|
5
5
|
- **`Astro.request.headers used on prerendered page`** — emitted by the `@wix/astro` integration's middleware on every prerendered route. Internal to the integration, not from skill-emitted code. Ignore.
|
|
6
6
|
- **`Failed to resolve dependency: @wix/stores, present in client 'optimizeDeps.include'`** — Vite warning. The integration speculatively lists `@wix/stores` in `optimizeDeps` regardless of whether the project depends on it. Harmless.
|
|
7
7
|
|
|
8
|
-
Do NOT add filters, edit config, or attempt to silence these — they're upstream and stable. Surface to the user only if a real build failure needs context.
|
|
8
|
+
Do NOT add filters, edit config, or attempt to silence these — they're upstream and stable. Surface to the user only if a real build failure needs context.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Wix documentation lookups
|
|
2
|
+
|
|
3
|
+
Operational calls in this skill use `npx @wix/cli@latest token --site "$SITE_ID"` + `curl` against `wixapis.com` (see `AUTHENTICATION.md`). When a bundled recipe falls short and you need to look up an endpoint, method schema, or article body, use the public unauthenticated REST endpoints below. **No MCP, no SDK** — these are plain `curl` calls.
|
|
4
|
+
|
|
5
|
+
## Doc search
|
|
6
|
+
|
|
7
|
+
| Need | Endpoint |
|
|
8
|
+
|---|---|
|
|
9
|
+
| Search REST / SDK / headless docs | `GET https://www.wixapis.com/mcp-docs-search/v1/search?kbName=<KB>&searchTerm=<q>&maxResults=<n>` |
|
|
10
|
+
| Read a full article | `GET https://dev.wix.com/rawdocs/api/get-article-content?articleUrl=<url>&schema=false` |
|
|
11
|
+
| Read method schema | Same URL with `schema=true` |
|
|
12
|
+
| Browse REST docs menu | `GET https://dev.wix.com/docs/api/v1/get-menu-content?url=<url>&format=markdown` |
|
|
13
|
+
|
|
14
|
+
**kbName values** (common): `REST_METHODS_KB_ID`, `SDK_KB_ID`, `HEADLESS_KB_ID`.
|
|
15
|
+
|
|
16
|
+
Example — search REST docs for app install:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
curl -sS --get 'https://www.wixapis.com/mcp-docs-search/v1/search' \
|
|
20
|
+
--data-urlencode 'kbName=REST_METHODS_KB_ID' \
|
|
21
|
+
--data-urlencode 'searchTerm=install app instance' \
|
|
22
|
+
--data-urlencode 'maxResults=3'
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Example — fetch article body:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
curl -sS --get 'https://dev.wix.com/rawdocs/api/get-article-content' \
|
|
29
|
+
--data-urlencode 'articleUrl=https://dev.wix.com/docs/...' \
|
|
30
|
+
--data-urlencode 'schema=false'
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
No auth headers required on these endpoints.
|
|
34
|
+
|
|
35
|
+
## Prefer bundled references
|
|
36
|
+
|
|
37
|
+
Your skill directory includes `.md` reference files with API recipes and error handling for your scope. **Read those first.** Use the doc endpoints above only when you hit an error or endpoint not covered by the bundled recipe — each external doc read costs a tool call and 15–30 s.
|
|
38
|
+
|
|
39
|
+
## Absolute paths
|
|
40
|
+
|
|
41
|
+
Subagents run with the **project directory** as CWD, not the skill root. Every dispatch prompt must include `Instruction file (absolute path): <SKILL_ROOT>/references/<scope>/INSTRUCTIONS.md`. Read that path only; use the absolute sibling paths it lists. Never resolve `references/...` against the project CWD.
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# Recipe: AI Image Generation + Wix Media Import
|
|
2
2
|
|
|
3
|
-
Generate images using **Wix AI (Runware)** via the
|
|
3
|
+
Generate images using **Wix AI (Runware)** via the `wixapis.com` REST proxy, then import them into Wix Media. This is a **pure utility** — it generates an image and returns the result. The calling skill owns prompt construction and entity attachment.
|
|
4
4
|
|
|
5
|
-
Image generation
|
|
5
|
+
Image generation authenticates with the same CLI-minted site-scoped token used for every other Wix REST call in this skill (see `AUTHENTICATION.md`) — no separate API keys, no MCP, no sandbox escape hatches.
|
|
6
6
|
|
|
7
7
|
## Step 1: Generate Image via Wix AI
|
|
8
8
|
|
|
9
|
-
Call the Runware proxy through `
|
|
9
|
+
Call the Runware proxy through `curl`. The body is an **array of tasks** — one request can generate N images by adding more task objects.
|
|
10
10
|
|
|
11
11
|
```
|
|
12
|
-
|
|
12
|
+
REST: POST https://www.wixapis.com/runwareschemaless/v1/request
|
|
13
13
|
body: [
|
|
14
14
|
{
|
|
15
15
|
"taskType": "imageInference",
|
|
@@ -25,7 +25,7 @@ body: [
|
|
|
25
25
|
]
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
Before the first call, ensure the `
|
|
28
|
+
Before the first call, ensure the `curl` tool schema is loaded (the orchestrator's session auth covers this — see `<SKILL_ROOT>/references/commands/AUTHENTICATION.md`) so `body` is sent as a real JSON array (not a stringified blob). Use your runtime's AUTHENTICATION.md recovery ladder if you need to (re-)load it.
|
|
29
29
|
|
|
30
30
|
Extract `data[0].imageURL` from the response. This is a short-lived URL — **import to Wix Media immediately** in the same task queue.
|
|
31
31
|
|
|
@@ -65,7 +65,7 @@ The image agent's `image-phase-1-decorative` and `image-phase-2-entity` scopes e
|
|
|
65
65
|
### For `bfl:5@1`, `runware:400@1`, and other models: ONE batched call
|
|
66
66
|
|
|
67
67
|
```
|
|
68
|
-
|
|
68
|
+
REST: POST https://www.wixapis.com/runwareschemaless/v1/request
|
|
69
69
|
body: [
|
|
70
70
|
{ "taskType": "imageInference", "taskUUID": "<uuid-1>", "positivePrompt": "...", ... },
|
|
71
71
|
{ "taskType": "imageInference", "taskUUID": "<uuid-2>", "positivePrompt": "...", ... },
|
|
@@ -76,13 +76,13 @@ One round-trip. Response's `data[]` array contains one result per task, matched
|
|
|
76
76
|
|
|
77
77
|
### For `google:4@2` (the default): N parallel 1-task sibling calls
|
|
78
78
|
|
|
79
|
-
`google:4@2` times out with `504` when a single request bundles N≥3 tasks — Runware's backend serializes work per request and the model is slow enough that large batches exceed the proxy timeout. Instead, emit **N parallel `
|
|
79
|
+
`google:4@2` times out with `504` when a single request bundles N≥3 tasks — Runware's backend serializes work per request and the model is slow enough that large batches exceed the proxy timeout. Instead, emit **N parallel `curl` tool calls as siblings in one concurrent batch**, each carrying one task:
|
|
80
80
|
|
|
81
81
|
```
|
|
82
82
|
Assistant message (single turn, multiple tool calls):
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
REST: POST https://www.wixapis.com/runwareschemaless/v1/request
|
|
84
|
+
REST: POST https://www.wixapis.com/runwareschemaless/v1/request
|
|
85
|
+
REST: POST https://www.wixapis.com/runwareschemaless/v1/request
|
|
86
86
|
```
|
|
87
87
|
|
|
88
88
|
All three fire in parallel (runtime dispatches concurrent siblings concurrently). No 504, no sequential wait. The important constraint is *one concurrent batch* — splitting them across turns loses the parallelism and degenerates into the anti-pattern below.
|
|
@@ -91,11 +91,11 @@ All three fire in parallel (runtime dispatches concurrent siblings concurrently)
|
|
|
91
91
|
|
|
92
92
|
Sequential 1-task calls across multiple turns:
|
|
93
93
|
```
|
|
94
|
-
Assistant msg 1:
|
|
94
|
+
Assistant msg 1: curl body: [ task1 ]
|
|
95
95
|
(runtime waits)
|
|
96
|
-
Assistant msg 2:
|
|
96
|
+
Assistant msg 2: curl body: [ task2 ]
|
|
97
97
|
(runtime waits)
|
|
98
|
-
Assistant msg 3:
|
|
98
|
+
Assistant msg 3: curl body: [ task3 ]
|
|
99
99
|
```
|
|
100
100
|
Each turn adds inter-message overhead. Whether you're using the batched pattern or parallel siblings, **all the image-generation tool calls MUST be in one concurrent batch**.
|
|
101
101
|
|
|
@@ -105,7 +105,7 @@ The following procedure prevents the observed serialization anti-pattern. Follow
|
|
|
105
105
|
|
|
106
106
|
1. **Write all prompts first.** In your text response, list every image you will generate with its positivePrompt, dimensions, and a UUID. Do not make any tool calls yet.
|
|
107
107
|
2. **Compose the full body array** as a fenced JSON block in your text. Verify the task count matches the entity count.
|
|
108
|
-
3. **One tool call.** Make exactly one `
|
|
108
|
+
3. **One tool call.** Make exactly one `curl` call with that complete body array.
|
|
109
109
|
4. **Parallel imports.** After the generate response arrives, emit all N `POST /site-media/v1/files/import` calls as **concurrent sibling calls in one concurrent batch**.
|
|
110
110
|
5. **Parallel PATCHes.** After all imports resolve, emit all N PATCH calls as **concurrent sibling calls in one concurrent batch**.
|
|
111
111
|
|
|
@@ -113,7 +113,7 @@ The following procedure prevents the observed serialization anti-pattern. Follow
|
|
|
113
113
|
|
|
114
114
|
### Media import and entity PATCH — parallelize with siblings
|
|
115
115
|
|
|
116
|
-
Generation is one concurrent batch — whether that's one batched call or N parallel siblings. The follow-up steps (`POST /site-media/v1/files/import` per image, and entity PATCH per product/post/item) are per-entity; those can parallelize via concurrent siblings — emit all N import calls in one concurrent batch, then all N PATCH calls in one concurrent batch. See the skill's `references/
|
|
116
|
+
Generation is one concurrent batch — whether that's one batched call or N parallel siblings. The follow-up steps (`POST /site-media/v1/files/import` per image, and entity PATCH per product/post/item) are per-entity; those can parallelize via concurrent siblings — emit all N import calls in one concurrent batch, then all N PATCH calls in one concurrent batch. See the skill's `references/PLAN.md` § "Batching discipline" for why sibling batching beats sequential dispatch.
|
|
117
117
|
|
|
118
118
|
**Pattern for an image phase:** one batched generation call → N parallel imports (sibling calls in one message) → N parallel PATCHes (sibling calls in one message).
|
|
119
119
|
|
|
@@ -122,7 +122,7 @@ Generation is one concurrent batch — whether that's one batched call or N para
|
|
|
122
122
|
This API is Wix-side and model-agnostic — the same shape works for any image source:
|
|
123
123
|
|
|
124
124
|
```
|
|
125
|
-
|
|
125
|
+
REST: POST https://www.wixapis.com/site-media/v1/files/import
|
|
126
126
|
body: {
|
|
127
127
|
"url": "<imageURL from Runware response>",
|
|
128
128
|
"mimeType": "image/png",
|
|
@@ -182,4 +182,4 @@ Every prompt should incorporate the full brand context available from the discov
|
|
|
182
182
|
| Wix Media import fails | Skip this image, entity gets no image |
|
|
183
183
|
| All images fail | Proceed without images, return `status: "failed"` with the root cause |
|
|
184
184
|
|
|
185
|
-
**Never block the main flow on image generation failure.** Products, posts, and pages work without images — users can upload their own via the Wix dashboard later.
|
|
185
|
+
**Never block the main flow on image generation failure.** Products, posts, and pages work without images — users can upload their own via the Wix dashboard later.
|