@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.
Files changed (195) hide show
  1. package/README.md +5 -9
  2. package/package.json +1 -1
  3. package/skills/wix-app/SKILL.md +51 -42
  4. package/skills/wix-app/references/BACKEND_EVENT.md +10 -65
  5. package/skills/wix-app/references/CUSTOM_ELEMENT_WIDGET.md +101 -406
  6. package/skills/wix-app/references/DASHBOARD_MENU_PLUGIN.md +14 -111
  7. package/skills/wix-app/references/DASHBOARD_MODAL.md +56 -205
  8. package/skills/wix-app/references/DASHBOARD_PAGE.md +19 -98
  9. package/skills/wix-app/references/DASHBOARD_PLUGIN.md +6 -108
  10. package/skills/wix-app/references/DATA_COLLECTION.md +113 -198
  11. package/skills/wix-app/references/EMBEDDED_SCRIPT.md +41 -268
  12. package/skills/wix-app/references/EXTENSION_REGISTRATION.md +27 -76
  13. package/skills/wix-app/references/SERVICE_PLUGIN.md +35 -188
  14. package/skills/wix-app/references/SITE_PLUGIN.md +8 -92
  15. package/skills/wix-app/references/STORES_VERSIONING.md +1 -0
  16. package/skills/wix-app/references/backend-event/COMMON-EVENTS.md +0 -44
  17. package/skills/wix-app/references/custom-element-widget/SETTINGS_PANEL.md +19 -330
  18. package/skills/wix-app/references/dashboard-menu-plugin/bookings-slots.md +0 -12
  19. package/skills/wix-app/references/dashboard-menu-plugin/ecommerce-slots.md +7 -0
  20. package/skills/wix-app/references/dashboard-menu-plugin/restaurants-slots.md +0 -12
  21. package/skills/wix-app/references/dashboard-plugin/SLOTS.md +3 -15
  22. package/skills/wix-app/references/service-plugin/ADDITIONAL-FEES.md +2 -18
  23. package/skills/wix-app/references/service-plugin/BOOKINGS-STAFF-SORTING.md +2 -42
  24. package/skills/wix-app/references/service-plugin/DISCOUNT-TRIGGERS.md +1 -11
  25. package/skills/wix-app/references/service-plugin/GIFT-CARDS.md +1 -11
  26. package/skills/wix-app/references/service-plugin/PAYMENT-SETTINGS.md +2 -40
  27. package/skills/wix-app/references/service-plugin/SHIPPING-RATES.md +2 -19
  28. package/skills/wix-app/references/service-plugin/VALIDATIONS.md +2 -18
  29. package/skills/wix-app/references/site-plugin/SLOTS.md +17 -68
  30. package/skills/wix-design-system/SKILL.md +4 -0
  31. package/skills/wix-headless/SKILL.md +131 -386
  32. package/skills/wix-headless/references/BUILD-astro.md +246 -0
  33. package/skills/wix-headless/references/BUILD-own-build.md +167 -0
  34. package/skills/wix-headless/references/BUILD.md +105 -0
  35. package/skills/wix-headless/references/DESIGN_SYSTEM.md +175 -0
  36. package/skills/wix-headless/references/DISCOVERY-connect.md +55 -0
  37. package/skills/wix-headless/references/DISCOVERY-create.md +238 -0
  38. package/skills/wix-headless/references/DISCOVERY.md +50 -306
  39. package/skills/wix-headless/references/PLAN-connect.md +19 -0
  40. package/skills/wix-headless/references/PLAN-create.md +17 -0
  41. package/skills/wix-headless/references/PLAN.md +92 -0
  42. package/skills/wix-headless/references/SEED.md +214 -0
  43. package/skills/wix-headless/references/SETUP.md +73 -248
  44. package/skills/wix-headless/references/{blog → astro/blog}/BLOG_PAGES.md +6 -5
  45. package/skills/wix-headless/references/{blog → astro/blog}/BLOG_SETUP.md +2 -2
  46. package/skills/wix-headless/references/astro/bookings/COMPONENTS.md +337 -0
  47. package/skills/wix-headless/references/astro/bookings/SERVICES_PAGES.md +428 -0
  48. package/skills/wix-headless/references/astro/cms/CMS_FOUNDATIONS.md +214 -0
  49. package/skills/wix-headless/references/{cms → astro/cms}/FAQ_KNOWLEDGE_BASE.md +14 -12
  50. package/skills/wix-headless/references/{cms → astro/cms}/PORTFOLIO.md +15 -16
  51. package/skills/wix-headless/references/{cms → astro/cms}/RESOURCE_LIBRARY.md +13 -15
  52. package/skills/wix-headless/references/{cms → astro/cms}/TEAM_DIRECTORY.md +11 -11
  53. package/skills/wix-headless/references/astro/designer/INSTRUCTIONS.md +354 -0
  54. package/skills/wix-headless/references/{ecom → astro/ecom}/CART_PAGES.md +8 -9
  55. package/skills/wix-headless/references/{ecom → astro/ecom}/CART_WIRING.md +6 -6
  56. package/skills/wix-headless/references/{ecom → astro/ecom}/COMPONENTS_CSS.md +6 -6
  57. package/skills/wix-headless/references/{forms → astro/forms}/CONTACT_FORM.md +18 -32
  58. package/skills/wix-headless/references/{gift-cards → astro/gift-cards}/COMPONENTS.md +3 -3
  59. package/skills/wix-headless/references/{gift-cards → astro/gift-cards}/PAGES.md +2 -2
  60. package/skills/wix-headless/references/{stores → astro/stores}/BACK_IN_STOCK.md +7 -7
  61. package/skills/wix-headless/references/{stores → astro/stores}/CATEGORY_PAGES.md +12 -13
  62. package/skills/wix-headless/references/{stores → astro/stores}/COMPONENTS_CSS.md +7 -7
  63. package/skills/wix-headless/references/{stores → astro/stores}/HOME_AND_NAV.md +11 -9
  64. package/skills/wix-headless/references/{stores → astro/stores}/PRODUCT_PAGES.md +11 -9
  65. package/skills/wix-headless/references/{stores → astro/stores}/SHARED_WIRING.md +8 -7
  66. package/skills/wix-headless/references/astro/templates/Footer.astro +27 -0
  67. package/skills/wix-headless/references/astro/templates/Layout.astro +132 -0
  68. package/skills/wix-headless/references/astro/templates/Navigation.astro +38 -0
  69. package/skills/wix-headless/references/astro/templates/astro.config.mjs +41 -0
  70. package/skills/wix-headless/references/astro/templates/bookings/AvailabilityCalendar.tsx +218 -0
  71. package/skills/wix-headless/references/astro/templates/bookings/BookingForm.tsx +194 -0
  72. package/skills/wix-headless/references/astro/templates/bookings/ManageBooking.tsx +84 -0
  73. package/skills/wix-headless/references/astro/templates/bookings/SeoTags.astro +25 -0
  74. package/skills/wix-headless/references/astro/templates/bookings/ServiceBookingFlow.tsx +50 -0
  75. package/skills/wix-headless/references/astro/templates/bookings/ServiceCard.astro +45 -0
  76. package/skills/wix-headless/references/astro/templates/bookings/api/confirm-booking.ts +34 -0
  77. package/skills/wix-headless/references/astro/templates/bookings/api/waitlist.ts +74 -0
  78. package/skills/wix-headless/references/astro/templates/bookings/booking-confirmation.astro +111 -0
  79. package/skills/wix-headless/references/astro/templates/bookings/components-bookings.css +413 -0
  80. package/skills/wix-headless/references/astro/templates/bookings/manage-booking.astro +76 -0
  81. package/skills/wix-headless/references/astro/templates/bookings/services/[slug].astro +81 -0
  82. package/skills/wix-headless/references/astro/templates/bookings/services/index.astro +65 -0
  83. package/skills/wix-headless/references/astro/templates/ecom/components-ecom.css +302 -0
  84. package/skills/wix-headless/references/astro/templates/global.css +286 -0
  85. package/skills/wix-headless/references/astro/templates/index.astro +56 -0
  86. package/skills/wix-headless/{templates → references/astro/templates}/stores/back-in-stock.ts +1 -1
  87. package/skills/wix-headless/{templates → references/astro/templates}/stores/components-stores.css +138 -33
  88. package/skills/wix-headless/references/blog/BLOG_CONTENT.md +28 -19
  89. package/skills/wix-headless/references/blog/INSTRUCTIONS.md +6 -6
  90. package/skills/wix-headless/references/bookings/INSTRUCTIONS.md +106 -0
  91. package/skills/wix-headless/references/bookings/SERVICES_DATA.md +295 -0
  92. package/skills/wix-headless/references/cms/CMS_FOUNDATIONS.md +35 -232
  93. package/skills/wix-headless/references/cms/INSTRUCTIONS.md +39 -8
  94. package/skills/wix-headless/references/commands/known-apps.json +2 -1
  95. package/skills/wix-headless/references/custom/CONNECTION_PLAN.md +142 -0
  96. package/skills/wix-headless/references/custom/INSTRUCTIONS.md +88 -0
  97. package/skills/wix-headless/references/custom/blog/WIRING.md +52 -0
  98. package/skills/wix-headless/references/custom/bookings/WIRING.md +88 -0
  99. package/skills/wix-headless/references/custom/cms/WIRING.md +97 -0
  100. package/skills/wix-headless/references/custom/ecom/WIRING.md +67 -0
  101. package/skills/wix-headless/references/custom/forms/WIRING.md +101 -0
  102. package/skills/wix-headless/references/custom/stores/WIRING.md +80 -0
  103. package/skills/wix-headless/references/ecom/INSTRUCTIONS.md +12 -12
  104. package/skills/wix-headless/references/forms/INSTRUCTIONS.md +6 -6
  105. package/skills/wix-headless/references/gift-cards/INSTRUCTIONS.md +13 -13
  106. package/skills/wix-headless/references/images/INSTRUCTIONS.md +58 -60
  107. package/skills/wix-headless/references/seed-recipes.md +49 -0
  108. package/skills/wix-headless/references/shared/AGENTS_MD.md +47 -0
  109. package/skills/wix-headless/references/shared/AUTHENTICATION.md +108 -0
  110. package/skills/wix-headless/references/shared/BUILD_NOISE.md +2 -2
  111. package/skills/wix-headless/references/shared/DESIGN_MD.md +85 -0
  112. package/skills/wix-headless/references/shared/DOCS_SEARCH.md +41 -0
  113. package/skills/wix-headless/references/shared/IMAGE_GENERATION.md +40 -39
  114. package/skills/wix-headless/references/shared/IMPLEMENTER.md +92 -41
  115. package/skills/wix-headless/references/shared/PRODUCTION_SHARP_EDGES.md +3 -3
  116. package/skills/wix-headless/references/shared/RETURN_CONTRACT.md +32 -312
  117. package/skills/wix-headless/references/shared/STYLING.md +48 -21
  118. package/skills/wix-headless/references/stores/INSTRUCTIONS.md +59 -29
  119. package/skills/wix-headless/references/stores/PRODUCT_CATALOG_DATA.md +31 -28
  120. package/skills/wix-headless/references/verticals/_schema.json +31 -117
  121. package/skills/wix-headless/references/verticals/_schema.md +60 -150
  122. package/skills/wix-headless/references/verticals/blog.md +5 -99
  123. package/skills/wix-headless/references/verticals/bookings.md +41 -0
  124. package/skills/wix-headless/references/verticals/cms.md +9 -100
  125. package/skills/wix-headless/references/verticals/ecom.md +6 -77
  126. package/skills/wix-headless/references/verticals/forms.md +5 -85
  127. package/skills/wix-headless/references/verticals/gift-cards.md +6 -103
  128. package/skills/wix-headless/references/verticals/stores.md +10 -144
  129. package/skills/wix-headless/scripts/check-manifest.mjs +148 -11
  130. package/skills/wix-headless/scripts/compose.mjs +540 -0
  131. package/skills/wix-headless/scripts/emit-design-tokens.mjs +136 -53
  132. package/skills/wix-headless/scripts/flatten.sh +61 -0
  133. package/skills/wix-headless/scripts/generate-images.mjs +242 -0
  134. package/skills/wix-headless/scripts/patch-decorative-slots.mjs +67 -43
  135. package/skills/wix-headless/scripts/plan-entity-image-waves.mjs +3 -3
  136. package/skills/wix-headless/scripts/scaffold.sh +113 -27
  137. package/skills/wix-headless/scripts/seed-utilities.sh +50 -12
  138. package/skills/wix-headless/scripts/write-decorative-json.mjs +62 -0
  139. package/skills/wix-manage/SKILL.md +4 -8
  140. package/skills/wix-manage/references/blog/how-to-create-blog-posts.md +2 -0
  141. package/skills/wix-manage/references/cms/cms-data-items-crud.md +4 -0
  142. package/skills/wix-manage/references/cms/cms-references-and-relationships.md +2 -0
  143. package/skills/wix-manage/references/cms/cms-schema-management.md +4 -0
  144. package/skills/wix-manage/references/domains/domain-search-and-purchase.md +10 -7
  145. package/skills/wix-manage/references/ecommerce/api-shipping.md +443 -0
  146. package/skills/wix-manage/references/ecommerce/flow-add-free-shipping.md +5 -6
  147. package/skills/wix-manage/references/ecommerce/flow-fix-coverage-gaps.md +4 -5
  148. package/skills/wix-manage/references/ecommerce/flow-optimize-shipping-rates.md +4 -5
  149. package/skills/wix-manage/references/ecommerce/goal-increase-aov.md +1 -1
  150. package/skills/wix-manage/references/ecommerce/goal-reduce-cart-abandonment.md +1 -2
  151. package/skills/wix-manage/references/ecommerce/guardrail-shipping-health.md +2 -2
  152. package/skills/wix-manage/references/ecommerce/recipe-apply-shipping-recommendations.md +4 -5
  153. package/skills/wix-manage/references/ecommerce/recommend-ecommerce-strategy.md +7 -7
  154. package/skills/wix-manage/references/ecommerce/setup-discount-rules.md +209 -72
  155. package/skills/wix-manage/references/ecommerce/setup-store-pickup-location.md +9 -10
  156. package/skills/wix-manage/references/ecommerce/skill-graph.md +4 -4
  157. package/skills/wix-manage/references/forms/create-form.md +50 -0
  158. package/skills/wix-manage/references/stores/bulk-create-products-with-options.md +2 -0
  159. package/skills/wix-manage/references/stores/create-product-from-image.md +91 -38
  160. package/skills/wix-manage/references/stores/setup-online-store-catalog-v3.md +2 -0
  161. package/skills/wix-app/references/custom-element-widget/default-thumbnail.png +0 -0
  162. package/skills/wix-app/references/data-collection/extension-template.ts +0 -107
  163. package/skills/wix-headless/references/ORCHESTRATION.md +0 -269
  164. package/skills/wix-headless/references/commands/install-app.md +0 -42
  165. package/skills/wix-headless/references/commands/mcp-bootstrap.md +0 -28
  166. package/skills/wix-headless/references/designer/INSTRUCTIONS.md +0 -828
  167. package/skills/wix-headless/references/shared/MCP_PREFIX.md +0 -105
  168. package/skills/wix-headless/scripts/copy-utility-templates.mjs +0 -153
  169. package/skills/wix-headless/scripts/finalize-run-json.mjs +0 -141
  170. package/skills/wix-headless/scripts/init-site-json.mjs +0 -63
  171. package/skills/wix-headless/scripts/preview.sh +0 -45
  172. package/skills/wix-headless/scripts/release.sh +0 -73
  173. package/skills/wix-headless/templates/ecom/components-ecom.css +0 -215
  174. package/skills/wix-manage/references/events/list-events.md +0 -203
  175. /package/skills/wix-headless/{templates → references/astro/templates}/ecom/CartBadge.tsx +0 -0
  176. /package/skills/wix-headless/{templates → references/astro/templates}/ecom/CartView.tsx +0 -0
  177. /package/skills/wix-headless/{templates → references/astro/templates}/ecom/cart.astro +0 -0
  178. /package/skills/wix-headless/{templates → references/astro/templates}/ecom/discounts.ts +0 -0
  179. /package/skills/wix-headless/{templates → references/astro/templates}/ecom/thank-you.astro +0 -0
  180. /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/GiftCardPurchase.tsx +0 -0
  181. /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/_home-teaser-snippet.astro +0 -0
  182. /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/_nav-snippet.astro +0 -0
  183. /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/components-gift-cards.css +0 -0
  184. /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/gift-cards.astro +0 -0
  185. /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/gift-cards.ts +0 -0
  186. /package/skills/wix-headless/{templates → references/astro/templates}/stores/AddToCartButton.tsx +0 -0
  187. /package/skills/wix-headless/{templates → references/astro/templates}/stores/BackInStockForm.tsx +0 -0
  188. /package/skills/wix-headless/{templates → references/astro/templates}/stores/CategoryRail.astro +0 -0
  189. /package/skills/wix-headless/{templates → references/astro/templates}/stores/ProductCard.astro +0 -0
  190. /package/skills/wix-headless/{templates → references/astro/templates}/stores/ProductPurchase.tsx +0 -0
  191. /package/skills/wix-headless/{templates → references/astro/templates}/stores/SeoTags.astro +0 -0
  192. /package/skills/wix-headless/{templates → references/astro/templates}/stores/categories.ts +0 -0
  193. /package/skills/wix-headless/{templates → references/astro/templates}/stores/category/[slug].astro +0 -0
  194. /package/skills/wix-headless/{templates → references/astro/templates}/stores/products/[slug].astro +0 -0
  195. /package/skills/wix-headless/{templates → references/astro/templates}/stores/products/index.astro +0 -0
