@wix/agent-skills 1.6.0 → 1.8.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 +5 -9
- package/package.json +1 -1
- package/skills/wix-app/SKILL.md +51 -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/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/STORES_VERSIONING.md +1 -0
- 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/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-design-system/SKILL.md +4 -0
- package/skills/wix-headless/SKILL.md +131 -386
- package/skills/wix-headless/references/BUILD-astro.md +246 -0
- package/skills/wix-headless/references/BUILD-own-build.md +167 -0
- package/skills/wix-headless/references/BUILD.md +105 -0
- package/skills/wix-headless/references/DESIGN_SYSTEM.md +175 -0
- package/skills/wix-headless/references/DISCOVERY-connect.md +55 -0
- package/skills/wix-headless/references/DISCOVERY-create.md +238 -0
- package/skills/wix-headless/references/DISCOVERY.md +50 -306
- package/skills/wix-headless/references/PLAN-connect.md +19 -0
- package/skills/wix-headless/references/PLAN-create.md +17 -0
- package/skills/wix-headless/references/PLAN.md +92 -0
- package/skills/wix-headless/references/SEED.md +214 -0
- package/skills/wix-headless/references/SETUP.md +73 -248
- package/skills/wix-headless/references/{blog → astro/blog}/BLOG_PAGES.md +6 -5
- package/skills/wix-headless/references/{blog → astro/blog}/BLOG_SETUP.md +2 -2
- package/skills/wix-headless/references/astro/bookings/COMPONENTS.md +337 -0
- package/skills/wix-headless/references/astro/bookings/SERVICES_PAGES.md +428 -0
- package/skills/wix-headless/references/astro/cms/CMS_FOUNDATIONS.md +214 -0
- package/skills/wix-headless/references/{cms → astro/cms}/FAQ_KNOWLEDGE_BASE.md +14 -12
- package/skills/wix-headless/references/{cms → astro/cms}/PORTFOLIO.md +15 -16
- package/skills/wix-headless/references/{cms → astro/cms}/RESOURCE_LIBRARY.md +13 -15
- package/skills/wix-headless/references/{cms → astro/cms}/TEAM_DIRECTORY.md +11 -11
- package/skills/wix-headless/references/astro/designer/INSTRUCTIONS.md +354 -0
- package/skills/wix-headless/references/{ecom → astro/ecom}/CART_PAGES.md +8 -9
- package/skills/wix-headless/references/{ecom → astro/ecom}/CART_WIRING.md +6 -6
- package/skills/wix-headless/references/{ecom → astro/ecom}/COMPONENTS_CSS.md +6 -6
- package/skills/wix-headless/references/{forms → astro/forms}/CONTACT_FORM.md +18 -32
- package/skills/wix-headless/references/{gift-cards → astro/gift-cards}/COMPONENTS.md +3 -3
- package/skills/wix-headless/references/{gift-cards → astro/gift-cards}/PAGES.md +2 -2
- package/skills/wix-headless/references/{stores → astro/stores}/BACK_IN_STOCK.md +7 -7
- package/skills/wix-headless/references/{stores → astro/stores}/CATEGORY_PAGES.md +12 -13
- package/skills/wix-headless/references/{stores → astro/stores}/COMPONENTS_CSS.md +7 -7
- 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 +11 -9
- package/skills/wix-headless/references/{stores → astro/stores}/SHARED_WIRING.md +8 -7
- 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/bookings/AvailabilityCalendar.tsx +218 -0
- package/skills/wix-headless/references/astro/templates/bookings/BookingForm.tsx +194 -0
- package/skills/wix-headless/references/astro/templates/bookings/ManageBooking.tsx +84 -0
- package/skills/wix-headless/references/astro/templates/bookings/SeoTags.astro +25 -0
- package/skills/wix-headless/references/astro/templates/bookings/ServiceBookingFlow.tsx +50 -0
- package/skills/wix-headless/references/astro/templates/bookings/ServiceCard.astro +45 -0
- package/skills/wix-headless/references/astro/templates/bookings/api/confirm-booking.ts +34 -0
- package/skills/wix-headless/references/astro/templates/bookings/api/waitlist.ts +74 -0
- package/skills/wix-headless/references/astro/templates/bookings/booking-confirmation.astro +111 -0
- package/skills/wix-headless/references/astro/templates/bookings/components-bookings.css +413 -0
- package/skills/wix-headless/references/astro/templates/bookings/manage-booking.astro +76 -0
- package/skills/wix-headless/references/astro/templates/bookings/services/[slug].astro +81 -0
- package/skills/wix-headless/references/astro/templates/bookings/services/index.astro +65 -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 +28 -19
- package/skills/wix-headless/references/blog/INSTRUCTIONS.md +6 -6
- package/skills/wix-headless/references/bookings/INSTRUCTIONS.md +106 -0
- package/skills/wix-headless/references/bookings/SERVICES_DATA.md +295 -0
- package/skills/wix-headless/references/cms/CMS_FOUNDATIONS.md +35 -232
- package/skills/wix-headless/references/cms/INSTRUCTIONS.md +39 -8
- package/skills/wix-headless/references/commands/known-apps.json +2 -1
- package/skills/wix-headless/references/custom/CONNECTION_PLAN.md +142 -0
- package/skills/wix-headless/references/custom/INSTRUCTIONS.md +88 -0
- package/skills/wix-headless/references/custom/blog/WIRING.md +52 -0
- package/skills/wix-headless/references/custom/bookings/WIRING.md +88 -0
- package/skills/wix-headless/references/custom/cms/WIRING.md +97 -0
- package/skills/wix-headless/references/custom/ecom/WIRING.md +67 -0
- package/skills/wix-headless/references/custom/forms/WIRING.md +101 -0
- package/skills/wix-headless/references/custom/stores/WIRING.md +80 -0
- package/skills/wix-headless/references/ecom/INSTRUCTIONS.md +12 -12
- package/skills/wix-headless/references/forms/INSTRUCTIONS.md +6 -6
- package/skills/wix-headless/references/gift-cards/INSTRUCTIONS.md +13 -13
- package/skills/wix-headless/references/images/INSTRUCTIONS.md +58 -60
- package/skills/wix-headless/references/seed-recipes.md +49 -0
- package/skills/wix-headless/references/shared/AGENTS_MD.md +47 -0
- package/skills/wix-headless/references/shared/AUTHENTICATION.md +108 -0
- package/skills/wix-headless/references/shared/BUILD_NOISE.md +2 -2
- package/skills/wix-headless/references/shared/DESIGN_MD.md +85 -0
- package/skills/wix-headless/references/shared/DOCS_SEARCH.md +41 -0
- package/skills/wix-headless/references/shared/IMAGE_GENERATION.md +40 -39
- package/skills/wix-headless/references/shared/IMPLEMENTER.md +92 -41
- package/skills/wix-headless/references/shared/PRODUCTION_SHARP_EDGES.md +3 -3
- package/skills/wix-headless/references/shared/RETURN_CONTRACT.md +32 -312
- package/skills/wix-headless/references/shared/STYLING.md +48 -21
- package/skills/wix-headless/references/stores/INSTRUCTIONS.md +59 -29
- package/skills/wix-headless/references/stores/PRODUCT_CATALOG_DATA.md +31 -28
- 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/bookings.md +41 -0
- package/skills/wix-headless/references/verticals/cms.md +9 -100
- package/skills/wix-headless/references/verticals/ecom.md +6 -77
- 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 +148 -11
- package/skills/wix-headless/scripts/compose.mjs +540 -0
- package/skills/wix-headless/scripts/emit-design-tokens.mjs +136 -53
- package/skills/wix-headless/scripts/flatten.sh +61 -0
- package/skills/wix-headless/scripts/generate-images.mjs +242 -0
- 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/scaffold.sh +113 -27
- package/skills/wix-headless/scripts/seed-utilities.sh +50 -12
- package/skills/wix-headless/scripts/write-decorative-json.mjs +62 -0
- package/skills/wix-manage/SKILL.md +4 -8
- package/skills/wix-manage/references/blog/how-to-create-blog-posts.md +2 -0
- 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/domains/domain-search-and-purchase.md +10 -7
- 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 +50 -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 +2 -0
- package/skills/wix-app/references/custom-element-widget/default-thumbnail.png +0 -0
- 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/scripts/finalize-run-json.mjs +0 -141
- package/skills/wix-headless/scripts/init-site-json.mjs +0 -63
- package/skills/wix-headless/scripts/preview.sh +0 -45
- package/skills/wix-headless/scripts/release.sh +0 -73
- 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
|
@@ -0,0 +1,108 @@
|
|
|
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
|
+
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
|
+
**Re-mint is never a recovery step — see Token minting.** 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-create.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).
|
|
@@ -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,85 @@
|
|
|
1
|
+
# DESIGN.md — the design-token format (vendored spec)
|
|
2
|
+
|
|
3
|
+
`DESIGN.md` is the **single design artifact** of the wix-headless design-system phase. The Designer authors it; `emit-design-tokens.mjs` writes it + projects `.wix/design-tokens.css` and `.wix/site.d.ts` from it; `compose.mjs` reads its **frontmatter** to write the astro design-system files. It is the standalone, framework-agnostic spec a non-astro frontend, a human, or another tool can read.
|
|
4
|
+
|
|
5
|
+
This file is the **canonical spec inside the skill** — the public DESIGN.md frontmatter format (the `design.md` spec, captured here) plus the small, documented extensions this skill uses. Do not depend on the external `design.md` project at runtime.
|
|
6
|
+
|
|
7
|
+
## Frontmatter structure
|
|
8
|
+
|
|
9
|
+
A `DESIGN.md` file is YAML frontmatter delimited by `---`, optionally followed by a free-form markdown body:
|
|
10
|
+
|
|
11
|
+
```yaml
|
|
12
|
+
---
|
|
13
|
+
version: alpha # optional
|
|
14
|
+
name: <string> # the brand / design-system name
|
|
15
|
+
colors:
|
|
16
|
+
<token-name>: <Color>
|
|
17
|
+
typography:
|
|
18
|
+
<token-name>:
|
|
19
|
+
fontFamily: <string>
|
|
20
|
+
fontSize: <Dimension> # optional (unused by this skill)
|
|
21
|
+
fontWeight: <number> # optional
|
|
22
|
+
lineHeight: <Dimension|number> # optional
|
|
23
|
+
letterSpacing: <Dimension> # optional
|
|
24
|
+
spacing:
|
|
25
|
+
<scale-level>: <Dimension|number>
|
|
26
|
+
rounded: # corner radii (DESIGN.md's name for radius tokens)
|
|
27
|
+
<scale-level>: <Dimension>
|
|
28
|
+
containers: # EXTENSION (this skill): content/reading widths
|
|
29
|
+
<scale-level>: <Dimension>
|
|
30
|
+
googleFontsHref: <string> # EXTENSION (this skill): the ready Google Fonts <link> href
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
# free-form body — documentation only, NEVER parsed
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Value types
|
|
37
|
+
|
|
38
|
+
- **Color** — any valid CSS color string (hex `#RRGGBB`, `rgb()`, `hsl()`, named). **Quote hex values** — an unquoted `#hex` after `: ` is a YAML comment.
|
|
39
|
+
- **Dimension** — a string with a unit suffix: `px`, `em`, `rem` (e.g. `"1rem"`, `16px`).
|
|
40
|
+
- **Token reference** — `{path.to.value}` (curly-brace object path into the YAML tree).
|
|
41
|
+
|
|
42
|
+
## How this skill uses it
|
|
43
|
+
|
|
44
|
+
### Frontmatter only is canonical
|
|
45
|
+
|
|
46
|
+
`compose.mjs` and `emit-design-tokens.mjs` read the **frontmatter only**. The markdown body is documentation and is **never parsed** — so a generated `DESIGN.md` can carry a minimal or empty body without affecting the build, and run-to-run body variance never reaches the output.
|
|
47
|
+
|
|
48
|
+
### Token vocabulary (the groups this skill consumes)
|
|
49
|
+
|
|
50
|
+
| DESIGN.md group | wix CSS projection | Notes |
|
|
51
|
+
|---|---|---|
|
|
52
|
+
| `colors` | `--color-<key>` | semantic role keys (see color roles below) |
|
|
53
|
+
| `typography.<level>.fontFamily` | `--font-<level>` | `display` + `body` required; `mono` optional |
|
|
54
|
+
| `spacing` | `--spacing-<key>` | full `2xs…4xl` rhythm scale |
|
|
55
|
+
| `rounded` | `--radius-<key>` | `sm` + `md` required |
|
|
56
|
+
| `containers` | `--container-<key>` | **extension** — content widths, a separate axis from spacing (`prose, md, 3xl, 6xl`) |
|
|
57
|
+
| `googleFontsHref` | the Layout `<link>` href | **extension** — the ready stylesheet URL for the chosen families |
|
|
58
|
+
|
|
59
|
+
### Color roles — wix-native keys are the contract
|
|
60
|
+
|
|
61
|
+
The skill's component-CSS templates reference a fixed set of `--color-*` names (`STYLING.md` § "Required tokens"). So the **canonical color token keys in our DESIGN.md are the wix editorial roles** — and these are valid DESIGN.md color token names (the format leaves token names free-form):
|
|
62
|
+
|
|
63
|
+
`paper` (primary background), `paper-warm` (secondary surface), `ink` (primary text / dark fills), `ink-soft`, `mute` (muted text), `rule` (borders / dividers), `accent` (brand emphasis), `cream`, `error`.
|
|
64
|
+
|
|
65
|
+
`paper`, `paper-warm`, `ink`, `mute`, `rule`, `accent` are **required**; `ink-soft`, `cream`, `error` recommended (derived as a fail-safe if absent).
|
|
66
|
+
|
|
67
|
+
### Standard-role compatibility (reading an externally-authored DESIGN.md)
|
|
68
|
+
|
|
69
|
+
A DESIGN.md authored elsewhere may use the DESIGN.md spec's *common* semantic roles instead of the wix-native keys. `compose.mjs` carries a **role-translation table** so such a file is still consumable; wix-native keys are not in the table and pass through unchanged (winning on conflict):
|
|
70
|
+
|
|
71
|
+
| standard role | → wix `--color-*` | | standard role | → wix `--color-*` |
|
|
72
|
+
|---|---|---|---|---|
|
|
73
|
+
| `primary` | `accent` | | `surface` / `background` | `paper` |
|
|
74
|
+
| `secondary` | `paper-warm` | | `on-surface` / `on-background` | `ink` |
|
|
75
|
+
| `tertiary` | `ink-soft` | | `outline` | `rule` |
|
|
76
|
+
| `neutral` | `mute` | | `error` | `error` |
|
|
77
|
+
|
|
78
|
+
This translation is a **compatibility layer**, not the authoring path: the Designer in this skill emits the wix-native keys directly (lossless — no role round-trip), so `STYLING.md` and every `components-<pack>.css` template stay untouched.
|
|
79
|
+
|
|
80
|
+
## Producers & consumers in the run
|
|
81
|
+
|
|
82
|
+
- **Designer** (`DESIGN_SYSTEM.md`) — **authors `DESIGN.md` directly** (its frontmatter is the spec); returns only the brand-voice strings + the `DESIGN.md` path.
|
|
83
|
+
- **`emit-design-tokens.mjs`** — reads the Designer's `DESIGN.md` and projects `.wix/design-tokens.css` + `.wix/site.d.ts` from its frontmatter. It does **not** write `DESIGN.md` (the Designer does).
|
|
84
|
+
- **`compose.mjs`** — reads `DESIGN.md` frontmatter → writes the 6 astro design-system files (astro only).
|
|
85
|
+
- **Non-astro (`own`) frontends** — import `.wix/design-tokens.css` for the same values; component composition stays framework-native (no `compose.mjs`).
|
|
@@ -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
|
-
|
|
28
|
+
Send `body` as a real JSON array (not a stringified blob). Auth uses the CLI-minted site-scoped token and the standard headers — see `<SKILL_ROOT>/references/shared/AUTHENTICATION.md`.
|
|
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
|
|
|
@@ -44,7 +44,7 @@ Extract `data[0].imageURL` from the response. This is a short-lived URL — **im
|
|
|
44
44
|
|
|
45
45
|
### Allowed Dimensions (safe defaults)
|
|
46
46
|
|
|
47
|
-
Runware enforces a fixed set per model. Start with these
|
|
47
|
+
Runware enforces a fixed set per model. Start with these:
|
|
48
48
|
|
|
49
49
|
| Aspect | Size | Use for |
|
|
50
50
|
|--------|------|---------|
|
|
@@ -58,14 +58,33 @@ If a 400 response lists supported dimensions, use one from that list — do not
|
|
|
58
58
|
|
|
59
59
|
Do NOT send `steps` or `CFGScale` — both are rejected with `unsupportedParameter` and cause a 400. These fields are valid for other Runware models but must be omitted for `google:4@2`.
|
|
60
60
|
|
|
61
|
-
##
|
|
61
|
+
## Preferred: run the whole phase through `generate-images.mjs`
|
|
62
|
+
|
|
63
|
+
Generation + Wix Media import is **embarrassingly parallel** (N independent `generate → import` chains, no cross-image dependency) and **recipe-free** (no entity write-shapes), so it is best run by a deterministic script rather than by hand. `<SKILL_ROOT>/scripts/generate-images.mjs` does exactly this: it fires every image as a **concurrent single-task request in one process** (`Promise.all`), then imports each result to Wix Media — all in parallel — and returns a `key → {url, fileId}` map. Because each task is its **own** request (not N tasks in one body), it sidesteps the `google:4@2` N≥3-in-one-request 504 entirely, and because the parallelism lives in code it cannot degrade into the sequential-turns anti-pattern below.
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
echo '{
|
|
67
|
+
"siteId": "<siteId>",
|
|
68
|
+
"model": "google:4@2",
|
|
69
|
+
"images": [
|
|
70
|
+
{"key": "hero", "positivePrompt": "<prompt>", "width": 1376, "height": 768},
|
|
71
|
+
{"key": "about", "positivePrompt": "<prompt>", "width": 1200, "height": 896}
|
|
72
|
+
]
|
|
73
|
+
}' | WIX_TOKEN="$TOKEN" node <SKILL_ROOT>/scripts/generate-images.mjs
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
`key` is a **slot name** for Phase 1 (`hero`, `about`) or an **entityId** for Phase 2. The returned `slots` map (key→url) pipes straight into `write-decorative-json.mjs` (Phase 1); the `map` (key→{url,fileId}) feeds the entity PATCH/PUT/publish recipe (Phase 2). Pass the **already-minted** site token via `WIX_TOKEN` (mint-once — `AUTHENTICATION.md`); the script mints its own only as a fallback. Per-image failures are isolated (`status: "partial"`), and `x-wix-request-id` is captured per call into `results[]` for trace analysis.
|
|
77
|
+
|
|
78
|
+
The manual `curl` shapes below remain the **reference for the request bodies** the script builds, and the **fallback** when the script can't be used. The "one concurrent batch" rule still applies if you ever hand-drive a phase.
|
|
79
|
+
|
|
80
|
+
## Required (manual fallback): minimize round-trips per image phase
|
|
62
81
|
|
|
63
82
|
The image agent's `image-phase-1-decorative` and `image-phase-2-entity` scopes each generate multiple images. **Do not emit N one-task calls in sequential turns** — sequential dispatch across many turns adds ~30–40 s of inter-message overhead. The correct shape depends on the model:
|
|
64
83
|
|
|
65
84
|
### For `bfl:5@1`, `runware:400@1`, and other models: ONE batched call
|
|
66
85
|
|
|
67
86
|
```
|
|
68
|
-
|
|
87
|
+
REST: POST https://www.wixapis.com/runwareschemaless/v1/request
|
|
69
88
|
body: [
|
|
70
89
|
{ "taskType": "imageInference", "taskUUID": "<uuid-1>", "positivePrompt": "...", ... },
|
|
71
90
|
{ "taskType": "imageInference", "taskUUID": "<uuid-2>", "positivePrompt": "...", ... },
|
|
@@ -76,53 +95,35 @@ One round-trip. Response's `data[]` array contains one result per task, matched
|
|
|
76
95
|
|
|
77
96
|
### For `google:4@2` (the default): N parallel 1-task sibling calls
|
|
78
97
|
|
|
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 `
|
|
98
|
+
`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
99
|
|
|
81
100
|
```
|
|
82
101
|
Assistant message (single turn, multiple tool calls):
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
102
|
+
REST: POST https://www.wixapis.com/runwareschemaless/v1/request
|
|
103
|
+
REST: POST https://www.wixapis.com/runwareschemaless/v1/request
|
|
104
|
+
REST: POST https://www.wixapis.com/runwareschemaless/v1/request
|
|
86
105
|
```
|
|
87
106
|
|
|
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
|
|
89
|
-
|
|
90
|
-
### ANTI-PATTERN (slow, regardless of model)
|
|
91
|
-
|
|
92
|
-
Sequential 1-task calls across multiple turns:
|
|
93
|
-
```
|
|
94
|
-
Assistant msg 1: <prefix>CallWixSiteAPI body: [ task1 ]
|
|
95
|
-
(runtime waits)
|
|
96
|
-
Assistant msg 2: <prefix>CallWixSiteAPI body: [ task2 ]
|
|
97
|
-
(runtime waits)
|
|
98
|
-
Assistant msg 3: <prefix>CallWixSiteAPI body: [ task3 ]
|
|
99
|
-
```
|
|
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**.
|
|
107
|
+
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: sequential 1-task calls across multiple turns each add inter-message overhead.
|
|
101
108
|
|
|
102
109
|
### Procedure to enforce batching
|
|
103
110
|
|
|
104
|
-
|
|
111
|
+
Whether you batch one request or fire parallel siblings, **all calls in each stage MUST be in one concurrent batch**. Follow these steps in order:
|
|
105
112
|
|
|
106
113
|
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
|
-
2. **Compose the full body array
|
|
108
|
-
3. **
|
|
109
|
-
4. **Parallel imports.** After the generate response arrives, emit all N `POST /site-media/v1/files/import` calls as
|
|
110
|
-
5. **Parallel PATCHes.** After all imports resolve, emit all N PATCH calls as
|
|
111
|
-
|
|
112
|
-
**Three concurrent batches total (one per stage).** If you find yourself making more, stop and check whether you're serializing.
|
|
113
|
-
|
|
114
|
-
### Media import and entity PATCH — parallelize with siblings
|
|
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/ORCHESTRATION.md` § "Batching compliance" for why sibling batching beats sequential dispatch.
|
|
114
|
+
2. **Compose the generation call(s).** For `bfl:5@1` / `runware:400@1`, one batched call with the full body array; for `google:4@2`, N parallel 1-task sibling calls. Verify the task count matches the entity count.
|
|
115
|
+
3. **Generate.** Fire that generation as one concurrent batch.
|
|
116
|
+
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.
|
|
117
|
+
5. **Parallel PATCHes.** After all imports resolve, emit all N PATCH calls as concurrent sibling calls in one concurrent batch.
|
|
117
118
|
|
|
118
|
-
**
|
|
119
|
+
**Three concurrent batches total (one per stage).** If you find yourself making more, stop and check whether you're serializing. See the skill's `references/PLAN.md` § "Batching discipline" for why sibling batching beats sequential dispatch.
|
|
119
120
|
|
|
120
121
|
## Step 2: Import to Wix Media
|
|
121
122
|
|
|
122
123
|
This API is Wix-side and model-agnostic — the same shape works for any image source:
|
|
123
124
|
|
|
124
125
|
```
|
|
125
|
-
|
|
126
|
+
REST: POST https://www.wixapis.com/site-media/v1/files/import
|
|
126
127
|
body: {
|
|
127
128
|
"url": "<imageURL from Runware response>",
|
|
128
129
|
"mimeType": "image/png",
|
|
@@ -182,4 +183,4 @@ Every prompt should incorporate the full brand context available from the discov
|
|
|
182
183
|
| Wix Media import fails | Skip this image, entity gets no image |
|
|
183
184
|
| All images fail | Proceed without images, return `status: "failed"` with the root cause |
|
|
184
185
|
|
|
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.
|
|
186
|
+
**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.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Shared Implementer — Common Behavior for Every Vertical Subagent
|
|
2
2
|
|
|
3
|
-
This file is **extended by every per-vertical `INSTRUCTIONS.md`** (stores, ecom, cms, blog, forms, gift-cards). Per-vertical instruction files are thin — they declare scopes and reference paths. Everything else lives here.
|
|
3
|
+
This file is **extended by every per-vertical `INSTRUCTIONS.md`** (stores, ecom, cms, blog, forms, gift-cards, bookings). Per-vertical instruction files are thin — they declare scopes and reference paths. Everything else lives here.
|
|
4
4
|
|
|
5
5
|
## Self-loading
|
|
6
6
|
|
|
@@ -8,61 +8,54 @@ Read **only** the files your scope needs. The reading set varies by scope:
|
|
|
8
8
|
|
|
9
9
|
| Your scope | Mandatory | Conditional |
|
|
10
10
|
|---|---|---|
|
|
11
|
-
| `seed` | this file, `RETURN_CONTRACT.md`, `
|
|
11
|
+
| `seed` | this file, `RETURN_CONTRACT.md`, `DOCS_SEARCH.md` | — |
|
|
12
12
|
| `components`, `components-css`, `pages`, `pages-*` | this file, `RETURN_CONTRACT.md`, `STYLING.md` | — |
|
|
13
13
|
| Image scopes | (read `references/images/INSTRUCTIONS.md` § Self-Loading) | — |
|
|
14
14
|
|
|
15
|
-
Then read the specific reference(s) for your declared scope (see your vertical's `INSTRUCTIONS.md` scope table). Do NOT read references for scopes
|
|
15
|
+
Then read the specific reference(s) for your declared scope(s) (see your vertical's `INSTRUCTIONS.md` scope table). Do NOT read references for scopes **not** named in your prompt — wastes context and blurs ownership.
|
|
16
16
|
|
|
17
17
|
## Phase routing
|
|
18
18
|
|
|
19
|
-
Your prompt includes a line
|
|
19
|
+
Your prompt includes a line naming your scope(s). Map **each** scope to its reference set per your vertical's `INSTRUCTIONS.md` scope table. If the scope line is missing, stop and ask the parent — do not guess.
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
**Merged dispatch (the common case — one agent owns components + pages for a vertical).** Your prompt may list **several** scopes — e.g. `Scopes (write in this order): components, pages-products, pages-categories`. This is a single "build" agent for one vertical: read the **union** of those scopes' references and write them in the order given — **islands/components FIRST, then the pages/routes that mount them.** Writing the page before its island leaves a dangling import; the within-agent order is exactly why these were merged into one dispatch (it removes the cross-agent Components→Pages barrier). You still own only the files those scopes declare; do not touch another vertical's files or a shared shell unless your scope list explicitly includes a shell-patching `pages` scope.
|
|
22
|
+
|
|
23
|
+
Standard scope names:
|
|
24
|
+
- `seed` — Seed phase (REST data setup, no frontend code)
|
|
23
25
|
- `components` — Components phase (reusable React/Astro islands, SDK wiring)
|
|
24
26
|
- `pages` — Pages phase (route files with visual design + data queries, single scope per vertical)
|
|
25
27
|
- `pages-<name>` — Pages phase sub-scope (only when a vertical has multiple pages groups, e.g. stores has `pages-products`, `pages-home-and-nav`)
|
|
26
28
|
|
|
27
|
-
##
|
|
28
|
-
|
|
29
|
-
Your prompt includes `MCP tool prefix: <prefix>`. Substitute it for `mcp__wix-mcp-remote__` wherever it appears in your reference files. See `references/shared/MCP_PREFIX.md` for discovery rules.
|
|
29
|
+
## REST auth
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
Scopes that call Wix APIs (`seed`, image phases) receive `siteId` in the prompt. Mint once: `TOKEN=$(npx @wix/cli@latest token --site "$SITE_ID")`. Every `curl` uses the headers in `references/shared/AUTHENTICATION.md`. Doc lookups use the public REST endpoints listed in `references/shared/DOCS_SEARCH.md`.
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
If your scope is `components` or `pages`, you should NOT make REST calls — those scopes are frontend-only. If you find yourself needing a site API call, it's a scope violation — return `status: "partial"` with an error note, do not proceed.
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
## Don't depend on mutable shared state (one scoped exception: `.wix/seeded.json`)
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
{
|
|
39
|
-
"brand": { "name": "...", "description": "..." },
|
|
40
|
-
"seeded": { "stores": { "products": [...] }, "cms": { "collections": {...} }, ... },
|
|
41
|
-
"designTokens": { "colors": {...}, "fonts": {...}, "radii": {...}, "spacing": {...} },
|
|
42
|
-
"verticals": ["stores", "ecom", "cms"]
|
|
43
|
-
}
|
|
44
|
-
```
|
|
37
|
+
Every input you need is either inlined in your prompt or — for seeded entity IDs — in **`.wix/seeded.json`**, the one shared file you are allowed to read. The orchestrator holds run state in scratch, not on disk — it is **not** a coordination channel you can read. `.wix/seeded.json` is the one exception: a producer→consumer handoff written **once** at the seed gate, read-only thereafter. Read **only your own `<vertical>` slice**; never write it.
|
|
45
38
|
|
|
46
|
-
**Phase-specific
|
|
39
|
+
**Phase-specific inputs:**
|
|
47
40
|
|
|
48
|
-
| Scope |
|
|
41
|
+
| Scope | Where its inputs come from |
|
|
49
42
|
|---|---|
|
|
50
|
-
| `seed` | `brand`
|
|
51
|
-
| `components` | `brand
|
|
52
|
-
| `pages` / `pages-*` | `brand`, `seeded.<vertical>` (products, posts, collections)
|
|
43
|
+
| `seed` | All **inlined**: `brand`, `intent.<pack>`, `siteId`, recipe path(s). Do NOT re-derive these. |
|
|
44
|
+
| `components` | **Inlined**: `brand`. **Read from disk**: the design tokens (the DESIGN.md vocabulary — `colors`/`typography`/`spacing`/`rounded`/`containers`) from `.wix/design-tokens.css` (gate-verified present; also the CSS variables the build consumes). Components do not need seeded IDs. |
|
|
45
|
+
| `pages` / `pages-*` | **Inlined:** `brand`. **Read from disk:** the design tokens (`.wix/design-tokens.css`, DESIGN.md vocabulary); your `seeded.<vertical>` slice from `.wix/seeded.json` (products, posts, collections IDs). Page data wiring uses live SDK queries; the `seeded` data is for path resolution + demo content authoring. |
|
|
53
46
|
|
|
54
|
-
If a required
|
|
47
|
+
If a required **inlined** input is missing from your prompt, or your **`.wix/seeded.json` slice** is absent (e.g. you are dispatched as `pages-products` but `.wix/seeded.json` has no `seeded.stores`), fail fast — return `status: "failed"` with `errors: [{ code: "SEEDED_JSON_SLICE_MISSING", missing: "seeded.stores.products" }]` (or `PROMPT_INCOMPLETE` for an inlined gap). Do NOT re-fetch via curl — the gap means an upstream phase didn't complete, and re-querying would mask the real bug.
|
|
55
48
|
|
|
56
|
-
## Seeders
|
|
49
|
+
## Seeders return data; orchestrator aggregates → `.wix/seeded.json`
|
|
57
50
|
|
|
58
|
-
Agents with `Scope: seed` return their seeded entities in the `data` block of the standard return (see `RETURN_CONTRACT.md`). The
|
|
51
|
+
Agents with `Scope: seed` return their seeded entities in the `data` block of the standard return (see `RETURN_CONTRACT.md`). The orchestrator collects every seeder return into its session scratch and writes the aggregated map **once** to `.wix/seeded.json` at the seed gate; per-vertical Page / wiring agents then read their own slice from that file (no inlined slice). (The single Image Phase 2 dispatch keeps its slice inlined.) You do NOT write `.wix/seeded.json` (the orchestrator is its sole writer), and you do NOT write `.wix/seed-returns/<pack>.json` — your JSON return is the contract.
|
|
59
52
|
|
|
60
53
|
## Writing page files
|
|
61
54
|
|
|
62
55
|
Pages-phase agents write route files (`.astro`) with:
|
|
63
56
|
|
|
64
|
-
1. **Visual design via design tokens and Tailwind.** Reference tokens as `var(--color-
|
|
65
|
-
2. **Data queries against seeded data.** Read the seeded
|
|
57
|
+
1. **Visual design via design tokens and Tailwind.** Reference tokens as `var(--color-accent)` in `<style>` blocks or `bg-[--color-accent]` as Tailwind arbitrary values. Use canonical component templates (`agents/<vertical>/templates/*.astro`) as starting points — adapt, don't invent.
|
|
58
|
+
2. **Data queries against seeded data.** Read the seeded entity IDs / slugs from your `seeded.<vertical>` slice in `.wix/seeded.json` (with the `Read` tool — not by `import`). Pages query the Wix SDK at request time (`await productsV3.queryProducts(...)`) — that's the production-correct pattern. Use the `seeded` data for path generation (e.g. `getStaticPaths` slugs) and for authoring demo content where needed; do NOT `import` `.wix/seeded.json` from page files — it sits outside the bundler root and reading it at author-time (not bundling it) keeps it out of `dist/`.
|
|
66
59
|
3. **Imports from shared components.** Pages import components your Components-phase agent wrote (`src/components/*.tsx`, `.astro`).
|
|
67
60
|
4. **Imports from skill shared utilities.** `from "../utils/wix-image"` and `from "../utils/analytics"` — these are skill-shipped (copied into the project by `seed-utilities.sh` during Setup); do NOT import them from anywhere else.
|
|
68
61
|
|
|
@@ -126,30 +119,88 @@ The full styling contract (tokens-as-utilities default, when global semantic cla
|
|
|
126
119
|
## Style conventions
|
|
127
120
|
|
|
128
121
|
- **camelCase for identifiers, kebab-case for filenames, PascalCase for components.** Example: `ProductCard.astro`, `queryBlogPosts` function, `cart-updated` event.
|
|
129
|
-
- **No inline styles beyond design-token CSS variables.** `style={{ color: "red" }}` is forbidden; `style={{ color: "var(--color-
|
|
130
|
-
- **Tailwind
|
|
131
|
-
- **Tailwind v4 `@reference` is mandatory in any scoped CSS that uses `@apply`.** Tailwind v4 isolates `@apply` per file — utilities defined in the main entry CSS (where `@theme` lives) are NOT visible to `components-*.css` unless that file prepends `@reference "./global.css";` on line 1. Without it, `wix cli build` fails with `Cannot apply unknown utility class 'gap-sm' …`. **`tsc` and `astro check` both pass clean** — only the bundler catches the regression. If your scope writes a `components-<vertical>.css` that uses `@apply` with theme tokens (e.g., `@apply gap-sm font-display text-sm`), the file MUST start with:
|
|
122
|
+
- **No inline styles beyond design-token CSS variables.** `style={{ color: "red" }}` is forbidden; `style={{ color: "var(--color-accent)" }}` is fine.
|
|
123
|
+
- **Tailwind v4 `@reference` is mandatory in any scoped CSS that uses `@apply`.** Tailwind v4 isolates `@apply` per file — utilities defined in the main entry CSS (where `@theme` lives) are NOT visible to `components-*.css` unless that file prepends `@reference "./global.css";` on line 1. If your scope writes a `components-<vertical>.css` that uses `@apply` with theme tokens (e.g., `@apply gap-sm font-display text-sm`), the file MUST start with:
|
|
132
124
|
```css
|
|
133
125
|
@reference "./global.css";
|
|
134
126
|
```
|
|
135
|
-
Without it, the build breaks at release time even though `tsc` and `astro check` pass clean — only the bundler catches it.
|
|
136
|
-
- **Fail loud, never silently.** If data is missing, a required field is absent, or an
|
|
127
|
+
Without it, the build breaks at release time with `Cannot apply unknown utility class 'gap-sm' …` even though `tsc` and `astro check` pass clean — only the bundler catches it.
|
|
128
|
+
- **Fail loud, never silently.** If data is missing, a required field is absent, or an REST call returns an unexpected shape, return `status: "failed"` with details. Do not invent placeholders or swallow errors.
|
|
137
129
|
|
|
138
130
|
## Return contract
|
|
139
131
|
|
|
140
|
-
Every agent ends its message with a fenced JSON block per `RETURN_CONTRACT.md
|
|
132
|
+
Every agent ends its message with a fenced JSON block per `RETURN_CONTRACT.md` (the universal envelope: skeleton, status semantics, no-trailing-prose rule). The JSON MUST be the last content in the message — no trailing prose. Timing fields are NOT included (the orchestrator captures timing via runtime `duration_ms`).
|
|
133
|
+
|
|
134
|
+
The `data` shapes for the scopes this file owns — `components` and `pages`/`pages-*` — are below. (Seed `data` shapes live in your per-vertical `INSTRUCTIONS.md` § Seed return.)
|
|
135
|
+
|
|
136
|
+
**`components` scope** (`phase: "<pack>-components"`):
|
|
137
|
+
|
|
138
|
+
```json
|
|
139
|
+
{
|
|
140
|
+
"status": "complete",
|
|
141
|
+
"phase": "stores-components",
|
|
142
|
+
"scope": "components",
|
|
143
|
+
"summary": "Wrote React islands + utils; wired analytics; contract classes referenced: 7",
|
|
144
|
+
"data": {
|
|
145
|
+
"islands": ["ProductPurchase.tsx", "CartView.tsx", "AddToCartButton.tsx", "CartBadge.tsx"],
|
|
146
|
+
"utils": ["wix-image.ts", "analytics.ts"],
|
|
147
|
+
"astroComponents": ["SeoTags.astro"]
|
|
148
|
+
},
|
|
149
|
+
"files": [
|
|
150
|
+
"src/utils/wix-image.ts",
|
|
151
|
+
"src/utils/analytics.ts",
|
|
152
|
+
"src/components/SeoTags.astro",
|
|
153
|
+
"src/components/AddToCartButton.tsx",
|
|
154
|
+
"src/components/CartBadge.tsx",
|
|
155
|
+
"src/components/ProductPurchase.tsx",
|
|
156
|
+
"src/components/CartView.tsx"
|
|
157
|
+
]
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
**`pages` / `pages-*` scope** (`phase: "<pack>-pages[-<group>]"`):
|
|
162
|
+
|
|
163
|
+
```json
|
|
164
|
+
{
|
|
165
|
+
"status": "complete",
|
|
166
|
+
"phase": "stores-pages-products",
|
|
167
|
+
"scope": "pages-products",
|
|
168
|
+
"data": {
|
|
169
|
+
"pagesWired": 2,
|
|
170
|
+
"wixMetadataExported": true,
|
|
171
|
+
"seoTagsMounted": true,
|
|
172
|
+
"analyticsEvents": ["AddProductImpression", "ClickProduct", "ViewContent"]
|
|
173
|
+
},
|
|
174
|
+
"files": [
|
|
175
|
+
"src/pages/products/index.astro",
|
|
176
|
+
"src/pages/products/[slug].astro",
|
|
177
|
+
"src/components/ProductCard.astro"
|
|
178
|
+
]
|
|
179
|
+
}
|
|
180
|
+
```
|
|
141
181
|
|
|
142
182
|
## Common failure modes
|
|
143
183
|
|
|
144
184
|
| Wrong | Right |
|
|
145
185
|
|---|---|
|
|
146
|
-
| Reading references for scopes
|
|
147
|
-
|
|
|
148
|
-
|
|
|
149
|
-
|
|
|
186
|
+
| Reading references for scopes **not** listed in your prompt | Read only the references for your declared scope(s) — the union when it's a merged build dispatch |
|
|
187
|
+
| Writing a page/route before the island it mounts (merged dispatch) | Write islands/components FIRST, then the pages — in the prompt's scope order |
|
|
188
|
+
| Issuing REST calls from a `components` or `pages` scope | Components/Pages are frontend-only; read `seeded` data from your `.wix/seeded.json` slice (pages only) — never curl |
|
|
189
|
+
| Re-querying when your `seeded.<vertical>` slice is missing from `.wix/seeded.json` | Fail fast with `SEEDED_JSON_SLICE_MISSING` — an upstream phase didn't complete (do NOT re-query) |
|
|
190
|
+
| Depending on mutable shared state the orchestrator holds in scratch | Every input is inlined; the one shared file you may read is your `.wix/seeded.json` slice (read-only) |
|
|
150
191
|
| Inventing class names for layout/spacing/typography (`.productCard`, `.heroSection`) | Tailwind utilities derived from `@theme` tokens (`class="flex flex-col gap-md"`, `class="py-4xl"`). For one-off page decoration, co-located `<style>` block. |
|
|
151
192
|
| Removing a marker after inserting at it | Marker stays; other verticals may contribute after you |
|
|
152
193
|
| Trailing narrative prose after the return JSON | JSON block must be the last content |
|
|
153
194
|
| Fabricated timestamps in the return JSON | Do not include timing fields — orchestrator captures them |
|
|
154
|
-
| Inline `style="color: red"` | Use design tokens: `style="color: var(--color-
|
|
195
|
+
| Inline `style="color: red"` | Use design tokens: `style="color: var(--color-accent)"` |
|
|
155
196
|
| Creating a new cross-cutting class name | Extract a shared primitive component instead |
|
|
197
|
+
|
|
198
|
+
### Astro/React build-blockers — check before returning `complete`
|
|
199
|
+
|
|
200
|
+
| Failure | How to detect | Fix |
|
|
201
|
+
|---------|---------------|-----|
|
|
202
|
+
| HTML-style comments in `.astro` frontmatter | `grep '<!--' *.astro` frontmatter | Use `//` or `/* */` — frontmatter is TypeScript. Surfaces at build as `Legacy HTML single-line comments`. |
|
|
203
|
+
| Missing `wixMetadata` on `/products/[slug]` | Check exports | Add the metadata export — required for Wix platform indexing |
|
|
204
|
+
| `import { products }` instead of `productsV3` | `grep 'from "@wix/stores"'` import line | V1 silently returns 0 on V3 catalogs |
|
|
205
|
+
| Missing `variantId` in cart operations | Check `catalogReference.options` | Always include — single-variant products have one |
|
|
206
|
+
| React island using default Tailwind color class | `grep 'bg-blue-\|bg-green-\|text-red-\|bg-gray-' *.tsx` | Use brand `@theme` utilities (`bg-bark`, `text-cream`) or contract class names |
|