@wix/agent-skills 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +111 -0
- package/package.json +29 -0
- package/skills/wix-app/SKILL.md +344 -0
- package/skills/wix-app/references/APP_IDENTIFIERS.md +35 -0
- package/skills/wix-app/references/APP_MARKET_REVIEW.md +311 -0
- package/skills/wix-app/references/APP_VALIDATION.md +171 -0
- package/skills/wix-app/references/BACKEND_API.md +233 -0
- package/skills/wix-app/references/BACKEND_EVENT.md +116 -0
- package/skills/wix-app/references/CODE_QUALITY.md +33 -0
- package/skills/wix-app/references/CUSTOM_ELEMENT_WIDGET.md +587 -0
- package/skills/wix-app/references/DASHBOARD_MENU_PLUGIN.md +157 -0
- package/skills/wix-app/references/DASHBOARD_MODAL.md +283 -0
- package/skills/wix-app/references/DASHBOARD_PAGE.md +403 -0
- package/skills/wix-app/references/DASHBOARD_PLUGIN.md +205 -0
- package/skills/wix-app/references/DATA_COLLECTION.md +451 -0
- package/skills/wix-app/references/DOCUMENTATION.md +42 -0
- package/skills/wix-app/references/EDITOR_REACT_COMPONENT.md +65 -0
- package/skills/wix-app/references/EMBEDDED_SCRIPT.md +468 -0
- package/skills/wix-app/references/EXTENSION_REGISTRATION.md +96 -0
- package/skills/wix-app/references/SERVICE_PLUGIN.md +235 -0
- package/skills/wix-app/references/SITE_PLUGIN.md +436 -0
- package/skills/wix-app/references/STORES_VERSIONING.md +334 -0
- package/skills/wix-app/references/backend-event/COMMON-EVENTS.md +84 -0
- package/skills/wix-app/references/custom-element-widget/SETTINGS_PANEL.md +345 -0
- package/skills/wix-app/references/dashboard-menu-plugin/blog-slots.md +71 -0
- package/skills/wix-app/references/dashboard-menu-plugin/bookings-slots.md +58 -0
- package/skills/wix-app/references/dashboard-menu-plugin/crm-slots.md +8 -0
- package/skills/wix-app/references/dashboard-menu-plugin/ecommerce-slots.md +17 -0
- package/skills/wix-app/references/dashboard-menu-plugin/events-slots.md +29 -0
- package/skills/wix-app/references/dashboard-menu-plugin/restaurants-slots.md +27 -0
- package/skills/wix-app/references/dashboard-menu-plugin/stores-slots.md +35 -0
- package/skills/wix-app/references/dashboard-page/API_SPEC.md +138 -0
- package/skills/wix-app/references/dashboard-page/DASHBOARD_API.md +573 -0
- package/skills/wix-app/references/dashboard-page/DYNAMIC_PARAMETERS.md +269 -0
- package/skills/wix-app/references/dashboard-page/ECOM_NAVIGATION.md +164 -0
- package/skills/wix-app/references/dashboard-plugin/SLOTS.md +294 -0
- package/skills/wix-app/references/data-collection/WIX_DATA.md +270 -0
- package/skills/wix-app/references/data-collection/extension-template.ts +107 -0
- package/skills/wix-app/references/editor-react-component/ACCESSIBILITY.md +138 -0
- package/skills/wix-app/references/editor-react-component/COMPONENT-API.md +454 -0
- package/skills/wix-app/references/editor-react-component/COMPONENT-CONFIGURATION.md +165 -0
- package/skills/wix-app/references/editor-react-component/CSS-GUIDELINES.md +576 -0
- package/skills/wix-app/references/editor-react-component/DIRECTIONALITY.md +170 -0
- package/skills/wix-app/references/editor-react-component/EDIT-FLOW.md +6 -0
- package/skills/wix-app/references/editor-react-component/PARTS.md +25 -0
- package/skills/wix-app/references/editor-react-component/PROPS-VS-CSS.md +203 -0
- package/skills/wix-app/references/editor-react-component/REACT-GUIDELINES.md +167 -0
- package/skills/wix-app/references/editor-react-component/REACT-PATTERNS.md +137 -0
- package/skills/wix-app/references/service-plugin/ADDITIONAL-FEES.md +112 -0
- package/skills/wix-app/references/service-plugin/BOOKINGS-STAFF-SORTING.md +118 -0
- package/skills/wix-app/references/service-plugin/DISCOUNT-TRIGGERS.md +87 -0
- package/skills/wix-app/references/service-plugin/GIFT-CARDS.md +86 -0
- package/skills/wix-app/references/service-plugin/PAYMENT-SETTINGS.md +135 -0
- package/skills/wix-app/references/service-plugin/SHIPPING-RATES.md +79 -0
- package/skills/wix-app/references/service-plugin/VALIDATIONS.md +68 -0
- package/skills/wix-app/references/site-plugin/EXAMPLES.md +311 -0
- package/skills/wix-app/references/site-plugin/SLOTS.md +263 -0
- package/skills/wix-design-system/SKILL.md +129 -0
- package/skills/wix-design-system/references/file-structure.md +56 -0
- package/skills/wix-design-system/scripts/wds.cjs +531 -0
- package/skills/wix-headless/SKILL.md +418 -0
- package/skills/wix-headless/references/DISCOVERY.md +332 -0
- package/skills/wix-headless/references/ORCHESTRATION.md +269 -0
- package/skills/wix-headless/references/SETUP.md +154 -0
- package/skills/wix-headless/references/blog/BLOG_CONTENT.md +152 -0
- package/skills/wix-headless/references/blog/BLOG_PAGES.md +299 -0
- package/skills/wix-headless/references/blog/BLOG_SETUP.md +218 -0
- package/skills/wix-headless/references/blog/INSTRUCTIONS.md +32 -0
- package/skills/wix-headless/references/cms/CMS_FOUNDATIONS.md +373 -0
- package/skills/wix-headless/references/cms/FAQ_KNOWLEDGE_BASE.md +229 -0
- package/skills/wix-headless/references/cms/INSTRUCTIONS.md +40 -0
- package/skills/wix-headless/references/cms/PORTFOLIO.md +454 -0
- package/skills/wix-headless/references/cms/RESOURCE_LIBRARY.md +356 -0
- package/skills/wix-headless/references/cms/TEAM_DIRECTORY.md +299 -0
- package/skills/wix-headless/references/commands/install-app.md +42 -0
- package/skills/wix-headless/references/commands/known-apps.json +5 -0
- package/skills/wix-headless/references/commands/mcp-bootstrap.md +28 -0
- package/skills/wix-headless/references/designer/INSTRUCTIONS.md +828 -0
- package/skills/wix-headless/references/ecom/CART_PAGES.md +120 -0
- package/skills/wix-headless/references/ecom/CART_WIRING.md +103 -0
- package/skills/wix-headless/references/ecom/COMPONENTS_CSS.md +132 -0
- package/skills/wix-headless/references/ecom/INSTRUCTIONS.md +59 -0
- package/skills/wix-headless/references/forms/CONTACT_FORM.md +477 -0
- package/skills/wix-headless/references/forms/INSTRUCTIONS.md +43 -0
- package/skills/wix-headless/references/gift-cards/COMPONENTS.md +119 -0
- package/skills/wix-headless/references/gift-cards/INSTRUCTIONS.md +51 -0
- package/skills/wix-headless/references/gift-cards/PAGES.md +129 -0
- package/skills/wix-headless/references/images/INSTRUCTIONS.md +359 -0
- package/skills/wix-headless/references/shared/BUILD_NOISE.md +8 -0
- package/skills/wix-headless/references/shared/IMAGE_GENERATION.md +185 -0
- package/skills/wix-headless/references/shared/IMPLEMENTER.md +155 -0
- package/skills/wix-headless/references/shared/MCP_PREFIX.md +105 -0
- package/skills/wix-headless/references/shared/PRODUCTION_SHARP_EDGES.md +97 -0
- package/skills/wix-headless/references/shared/RETURN_CONTRACT.md +423 -0
- package/skills/wix-headless/references/shared/STYLING.md +117 -0
- package/skills/wix-headless/references/stores/BACK_IN_STOCK.md +178 -0
- package/skills/wix-headless/references/stores/CATEGORY_PAGES.md +86 -0
- package/skills/wix-headless/references/stores/COMPONENTS_CSS.md +129 -0
- package/skills/wix-headless/references/stores/HOME_AND_NAV.md +227 -0
- package/skills/wix-headless/references/stores/INSTRUCTIONS.md +96 -0
- package/skills/wix-headless/references/stores/PRODUCT_CATALOG_DATA.md +249 -0
- package/skills/wix-headless/references/stores/PRODUCT_PAGES.md +213 -0
- package/skills/wix-headless/references/stores/SHARED_WIRING.md +164 -0
- package/skills/wix-headless/references/verticals/_schema.json +160 -0
- package/skills/wix-headless/references/verticals/_schema.md +185 -0
- package/skills/wix-headless/references/verticals/blog.md +125 -0
- package/skills/wix-headless/references/verticals/cms.md +121 -0
- package/skills/wix-headless/references/verticals/ecom.md +96 -0
- package/skills/wix-headless/references/verticals/forms.md +106 -0
- package/skills/wix-headless/references/verticals/gift-cards.md +121 -0
- package/skills/wix-headless/references/verticals/stores.md +167 -0
- package/skills/wix-headless/scripts/check-manifest.mjs +198 -0
- package/skills/wix-headless/scripts/copy-utility-templates.mjs +153 -0
- package/skills/wix-headless/scripts/emit-design-tokens.mjs +77 -0
- package/skills/wix-headless/scripts/finalize-run-json.mjs +141 -0
- package/skills/wix-headless/scripts/init-site-json.mjs +63 -0
- package/skills/wix-headless/scripts/patch-decorative-slots.mjs +124 -0
- package/skills/wix-headless/scripts/plan-entity-image-waves.mjs +190 -0
- package/skills/wix-headless/scripts/preview.sh +45 -0
- package/skills/wix-headless/scripts/release.sh +73 -0
- package/skills/wix-headless/scripts/scaffold.sh +53 -0
- package/skills/wix-headless/scripts/seed-utilities.sh +55 -0
- package/skills/wix-headless/shared-utilities/analytics.ts +40 -0
- package/skills/wix-headless/shared-utilities/ricos.ts +179 -0
- package/skills/wix-headless/shared-utilities/wix-image.ts +72 -0
- package/skills/wix-headless/templates/ecom/CartBadge.tsx +84 -0
- package/skills/wix-headless/templates/ecom/CartView.tsx +543 -0
- package/skills/wix-headless/templates/ecom/cart.astro +13 -0
- package/skills/wix-headless/templates/ecom/components-ecom.css +215 -0
- package/skills/wix-headless/templates/ecom/discounts.ts +71 -0
- package/skills/wix-headless/templates/ecom/thank-you.astro +24 -0
- package/skills/wix-headless/templates/gift-cards/GiftCardPurchase.tsx +172 -0
- package/skills/wix-headless/templates/gift-cards/_home-teaser-snippet.astro +42 -0
- package/skills/wix-headless/templates/gift-cards/_nav-snippet.astro +11 -0
- package/skills/wix-headless/templates/gift-cards/components-gift-cards.css +219 -0
- package/skills/wix-headless/templates/gift-cards/gift-cards.astro +51 -0
- package/skills/wix-headless/templates/gift-cards/gift-cards.ts +75 -0
- package/skills/wix-headless/templates/stores/AddToCartButton.tsx +77 -0
- package/skills/wix-headless/templates/stores/BackInStockForm.tsx +176 -0
- package/skills/wix-headless/templates/stores/CategoryRail.astro +69 -0
- package/skills/wix-headless/templates/stores/ProductCard.astro +79 -0
- package/skills/wix-headless/templates/stores/ProductPurchase.tsx +397 -0
- package/skills/wix-headless/templates/stores/SeoTags.astro +21 -0
- package/skills/wix-headless/templates/stores/back-in-stock.ts +67 -0
- package/skills/wix-headless/templates/stores/categories.ts +155 -0
- package/skills/wix-headless/templates/stores/category/[slug].astro +130 -0
- package/skills/wix-headless/templates/stores/components-stores.css +295 -0
- package/skills/wix-headless/templates/stores/products/[slug].astro +128 -0
- package/skills/wix-headless/templates/stores/products/index.astro +101 -0
- package/skills/wix-manage/SKILL.md +280 -0
- package/skills/wix-manage/references/app-installation/install-wix-apps.md +155 -0
- package/skills/wix-manage/references/app-installation/list-installed-apps.md +124 -0
- package/skills/wix-manage/references/blog/how-to-create-blog-posts.md +226 -0
- package/skills/wix-manage/references/bookings/booking-service-policy-setup.md +95 -0
- package/skills/wix-manage/references/bookings/booking-system-integration-gaps.md +416 -0
- package/skills/wix-manage/references/bookings/bookings-staff-setup.md +255 -0
- package/skills/wix-manage/references/bookings/create-and-update-booking-services.md +462 -0
- package/skills/wix-manage/references/bookings/end-to-end-booking-flow.md +278 -0
- package/skills/wix-manage/references/bookings/external-calendar-integration.md +258 -0
- package/skills/wix-manage/references/bookings/multi-resource-service-creation.md +231 -0
- package/skills/wix-manage/references/calendar/configure-default-business-hours.md +226 -0
- package/skills/wix-manage/references/cms/cms-data-items-crud.md +422 -0
- package/skills/wix-manage/references/cms/cms-data-operations-extended.md +263 -0
- package/skills/wix-manage/references/cms/cms-ecommerce-catalog-integration.md +136 -0
- package/skills/wix-manage/references/cms/cms-references-and-relationships.md +160 -0
- package/skills/wix-manage/references/cms/cms-schema-management.md +143 -0
- package/skills/wix-manage/references/contacts/bulk-delete-contacts.md +73 -0
- package/skills/wix-manage/references/contacts/bulk-label-and-unlabel-contacts.md +67 -0
- package/skills/wix-manage/references/domains/domain-search-and-purchase.md +434 -0
- package/skills/wix-manage/references/ecommerce/api-recommendation-tracking.md +420 -0
- package/skills/wix-manage/references/ecommerce/flow-add-free-shipping.md +267 -0
- package/skills/wix-manage/references/ecommerce/flow-bundle-and-save.md +290 -0
- package/skills/wix-manage/references/ecommerce/flow-fix-coverage-gaps.md +300 -0
- package/skills/wix-manage/references/ecommerce/flow-optimize-shipping-rates.md +364 -0
- package/skills/wix-manage/references/ecommerce/flow-seasonal-promotion.md +315 -0
- package/skills/wix-manage/references/ecommerce/flow-stock-mover.md +308 -0
- package/skills/wix-manage/references/ecommerce/flow-upsell-boost.md +271 -0
- package/skills/wix-manage/references/ecommerce/goal-clear-inventory.md +118 -0
- package/skills/wix-manage/references/ecommerce/goal-drive-cross-sells.md +122 -0
- package/skills/wix-manage/references/ecommerce/goal-increase-aov.md +132 -0
- package/skills/wix-manage/references/ecommerce/goal-reduce-cart-abandonment.md +148 -0
- package/skills/wix-manage/references/ecommerce/goal-seasonal-revenue.md +146 -0
- package/skills/wix-manage/references/ecommerce/guardrail-discount-conflicts.md +118 -0
- package/skills/wix-manage/references/ecommerce/guardrail-margin-protection.md +88 -0
- package/skills/wix-manage/references/ecommerce/guardrail-rate-pricing-sanity.md +108 -0
- package/skills/wix-manage/references/ecommerce/guardrail-shipping-health.md +124 -0
- package/skills/wix-manage/references/ecommerce/recipe-apply-shipping-recommendations.md +299 -0
- package/skills/wix-manage/references/ecommerce/recommend-ecommerce-strategy.md +582 -0
- package/skills/wix-manage/references/ecommerce/setup-coupons.md +338 -0
- package/skills/wix-manage/references/ecommerce/setup-discount-rules.md +444 -0
- package/skills/wix-manage/references/ecommerce/setup-shipping-rates.md +86 -0
- package/skills/wix-manage/references/ecommerce/setup-shipping-regions.md +56 -0
- package/skills/wix-manage/references/ecommerce/setup-store-pickup-location.md +209 -0
- package/skills/wix-manage/references/ecommerce/skill-graph.md +139 -0
- package/skills/wix-manage/references/ecommerce/troubleshoot-checkout-delivery-dropoff.md +124 -0
- package/skills/wix-manage/references/ecommerce/troubleshoot-discount-not-applying.md +95 -0
- package/skills/wix-manage/references/events/list-events.md +203 -0
- package/skills/wix-manage/references/forms/create-form.md +260 -0
- package/skills/wix-manage/references/get-paid/create-payment-links.md +212 -0
- package/skills/wix-manage/references/get-paid/how-to-setup-wix-payments.md +57 -0
- package/skills/wix-manage/references/get-paid/payment-links-for-bookings.md +101 -0
- package/skills/wix-manage/references/media/upload-media-to-wix.md +216 -0
- package/skills/wix-manage/references/pricing-plans/create-and-update-pricing-plans.md +77 -0
- package/skills/wix-manage/references/pricing-plans/pricing-plans-bookings-integration.md +166 -0
- package/skills/wix-manage/references/restaurants/wix-restaurants-setup.md +336 -0
- package/skills/wix-manage/references/rich-content/ricos-converter-service.md +295 -0
- package/skills/wix-manage/references/site-properties/change-payment-currency-site-properties.md +59 -0
- package/skills/wix-manage/references/sites/create-site-from-template.md +183 -0
- package/skills/wix-manage/references/sites/query-sites.md +125 -0
- package/skills/wix-manage/references/stores/add-store-pages-to-site.md +57 -0
- package/skills/wix-manage/references/stores/bulk-create-products-with-options.md +1041 -0
- package/skills/wix-manage/references/stores/create-product-catalog-v1.md +125 -0
- package/skills/wix-manage/references/stores/create-product-from-image.md +824 -0
- package/skills/wix-manage/references/stores/create-product-with-options-catalog-v3.md +566 -0
- package/skills/wix-manage/references/stores/find-products-query-and-search-catalog-v3.md +194 -0
- package/skills/wix-manage/references/stores/query-products-catalog-v1.md +80 -0
- package/skills/wix-manage/references/stores/setup-online-store-catalog-v3.md +99 -0
- package/skills/wix-manage/references/stores/update-product-pre-order.md +213 -0
- package/skills/wix-manage/references/stores/update-product-with-options.md +318 -0
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
# Discovery
|
|
2
|
+
|
|
3
|
+
Infer as much as possible from the user's opening message; ask only what's genuinely unknown. Target: **~1:30 of discovery** including user think-time.
|
|
4
|
+
|
|
5
|
+
## Step 0 — Infer Vertical(s) and Business Context
|
|
6
|
+
|
|
7
|
+
The user's opening message typically names what they want: *"build me a skincare store"*, *"I want to sell handmade jewelry"*, *"create a coffee shop website"*.
|
|
8
|
+
|
|
9
|
+
From the opening message, extract:
|
|
10
|
+
- **Vertical(s)** — which packs to load. See the routing table in `SKILL.md` § "When This Skill Triggers".
|
|
11
|
+
- **Business / product context** — feeds into brand-name suggestions, vibe options, product templates, image prompts.
|
|
12
|
+
|
|
13
|
+
If the opening message is too vague to infer a vertical (e.g., *"build me a site"*, *"I want to go online"*), ask **one conversational clarifier** (NOT an `AskUserQuestion`): *"What do you want your site to do — sell things, publish content, take bookings?"* One sentence. Only ask if you genuinely cannot infer.
|
|
14
|
+
|
|
15
|
+
**Do not ask the user what features they want.** Features are determined by the inferred vertical(s). The user reviews and adjusts the plan at Step 3.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Step 1 — Brand Name
|
|
20
|
+
|
|
21
|
+
Use `AskUserQuestion` with a single-select question.
|
|
22
|
+
|
|
23
|
+
Generate **3–4 brand name suggestions** relevant to the business context, plus a "Type my own" option:
|
|
24
|
+
|
|
25
|
+
> *"What should we call your brand?"*
|
|
26
|
+
|
|
27
|
+
Options: [3–4 generated names], Type my own.
|
|
28
|
+
|
|
29
|
+
Guidelines for generated names:
|
|
30
|
+
- Short (1–3 words), memorable, relevant to the business context
|
|
31
|
+
- Mix styles: one punchy/modern, one descriptive, one abstract/evocative
|
|
32
|
+
- Avoid generic filler (*"Pro Store"*, *"Best Shop"*)
|
|
33
|
+
|
|
34
|
+
If the user picks *"Type my own"*, follow up conversationally: *"Sure — what should I call it?"*
|
|
35
|
+
|
|
36
|
+
If the user already named the brand in the opening message, skip this step.
|
|
37
|
+
|
|
38
|
+
### Background actions on Q1 answer
|
|
39
|
+
|
|
40
|
+
Immediately after the brand name is confirmed (before Q2), emit **one concurrent batch** containing both the scaffold dispatch AND prefetch reads of the shared contract docs. These reads cost nothing during Q2 + plan review wait time but save ~1 min of post-approval latency that prior runs spent reading these docs serially.
|
|
41
|
+
|
|
42
|
+
1. **Scaffold dispatch.** Derive the project slug from the brand, validate it, then run `bash <SKILL_ROOT>/scripts/scaffold.sh <slug> "<Brand>"` as a background shell. The script handles the npm-create invocation + slug pre-flight (regex `^[a-z0-9]{3,20}$`); the orchestrator handles slug derivation from the human-readable brand.
|
|
43
|
+
|
|
44
|
+
**Slug derivation (apply to brand before invoking the script):**
|
|
45
|
+
1. Lowercase
|
|
46
|
+
2. Strip every char that isn't `[a-z0-9]` (drop hyphens, spaces, punctuation, accents — the Wix CLI rejects them)
|
|
47
|
+
3. Truncate to 20 chars
|
|
48
|
+
4. If the result is shorter than 3 chars, ask the user explicitly for a slug (`AskUserQuestion`)
|
|
49
|
+
|
|
50
|
+
Examples: `"Acme-Co" → "acmeco"`; `"Sole Society" → "solesociety"`; `"E&E Co." → "eeco"`; `"AB" → ask the user`.
|
|
51
|
+
|
|
52
|
+
The Wix CLI requires `[a-z0-9]{3,20}` — hyphens, underscores, uppercase, and other punctuation are rejected.
|
|
53
|
+
|
|
54
|
+
**Pre-flight validation (orchestrator-side, before invoking the script).** Both must pass; if either fails, regenerate the slug or re-prompt the user — do NOT rely solely on the script's pre-flight (it'll exit non-zero, but that costs a round-trip):
|
|
55
|
+
- `slug` matches `^[a-z0-9]{3,20}$`
|
|
56
|
+
- `brand` is non-empty after trimming whitespace
|
|
57
|
+
|
|
58
|
+
**The scaffold call (background shell, with timing capture):**
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
STARTED_AT=$(date -u +%Y-%m-%dT%H:%M:%SZ)
|
|
62
|
+
bash "<SKILL_ROOT>/scripts/scaffold.sh" "<slug>" "<brand>"
|
|
63
|
+
ENDED_AT=$(date -u +%Y-%m-%dT%H:%M:%SZ)
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
- Substitute `<brand>` with the user's confirmed brand (preserve original case; quotes are passed by the shell). Substitute `<slug>` with the validated slug.
|
|
67
|
+
- The script pins `--site-template-id` to the pure-headless blank template (`212b41cb-0da6-4401-9c72-7c579e6477a2`). Vibe-compatible templates trigger an interactive prompt that blocks non-TTY runs — the template ID is intentionally hardcoded inside the script.
|
|
68
|
+
- Append timing to `.wix/run.json.phases[]` as `{ phase: "scaffold", seconds: <duration>, started: $STARTED_AT, ended: $ENDED_AT }`.
|
|
69
|
+
|
|
70
|
+
**Strict-then-recover:**
|
|
71
|
+
1. Script exit 2 (slug or brand validation failed) → orchestrator-side bug; the orchestrator should have caught this in pre-flight. Fix the slug derivation and retry.
|
|
72
|
+
2. Auth error from npm/Wix CLI → surface `"Run \`npx @wix/cli login\` and retry."` and stop.
|
|
73
|
+
3. `invalid template` error → the template ID inside `scaffold.sh` is stale. Look up the current ID via `<prefix>SearchWixCLIDocumentation` query `create headless template`, edit the script's `TEMPLATE_ID` constant, retry once, log to `.wix/run.json.commandDrift[]` so the script can be tightened.
|
|
74
|
+
4. Other errors → surface stderr to the user.
|
|
75
|
+
|
|
76
|
+
Launch with background.
|
|
77
|
+
|
|
78
|
+
2. **Prefetch shared contracts** — siblings in the same concurrent batch (resolve `<SKILL_ROOT>` per SKILL.md § "Path resolution"):
|
|
79
|
+
- `Read <SKILL_ROOT>/references/shared/RETURN_CONTRACT.md`
|
|
80
|
+
- `Read <SKILL_ROOT>/references/shared/IMAGE_GENERATION.md`
|
|
81
|
+
- `Read <SKILL_ROOT>/references/shared/MCP_PREFIX.md`
|
|
82
|
+
|
|
83
|
+
3. **Prefetch loaded pack files** — siblings in the same message:
|
|
84
|
+
- `Read <SKILL_ROOT>/references/verticals/<pack>.md` for each loaded pack
|
|
85
|
+
|
|
86
|
+
Then continue to Q2. The scaffold runs during Q2 + plan review (~30–60s, usually finishes before approval); the reads resolve near-instantly and pre-load the docs the orchestrator needs at Step 3 and Step 7, eliminating mid-flow read churn.
|
|
87
|
+
|
|
88
|
+
**Do NOT also prefetch these docs after plan approval.** Reading them between plan approval and Step 3 adds ~1 min of user-visible wait with zero overlap to useful work.
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Step 2 — Vibe
|
|
93
|
+
|
|
94
|
+
Use `AskUserQuestion` with a single-select question. Generate **4 brand personality options** tailored to the inferred business context, plus "Something else":
|
|
95
|
+
|
|
96
|
+
> *"What's the vibe for [brand name]?"*
|
|
97
|
+
|
|
98
|
+
Example options for a jewelry store:
|
|
99
|
+
- **Bold & premium** — luxury feel, dark tones, sharp typography
|
|
100
|
+
- **Clean & modern** — minimal, lots of whitespace, crisp lines
|
|
101
|
+
- **Warm & approachable** — friendly, inviting, earthy tones
|
|
102
|
+
- **Something else** — let me describe it
|
|
103
|
+
|
|
104
|
+
If the user picks "Something else", follow up with `AskUserQuestion` using a text input.
|
|
105
|
+
|
|
106
|
+
### Craft the aesthetic direction (in session scratch)
|
|
107
|
+
|
|
108
|
+
Based on vertical + brand personality + audience, craft a **2–3 sentence aesthetic direction** like a designer would. Decide — don't ask more questions.
|
|
109
|
+
|
|
110
|
+
Example:
|
|
111
|
+
> *"For Bloom & Root, I'm going with an organic editorial aesthetic — think Kinfolk magazine meets a botanical garden. Warm cream backgrounds, deep forest green accents, Playfair Display for headings paired with Source Sans 3 for body text. Subtle leaf-pattern overlays and generous whitespace to let the products breathe."*
|
|
112
|
+
|
|
113
|
+
> **Do NOT print this aesthetic direction as a standalone message.** Hold it in session scratch and weave it into the plan (Step 3) as the opening **Design Direction** section. Printing it above the plan detaches the most emotionally important content from the rest. Keep Q2 → plan presentation tight.
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Step 3 — Present the Plan
|
|
118
|
+
|
|
119
|
+
Present the plan as formatted markdown. After presenting, use `AskUserQuestion` for approval.
|
|
120
|
+
|
|
121
|
+
> **Do NOT show implementation details.** Users do not want to read about scaffolding, `npm install`, `env pull`, MCP calls, phase agents, designer handoffs, sidecars, or build/preview steps. They care about their site. The TaskList conveys progress; the plan conveys outcome. Never open with SDK packages or CMS collection fields.
|
|
122
|
+
|
|
123
|
+
The plan is composed from the loaded vertical packs. Each pack contributes: apps, packages, pages, CMS collections, features blurbs. The skill assembles; the packs supply.
|
|
124
|
+
|
|
125
|
+
### Plan structure (in order)
|
|
126
|
+
|
|
127
|
+
The plan has TWO halves: a short **decision card** (Sections A + B — what the user actually weighs in on) and a longer **technical scope** block (Sections C + D + E — what comes "for free" from the loaded packs). The user reads A and B carefully; C–E are reference material they skim or skip.
|
|
128
|
+
|
|
129
|
+
> **Sections C, D, E are markdown tables.** Each section below leads with the exact header skeleton — copy it verbatim. Do NOT type column headers from memory: that's the root cause of every plan-format regression.
|
|
130
|
+
|
|
131
|
+
**Section A: Design Direction** — Lead with this. Open with the aesthetic paragraph crafted in Step 2, then a compact detail block:
|
|
132
|
+
- Aesthetic tone (e.g., "organic editorial")
|
|
133
|
+
- Color palette (2–3 dominant colors with hex codes)
|
|
134
|
+
- Typography pairing (display + body)
|
|
135
|
+
- Mood and key visual elements
|
|
136
|
+
- Page color strategy: Uniform Light / Uniform Dark / Defined Hybrid
|
|
137
|
+
|
|
138
|
+
**Section B: Features** — 1–2 line descriptions of user-facing functionality from each pack. Bullet list is correct here. Explain what the user's visitors will be able to do. Tag CMS-powered features with **(CMS-based)** so the user knows which content they can edit from the dashboard.
|
|
139
|
+
|
|
140
|
+
**Skip features from packs with `disabled: true`** (today: only `gift-cards`). Its surfaces are inactive by default — they light up only when the user enables the matching Wix app from the dashboard. The plan must not promise a feature that isn't active out of the box. The code still ships (the `/gift-cards` page file is created plus the nav/home contributions) so activation is instant once the user opts in — but the plan stays silent until then. Packs without `disabled: true` (including transitive ones like ecom) contribute their features normally.
|
|
141
|
+
|
|
142
|
+
→ **Verify B:** No bullet derives from a `disabled: true` pack. Today: no "Gift cards" bullet, no "(when enabled)" / "(auto)" markers anywhere in B.
|
|
143
|
+
|
|
144
|
+
> **Visual separator before the technical scope.** After Section B, emit a `---` rule and a single line: *"Technical scope below — auto-decided from the features above. Skim if you want; not required reading."* This signals to the user that the decision is essentially made and the rest is reference material. Without the cue, users feel obligated to read every table cell before approving and stall the build for tens of minutes.
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
**Section C: Pages.** Emit exactly this header, then one row per loaded pack's `routes:` entry:
|
|
149
|
+
|
|
150
|
+
```
|
|
151
|
+
| Page | Route | Source |
|
|
152
|
+
|------|-------|--------|
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
> **STOP if you typed anything else.** `| Route | Purpose |` (drops Source), `| Page | Route |` (no Source), bullet list `- **Cart** (/cart)`, or Source merged into Route (`/cart (Stores)`) — each is a known regression. **Three columns, exact names, in that order.** Re-read the skeleton above before typing rows; do not type column headers from memory.
|
|
156
|
+
|
|
157
|
+
**Compose rows from each loaded pack's `routes:` array.** Do not hardcode rows; do not omit declared rows; do not invent rows. For every loaded pack (top-level OR transitive via `requires:`), iterate its `routes:` array.
|
|
158
|
+
|
|
159
|
+
**Skip rule.** Skip every route from any pack with `disabled: true`. Today that's only `gift-cards` — its `/gift-cards` row does NOT appear in the plan. The page file still ships so the runtime probe lights up the surface the moment the user enables the Wix Gift Card app from the dashboard, but the plan must not promise a surface the user did not ask for. Surfacing it with a `Source: "Wix Stores (auto)"` marker has been tried and rejected — users push back ("Giftcard shouldn't appear unless the user asked for it").
|
|
160
|
+
|
|
161
|
+
Each surviving entry → one table row:
|
|
162
|
+
|
|
163
|
+
```
|
|
164
|
+
Page name (Page cell):
|
|
165
|
+
- Use the entry's `name:` field if present (override).
|
|
166
|
+
- Else derive from the route path:
|
|
167
|
+
"/" → "Home"
|
|
168
|
+
"/<seg>/[slug]" → title-case(seg, singular) + " Detail"
|
|
169
|
+
otherwise → title-case the last static segment, replacing
|
|
170
|
+
"-" with space ("/thank-you" → "Thank You")
|
|
171
|
+
|
|
172
|
+
Route cell:
|
|
173
|
+
- The entry's `route:` value verbatim (e.g. "/cart" — or the literal
|
|
174
|
+
string "Hosted by Wix" for Wix-hosted endpoints with no path).
|
|
175
|
+
|
|
176
|
+
Source cell:
|
|
177
|
+
- For top-level packs with non-empty `apps:`, use apps[0].name
|
|
178
|
+
(e.g. "Wix Stores", "Wix Blog").
|
|
179
|
+
- For transitive packs (loaded via another pack's `requires:`),
|
|
180
|
+
walk up the requires chain to the top-level puller and use ITS
|
|
181
|
+
apps[0].name. So ecom's "/cart" shows Source: "Wix Stores"
|
|
182
|
+
(because stores requires ecom and the user opted into "selling
|
|
183
|
+
things", not into "an ecommerce SDK").
|
|
184
|
+
- For the `cms` pack, use the literal "CMS (builtin)".
|
|
185
|
+
- No suffixes (no "(auto)", no "(passive)", etc.) — disabled packs
|
|
186
|
+
don't contribute rows at all.
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
**Order rows by user-facing flow:** CMS pages first (Home, About, FAQ), then catalog/content pages, then transactional pages (cart, thank-you, checkout). Within a pack, preserve declaration order from the pack's `routes:` array.
|
|
190
|
+
|
|
191
|
+
→ **Verify C:** Header is exactly `| Page | Route | Source |`. Row count = sum of `routes:` entries across all loaded packs that are NOT `disabled: true`. Every Route is either a `/`-prefixed path matching the slugified Page name OR the literal `Hosted by Wix`. No "(auto)"/"(passive)" suffixes anywhere. No "Gift Cards" row when gift-cards loads transitively.
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
**Section D: CMS Collections.** Emit exactly this header, then one row per `cmsCollections:` entry from each loaded pack:
|
|
196
|
+
|
|
197
|
+
```
|
|
198
|
+
| Collection | Key Fields |
|
|
199
|
+
|------------|------------|
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
> **STOP if you typed `Fields` instead of `Key Fields`.** Re-read the skeleton above.
|
|
203
|
+
|
|
204
|
+
Iterate `cmsCollections:` from each loaded pack and emit one row per collection (collections from the `cms` pack always appear; other packs may declare their own).
|
|
205
|
+
|
|
206
|
+
→ **Verify D:** Header is exactly `| Collection | Key Fields |`.
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
**Section E: Apps & SDK Packages.** Last. Reference table for developer-minded users. Emit exactly this header, then **one row per loaded pack** (NOT one row per package):
|
|
211
|
+
|
|
212
|
+
```
|
|
213
|
+
| App | SDK Packages |
|
|
214
|
+
|-----|--------------|
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
> **STOP if you wrote one row per package.** `| Item | Type |` with `@wix/stores | SDK`, `@wix/ecom | SDK`, … is the wrong shape. Two columns, comma-joined packages in cell two, **one row per App**, not per SDK. Re-read the skeleton above.
|
|
218
|
+
|
|
219
|
+
**Compose Section E from loaded pack frontmatter:**
|
|
220
|
+
|
|
221
|
+
```
|
|
222
|
+
A pack contributes a Section E row iff:
|
|
223
|
+
- Its `apps:` array is non-empty (top-level user-facing app), OR
|
|
224
|
+
- Its `include: true` (the cms pack — built-in, no app to install).
|
|
225
|
+
|
|
226
|
+
The "App" cell:
|
|
227
|
+
- For packs with non-empty `apps:`: apps[0].name (e.g. "Wix Stores").
|
|
228
|
+
- For the cms pack: the literal "CMS (builtin)".
|
|
229
|
+
|
|
230
|
+
The "SDK Packages" cell:
|
|
231
|
+
- This pack's `packages:` ∪ packages from every pack in its transitive
|
|
232
|
+
`requires:` chain — deduped, in declared order.
|
|
233
|
+
- So when stores is loaded (and pulls in ecom + gift-cards via requires),
|
|
234
|
+
the "Wix Stores" row's SDK Packages cell is the union of stores +
|
|
235
|
+
ecom + gift-cards packages — typically: @wix/stores, @wix/ecom,
|
|
236
|
+
@wix/redirects, @wix/site, @wix/essentials.
|
|
237
|
+
|
|
238
|
+
Packs with `apps: []` AND `include: false` (ecom, gift-cards) do
|
|
239
|
+
NOT get their own row. Their packages roll up under whichever loaded
|
|
240
|
+
top-level pack pulled them in. There is no "@wix/gift-cards" SDK on
|
|
241
|
+
npm; the gift-cards pack is runtime-detected via REST and contributes
|
|
242
|
+
zero npm packages of its own.
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
→ **Verify E:** Header is exactly `| App | SDK Packages |`. One row per loaded pack with non-empty `apps:` OR `include: true`. SDK Packages cell is comma-joined within a single cell, NOT split across rows. No "Wix Gift Cards" row when gift-cards loads transitively (no `@wix/gift-cards` SDK exists).
|
|
246
|
+
|
|
247
|
+
### Example (skincare ecommerce brand)
|
|
248
|
+
|
|
249
|
+
```markdown
|
|
250
|
+
Here's my plan for **Bloom & Root**:
|
|
251
|
+
|
|
252
|
+
## Design Direction
|
|
253
|
+
|
|
254
|
+
For Bloom & Root, I'm going with **clean luxury with organic warmth** —
|
|
255
|
+
think a curated boutique where every product feels considered. Warm cream
|
|
256
|
+
backgrounds paired with deep charcoal text and rose gold accents. Cormorant
|
|
257
|
+
Garamond headlines bring editorial gravity; DM Sans keeps the body text
|
|
258
|
+
tactile and approachable.
|
|
259
|
+
|
|
260
|
+
- **Colors:** Warm cream (#FFF8F0), deep charcoal (#1A1A1A), rose gold (#B76E79)
|
|
261
|
+
- **Fonts:** Cormorant Garamond (headings) + DM Sans (body)
|
|
262
|
+
- **Mood:** Premium, approachable, tactile
|
|
263
|
+
- **Color strategy:** Uniform Light
|
|
264
|
+
|
|
265
|
+
## Features
|
|
266
|
+
|
|
267
|
+
- **Product catalog** — Browse all products with images, prices, and variants.
|
|
268
|
+
- **Cart & checkout** — Add to cart, review, check out via Wix's hosted checkout.
|
|
269
|
+
- **About (CMS-based)** — Brand story, editable from the Wix dashboard.
|
|
270
|
+
- **FAQ (CMS-based)** — Q&A about products, editable from the dashboard.
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
|
|
274
|
+
*Technical scope below — auto-decided from the features above. Skim if you want; not required reading.*
|
|
275
|
+
|
|
276
|
+
## Pages (8)
|
|
277
|
+
|
|
278
|
+
| Page | Route | Source |
|
|
279
|
+
|----------------|-------------------|---------------|
|
|
280
|
+
| Home | / | CMS (builtin) |
|
|
281
|
+
| About | /about | CMS (builtin) |
|
|
282
|
+
| FAQ | /faq | CMS (builtin) |
|
|
283
|
+
| Products | /products | Wix Stores |
|
|
284
|
+
| Product Detail | /products/[slug] | Wix Stores |
|
|
285
|
+
| Cart | /cart | Wix Stores |
|
|
286
|
+
| Thank You | /thank-you | Wix Stores |
|
|
287
|
+
| Checkout | Hosted by Wix | Wix Stores |
|
|
288
|
+
|
|
289
|
+
## CMS Collections
|
|
290
|
+
|
|
291
|
+
| Collection | Key Fields |
|
|
292
|
+
|----------------|-----------------------------|
|
|
293
|
+
| About Content | heading, body, image |
|
|
294
|
+
| FAQ | question, answer, sortOrder |
|
|
295
|
+
|
|
296
|
+
## Apps & SDK Packages
|
|
297
|
+
|
|
298
|
+
| App | SDK Packages |
|
|
299
|
+
|---------------|--------------------------------------------------------------------|
|
|
300
|
+
| Wix Stores | @wix/stores, @wix/ecom, @wix/redirects, @wix/site, @wix/essentials |
|
|
301
|
+
| CMS (builtin) | @wix/data, @wix/essentials |
|
|
302
|
+
|
|
303
|
+
Should I proceed?
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
The Cart, Thank You, and Checkout rows show `Source: Wix Stores` — not "Wix eCommerce" — because ecom is loaded transitively via stores's `requires:` and the orchestrator walks up the chain. The user opted into "selling things", not into "an ecommerce SDK".
|
|
307
|
+
|
|
308
|
+
### Final scan (MANDATORY)
|
|
309
|
+
|
|
310
|
+
Before sending the plan, confirm each inline → Verify above (B, C, D, E) passed. If any failed, regenerate that section and re-scan before emitting. Plans that violate multiple inline checks at once cost a full plan replay (~25 min of user time) when caught post-hoc. The inline → Verify lines exist to catch them before sending.
|
|
311
|
+
|
|
312
|
+
### Approval
|
|
313
|
+
|
|
314
|
+
Use `AskUserQuestion`: *"Ready to build?"* Options: **Yes, build it** / **Adjust something**.
|
|
315
|
+
|
|
316
|
+
If the user wants to adjust, handle it conversationally (swap brand, change vibe, add/remove a page). Re-present the plan and re-ask for approval.
|
|
317
|
+
|
|
318
|
+
---
|
|
319
|
+
|
|
320
|
+
## After Approval
|
|
321
|
+
|
|
322
|
+
Save the project context to memory (type: `project`) so future sessions can resume:
|
|
323
|
+
- Brand name, vertical(s) inferred
|
|
324
|
+
- Apps, packages, pages from the loaded packs
|
|
325
|
+
- Project name + absolute project directory
|
|
326
|
+
- Current phase: `scaffolding`
|
|
327
|
+
|
|
328
|
+
> **Do NOT narrate the internal sub-steps.** After approval, proceed silently through setup, launch phases, etc. The user tracks progress via TaskList — that's enough. No *"Now I'll install Wix Stores via MCP"*, no *"Launching Phase 1 agents"*, no MCP / sidecar / agent-name / `.wix/` leakage.
|
|
329
|
+
|
|
330
|
+
Brief transition messages are fine when major milestones complete (e.g., *"Products seeded, designing pages now"* or the final preview URL), but never surface tool-layer mechanics.
|
|
331
|
+
|
|
332
|
+
Proceed to **Setup** (see `SETUP.md`).
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
# Orchestration — Concurrency Model
|
|
2
|
+
|
|
3
|
+
This file describes **what runs in parallel and what blocks**. It does not prescribe a specific tool API — map each step to whatever subagent / parallel-execution primitive your runtime offers.
|
|
4
|
+
|
|
5
|
+
## Concurrency vocabulary
|
|
6
|
+
|
|
7
|
+
The terms below appear throughout this skill. They describe the *shape* of work; the runtime decides how to implement them:
|
|
8
|
+
|
|
9
|
+
- **Subagent** — an isolated worker with its own context. The orchestrator sends it a prompt (an `Instruction file` path + inputs); the subagent reads the instruction file, performs the scope, and returns a structured result.
|
|
10
|
+
- **Concurrent batch** — N subagents (or N tool calls) launched together so they execute in parallel rather than serially. Whether this is concurrent sibling calls, async tasks, threads, or a parallel-fan-out primitive doesn't matter — only that they overlap in execution.
|
|
11
|
+
- **Background subagent** — a subagent the orchestrator does not block on; it runs while the orchestrator continues with downstream work and reports its result asynchronously.
|
|
12
|
+
- **Foreground subagent** — a subagent the orchestrator blocks on before continuing.
|
|
13
|
+
- **Wait (gate)** — the orchestrator pauses until specified background subagents finish.
|
|
14
|
+
- **Result** — the structured JSON block each subagent returns at the end of its run, per `references/shared/RETURN_CONTRACT.md`.
|
|
15
|
+
|
|
16
|
+
## Phase axis
|
|
17
|
+
|
|
18
|
+
| Phase | What | Dispatched at |
|
|
19
|
+
|---|---|---|
|
|
20
|
+
| **Phase 1 — Seed** | Per-vertical MCP data → `.wix/site.json.seeded.<vertical>` | Step 3 (concurrent with Phase 2 + Image Phase 1) |
|
|
21
|
+
| **Phase 2 — Design System** | Designer writes tokens + Layout + Nav + Footer | Step 3 (foreground) |
|
|
22
|
+
| **Phase 3 — Components** | Per-vertical React islands, with styling contract inlined into each prompt | Step 4.5 (after Phase 2 completes) |
|
|
23
|
+
| **Phase 4 — Pages** | Per-vertical routes; each page agent writes its routes once with both visual design and live data queries | Step 7 (concurrent with Image Phase 2) |
|
|
24
|
+
| **Image Phase 1 — Decorative** | Hero/about/page-header decoratives | Step 3 (concurrent with Phases 1 + 2) |
|
|
25
|
+
| **Image Phase 2 — Entity** | Product / blog post / CMS item images | Step 4.5 (concurrent with Phase 3 Components) — depends only on Phase 1 Seed entity IDs + brand context |
|
|
26
|
+
|
|
27
|
+
## Why batching matters
|
|
28
|
+
|
|
29
|
+
Historical runs lost 1–2 minutes per phase to serialized dispatch — N subagents emitted one-per-turn instead of in a single concurrent batch. Even when each subagent ran fast, the inter-dispatch gaps (12–39s in measured runs) accumulated to >25% overhead per phase.
|
|
30
|
+
|
|
31
|
+
Two mitigations exist; use both:
|
|
32
|
+
|
|
33
|
+
1. **State the batch as a single concurrent step.** The skill's dispatch sections below say "launch N subagents concurrently" — that is one orchestration step, not N. Implement it as a single batch.
|
|
34
|
+
2. **Use background-on-dispatch for subagents that don't block downstream work.** Even if the runtime serializes the launch turns, background dispatch lets subagents overlap in execution. Measured compression on a sequential-launch / background-execute model: ~2× wall-time vs. serial.
|
|
35
|
+
|
|
36
|
+
If your runtime forces serialization across the orchestrator's turns, make every subagent that can run in the background a background subagent. Only the Phase 2 Design System is foreground (because Step 4.5 needs `.wix/design-tokens.css` on disk before continuing).
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Step 3 Dispatch — Phase 1 (Seed) + Phase 2 (Design System) + Image Phase 1 (Decorative)
|
|
41
|
+
|
|
42
|
+
Runs immediately after Step 2 (Setup) completes.
|
|
43
|
+
|
|
44
|
+
### Concurrent batch
|
|
45
|
+
|
|
46
|
+
For each loaded vertical pack (stores, cms, blog, …):
|
|
47
|
+
- Phase 1 Seeder — **background**
|
|
48
|
+
|
|
49
|
+
Always:
|
|
50
|
+
- Image Phase 1 Decorative subagent — **background**. Generates decoratives from brand context only; no Phase 1 Seed dependency. Internally it issues ONE batched generation call for all slots — no per-image sequential calls.
|
|
51
|
+
- Phase 2 Design System subagent — **foreground** (orchestrator waits for this before Step 4 / Step 4.5 / Step 7). Writes `global.css`, `Layout.astro`, `Navigation.astro`, `Footer.astro`, `astro.config.mjs`, `index.astro` shell, and returns `designTokens` JSON. The orchestrator emits `.wix/design-tokens.css` + `.wix/site.d.ts` deterministically from the merged JSON via `<SKILL_ROOT>/scripts/emit-design-tokens.mjs` in Step 4 (the agent does not write either file).
|
|
52
|
+
|
|
53
|
+
**Phase 3 Components is not dispatched here.** It runs in Step 4.5 with the design tokens inlined into each prompt — see § "Styling contract coordination" below.
|
|
54
|
+
|
|
55
|
+
**Image Phase 2 (entity images) is not dispatched here.** It runs in Step 4.5 (alongside Phase 3 Components, gated on Phase 1 Seed having returned) with Phase 1 Seed entity IDs inlined — see § "Wait: Phase 2 → Step 4.5" below.
|
|
56
|
+
|
|
57
|
+
### Example (ecommerce run — stores + cms packs loaded)
|
|
58
|
+
|
|
59
|
+
Four subagents launched concurrently, each pointed at a vertical instruction file:
|
|
60
|
+
|
|
61
|
+
1. Phase 1 stores seeder (bg) — instruction file: `<SKILL_ROOT>/references/stores/INSTRUCTIONS.md`, scope: `seed-seed`
|
|
62
|
+
2. Phase 1 CMS seeder (bg) — instruction file: `<SKILL_ROOT>/references/cms/INSTRUCTIONS.md`, scope: `seed-seed`
|
|
63
|
+
3. Image Phase 1 Decorative (bg) — instruction file: `<SKILL_ROOT>/references/images/INSTRUCTIONS.md`, scope: `image-phase-1-decorative`
|
|
64
|
+
4. Phase 2 Design System (fg) — instruction file: `<SKILL_ROOT>/references/designer/INSTRUCTIONS.md`, scope: `design-system`
|
|
65
|
+
|
|
66
|
+
### Subagent prompt template
|
|
67
|
+
|
|
68
|
+
Every dispatch sends a self-contained prompt with these fields:
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
Instruction file (absolute path): <SKILL_ROOT>/references/<vertical>/INSTRUCTIONS.md
|
|
72
|
+
Read this file in full before doing anything else. It defines your role,
|
|
73
|
+
scope routing, and return contract.
|
|
74
|
+
Phase instruction: <exact phase/scope string from the pack>
|
|
75
|
+
Scope: <scope string>
|
|
76
|
+
Project directory (absolute path): <project path>
|
|
77
|
+
siteId: <from wix.config.json>
|
|
78
|
+
MCP tool prefix: <prefix>
|
|
79
|
+
Use this prefix for every Wix MCP call. Example: <prefix>CallWixSiteAPI, <prefix>WixREADME.
|
|
80
|
+
Brand context: name, vibe, aesthetic direction, colors, fonts, mood, page color strategy
|
|
81
|
+
Design tokens: .wix/design-tokens.css (generated from site.json.designTokens)
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**`Instruction file` must point to one of these vertical instruction files:**
|
|
85
|
+
- `<SKILL_ROOT>/references/stores/INSTRUCTIONS.md` — Phase 1 Seed + Phase 3 Components + Phase 4 Pages
|
|
86
|
+
- `<SKILL_ROOT>/references/ecom/INSTRUCTIONS.md` — Phase 1 Seed + Phase 3 Components (cart/checkout — passive, required by stores)
|
|
87
|
+
- `<SKILL_ROOT>/references/cms/INSTRUCTIONS.md` — Phase 1 Seed + Phase 4 CMS Pages
|
|
88
|
+
- `<SKILL_ROOT>/references/blog/INSTRUCTIONS.md` — Phase 1 Seed + Phase 3 Components + Phase 4 Pages
|
|
89
|
+
- `<SKILL_ROOT>/references/forms/INSTRUCTIONS.md` — Phase 1 Seed + Phase 3 Components + Phase 4 Pages
|
|
90
|
+
- `<SKILL_ROOT>/references/gift-cards/INSTRUCTIONS.md` — Phase 1 Seed + Phase 3 Components + Phase 4 Pages (passive/dashboard-gated)
|
|
91
|
+
- `<SKILL_ROOT>/references/images/INSTRUCTIONS.md` — `image-phase-1-decorative` + `image-phase-2-entity`
|
|
92
|
+
- `<SKILL_ROOT>/references/designer/INSTRUCTIONS.md` — Phase 2 Design System + all Phase 4 Page designers
|
|
93
|
+
|
|
94
|
+
For **image subagents**, the prompt additionally includes: page list (for decorative brief), entity types to cover (products, about-content, etc.).
|
|
95
|
+
|
|
96
|
+
Phase 3 Components subagents (Step 4.5) additionally receive the full styling-contract JSON inlined in their prompt — they do not read `.wix/design-tokens.css` + `.wix/site.d.ts` from disk. See § "Styling contract coordination" below.
|
|
97
|
+
|
|
98
|
+
### Subagent return
|
|
99
|
+
|
|
100
|
+
Every subagent returns a structured JSON block at the end of its run, per `references/shared/RETURN_CONTRACT.md`. The orchestrator parses each return as it arrives.
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Wait: Phase 2 → Step 4.5 (Phase 3 Components + Image Phase 2) → Step 7 (Phase 4 Pages)
|
|
105
|
+
|
|
106
|
+
Phase 2 completes (~2–3 min) in the foreground — the orchestrator resumes automatically. Verify `.wix/design-tokens.css` + `.wix/site.d.ts` exist on disk before launching Step 4.5.
|
|
107
|
+
|
|
108
|
+
### Step 4.5 — Phase 3 Components + Image Phase 2 Entity (one concurrent batch, all background)
|
|
109
|
+
|
|
110
|
+
Read `.wix/design-tokens.css` + `.wix/site.d.ts` once, then dispatch in a single concurrent batch:
|
|
111
|
+
|
|
112
|
+
1. **One Phase 3 Components subagent per loaded pack** that declares `components`. Each prompt carries:
|
|
113
|
+
- All standard fields (see "Subagent prompt template" above)
|
|
114
|
+
- The **full styling-contract JSON inlined** — not a file path
|
|
115
|
+
|
|
116
|
+
2. **One Image Phase 2 Entity subagent** (when any pack produced entities — stores products, CMS items, blog posts), provided the relevant Phase 1 Seeder has returned. Prompt carries Phase 1 Seed return data inline + brand context. The image agent reads `<SKILL_ROOT>/references/images/INSTRUCTIONS.md` § "Scope: image-phase-2-entity".
|
|
117
|
+
|
|
118
|
+
Both groups are **background**. They start immediately and continue running through Step 7 dispatch — no polling.
|
|
119
|
+
|
|
120
|
+
**Why Image Phase 2 lives here, not in Step 7.** Image Phase 2 only depends on Phase 1 Seed entity IDs/names/descriptions + brand context. It does not read or write anything Phase 3 Components or Phase 4 Pages produce — its PATCH/PUT targets are Wix-side entities (`stores/v3/products`, `wix-data/v2/items`, `blog/v3/posts`). Launching it here lets it overlap entirely with Phase 3 (and often Phase 4 too) instead of becoming a post-Phase-4 tail blocker.
|
|
121
|
+
|
|
122
|
+
**Gate.** If a Phase 1 Seeder is still running when this batch is dispatched, hold Image Phase 2 back until that seeder returns. Phase 3 Components dispatch does not wait — Phase 3 agents don't need entity data. In practice Phase 1 Seeders (~99–121 s typical) finish well before Phase 2 DS (~500 s typical), so this gate rarely fires.
|
|
123
|
+
|
|
124
|
+
### Then Phase 4 (Pages)
|
|
125
|
+
|
|
126
|
+
Phase 4 launches in Step 7. Phase 1 Seeders, Phase 3 Components, and Image Phase 2 are typically still running (or finished) at that point. Step 6 explicitly waits for Phase 1 + Phase 3 before Step 7 dispatches; Image Phase 2 is allowed to continue running through Phase 4 and is gated only at Step 8 / Build.
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## Wait: Phase 3 + Phase 1 → Step 7 (Phase 4 Pages)
|
|
131
|
+
|
|
132
|
+
Both must complete before Step 7 dispatches:
|
|
133
|
+
|
|
134
|
+
1. **Phase 1 Seeders** — return data includes product slugs, CMS item IDs, etc. that Phase 4 subagents need for wiring.
|
|
135
|
+
2. **Phase 3 Components** — writes the React islands that Phase 4 Pages mount.
|
|
136
|
+
|
|
137
|
+
If one is still running when the other finishes, wait for its return. Do NOT launch Phase 4 prematurely — Phase 4 subagents would fail reading missing islands or missing product slugs.
|
|
138
|
+
|
|
139
|
+
### Data carry-forward
|
|
140
|
+
|
|
141
|
+
Parse these from Phase 1 Seed returns into session scratch for Phase 4 subagent prompts:
|
|
142
|
+
- **Stores Phase 1 return** → `products: [{id, name, slug, variantId, price, inventory, sku}]`
|
|
143
|
+
- **CMS Phase 1 return** → `collections: [{name, items: [{id, …}]}]`
|
|
144
|
+
|
|
145
|
+
Since 2026-04 the orchestrator also merges each Seeder's `data` block into `.wix/site.json.seeded.<vertical>` — Phase 4 prompts reference the `site.json` path rather than re-inlining the raw data, but the shape above is what Phase 4 subagents ultimately read.
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## Step 7 Dispatch — Phase 4 (Pages)
|
|
150
|
+
|
|
151
|
+
### Concurrent batch
|
|
152
|
+
|
|
153
|
+
For each loaded pack's `pages`:
|
|
154
|
+
- One Phase 4 subagent per scope — **background**. Each writes its routes ONCE with both visual design and live data queries (the merged design+wire model — see SKILL.md Step 5 note). Earlier flows split this into a placeholder-writing dispatch followed by a page-rewrite dispatch; that double-write was eliminated.
|
|
155
|
+
|
|
156
|
+
> **Image Phase 2 is NOT dispatched here.** It was launched earlier in Step 4.5, alongside Phase 3 Components. By the time Step 7 fires, Image Phase 2 has typically been running for ~5–8 minutes and is finished or close to finishing. The Step 8 hard gate still waits for it before invoking `release.sh`.
|
|
157
|
+
|
|
158
|
+
### Example (ecommerce run — stores pack contributes 4 Phase 4 scopes + cms pack 1)
|
|
159
|
+
|
|
160
|
+
Five subagents launched concurrently:
|
|
161
|
+
|
|
162
|
+
1. **product-pages** — `products/index.astro`, `products/[slug].astro`, `ProductCard.astro`
|
|
163
|
+
2. **category-pages** — `category/[slug].astro`, `CategoryRail.astro`, `utils/categories.ts`
|
|
164
|
+
3. **cart-checkout** — `cart.astro`, `thank-you.astro`
|
|
165
|
+
4. **home-and-nav** — patch `index.astro` product grid + `Navigation.astro` (CartBadge mount + Shop submenu insert at `<!-- nav:links -->`)
|
|
166
|
+
5. **cms-pages** — wire About + FAQ to live `@wix/data` queries
|
|
167
|
+
|
|
168
|
+
`product-pages` and `home-and-nav` import files written by `category-pages` (`CategoryRail.astro`, `utils/categories.ts`) — but the imports resolve at build time (Step 8), not at write time, so the three can dispatch concurrently.
|
|
169
|
+
|
|
170
|
+
### Phase 4 prompt additions
|
|
171
|
+
|
|
172
|
+
```
|
|
173
|
+
Scope: <scope name from pack.pages[*].name>
|
|
174
|
+
Files to own (absolute paths): <from pack.pages[*].files>
|
|
175
|
+
Phase 1 Seed data: read from `.wix/site.json.seeded.<vertical>` (path reference — see SKILL.md Step 7)
|
|
176
|
+
Design tokens: .wix/design-tokens.css (read from disk if needed)
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Each scope subagent writes its `.astro` files directly with live SDK queries, wires up analytics events, and mounts the React islands written by Phase 3 Components.
|
|
180
|
+
|
|
181
|
+
Scope subagents MUST NOT:
|
|
182
|
+
- Modify files outside their declared scope
|
|
183
|
+
- Modify CSS (owned by Phase 2 Design System)
|
|
184
|
+
- Modify React islands (owned by Phase 3 Components)
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## Wait: Phase 4 → Build
|
|
189
|
+
|
|
190
|
+
> **HARD GATE: Do NOT run `npx @wix/cli build` until `image-phase-2-entity` has completed or timed out (120s).** This gate is non-negotiable even if earlier phases had failures or were written inline. Skipping it after cascading failures has shipped previews with no product images and `run.json` recording `image-phase-2-entity` as `"in_progress"`.
|
|
191
|
+
|
|
192
|
+
All Step 7 Phase 4 Pages subagents return. Image Phase 2 was dispatched in Step 4.5 (not Step 7), so it has been running through Phase 3 + Phase 4 in parallel — typically ~5–8 minutes by the time Phase 4 Pages finish, which is enough for Image Phase 2 to be done or in its tail. All return JSON is in session context.
|
|
193
|
+
|
|
194
|
+
If Phase 4 finishes before `image-phase-2-entity`, wait for it before proceeding. Without this wait, the preview shows empty image placeholders on products (images not yet PATCHed). With Image Phase 2 dispatched earlier (in Step 4.5), this wait is usually a no-op.
|
|
195
|
+
|
|
196
|
+
> **Timeout safety:** if `image-phase-2-entity` has not completed within 120s after all Phase 4 subagents finish, proceed to Build and note `{code: "IMAGE_PHASE_2_TIMEOUT"}` in `run.json`. The timeout is a safety valve — under the Step-4.5-dispatch model it should rarely fire.
|
|
197
|
+
|
|
198
|
+
Also ensure the background `npm install` (started in Step 2 Setup) has completed. Wait on its handle rather than polling. On non-zero exit, follow the recovery ladder in `SETUP.md` § "npm install recovery".
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## Subagent rate / credit limits
|
|
203
|
+
|
|
204
|
+
Some runtimes apply per-session rate or credit limits to subagents. When a subagent return looks truncated, treat it as a rate-limit hit and recover.
|
|
205
|
+
|
|
206
|
+
### Detection
|
|
207
|
+
|
|
208
|
+
A subagent has hit a rate / credit limit when its return contains any of:
|
|
209
|
+
- Literal text `"You've hit your limit"`, `"quota exceeded"`, `"rate limit"`
|
|
210
|
+
- Total return under ~100 tokens with no fenced JSON block
|
|
211
|
+
- Return ending mid-sentence without a completion indicator
|
|
212
|
+
|
|
213
|
+
### Recovery procedure
|
|
214
|
+
|
|
215
|
+
1. **Check the subagent's declared output files on disk.** Each scope's reference lists the files it owns (e.g., the Phase 4 store-pages scope owns `products/index.astro`, `products/[slug].astro`, `cart.astro`, `thank-you.astro`, `ProductCard.astro`). Read each expected path.
|
|
216
|
+
2. **If all expected files exist on disk and look syntactically valid** (no empty files, no unterminated strings): synthesize a `status: "complete"` entry for `run.json` with `notes: "Sub-agent hit rate limit after writing all files; files on disk are valid."` Proceed with the next dispatch.
|
|
217
|
+
3. **If expected files are missing or empty:** retry the subagent once with an identical prompt. If the retry also hits the limit, mark the phase `status: "partial"` in `run.json` with `errors: [{code: "RATE_LIMIT", message: "Subagent rate-limited; <N> of <M> files produced"}]` and decide per-case — the orchestrator may fall back to inline emission of the missing files if they're trivial (single-file scope), or fail the run.
|
|
218
|
+
4. **Do not loop.** Retrying the same subagent more than once after a rate limit wastes budget — the limit is session-scoped and persists.
|
|
219
|
+
|
|
220
|
+
Record the rate-limit event in `run.json` `notes[]` regardless of recovery outcome — it's important observability for tuning scope sizes.
|
|
221
|
+
|
|
222
|
+
## Build & Release
|
|
223
|
+
|
|
224
|
+
1. `npx @wix/cli build` — if it fails, inspect `.wix/debug.log` for the specific error, fix, retry. Common failure modes are listed in `references/shared/RETURN_CONTRACT.md` § "Common failure modes".
|
|
225
|
+
2. `npx @wix/cli release` — extract the published URL from the `Site published on <url>` line in stdout. This command also populates the **Frontend link** in headless settings natively, so transactional emails link to the deployed frontend without any extra API calls.
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## Final Message — single concluding turn
|
|
230
|
+
|
|
231
|
+
Contains (in order):
|
|
232
|
+
|
|
233
|
+
1. **Release URL** as the very first thing — bold heading or link. The user must see it immediately.
|
|
234
|
+
2. **Write `.wix/run.json`** in the same turn — a single observability record aggregating every subagent return. Format per `references/shared/RETURN_CONTRACT.md` § "Final run.json format".
|
|
235
|
+
|
|
236
|
+
Why URL-first within one turn: the user perceives the URL instantly, but the turn does not close until the file write completes — so the observability record is guaranteed on disk before the turn ends. Earlier flows composed the final log BEFORE emitting the URL, adding ~70s to the user's wait.
|
|
237
|
+
|
|
238
|
+
Do NOT re-read anything to compose `run.json`. Use the subagent return data already in session context.
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## Styling contract coordination
|
|
243
|
+
|
|
244
|
+
The **design tokens** (`.wix/design-tokens.css` + `.wix/site.d.ts`) are the coordination artifacts between subagents. Read by every downstream phase that touches styled markup.
|
|
245
|
+
|
|
246
|
+
### Producer: Phase 2 Design System (Step 3, foreground) → orchestrator (Step 4, deterministic)
|
|
247
|
+
|
|
248
|
+
Phase 2 writes `global.css` and returns `designTokens` JSON. The orchestrator merges the JSON into `.wix/site.json.designTokens` and runs `node <SKILL_ROOT>/scripts/emit-design-tokens.mjs` (Step 4), which deterministically emits `.wix/design-tokens.css` + `.wix/site.d.ts` from the JSON. Both derived files are pure projections — no agent-side template, no LLM. See `<SKILL_ROOT>/scripts/emit-design-tokens.mjs` for the projection rules.
|
|
249
|
+
|
|
250
|
+
### Consumer: Phase 3 Components (Step 4.5 — launched AFTER Phase 2 completes; no polling)
|
|
251
|
+
|
|
252
|
+
Phase 3 Components is **not** dispatched in Step 3 alongside Phase 2. The orchestrator waits for Phase 2 to finish (foreground) and then launches Phase 3 in the background in Step 4.5. The contract is passed inline in each Phase 3 prompt.
|
|
253
|
+
|
|
254
|
+
Why serialized instead of polled: a polling mechanic would only save time if Phase 3 could finish early — but Step 7 (Phase 4) already depends on Phase 2, so Phase 2 is the critical-path gate regardless. Serializing Phase 3 behind Phase 2 adds zero to critical-path `max(Phase 2, Phase 3)` wall time and eliminates one failure mode (a missing-contract timeout).
|
|
255
|
+
|
|
256
|
+
### Consumers: Phase 4 Pages (Step 7)
|
|
257
|
+
|
|
258
|
+
Contract already exists when Phase 4 launches. Subagents receive the contract contents inline in their prompt (no polling).
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
## Diagnostic: did the concurrent batch actually run in parallel?
|
|
263
|
+
|
|
264
|
+
If a build feels slow, check whether dispatches that should have been concurrent actually overlapped in execution. Two failure modes:
|
|
265
|
+
|
|
266
|
+
1. **Serialized launch:** the orchestrator emitted subagent invocations one at a time across multiple turns instead of as a single batch. Symptom: 12–39s gaps between subagent starts in the run log.
|
|
267
|
+
2. **Serialized execution:** the runtime dispatched the batch but executed it sequentially (rare; most runtimes parallelize properly).
|
|
268
|
+
|
|
269
|
+
The fix for (1) depends on the runtime — check whether your dispatch primitive supports a single concurrent batch and whether anything between the subagent invocations (status updates, narration, file writes) is splitting the batch into multiple turns. Even when (1) cannot be fixed, **background dispatch alone gives ~2× compression** by overlapping execution. Make every subagent that doesn't block downstream work a background subagent.
|