@@ -0,0 +1,354 @@
1
+ ---
2
+ name: page-designer
3
+ description: "The page-design specification for Wix Managed Headless page routes: home, static (about/faq), store-pages, services-pages, blog-pages, contact-page. This is the visual-design guidance the merged build agents' `pages` scopes (vertical packs, BUILD-astro.md § 'Step 4.5' — the build wave) apply when they write each route ONCE with both visual design and live SDK data. It defines layout, contract classes, decorative-slot conventions, responsive rules, and anti-patterns — not a separate placeholder-writing pass. The design-system phase (tokens + global.css + Layout/Nav/Footer shells) is NOT here — it is split across DESIGN_SYSTEM.md (Designer) and scripts/compose.mjs (Composer)."
4
+ ---
5
+
6
+ # Page Designer — Scope-Based Page Design
7
+
8
+ > **Single-write merged model (BUILD-astro.md § "Step 4.5" — the build wave — is authoritative).** Routes are written **once**, by the per-vertical merged build agents' `pages` scopes (after that agent writes its islands), with both visual design **and** live SDK queries in the same pass — there is no separate "write a design placeholder, then rewrite it with data" dispatch (that double-write was eliminated), and no separate Components→Pages wave (those are merged into one per-vertical agent). This doc is the **visual-design specification** the merged author applies: the layout, typography, color, spacing, contract classes, decorative slots, and component composition each route should have. Where a section below says "placeholder data," read it as *the data shape* the live query maps onto — and the safe fallback to render if a query returns empty. The merged scope binds real SDK data into this structure; it does not ship hardcoded arrays as the final output.
9
+
10
+ Your prompt will contain a `Scope:` line naming exactly one of the page scopes below. **Read only the section for your scope. Do not read sections for other scopes — wastes context and blurs ownership.**
11
+
12
+ You own **page-level visual output**: the layout, typography, color, spacing, and component composition of one route group. The same merged scope also binds the live SDK data into that structure (the per-vertical reference under `references/astro/<vertical>/` supplies the exact queries).
13
+
14
+ > **The design-system phase is not in this doc.** Tokens (`DESIGN.md` / `data.design`), `global.css`, `astro.config.mjs`, `Layout.astro`, `Navigation.astro`, and `Footer.astro` are produced earlier in the run by a two-role split:
15
+ > - **Designer** (`<SKILL_ROOT>/references/DESIGN_SYSTEM.md`) — authors `DESIGN.md` (the framework-agnostic token spec) and returns the brand-voice strings.
16
+ > - **Composer** (`<SKILL_ROOT>/scripts/compose.mjs`, a deterministic script — self-documenting) — applies `DESIGN.md` to the astro skeletons and writes the 6 design-system files.
17
+ >
18
+ > By the time the Phase 4 routes are written, the `@theme` token contract, the `.astro` shells, and `.wix/design-tokens.css` already exist. You consume them; you do not write them.
19
+
20
+ ## Self-Loading
21
+
22
+ 1. Read `../../shared/RETURN_CONTRACT.md` — structured return format.
23
+ 2. Read `../../shared/STYLING.md` — three styling categories (tokens-as-utilities, global semantic classes, co-located styles). Pages compose `@theme` tokens at call sites as Tailwind utilities; the design-token vocabulary on disk at `.wix/design-tokens.css` tells you which tokens this run published.
24
+
25
+ No REST calls required. Page-design scopes are frontend-only — no `curl`, no MCP tool-discovery.
26
+
27
+ **Every input you need (brand, the published design-token vocabulary, pages to design, pack home-section snippets) is inlined in your prompt.** Don't depend on mutable shared state.
28
+
29
+ ## Scope Routing
30
+
31
+ | Scope | Phase | Output (files) |
32
+ |-------|-------|----------------|
33
+ | `home` | build wave | `src/pages/index.astro` (composes pack home-sections + brand hero/CTA into the Composer-written shell) |
34
+ | `static` | build wave | `src/pages/about.astro`, `src/pages/faq.astro` |
35
+ | `store-pages` | build wave | `src/pages/products/index.astro`, `src/pages/products/[slug].astro`, `src/components/ProductCard.astro`, `src/pages/cart.astro`, `src/pages/thank-you.astro` |
36
+ | `services-pages` | build wave | `src/pages/services/index.astro`, `src/pages/services/[slug].astro`, `src/pages/booking-confirmation.astro`, `src/pages/manage-booking.astro` |
37
+ | `blog-pages` | build wave | `src/pages/blog/index.astro`, `src/pages/blog/[slug].astro` |
38
+ | `contact-page` | build wave | `src/pages/contact.astro` |
39
+
40
+ If your prompt's `Scope:` line names `design-system`, you have the wrong doc — that work lives in `DESIGN_SYSTEM.md` (Designer) and `scripts/compose.mjs` (Composer). Stop and tell the parent.
41
+
42
+ If your prompt is missing a `Scope:` line, stop and ask the parent — do not guess.
43
+
44
+ **Disabled-pack route discipline.** Loaded packs with `disabled: true` (today: only `gift-cards`) ship dormant — their surfaces are runtime-gated and only appear once the user enables the matching app. Do NOT add hero CTAs, footer links, brand-story callouts, closing-CTA buttons, or ANY entry point pointing at a `disabled: true` pack's route in your page output. Users click through and the feature doesn't exist. The pack's own markers are the only acceptable touchpoint, and those get gated by the pack's runtime probe in Phase 4, not by you.
45
+
46
+ ---
47
+
48
+ ## Page Designer Scopes (build wave, background)
49
+
50
+ All page scopes share common inputs and rules. Scope-specific details follow.
51
+
52
+ ### Common inputs (from your prompt)
53
+
54
+ - **Brand context** — name, vibe, aesthetic direction, colors, fonts, mood.
55
+ - **Published token contract** — the design-token vocabulary (the DESIGN.md tokens, written into `@theme` by `compose.mjs`). Compose these tokens as Tailwind utilities; if a token you need is absent, flag it in your return (`MISSING_TOKEN`) — do not invent a class.
56
+ - **Pages to design** — list of routes and their contract class associations.
57
+ - **Pack home-section snippet** (home scope only) — section stubs from every loaded pack.
58
+ - **Placeholder data instruction** — use plausible brand-contextual placeholder text, prices, images where live data is not yet available.
59
+
60
+ ### Common rules for all page scopes
61
+
62
+ 1. **Use contract classes.** Every component that corresponds to a contract key uses that class name. Do not invent replacements.
63
+ 2. **Use the Layout.** Every page wraps content in `<Layout>`:
64
+ ```astro
65
+ ---
66
+ import Layout from '../layouts/Layout.astro';
67
+ ---
68
+ <Layout title="Page Title">
69
+ <!-- page content -->
70
+ </Layout>
71
+ ```
72
+ 3. **Never empty — render real data, fall back gracefully.** Bind the live SDK query into the designed structure. When a query legitimately returns empty (collection not seeded, OOS, etc.), render a brand-contextual fallback (plausible copy / a tasteful empty state) so the page still looks complete and reviewable — never a blank section.
73
+ 4. **SDK queries belong in the route frontmatter.** The merged `pages` scope imports the relevant SDK (`@wix/stores`, `@wix/data`, `@wix/blog`, …) in the route's frontmatter and queries live data — see the per-vertical reference under `references/astro/<vertical>/` for the exact queries. Wrap every SSR `await` in try/catch with a safe fallback (an unguarded SSR throw truncates Astro's response stream mid-body). Do **not** ship hardcoded arrays as the final page output.
74
+ 5. **No React islands authored here.** Do not write `.tsx` components — Phase 3 Components writes the islands. Phase 4 routes **mount** the already-written islands (`client:load`, etc.) but never author them.
75
+ 6. **Scoped page styles allowed.** Pages may add `<style>` blocks for page-specific ornamental styling (section backgrounds, decorative elements, page-specific spacing adjustments). These are local to the page — do not override contract class rules from `global.css`.
76
+ 7. **Image placeholders — decorative slot convention.** Every decorative image (hero, about visual, page-header art) MUST be emitted as a `<div>` placeholder carrying a `data-decorative-slot="<key>"` attribute. **Use ONLY canonical slot keys from this fixed vocabulary:**
77
+
78
+ | Key | Where it lives | Required when |
79
+ |---|---|---|
80
+ | `hero` | Homepage hero image | Always |
81
+ | `about` | About-page (or home brand-story) editorial visual | Always |
82
+ | `productsHeader` | `/products` listing header decorative | Stores pack loaded |
83
+ | `cmsHeader` | `/about` or `/faq` page header decorative | CMS pack loaded (optional) |
84
+
85
+ Do NOT invent keys like `aboutFeature`, `background`, `heroAlt`, etc. The image agent receives this canonical list as its `decorativeSlots` input and generates exactly those keys — invented keys will not have images, and orphan generated images go unused. If a page needs more visual interest, use scoped CSS / SVG / brand-color blocks instead of additional generated images. The orchestrator runs a post-Phase-2 Edit pass that injects the actual `<img>` for each slot once Image Phase 1 finishes; your job is to make the slot visible. Rules:
86
+ - Use aspect-ratio + background-color on the placeholder so the page looks complete even if Image Phase 1 never completes.
87
+ - Keep decorative overlays (stamps, rules, frames) as siblings of the slot `<div>` — the orchestrator injects the `<img>` as the FIRST child of the slot, so anything you want to layer over it must stay outside the slot `<div>` (or inside with explicit z-index).
88
+ - Do NOT conditionally read any image-coordination file — Image Phase 1's slot→URL map flows to the orchestrator via its JSON return, and the orchestrator injects URLs into your slot placeholders. The slot mechanism is the contract; no file lookup is needed or correct.
89
+ - Do not use external placeholder services (picsum, unsplash, etc.).
90
+
91
+ Example:
92
+ ```astro
93
+ <section class="hero-section relative">
94
+ <div
95
+ class="hero-image"
96
+ data-decorative-slot="hero"
97
+ style="aspect-ratio: 4/5; background-color: var(--color-paper-warm);"
98
+ >
99
+ <!-- orchestrator injects <img src={decorativeImages.hero} …> here -->
100
+ </div>
101
+ <div class="hero-stamp">{/* decorative overlay, stays outside the slot */}</div>
102
+ </section>
103
+ ```
104
+ 8. **Comments in frontmatter.** Use `//` or `/* */` — never HTML `<!-- -->` comments in `.astro` frontmatter (it's TypeScript, not HTML). HTML comments in the template section are fine.
105
+ 9. **Responsive.** All pages must work at mobile (320px), tablet (768px), and desktop (1024px+). Use Tailwind responsive prefixes (`md:`, `lg:`) and the spacing scale from `@theme`.
106
+ 10. **Use Tailwind utility classes in templates.** For layout, spacing, typography, and responsive design — use utility classes directly in the markup. Contract classes are still required for components referenced by Phase 3/4 agents. Mix both: `<div class="product-grid grid grid-cols-1 md:grid-cols-3 gap-lg">`. Always use brand `@theme` tokens (e.g., `bg-bark`, `text-cream`) — never default Tailwind colors.
107
+ 11. **No duplicate files.** If two scopes list the same file (rare), the scope whose prompt explicitly names it as "owned" takes precedence. If unclear, write it and note the overlap in your return.
108
+ 12. **Do NOT write to `src/styles/components-<pack>.css` or `src/styles/global.css`** — `components-<pack>.css` is pre-copied from the skill template by the orchestrator (build-wave pre-batch); `global.css` is owned by the Composer. Writing to either causes double-write conflicts.
109
+
110
+ ### Scope: `home`
111
+
112
+ Composes the home page from every loaded pack's `homeSection` snippet plus brand-specific hero and CTA sections.
113
+
114
+ **Inputs (additional):**
115
+ - `Pack home-section snippets` — one per loaded pack. Each names a section (e.g., "Featured products", "Brand story", "Latest posts", "Contact CTA") with a description and contract classes.
116
+
117
+ **Structure:**
118
+ 1. **Hero section** — full-width, impactful brand moment. Uses `hero-section` contract class. Emit a `data-decorative-slot="hero"` placeholder per Common rule #7 — do not inline an Image Phase 1 URL; the orchestrator injects the `<img>` after Image Phase 1 completes.
119
+ 2. **Pack sections** — one section per loaded pack's `homeSection`, in a sensible order (typically: featured content first, then story, then CTA).
120
+ 3. **Optional closing CTA** — if no pack contributes a CTA section, add a minimal brand-appropriate closing.
121
+
122
+ **Files:** `src/pages/index.astro`
123
+
124
+ **Return:**
125
+ ```json
126
+ {
127
+ "status": "complete",
128
+ "phase": "designer-home",
129
+ "scope": "home",
130
+ "data": {
131
+ "pagesDesigned": ["src/pages/index.astro"],
132
+ "contractClassesHonored": ["hero-section", "product-grid", "product-card", "brand-story", ...]
133
+ },
134
+ "files": ["src/pages/index.astro"]
135
+ }
136
+ ```
137
+
138
+ ### Scope: `static`
139
+
140
+ About and FAQ pages — content pages with similar layout demands.
141
+
142
+ **Files:** `src/pages/about.astro`, `src/pages/faq.astro`
143
+
144
+ **About page:**
145
+ - Hero/header section with `about-hero` class
146
+ - Body content with `about-body` class
147
+ - Placeholder brand story text (2-3 paragraphs, brand-contextual)
148
+ - Image placeholder for brand/team visual
149
+
150
+ **FAQ page:**
151
+ - Section wrapper with `faq-section` class
152
+ - Individual Q&A items with `faq-item`, `faq-question`, `faq-answer` classes
153
+ - 4-6 placeholder FAQ items contextual to the business type
154
+ - Accordion or expandable pattern (CSS-only, using `<details>`/`<summary>` or checkbox hack)
155
+
156
+ **Return:**
157
+ ```json
158
+ {
159
+ "status": "complete",
160
+ "phase": "designer-static",
161
+ "scope": "static",
162
+ "data": {
163
+ "pagesDesigned": ["about", "faq"],
164
+ "contractClassesHonored": ["about-hero", "about-body", "faq-section", "faq-item", "faq-question", "faq-answer"]
165
+ },
166
+ "files": ["src/pages/about.astro", "src/pages/faq.astro"]
167
+ }
168
+ ```
169
+
170
+ ### Scope: `store-pages`
171
+
172
+ All store-facing pages designed together for visual coherence.
173
+
174
+ **Files:** `src/pages/products/index.astro`, `src/pages/products/[slug].astro`, `src/components/ProductCard.astro`, `src/pages/cart.astro`, `src/pages/thank-you.astro`
175
+
176
+ **Products listing (`/products`):**
177
+ - Page heading
178
+ - Product grid using `product-grid` class
179
+ - Bind the live `productsV3` query (per `references/astro/stores/PRODUCT_PAGES.md`) into a grid of `ProductCard` components; render a brand-contextual empty state if the query returns nothing
180
+
181
+ **Product detail (`/products/[slug]`):**
182
+ - Product image (large) resolved from the live product record
183
+ - Product info section with `product-detail` class
184
+ - Purchase area with `product-purchase` class — price, variant selector, and Add to Cart button (`add-to-cart-btn` class) bound to the live product/variant data
185
+ - Product description area
186
+
187
+ **ProductCard component:**
188
+ - Accepts a single `product` prop — the full Wix product object from `productsV3`
189
+ - Uses `product-card` class
190
+ - Image, name, price, link to `/products/${product.slug}`
191
+ - Design the prop interface around the full product object: `{ product }` (the canonical `productsV3` shape — see `references/astro/stores/PRODUCT_PAGES.md`)
192
+
193
+ **Cart (`/cart`):**
194
+ - Two-column grid layout: `.cart-grid` — items column left, order summary right. Stacks vertically on mobile
195
+ - Items column with `.cart-items`, `.cart-item`, `.cart-item.unavailable` (reduced opacity), `.cart-item-image`, `.cart-item-info`, `.cart-item-name`, `.cart-item-option`, `.cart-item-modifiers` classes
196
+ - Quantity selector with `.cart-item-qty`, `.qty-btn`, `.qty-value` classes — include `:disabled` states (reduced opacity + `cursor: not-allowed`)
197
+ - Price display with `.cart-item-actions`, `.cart-item-prices`, `.cart-item-full-price` (strikethrough for discounts), `.cart-item-unit-price`, `.cart-item-line-total` classes
198
+ - Remove button with `.cart-item-remove` class (muted color, underline on hover)
199
+ - Summary column with `.cart-summary` (sticky on desktop), `.cart-subtotal`, `.checkout-btn` (with `:disabled` state), `.cart-empty` classes
200
+ - Unavailable item warning with `.cart-item-unavailable` class (red text)
201
+ - Empty state with `.cart-empty` class (centered, muted text + "Browse Products" link)
202
+ - **All cart CSS must be in `<style is:global>`** — `CartView` is a React island; scoped Astro styles do not reach its children
203
+ - The live `CartView` island renders the items/summary at runtime; design the surrounding structure and an empty-cart fallback
204
+
205
+ **Thank you (`/thank-you`):**
206
+ - Confirmation message with `order-summary` class
207
+ - Order details bound to the live order data (per the ecom cart/checkout reference)
208
+
209
+ **Return:**
210
+ ```json
211
+ {
212
+ "status": "complete",
213
+ "phase": "designer-store-pages",
214
+ "scope": "store-pages",
215
+ "data": {
216
+ "pagesDesigned": ["products/index.astro", "products/[slug].astro", "ProductCard.astro", "cart.astro", "thank-you.astro"],
217
+ "contractClassesHonored": <count>
218
+ },
219
+ "files": [
220
+ "src/pages/products/index.astro",
221
+ "src/pages/products/[slug].astro",
222
+ "src/components/ProductCard.astro",
223
+ "src/pages/cart.astro",
224
+ "src/pages/thank-you.astro"
225
+ ]
226
+ }
227
+ ```
228
+
229
+ ### Scope: `services-pages`
230
+
231
+ All bookings-facing pages designed together for visual coherence. **Canonical templates exist** at `<SKILL_ROOT>/references/astro/templates/bookings/` — adapt them (copy, headings, styling); do not re-author the SDK/booking-flow wiring (`references/astro/bookings/SERVICES_PAGES.md` is the wiring spec).
232
+
233
+ **Files:** `src/pages/services/index.astro`, `src/pages/services/[slug].astro`, `src/pages/booking-confirmation.astro`, `src/pages/manage-booking.astro`
234
+
235
+ **Services listing (`/services`):**
236
+ - Page heading + optional brand tagline
237
+ - Service grid using the `service-grid` class, one `ServiceCard` per service (`service-card` class — image/placeholder, name, tagline, duration + price row)
238
+ - Bind the live `services.queryServices` query (per `references/astro/bookings/SERVICES_PAGES.md`); brand-contextual empty state if it returns nothing
239
+
240
+ **Service detail (`/services/[slug]`):**
241
+ - `container-reading` width (never a bare `max-w-<size>`); optional banner image **only when the service has media** (image-less is the common seed case — no fixed-ratio placeholder)
242
+ - Title, tagline, duration + price row, description
243
+ - "Book this service" section mounting the `ServiceBookingFlow` island (`client:only="react"`, threads `serviceType`) — calendar slots use `time-slot` classes (`--available`/`--selected`/`--full`), form uses the `booking-form` family
244
+
245
+ **Booking confirmation (`/booking-confirmation`):**
246
+ - `max-w-prose`, centered; status-aware headline ("Thank you for booking" vs pending-approval) + embedded cancel (`ManageBooking` island, `showSummary={false}`)
247
+
248
+ **Manage booking (`/manage-booking`):**
249
+ - `container-reading`; booking summary + cancel via the `manage-booking` class family
250
+
251
+ ### Scope: `blog-pages`
252
+
253
+ Blog feed listing and post detail designed together.
254
+
255
+ **Files:** `src/pages/blog/index.astro`, `src/pages/blog/[slug].astro`
256
+
257
+ **Blog listing (`/blog`):**
258
+ - Page heading
259
+ - Post grid/list using `blog-feed` class
260
+ - 3 placeholder post cards using `blog-post-card` class (title, date, excerpt, cover image placeholder)
261
+
262
+ **Blog post detail (`/blog/[slug]`):**
263
+ - Post header with title, date, author, cover image placeholder
264
+ - Body area with `blog-post` and `blog-post-body` classes
265
+ - Meta section with `blog-post-meta` class (tags, share links)
266
+ - Good reading typography (max-width prose container, comfortable line height)
267
+
268
+ **Return:**
269
+ ```json
270
+ {
271
+ "status": "complete",
272
+ "phase": "designer-blog-pages",
273
+ "scope": "blog-pages",
274
+ "data": {
275
+ "pagesDesigned": ["blog/index.astro", "blog/[slug].astro"],
276
+ "contractClassesHonored": ["blog-feed", "blog-post-card", "blog-post", "blog-post-body", "blog-post-meta"]
277
+ },
278
+ "files": ["src/pages/blog/index.astro", "src/pages/blog/[slug].astro"]
279
+ }
280
+ ```
281
+
282
+ ### Scope: `contact-page`
283
+
284
+ Contact page with form placeholder.
285
+
286
+ **Files:** `src/pages/contact.astro`
287
+
288
+ **Contact page:**
289
+ - Page heading and descriptive text
290
+ - Contact CTA section using `contact-cta` class (if on home, this mirrors the home CTA's visual language)
291
+ - Form area — mount the `ContactForm.tsx` island (written by Phase 3 Components) styled to the brand, per `references/astro/forms/CONTACT_FORM.md`. Style a complete form layout (name, email, message fields, submit button) so the page reads as finished even before submissions wire up.
292
+ - Optional: map embed placeholder, business hours, address (if brand context suggests it)
293
+
294
+ **Return:**
295
+ ```json
296
+ {
297
+ "status": "complete",
298
+ "phase": "designer-contact-page",
299
+ "scope": "contact-page",
300
+ "data": {
301
+ "pagesDesigned": ["contact.astro"],
302
+ "contractClassesHonored": ["contact-cta"]
303
+ },
304
+ "files": ["src/pages/contact.astro"]
305
+ }
306
+ ```
307
+
308
+ ---
309
+
310
+ ## Return Contract
311
+
312
+ At the end of your work, emit a structured JSON block per `../../shared/RETURN_CONTRACT.md`. Do **not** write sidecar files to `.wix/logs/*`.
313
+
314
+ The JSON block MUST be the **last** content in your message — the parent parses it as the last fenced JSON. No trailing prose after the closing ` ``` `.
315
+
316
+ ## Anti-Patterns (apply to all page scopes)
317
+
318
+ | WRONG | CORRECT |
319
+ |-------|---------|
320
+ | Author a `.tsx` React island in a page scope | Phase 3 Components writes the islands; the route only **mounts** them (`client:load`) |
321
+ | Ship hardcoded data arrays as the final page | Query live SDK data in frontmatter (per the vertical reference) and bind it; hardcoded shapes are only a fallback for empty queries |
322
+ | Write `global.css` or `@theme` tokens | The Composer owns `global.css`; you consume the published token contract |
323
+ | Invent global semantic classes for layout/spacing/typography (`.featured-section`, `.page-header`) | Use Tailwind utilities derived from `@theme` tokens at the call site (`<section class="py-4xl">`); see `../../shared/STYLING.md` |
324
+ | Override `global.css` rules from page `<style>` blocks | Pages can add co-located styles for one-off decoration; never override Composer-owned global classes |
325
+ | HTML `<!-- comment -->` in `.astro` frontmatter | Use `//` or `/* */` — frontmatter is TypeScript |
326
+ | Use external placeholder image services (picsum, unsplash) | Use colored `<div>` placeholders with `data-decorative-slot` — the orchestrator injects Image Phase 1 URLs later |
327
+ | Write `components-<pack>.css` | Phase 3 Components creates that file — page scopes must not write it |
328
+ | Leave a section empty when a query returns nothing | Render a brand-contextual fallback / empty state so the page is always reviewable |
329
+ | Use default Tailwind colors (`bg-blue-500`, `text-gray-200`) | Use brand `@theme` tokens (`bg-bark`, `text-cream`) — defaults expose that it's AI-generated |
330
+ | Generic unstyled HTML | Brand-first design — every element reflects the aesthetic direction |
331
+ | Fixed-width layouts | Responsive: mobile-first, breakpoints at 320/768/1024px |
332
+ | `ls src/`, `Glob src/**` to discover files | Your prompt lists every file and class contract. Write directly. |
333
+ | Read a shared file to get brand or verticals | Every field is in your prompt |
334
+ | Hardcode an external `<img src="https://...">` for product/content images | Resolve entity images from the live record (`media.getScaledToFillImageUrl(...)`) in this same scope; **decorative** images use the `data-decorative-slot` mechanism |
335
+ | Omit `data-decorative-slot` on hero/about/background placeholders | Every decorative image placeholder MUST carry a slot attribute — the orchestrator's injection pass depends on it (common rule #7) |
336
+ | Add a hero CTA / footer link to a disabled-pack route | Disabled packs (gift-cards) are dormant — no entry points to their routes |
337
+ | ProductCard with flat props (`name`, `price`, `slug` as separate props) | Single `product` object prop: `{ product }` — Phase 4 passes the full Wix product object |
338
+ | Wrap CartBadge in `<a>` or add cart SVG icons in `nav-actions` | Leave `nav-actions` empty — CartBadge renders its own `<a>` link; nesting `<a>` tags produces duplicate icons |
339
+
340
+ ## Coordination with other agents
341
+
342
+ | Agent | Relationship | Rule |
343
+ |-------|-------------|------|
344
+ | Composer (design-system) | Wrote `global.css`, `Layout.astro`, `Navigation.astro`, `Footer.astro`, the `@theme` tokens | You consume the token contract and wrap pages in its `Layout`; you never rewrite those files |
345
+ | Phase 3 Components (stores/bookings/blog/forms) | Writes React islands referencing contract classes + `components-<pack>.css` | They own islands + scoped CSS; the route references contract classes in markup and mounts the islands, no overlap |
346
+ | Per-vertical reference (`references/astro/<vertical>/`) | Supplies the exact SDK queries + wiring the merged route binds | Apply this design spec **and** that vertical's queries together in one write — there is no second pass |
347
+ | Image agent (Image Phase 1) | Returns decorative URLs in `data.slots` | Emit `data-decorative-slot="<key>"` placeholders; the orchestrator injects the `<img>` once Image Phase 1 returns |
348
+ | Image agent (Image Phase 2) | PATCHes entity images onto products/posts via REST | No direct interaction — images flow through product/post records that Phase 4 queries |
349
+
350
+ ## File ownership
351
+
352
+ The merged Phase 4 `pages` scope owns each route file **end to end** — visual structure **and** data wiring, written in a single pass. There is no separate page-designer agent that writes a file for a later scope to rewrite; this doc is the visual-design spec the merged author applies alongside its vertical's SDK queries (`references/astro/<vertical>/`). Each route file therefore has exactly **one** writer (its `pages` scope), which removes the cross-phase double-write the older placeholder-then-rewrite model carried.
353
+
354
+ The shared shells the route composes into — `Layout.astro`, `global.css` (Composer), and the marker-patched `Navigation.astro` / `index.astro` / `components-<pack>.css` (pre-copied or patched by the serialized shell-patcher agents) — are NOT owned by a private-file route scope (see "Coordination" above and BUILD-astro.md § "Step 4.5", the serialized shell chain).
@@ -1,21 +1,20 @@
1
1
  # Phase 4 Cart Pages — Ecom
2
2
 
3
- Scope: `ecom-pages`. Launched in **Step 7**. Mounts `CartView` island on the cart page, wires the thank-you page, and mounts `CartBadge` in Navigation.
3
+ Scope: `cart-checkout` (the ecom `pages` scope) — the **pages** portion of the ecom **merged build agent** (the build wave), written *after* its `components`. Mounts `CartView` island on the cart page, wires the thank-you page, and mounts `CartBadge` in `Navigation.astro` (at the `<!-- nav:actions -->` marker). **Because it patches the shared `Navigation.astro` shell, the ecom build agent runs in the build wave's serialized shell chain** — never concurrent with the other Navigation/index patchers (stores `pages-home-and-nav`, gift-cards, blog), so concurrent marker edits can't collide (`BUILD-astro.md` § "Step 4.5").
4
4
 
5
5
  ## Scope
6
6
 
7
- Files this agent OWNS (rewrites from designer output):
7
+ Files this agent OWNS (each written once — designer visual spec + live wiring together):
8
8
 
9
9
  - `src/pages/cart.astro` — mount `CartView.tsx` (client-only, no server-side cart fetch)
10
10
  - `src/pages/thank-you.astro` — read `orderId` from URL, fire `Purchase` event
11
11
 
12
- Files this agent PATCHES (does NOT rewrite):
12
+ Files this agent PATCHES (does NOT rewrite) — only at its own marker:
13
13
 
14
- - `src/components/Navigation.astro` — mount `CartBadge` in the `nav-actions` area
14
+ - `src/components/Navigation.astro` — mount `CartBadge` in the `nav-actions` area (`<!-- nav:actions -->`). Stores `pages-home-and-nav` patches the same file at `<!-- nav:links -->`; the serialized shell chain keeps these from colliding.
15
15
 
16
16
  Files this agent MUST NOT touch:
17
- - `src/components/CartView.tsx` — owned by `ecom-shared` (already written)
18
- - `src/components/CartBadge.tsx` — owned by `ecom-shared`
17
+ - `src/components/CartView.tsx`, `src/components/CartBadge.tsx` — the ecom islands; written earlier in this same merged agent (the `components` scope)
19
18
  - Any product page, home page, or stores-specific component
20
19
  - `global.css`, any designed component
21
20
 
@@ -100,8 +99,8 @@ Cart page → "Proceed to Checkout"
100
99
  ```json
101
100
  {
102
101
  "status": "complete",
103
- "phase": "ecom-pages",
104
- "scope": "ecom-pages",
102
+ "phase": "cart-checkout",
103
+ "scope": "cart-checkout",
105
104
  "summary": "Mounted CartView (client-only fetch); wired Purchase event; mounted CartBadge in Navigation",
106
105
  "data": {
107
106
  "pagesWired": 2,
@@ -117,4 +116,4 @@ Cart page → "Proceed to Checkout"
117
116
  ],
118
117
  "errors": []
119
118
  }
120
- ```
119
+ ```
@@ -1,8 +1,8 @@
1
1
  # Phase 3 Components — Ecom (TSX)
2
2
 
3
- Scope: `components`. Launched in **Step 4.5** (after Phase 2 Design System completes, parallel to stores components and the `components-css` sibling). Writes code that depends on the **design tokens** but NOT on Phase 4 page markup.
3
+ This is the **components** portion of the ecom **merged build agent** (the build wave — `BUILD-astro.md` § "Step 4.5"). Your agent writes these islands **first**, then the ecom pages (`cart.astro`, `thank-you.astro`) that mount them. The code here depends on the **design tokens** (read from `.wix/design-tokens.css` on disk) but NOT on page markup.
4
4
 
5
- > **CSS lives in a sibling scope.** `src/styles/components-ecom.css` is owned by the `components-css` scope (see `./COMPONENTS_CSS.md`), which runs concurrently with this one in the same Step 4.5 batch. This scope does NOT write the CSS file. Reference contract class names from the design tokens here; the CSS sibling defines the rules.
5
+ > **CSS is pre-copied, not authored.** `src/styles/components-ecom.css` ships from the skill template, copied by the orchestrator in the build-wave pre-batch (see `./COMPONENTS_CSS.md`). This scope does NOT write the CSS file. Reference its contract class names from the design tokens here; the pre-copied stylesheet defines the rules.
6
6
 
7
7
  ## Scope
8
8
 
@@ -20,7 +20,7 @@ Files this agent MUST NOT touch:
20
20
 
21
21
  ## Coordination: design tokens
22
22
 
23
- Your parent prompt includes the design tokens inline. Use it directly — do not read `.wix/design-tokens.css` + `.wix/site.d.ts` from disk.
23
+ Read the design tokens from `.wix/design-tokens.css` (on disk, gate-verified present before the wave).
24
24
 
25
25
  For layout/spacing/typography, compose Tailwind utilities derived from `@theme` tokens at the call site (`<div class="grid grid-cols-1 md:grid-cols-[1fr_22rem] gap-2xl">`). For published global semantic classes (`cart-summary`, `cart-total`, `checkout-btn`, `cart-empty` — the compound + interactive-state patterns), use the ACTUAL class name verbatim. Row-internal class names (`cart-item-qty`, `qty-btn`, etc.) come from the template — keep them as-is and live in `components-ecom.css`. See `references/shared/STYLING.md` and `references/shared/IMPLEMENTER.md` § "Styling: tokens-first, classes as exception".
26
26
 
@@ -67,7 +67,7 @@ Class names used (template provides them — do not invent):
67
67
 
68
68
  Use template `templates/CartBadge.tsx`.
69
69
 
70
- Mounted once in `Navigation.astro` (by `ecom-pages` scope). Shows cart item count; listens for `cart-updated` custom event.
70
+ Mounted once in `Navigation.astro` (by the `cart-checkout` scope). Shows cart item count; listens for `cart-updated` custom event.
71
71
 
72
72
  **No `initialCount` prop.** Cart is per-visitor — server-rendering the count breaks SSR caching. On mount, CartBadge reads the sessionStorage snapshot that CartView maintains (same `CART_CACHE_KEY`) to seed the initial count without a visible zero-flash between page navigations, then fetches fresh from the SDK and reconciles. If no snapshot exists (first-ever page load), count starts at 0 like before.
73
73
 
@@ -77,7 +77,7 @@ Contract keys: `cartBadge`, `cartBadgeCount`
77
77
 
78
78
  ### 3. `src/utils/analytics.ts` — not owned by this scope
79
79
 
80
- > `analytics.ts` is a shared utility (see `references/shared/analytics.ts`). Import from it (`import { trackEvent } from "../utils/analytics"`) but do not write it.
80
+ > `analytics.ts` is a shared utility (canonical source `shared-utilities/analytics.ts`, seeded to `src/utils/analytics.ts`). Import from it (`import { trackEvent } from "../utils/analytics"`) but do not write it.
81
81
 
82
82
  ### 4. `src/styles/components-ecom.css` — not owned by this scope
83
83
 
@@ -100,4 +100,4 @@ Contract keys: `cartBadge`, `cartBadgeCount`
100
100
  ],
101
101
  "errors": []
102
102
  }
103
- ```
103
+ ```
@@ -1,6 +1,6 @@
1
1
  # Phase 3 Components-CSS — Ecom
2
2
 
3
- Sibling of the `components` scope. Launched in **Step 4.5** in the same concurrent batch — runs in parallel with the TSX work, stores components, gift-cards components, and Image Phase 2.
3
+ **This stylesheet is pre-copied from the skill template by the orchestrator** (build-wave pre-batch, BUILD-astro.md § "Step 4.5") — there is no `components-css` subagent to dispatch. This file documents the CSS for reference so the ecom `components` scope (in the merged build agent) knows the class-name surface it targets.
4
4
 
5
5
  ## What this scope owns
6
6
 
@@ -19,11 +19,11 @@ Exactly one file:
19
19
 
20
20
  You only need:
21
21
 
22
- 1. **`<SKILL_ROOT>/templates/ecom/components-ecom.css`** — the canonical template. Read it once.
22
+ 1. **`<SKILL_ROOT>/references/astro/templates/ecom/components-ecom.css`** — the canonical template. Read it once.
23
23
  2. **`<SKILL_ROOT>/references/shared/STYLING.md`** — the styling-contract conventions (how to use `@apply`, the `@theme` token utilities, the no-default-Tailwind-colors rule, and the global-vs-scoped CSS ownership boundary).
24
24
  3. **`<SKILL_ROOT>/references/shared/RETURN_CONTRACT.md`** — the return JSON shape.
25
25
  4. **`src/styles/global.css`** in the project — read to audit for ecom-class leaks (see § "Global-CSS leak audit" below).
26
- 5. **Design tokens (inline in your prompt)** — the parent skill pastes the full `designTokens` JSON into your dispatch prompt. Use it directly; do NOT read `.wix/design-tokens.css` or `.wix/site.d.ts` from disk.
26
+ 5. **Design tokens (on disk)** — read the design tokens (the DESIGN.md vocabulary — `colors`/`typography`/`spacing`/`rounded`/`containers`) from `.wix/design-tokens.css` (gate-verified present before the wave). They are NOT inlined in your prompt.
27
27
 
28
28
  You do NOT need to read `INSTRUCTIONS.md`, `CART_WIRING.md`, the TSX templates, the `discounts.ts` util, or any other reference. Skipping those reads is the point of the split.
29
29
 
@@ -32,7 +32,7 @@ You do NOT need to read `INSTRUCTIONS.md`, `CART_WIRING.md`, the TSX templates,
32
32
  ### 1. Read the template
33
33
 
34
34
  ```
35
- <SKILL_ROOT>/templates/ecom/components-ecom.css
35
+ <SKILL_ROOT>/references/astro/templates/ecom/components-ecom.css
36
36
  ```
37
37
 
38
38
  This is the canonical scoped CSS for the ecom pack. Adapt sizing/spacing to the brand's aesthetic — use the design tokens from your prompt (`--color-bark`, `--color-cream`, `--spacing-md`, `--font-display`, etc.). **Do not rename the class names or state modifiers** — they must match the contract keys the TSX components reference.
@@ -85,7 +85,7 @@ Write the adapted CSS to `src/styles/components-ecom.css`. The orchestrator's po
85
85
 
86
86
  ## Coordination: design tokens
87
87
 
88
- Your parent prompt includes the design tokens JSON inline. Use it directly — do **not** read `.wix/design-tokens.css` or `.wix/site.d.ts` from disk and do not poll for them.
88
+ Read the design tokens from `.wix/design-tokens.css` (on disk, gate-verified present before the wave) — they are NOT inlined in your prompt.
89
89
 
90
90
  ## Return format
91
91
 
@@ -129,4 +129,4 @@ If a leak was found and overridden, include `errors: [{code: "GLOBAL_CSS_LEAK",
129
129
  | `@apply btn-primary` on `.checkout-btn` | Tailwind v4 only `@apply`s `@utility` declarations, not plain CSS rules — build fails. Either repeat the properties manually or compose via `composes` |
130
130
  | Rename a class because the brand is "more elegant" with kebab variants | Class names are contract keys; renaming breaks every TSX import that references them |
131
131
  | Skip the leak audit | Skipping ships double-defined rules; the audit is < 5 s and prevents downstream visual regressions |
132
- | Drop the `@reference` directives | Tailwind v4 needs both — without them, `@apply size-6` and similar fail at build |
132
+ | Drop the `@reference` directives | Tailwind v4 needs both — without them, `@apply size-6` and similar fail at build |
@@ -12,31 +12,28 @@ Build a complete form feature using `@wix/forms` — server-side schema fetching
12
12
 
13
13
  ## Prerequisites
14
14
 
15
- - Wix Forms app must be installed on the site (via MCP after scaffolding, or manually in Wix dashboard)
15
+ - Wix Forms app must be installed on the site (installed via the apps-installer REST endpoint after scaffolding, or manually in the Wix dashboard)
16
16
  - `@wix/forms` package installed: `npm install @wix/forms`
17
17
 
18
- > **Forms are auto-created during scaffolding.** When scaffolding with a forms template (e.g., the Registration template `e5d63bf1-cd06-48eb-ad77-0da9235adcf1`), a form is automatically created on the site with server-side privileges. Use `forms.listForms("wix.form_app.form")` with `auth.elevate` to discover it — no manual form ID needed. If no forms exist, use the MCP-assisted Form Setup below to create one (the Create Form API is not available to headless SDK calls, but MCP credentials can create forms).
18
+ > **Forms are auto-created during scaffolding.** When scaffolding with a forms template (e.g., the Registration template `e5d63bf1-cd06-48eb-ad77-0da9235adcf1`), a form is automatically created on the site with server-side privileges. Use `forms.listForms("wix.form_app.form")` with `auth.elevate` to discover it — no manual form ID needed. If no forms exist, use the REST API Form Setup below to create one (the Create Form API is not available to headless SDK calls, but the CLI-minted REST token can create forms).
19
19
 
20
- ## Form Setup (MCP-Assisted)
20
+ ## Form Setup (REST)
21
21
 
22
- Before writing any form code, ensure a contact form exists on the site via MCP:
22
+ Before writing any form code, ensure a contact form exists on the site via the form-schema REST API:
23
23
 
24
- 1. **List forms** — `CallWixSiteAPI: GET https://www.wixapis.com/form-schema-service/v4/forms?namespace=wix.form_app.form`
24
+ 1. **List forms** — `REST: GET https://www.wixapis.com/form-schema-service/v4/forms?namespace=wix.form_app.form`
25
25
  2. **If the API returns a "missing installed app" error** → install the Wix Forms app:
26
26
  ```
27
- CallWixSiteAPI: POST https://www.wixapis.com/apps-installer-service/v1/app-instance/install
27
+ REST: POST https://www.wixapis.com/apps-installer-service/v1/app-instance/install
28
28
  body: {
29
29
  "tenant": { "tenantType": "SITE", "id": "<siteId>" },
30
30
  "appInstance": { "appDefId": "225dd912-7dea-4738-8688-4b8c6955ffc2", "enabled": true }
31
31
  }
32
32
  ```
33
- > Translate this prose-HTTP form into the full `CallWixSiteAPI` tool-call shape — include `siteId`, `reason`, `sourceDocUrl` wrapper fields and pass `body` as a real object (NOT a stringified JSON). See `../../shared/MCP_PREFIX.md` § "CallWixSiteAPI call conventions".
33
+ > Translate this prose-HTTP form into the full `curl` tool-call shape — pass `body` as JSON in `-d` (NOT a stringified JSON). See `../../shared/AUTHENTICATION.md` for the standard REST headers.
34
34
 
35
35
  Then retry listing forms.
36
- 3. **If forms list is empty** → create a form (two-step atomic operation):
37
- - **Step 3a:** POST to create the form (fields, layout, submit settings)
38
- - **Step 3b:** Immediately PATCH to add `postSubmissionTriggers` (the POST silently drops this field — see step 4)
39
- - Both steps must succeed. If 3a succeeds but 3b fails, log Status as `partial`.
36
+ 3. **If forms list is empty** → create a form. This is a two-step atomic operation (POST to create, then PATCH to add `postSubmissionTriggers`) — see step 4 for the full procedure and rationale.
40
37
 
41
38
  > **Namespace propagation:** If form creation fails with `UNSUPPORTED_FORM_NAMESPACE` immediately after installing the Forms app, the namespace hasn't propagated yet. Wait 10 seconds and retry up to 3 times. Do NOT silently fall back to static field definitions — forms without a `formId` cannot submit to Wix.
42
39
 
@@ -125,9 +122,9 @@ Before writing any form code, ensure a contact form exists on the site via MCP:
125
122
  }
126
123
  ```
127
124
 
128
- Full MCP call structure:
125
+ Full REST call structure:
129
126
  ```
130
- CallWixSiteAPI: POST https://www.wixapis.com/form-schema-service/v4/forms
127
+ REST: POST https://www.wixapis.com/form-schema-service/v4/forms
131
128
  body: {
132
129
  "form": {
133
130
  "formFields": [ <selected fields from above> ],
@@ -162,7 +159,7 @@ Before writing any form code, ensure a contact form exists on the site via MCP:
162
159
  - PATCH using the procedure in step 5 below
163
160
  5. **If forms already exist** → verify the form has `postSubmissionTriggers.upsertContact`. This field is **critical** — without it, submissions are recorded but no Contact is created in the CRM. If missing, patch the form to add it:
164
161
  ```
165
- CallWixSiteAPI: PATCH https://www.wixapis.com/form-schema-service/v4/forms/<formId>
162
+ REST: PATCH https://www.wixapis.com/form-schema-service/v4/forms/<formId>
166
163
  body: {
167
164
  "form": {
168
165
  "revision": "<current revision from GET>",
@@ -194,7 +191,7 @@ Before writing any form code, ensure a contact form exists on the site via MCP:
194
191
 
195
192
  ### 1. Modify the Existing Designed Page
196
193
 
197
- **Do NOT create a new page from scratch.** The design skill already created this page with branded styling, layout, and a `<style>` block. Modify it in place:
194
+ **Do NOT create a new page from scratch.** The merged `contact-page` scope writes this page once — branded styling, layout, and `<style>` block alongside the form wiring (per `references/astro/designer/INSTRUCTIONS.md` → `contact-page`). When wiring an existing designed page, modify it in place:
198
195
 
199
196
  1. **Add SDK imports** to the frontmatter:
200
197
  ```astro
@@ -262,7 +259,7 @@ The React island must match the designed component's class names and use CSS var
262
259
 
263
260
  **Approach B: Component owns its styles using CSS variables.** If the page doesn't have a `<style>` block for the form, the component includes a `<style>` JSX element using only CSS custom properties.
264
261
 
265
- > **Styling note:** The React island uses the styling contract class names (`.form-container`, `.form-field`, `.form-label`, `.form-input`, `.form-textarea`, `.form-button`, `.form-success`, `.form-error`, `.form-field-error`, `.form-input-error`) from the designed ContactForm component's `<style is:global>` block. See the design skill's `COMPONENT_PATTERNS.md` → Contact Form.
262
+ > **Styling note:** The React island uses the styling contract class names (`.form-container`, `.form-field`, `.form-label`, `.form-input`, `.form-textarea`, `.form-button`, `.form-success`, `.form-error`, `.form-field-error`, `.form-input-error`) from the designed ContactForm component's `<style is:global>` block. See `references/shared/STYLING.md` (Contact Form).
266
263
 
267
264
  ```tsx
268
265
  import { useState } from "react";
@@ -342,7 +339,7 @@ export default function ContactForm({ formId, fields }: ContactFormProps) {
342
339
  Uses styling contract classes: .form-container, .form-field, .form-label,
343
340
  .form-input, .form-select, .form-textarea, .form-button, .form-error,
344
341
  .form-field-error, .form-input-error.
345
- See design skill's COMPONENT_PATTERNS.md → Contact Form. */}
342
+ See references/shared/STYLING.md (Contact Form). */}
346
343
 
347
344
  {fields.map((field) => (
348
345
  <div key={field.target} className="form-field">
@@ -411,7 +408,7 @@ export default function ContactForm({ formId, fields }: ContactFormProps) {
411
408
  }
412
409
  ```
413
410
 
414
- > **Adapting class names:** The class names above (`form-container`, `form-field`, `form-label`, `form-input`, `form-button`, `form-success`, `form-error`, `form-field-error`, `form-input-error`) are defaults. If the designed component uses different class names, use those instead — the styling contract from the design skill takes precedence.
411
+ > **Adapting class names:** The class names above (`form-container`, `form-field`, `form-label`, `form-input`, `form-button`, `form-success`, `form-error`, `form-field-error`, `form-input-error`) are defaults. If the designed component uses different class names, use those instead — the styling contract from the page's own design takes precedence.
415
412
 
416
413
  ## Discovering Forms
417
414
 
@@ -427,7 +424,7 @@ const wixForm = listResult.forms?.[0];
427
424
  const formId = wixForm?._id;
428
425
  ```
429
426
 
430
- If no forms exist, use the MCP-assisted Form Setup section above to create one via `CallWixSiteAPI`. If MCP is not available, create one in the Wix dashboard (Forms section → Add New Form).
427
+ If no forms exist, use the REST API Form Setup section above to create one via `curl`. If curl auth is not available, create one in the Wix dashboard (Forms section → Add New Form).
431
428
 
432
429
  ## Form Field Schema (SDK Types)
433
430
 
@@ -458,20 +455,9 @@ field.inputOptions.stringOptions.phoneInputOptions?.label // label for phone
458
455
 
459
456
  Custom fields use UUID-based targets from the form schema.
460
457
 
461
- ## Log Results
462
-
463
- After form verification, write a sidecar file at `.wix/logs/forms-data.md` (form schema setup) or `.wix/logs/forms-implementer.md` (Phase 2 wiring) — see `../../shared/LIFECYCLE_LOG.md` for the sidecar contract. Do **not** append to `.wix/lifecycle.log.md` directly — the orchestrator concatenates all sidecars at the end. Use a `####` heading so the entry nests under `### features-orchestrator` in the assembled log:
464
-
465
- ```markdown
466
- ## forms
467
- - Status: complete
468
- - Content: "{form name}" form created (fields: {field list})
469
- - Images: not applicable
470
- ```
471
-
472
458
  ## Testing
473
459
 
474
- 1. Run `npx @wix/cli dev`
460
+ 1. Run `npx @wix/cli@latest dev`
475
461
  2. Navigate to `/contact`
476
462
  3. Fill in the form and submit
477
- 4. Check the Wix dashboard → Forms → Submissions to verify the data arrived
463
+ 4. Check the Wix dashboard → Forms → Submissions to verify the data arrived