@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.
Files changed (220) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +111 -0
  3. package/package.json +29 -0
  4. package/skills/wix-app/SKILL.md +344 -0
  5. package/skills/wix-app/references/APP_IDENTIFIERS.md +35 -0
  6. package/skills/wix-app/references/APP_MARKET_REVIEW.md +311 -0
  7. package/skills/wix-app/references/APP_VALIDATION.md +171 -0
  8. package/skills/wix-app/references/BACKEND_API.md +233 -0
  9. package/skills/wix-app/references/BACKEND_EVENT.md +116 -0
  10. package/skills/wix-app/references/CODE_QUALITY.md +33 -0
  11. package/skills/wix-app/references/CUSTOM_ELEMENT_WIDGET.md +587 -0
  12. package/skills/wix-app/references/DASHBOARD_MENU_PLUGIN.md +157 -0
  13. package/skills/wix-app/references/DASHBOARD_MODAL.md +283 -0
  14. package/skills/wix-app/references/DASHBOARD_PAGE.md +403 -0
  15. package/skills/wix-app/references/DASHBOARD_PLUGIN.md +205 -0
  16. package/skills/wix-app/references/DATA_COLLECTION.md +451 -0
  17. package/skills/wix-app/references/DOCUMENTATION.md +42 -0
  18. package/skills/wix-app/references/EDITOR_REACT_COMPONENT.md +65 -0
  19. package/skills/wix-app/references/EMBEDDED_SCRIPT.md +468 -0
  20. package/skills/wix-app/references/EXTENSION_REGISTRATION.md +96 -0
  21. package/skills/wix-app/references/SERVICE_PLUGIN.md +235 -0
  22. package/skills/wix-app/references/SITE_PLUGIN.md +436 -0
  23. package/skills/wix-app/references/STORES_VERSIONING.md +334 -0
  24. package/skills/wix-app/references/backend-event/COMMON-EVENTS.md +84 -0
  25. package/skills/wix-app/references/custom-element-widget/SETTINGS_PANEL.md +345 -0
  26. package/skills/wix-app/references/dashboard-menu-plugin/blog-slots.md +71 -0
  27. package/skills/wix-app/references/dashboard-menu-plugin/bookings-slots.md +58 -0
  28. package/skills/wix-app/references/dashboard-menu-plugin/crm-slots.md +8 -0
  29. package/skills/wix-app/references/dashboard-menu-plugin/ecommerce-slots.md +17 -0
  30. package/skills/wix-app/references/dashboard-menu-plugin/events-slots.md +29 -0
  31. package/skills/wix-app/references/dashboard-menu-plugin/restaurants-slots.md +27 -0
  32. package/skills/wix-app/references/dashboard-menu-plugin/stores-slots.md +35 -0
  33. package/skills/wix-app/references/dashboard-page/API_SPEC.md +138 -0
  34. package/skills/wix-app/references/dashboard-page/DASHBOARD_API.md +573 -0
  35. package/skills/wix-app/references/dashboard-page/DYNAMIC_PARAMETERS.md +269 -0
  36. package/skills/wix-app/references/dashboard-page/ECOM_NAVIGATION.md +164 -0
  37. package/skills/wix-app/references/dashboard-plugin/SLOTS.md +294 -0
  38. package/skills/wix-app/references/data-collection/WIX_DATA.md +270 -0
  39. package/skills/wix-app/references/data-collection/extension-template.ts +107 -0
  40. package/skills/wix-app/references/editor-react-component/ACCESSIBILITY.md +138 -0
  41. package/skills/wix-app/references/editor-react-component/COMPONENT-API.md +454 -0
  42. package/skills/wix-app/references/editor-react-component/COMPONENT-CONFIGURATION.md +165 -0
  43. package/skills/wix-app/references/editor-react-component/CSS-GUIDELINES.md +576 -0
  44. package/skills/wix-app/references/editor-react-component/DIRECTIONALITY.md +170 -0
  45. package/skills/wix-app/references/editor-react-component/EDIT-FLOW.md +6 -0
  46. package/skills/wix-app/references/editor-react-component/PARTS.md +25 -0
  47. package/skills/wix-app/references/editor-react-component/PROPS-VS-CSS.md +203 -0
  48. package/skills/wix-app/references/editor-react-component/REACT-GUIDELINES.md +167 -0
  49. package/skills/wix-app/references/editor-react-component/REACT-PATTERNS.md +137 -0
  50. package/skills/wix-app/references/service-plugin/ADDITIONAL-FEES.md +112 -0
  51. package/skills/wix-app/references/service-plugin/BOOKINGS-STAFF-SORTING.md +118 -0
  52. package/skills/wix-app/references/service-plugin/DISCOUNT-TRIGGERS.md +87 -0
  53. package/skills/wix-app/references/service-plugin/GIFT-CARDS.md +86 -0
  54. package/skills/wix-app/references/service-plugin/PAYMENT-SETTINGS.md +135 -0
  55. package/skills/wix-app/references/service-plugin/SHIPPING-RATES.md +79 -0
  56. package/skills/wix-app/references/service-plugin/VALIDATIONS.md +68 -0
  57. package/skills/wix-app/references/site-plugin/EXAMPLES.md +311 -0
  58. package/skills/wix-app/references/site-plugin/SLOTS.md +263 -0
  59. package/skills/wix-design-system/SKILL.md +129 -0
  60. package/skills/wix-design-system/references/file-structure.md +56 -0
  61. package/skills/wix-design-system/scripts/wds.cjs +531 -0
  62. package/skills/wix-headless/SKILL.md +418 -0
  63. package/skills/wix-headless/references/DISCOVERY.md +332 -0
  64. package/skills/wix-headless/references/ORCHESTRATION.md +269 -0
  65. package/skills/wix-headless/references/SETUP.md +154 -0
  66. package/skills/wix-headless/references/blog/BLOG_CONTENT.md +152 -0
  67. package/skills/wix-headless/references/blog/BLOG_PAGES.md +299 -0
  68. package/skills/wix-headless/references/blog/BLOG_SETUP.md +218 -0
  69. package/skills/wix-headless/references/blog/INSTRUCTIONS.md +32 -0
  70. package/skills/wix-headless/references/cms/CMS_FOUNDATIONS.md +373 -0
  71. package/skills/wix-headless/references/cms/FAQ_KNOWLEDGE_BASE.md +229 -0
  72. package/skills/wix-headless/references/cms/INSTRUCTIONS.md +40 -0
  73. package/skills/wix-headless/references/cms/PORTFOLIO.md +454 -0
  74. package/skills/wix-headless/references/cms/RESOURCE_LIBRARY.md +356 -0
  75. package/skills/wix-headless/references/cms/TEAM_DIRECTORY.md +299 -0
  76. package/skills/wix-headless/references/commands/install-app.md +42 -0
  77. package/skills/wix-headless/references/commands/known-apps.json +5 -0
  78. package/skills/wix-headless/references/commands/mcp-bootstrap.md +28 -0
  79. package/skills/wix-headless/references/designer/INSTRUCTIONS.md +828 -0
  80. package/skills/wix-headless/references/ecom/CART_PAGES.md +120 -0
  81. package/skills/wix-headless/references/ecom/CART_WIRING.md +103 -0
  82. package/skills/wix-headless/references/ecom/COMPONENTS_CSS.md +132 -0
  83. package/skills/wix-headless/references/ecom/INSTRUCTIONS.md +59 -0
  84. package/skills/wix-headless/references/forms/CONTACT_FORM.md +477 -0
  85. package/skills/wix-headless/references/forms/INSTRUCTIONS.md +43 -0
  86. package/skills/wix-headless/references/gift-cards/COMPONENTS.md +119 -0
  87. package/skills/wix-headless/references/gift-cards/INSTRUCTIONS.md +51 -0
  88. package/skills/wix-headless/references/gift-cards/PAGES.md +129 -0
  89. package/skills/wix-headless/references/images/INSTRUCTIONS.md +359 -0
  90. package/skills/wix-headless/references/shared/BUILD_NOISE.md +8 -0
  91. package/skills/wix-headless/references/shared/IMAGE_GENERATION.md +185 -0
  92. package/skills/wix-headless/references/shared/IMPLEMENTER.md +155 -0
  93. package/skills/wix-headless/references/shared/MCP_PREFIX.md +105 -0
  94. package/skills/wix-headless/references/shared/PRODUCTION_SHARP_EDGES.md +97 -0
  95. package/skills/wix-headless/references/shared/RETURN_CONTRACT.md +423 -0
  96. package/skills/wix-headless/references/shared/STYLING.md +117 -0
  97. package/skills/wix-headless/references/stores/BACK_IN_STOCK.md +178 -0
  98. package/skills/wix-headless/references/stores/CATEGORY_PAGES.md +86 -0
  99. package/skills/wix-headless/references/stores/COMPONENTS_CSS.md +129 -0
  100. package/skills/wix-headless/references/stores/HOME_AND_NAV.md +227 -0
  101. package/skills/wix-headless/references/stores/INSTRUCTIONS.md +96 -0
  102. package/skills/wix-headless/references/stores/PRODUCT_CATALOG_DATA.md +249 -0
  103. package/skills/wix-headless/references/stores/PRODUCT_PAGES.md +213 -0
  104. package/skills/wix-headless/references/stores/SHARED_WIRING.md +164 -0
  105. package/skills/wix-headless/references/verticals/_schema.json +160 -0
  106. package/skills/wix-headless/references/verticals/_schema.md +185 -0
  107. package/skills/wix-headless/references/verticals/blog.md +125 -0
  108. package/skills/wix-headless/references/verticals/cms.md +121 -0
  109. package/skills/wix-headless/references/verticals/ecom.md +96 -0
  110. package/skills/wix-headless/references/verticals/forms.md +106 -0
  111. package/skills/wix-headless/references/verticals/gift-cards.md +121 -0
  112. package/skills/wix-headless/references/verticals/stores.md +167 -0
  113. package/skills/wix-headless/scripts/check-manifest.mjs +198 -0
  114. package/skills/wix-headless/scripts/copy-utility-templates.mjs +153 -0
  115. package/skills/wix-headless/scripts/emit-design-tokens.mjs +77 -0
  116. package/skills/wix-headless/scripts/finalize-run-json.mjs +141 -0
  117. package/skills/wix-headless/scripts/init-site-json.mjs +63 -0
  118. package/skills/wix-headless/scripts/patch-decorative-slots.mjs +124 -0
  119. package/skills/wix-headless/scripts/plan-entity-image-waves.mjs +190 -0
  120. package/skills/wix-headless/scripts/preview.sh +45 -0
  121. package/skills/wix-headless/scripts/release.sh +73 -0
  122. package/skills/wix-headless/scripts/scaffold.sh +53 -0
  123. package/skills/wix-headless/scripts/seed-utilities.sh +55 -0
  124. package/skills/wix-headless/shared-utilities/analytics.ts +40 -0
  125. package/skills/wix-headless/shared-utilities/ricos.ts +179 -0
  126. package/skills/wix-headless/shared-utilities/wix-image.ts +72 -0
  127. package/skills/wix-headless/templates/ecom/CartBadge.tsx +84 -0
  128. package/skills/wix-headless/templates/ecom/CartView.tsx +543 -0
  129. package/skills/wix-headless/templates/ecom/cart.astro +13 -0
  130. package/skills/wix-headless/templates/ecom/components-ecom.css +215 -0
  131. package/skills/wix-headless/templates/ecom/discounts.ts +71 -0
  132. package/skills/wix-headless/templates/ecom/thank-you.astro +24 -0
  133. package/skills/wix-headless/templates/gift-cards/GiftCardPurchase.tsx +172 -0
  134. package/skills/wix-headless/templates/gift-cards/_home-teaser-snippet.astro +42 -0
  135. package/skills/wix-headless/templates/gift-cards/_nav-snippet.astro +11 -0
  136. package/skills/wix-headless/templates/gift-cards/components-gift-cards.css +219 -0
  137. package/skills/wix-headless/templates/gift-cards/gift-cards.astro +51 -0
  138. package/skills/wix-headless/templates/gift-cards/gift-cards.ts +75 -0
  139. package/skills/wix-headless/templates/stores/AddToCartButton.tsx +77 -0
  140. package/skills/wix-headless/templates/stores/BackInStockForm.tsx +176 -0
  141. package/skills/wix-headless/templates/stores/CategoryRail.astro +69 -0
  142. package/skills/wix-headless/templates/stores/ProductCard.astro +79 -0
  143. package/skills/wix-headless/templates/stores/ProductPurchase.tsx +397 -0
  144. package/skills/wix-headless/templates/stores/SeoTags.astro +21 -0
  145. package/skills/wix-headless/templates/stores/back-in-stock.ts +67 -0
  146. package/skills/wix-headless/templates/stores/categories.ts +155 -0
  147. package/skills/wix-headless/templates/stores/category/[slug].astro +130 -0
  148. package/skills/wix-headless/templates/stores/components-stores.css +295 -0
  149. package/skills/wix-headless/templates/stores/products/[slug].astro +128 -0
  150. package/skills/wix-headless/templates/stores/products/index.astro +101 -0
  151. package/skills/wix-manage/SKILL.md +280 -0
  152. package/skills/wix-manage/references/app-installation/install-wix-apps.md +155 -0
  153. package/skills/wix-manage/references/app-installation/list-installed-apps.md +124 -0
  154. package/skills/wix-manage/references/blog/how-to-create-blog-posts.md +226 -0
  155. package/skills/wix-manage/references/bookings/booking-service-policy-setup.md +95 -0
  156. package/skills/wix-manage/references/bookings/booking-system-integration-gaps.md +416 -0
  157. package/skills/wix-manage/references/bookings/bookings-staff-setup.md +255 -0
  158. package/skills/wix-manage/references/bookings/create-and-update-booking-services.md +462 -0
  159. package/skills/wix-manage/references/bookings/end-to-end-booking-flow.md +278 -0
  160. package/skills/wix-manage/references/bookings/external-calendar-integration.md +258 -0
  161. package/skills/wix-manage/references/bookings/multi-resource-service-creation.md +231 -0
  162. package/skills/wix-manage/references/calendar/configure-default-business-hours.md +226 -0
  163. package/skills/wix-manage/references/cms/cms-data-items-crud.md +422 -0
  164. package/skills/wix-manage/references/cms/cms-data-operations-extended.md +263 -0
  165. package/skills/wix-manage/references/cms/cms-ecommerce-catalog-integration.md +136 -0
  166. package/skills/wix-manage/references/cms/cms-references-and-relationships.md +160 -0
  167. package/skills/wix-manage/references/cms/cms-schema-management.md +143 -0
  168. package/skills/wix-manage/references/contacts/bulk-delete-contacts.md +73 -0
  169. package/skills/wix-manage/references/contacts/bulk-label-and-unlabel-contacts.md +67 -0
  170. package/skills/wix-manage/references/domains/domain-search-and-purchase.md +434 -0
  171. package/skills/wix-manage/references/ecommerce/api-recommendation-tracking.md +420 -0
  172. package/skills/wix-manage/references/ecommerce/flow-add-free-shipping.md +267 -0
  173. package/skills/wix-manage/references/ecommerce/flow-bundle-and-save.md +290 -0
  174. package/skills/wix-manage/references/ecommerce/flow-fix-coverage-gaps.md +300 -0
  175. package/skills/wix-manage/references/ecommerce/flow-optimize-shipping-rates.md +364 -0
  176. package/skills/wix-manage/references/ecommerce/flow-seasonal-promotion.md +315 -0
  177. package/skills/wix-manage/references/ecommerce/flow-stock-mover.md +308 -0
  178. package/skills/wix-manage/references/ecommerce/flow-upsell-boost.md +271 -0
  179. package/skills/wix-manage/references/ecommerce/goal-clear-inventory.md +118 -0
  180. package/skills/wix-manage/references/ecommerce/goal-drive-cross-sells.md +122 -0
  181. package/skills/wix-manage/references/ecommerce/goal-increase-aov.md +132 -0
  182. package/skills/wix-manage/references/ecommerce/goal-reduce-cart-abandonment.md +148 -0
  183. package/skills/wix-manage/references/ecommerce/goal-seasonal-revenue.md +146 -0
  184. package/skills/wix-manage/references/ecommerce/guardrail-discount-conflicts.md +118 -0
  185. package/skills/wix-manage/references/ecommerce/guardrail-margin-protection.md +88 -0
  186. package/skills/wix-manage/references/ecommerce/guardrail-rate-pricing-sanity.md +108 -0
  187. package/skills/wix-manage/references/ecommerce/guardrail-shipping-health.md +124 -0
  188. package/skills/wix-manage/references/ecommerce/recipe-apply-shipping-recommendations.md +299 -0
  189. package/skills/wix-manage/references/ecommerce/recommend-ecommerce-strategy.md +582 -0
  190. package/skills/wix-manage/references/ecommerce/setup-coupons.md +338 -0
  191. package/skills/wix-manage/references/ecommerce/setup-discount-rules.md +444 -0
  192. package/skills/wix-manage/references/ecommerce/setup-shipping-rates.md +86 -0
  193. package/skills/wix-manage/references/ecommerce/setup-shipping-regions.md +56 -0
  194. package/skills/wix-manage/references/ecommerce/setup-store-pickup-location.md +209 -0
  195. package/skills/wix-manage/references/ecommerce/skill-graph.md +139 -0
  196. package/skills/wix-manage/references/ecommerce/troubleshoot-checkout-delivery-dropoff.md +124 -0
  197. package/skills/wix-manage/references/ecommerce/troubleshoot-discount-not-applying.md +95 -0
  198. package/skills/wix-manage/references/events/list-events.md +203 -0
  199. package/skills/wix-manage/references/forms/create-form.md +260 -0
  200. package/skills/wix-manage/references/get-paid/create-payment-links.md +212 -0
  201. package/skills/wix-manage/references/get-paid/how-to-setup-wix-payments.md +57 -0
  202. package/skills/wix-manage/references/get-paid/payment-links-for-bookings.md +101 -0
  203. package/skills/wix-manage/references/media/upload-media-to-wix.md +216 -0
  204. package/skills/wix-manage/references/pricing-plans/create-and-update-pricing-plans.md +77 -0
  205. package/skills/wix-manage/references/pricing-plans/pricing-plans-bookings-integration.md +166 -0
  206. package/skills/wix-manage/references/restaurants/wix-restaurants-setup.md +336 -0
  207. package/skills/wix-manage/references/rich-content/ricos-converter-service.md +295 -0
  208. package/skills/wix-manage/references/site-properties/change-payment-currency-site-properties.md +59 -0
  209. package/skills/wix-manage/references/sites/create-site-from-template.md +183 -0
  210. package/skills/wix-manage/references/sites/query-sites.md +125 -0
  211. package/skills/wix-manage/references/stores/add-store-pages-to-site.md +57 -0
  212. package/skills/wix-manage/references/stores/bulk-create-products-with-options.md +1041 -0
  213. package/skills/wix-manage/references/stores/create-product-catalog-v1.md +125 -0
  214. package/skills/wix-manage/references/stores/create-product-from-image.md +824 -0
  215. package/skills/wix-manage/references/stores/create-product-with-options-catalog-v3.md +566 -0
  216. package/skills/wix-manage/references/stores/find-products-query-and-search-catalog-v3.md +194 -0
  217. package/skills/wix-manage/references/stores/query-products-catalog-v1.md +80 -0
  218. package/skills/wix-manage/references/stores/setup-online-store-catalog-v3.md +99 -0
  219. package/skills/wix-manage/references/stores/update-product-pre-order.md +213 -0
  220. package/skills/wix-manage/references/stores/update-product-with-options.md +318 -0
@@ -0,0 +1,828 @@
1
+ ---
2
+ name: site-designer
3
+ description: "Designs and builds the visual layer for Wix Managed Headless sites: CSS, layouts, navigation, footer, and all page designs. Launched once per scope by the wix-headless skill. Foundation scope writes global.css, Layout.astro, Navigation.astro, Footer.astro, and returns designTokens JSON; the orchestrator deterministically emits .wix/site.d.ts + .wix/design-tokens.css from the merged JSON via <SKILL_ROOT>/scripts/emit-design-tokens.mjs."
4
+ ---
5
+
6
+ # Site Designer — Scope-Based Visual Design
7
+
8
+ Launched once per scope by the parent skill. Your prompt will contain a `Scope:` line naming exactly one of the scopes below. **Read only the section for your scope. Do not read sections for other scopes — wastes context and blurs ownership.**
9
+
10
+ You own **all visual output**: CSS, page layout, typography, color, spacing, component composition. Phase 4 vertical-pack agents own SDK wiring — they read your files and swap placeholder data for live queries without modifying your design.
11
+
12
+ ## Self-Loading
13
+
14
+ 1. Read `.wix/site.json` — current site manifest (brand, loaded verticals)
15
+ 2. Read `../shared/RETURN_CONTRACT.md` — structured return format
16
+ 3. Read `../shared/STYLING.md` — three styling categories (tokens-as-utilities, global semantic classes, co-located styles), ownership, and decision rules. The principle that governs what belongs in `global.css` versus what stays in markup as utilities.
17
+
18
+ No MCP calls required. Designer scopes are frontend-only — no `CallWixSiteAPI`, no MCP tool-discovery.
19
+
20
+ ## Scope Routing
21
+
22
+ The designer agent now has a single scope — `design-system`. The former page-design scopes (`home`, `static`, `store-pages`, `blog-pages`, `contact-page`) were retired in Step 3 of the architecture migration: each vertical's `pages` phase agent now writes its route files once with both visual design and data queries, eliminating the placeholder-then-rewrite pattern.
23
+
24
+ | Scope | Phase | Runs as | Output |
25
+ |-------|-------|---------|--------|
26
+ | `design-system` | Design System | foreground (critical path) | Files written: `src/styles/global.css`, `astro.config.mjs`, `src/layouts/Layout.astro`, `src/components/Navigation.astro` (shell with markers), `src/components/Footer.astro`, `src/pages/index.astro` (shell with markers). Returned (orchestrator merges into `.wix/site.json.designTokens`, then emits `.wix/design-tokens.css` + `.wix/site.d.ts` deterministically): `data.designTokens`. |
27
+
28
+ If your prompt is missing a `Scope:` line, stop and ask the parent — do not guess.
29
+
30
+ **Shell files with markers** — `Navigation.astro` and `index.astro` are scaffolded with named-marker comments (`<!-- nav:links -->`, `<!-- nav:actions -->`, `<!-- home:stores -->`, etc.) where each loaded vertical will insert its contribution during its Pages phase. Emit a marker ONLY if at least one loaded pack declares a matching `contributes:` entry — unused markers are dead HTML comments that confuse later editors. (Example: do NOT emit `<!-- home:cms -->` — the CMS pack owns the brand-story section directly; see `references/verticals/cms.md` frontmatter.) See architecture-proposal §5 for the contributes: pattern.
31
+
32
+ **Do NOT speculatively populate pack-owned slots.** Leave the marker line on its own with no preceding/following nav links, home sections, or teasers that a Phase 4 vertical agent owns. Specifically:
33
+ - In `Navigation.astro`, do NOT add a "Shop" link, a "Gift Cards" link, or a `<CartBadge />` mount — those belong to stores' `home-and-nav`, gift-cards' `pages`, and ecom's `pages` respectively, each at their own named marker. About / FAQ links to CMS pages are fine to place directly (CMS does not declare a `contributes:` entry for nav).
34
+ - In `src/pages/index.astro`, do NOT add a featured-products grid, a gift-cards teaser, or any pack-owned section above/below their markers. The hero, brand-story, and decorative-slot placeholders are yours; everything else is reserved.
35
+
36
+ If you place pack-owned content speculatively, the Phase 4 vertical agent inserts at its marker and the result is a duplicate (or — worse — the vertical agent removes your content trying to dedupe, then drops the marker, breaking the next vertical agent that runs against the same file). Leave markers empty.
37
+
38
+ **Disabled-pack route discipline.** Loaded packs with `disabled: true` (today: only `gift-cards`) ship dormant — their surfaces are runtime-gated by a per-request probe and only appear once the user enables the matching app from the Wix dashboard. Treat their routes as **not yet active** anywhere in your output:
39
+
40
+ - Do NOT add hero CTAs, footer links, brand-story callouts, closing-CTA buttons, or ANY other UI element pointing at a `disabled: true` pack's route. The pack's own `<!-- nav:links -->` and `<!-- home:<pack> -->` markers are the only acceptable touchpoints — and even those get gated by the pack's runtime probe in Phase 4, not by you.
41
+ - Disabled-pack routes (today: gift-cards when its dashboard app isn't enabled) must not surface as hero CTAs, footer links, or any other designer-emitted entry point. Users find these confusing — they click through and the feature doesn't exist.
42
+
43
+ The orchestrator's prompt names every loaded pack, but only packs WITHOUT `disabled: true` should influence visible UI. If your prompt's "Loaded packs" line includes e.g. `gift-cards`, treat that entry as code-only — its surfaces light up later via the marker patches, never via anything you write in the hero / footer / CTAs / brand-story.
44
+
45
+ ---
46
+
47
+ ## Scope: `design-system` (foreground, critical path)
48
+
49
+ **Tool call budget: target 9 calls** (2 reads for self-loading + 1 read of `.wix/site.json` + 6 writes — `global.css`, `astro.config.mjs`, `Layout.astro`, `Navigation.astro` shell, `Footer.astro`, `index.astro` shell). You no longer write `.wix/design-tokens.css` or `.wix/site.d.ts` — the orchestrator emits both deterministically from your returned `designTokens` JSON via `<SKILL_ROOT>/scripts/emit-design-tokens.mjs`. `site.json` is NOT one of your writes either — return your `designTokens` in the standard return `data` block and the orchestrator merges. Do NOT read existing project files, glob directories, or explore the scaffold — everything you need is in your prompt or in `.wix/site.json`.
50
+
51
+ You are the design system architect. Everything downstream depends on what you produce here. Your output sets the brand's visual identity (design tokens + typed manifest) and the class-name contract that every other agent references.
52
+
53
+ ### Inputs (from your prompt + .wix/site.json)
54
+
55
+ - **Brand name** and **description** — from `.wix/site.json.brand` (written by Setup).
56
+ - **Aesthetic direction** — 2–3 sentence design brief from discovery (in prompt).
57
+ - **Color palette** — hex codes (in prompt; you return these in `data.designTokens.colors` of your final return JSON — the orchestrator writes `site.json`).
58
+ - **Typography** — font pairing (display + body).
59
+ - **Mood** — personality and visual elements.
60
+ - **Page color strategy** — Uniform Light / Uniform Dark / Defined Hybrid.
61
+ - **Verticals loaded** — which packs are active (stores, cms, blog, forms).
62
+ - **Packs with components** — which packs will have a `components-<pack>.css` file (for Layout.astro imports).
63
+ - **Always-required global semantic classes** — derived from which packs are loaded (see § "Always-required global semantic classes" below). These are the principled exceptions where a class earns its place in `global.css`; everything else flows through tokens-as-utilities at the call site.
64
+
65
+ ### Outputs that matter to every downstream phase
66
+
67
+ - **`data.designTokens` in your return JSON** — populate `{ colors, fonts, radii, spacing }`. The orchestrator merges this into `.wix/site.json.designTokens` after your return arrives, then runs `<SKILL_ROOT>/scripts/emit-design-tokens.mjs`, which deterministically projects the JSON into both `.wix/design-tokens.css` (CSS custom properties) and `.wix/site.d.ts` (TypeScript types). You do not write either file yourself — the script is the single source of truth for both projections, and it can't drift the way agent-emitted CSS / TS could.
68
+ - Do **NOT** write `.wix/site.json` yourself either — Phase 1 Seeders run in parallel, and concurrent writes would clobber each other. The orchestrator owns site.json writes precisely to avoid that race; see `skills/wix-headless/SKILL.md` § Step 2 "`.wix/site.json` write contract".
69
+
70
+ **Token-key naming contract.** Because `emit-design-tokens.mjs` projects each group with a fixed prefix, your `designTokens` return must use the bare key (no prefix):
71
+
72
+ | Group | Your return keys | Emitted CSS variable |
73
+ |---|---|---|
74
+ | `colors` | `paper`, `accent`, `ink`, … | `--color-paper`, `--color-accent`, `--color-ink`, … |
75
+ | `fonts` | `display`, `body`, … | `--font-display`, `--font-body`, … |
76
+ | `radii` | `sm`, `md`, … | `--radius-sm`, `--radius-md`, … |
77
+ | `spacing` | `xs`, `sm`, `md`, `lg`, `xl`, `2xl`, `3xl`, `4xl`, … | `--spacing-xs`, `--spacing-sm`, … |
78
+
79
+ If you reference `class="py-4xl bg-paper text-ink"` in your shell markup, your `designTokens.spacing` must include a `4xl` entry, your `designTokens.colors` must include `paper` and `ink` entries — Tailwind v4 generates utilities from the emitted `--spacing-*` / `--color-*` variables, and silently drops references whose token isn't declared. This is the coverage check at the bottom of this section, just expressed as a JSON-key check rather than a CSS-grep.
80
+
81
+ The emitted files look like:
82
+
83
+ ```css
84
+ /* .wix/design-tokens.css — generated from .wix/site.json.designTokens. Do not edit. */
85
+ :root {
86
+ --color-paper: #FAF6EF;
87
+ --color-accent: #B49A78;
88
+ --font-display: "Fraunces", serif;
89
+ --font-body: "Inter", sans-serif;
90
+ --radius-md: 0.5rem;
91
+ --spacing-md: 1rem;
92
+ }
93
+ ```
94
+
95
+ ```ts
96
+ // .wix/site.d.ts — generated from .wix/site.json.designTokens. Do not edit.
97
+ export type Brand = { name: string; description: string };
98
+ export type DesignTokens = {
99
+ colors: Record<"paper" | "accent" | …, string>;
100
+ fonts: Record<"display" | "body", string>;
101
+ radii: Record<"sm" | "md" | …, string>;
102
+ spacing: Record<"xs" | "sm" | "md" | "lg" | …, string>;
103
+ };
104
+ export type Product = { id: string; name: string; slug: string; price: number; variantId: string };
105
+ export declare const site: {
106
+ brand: Brand;
107
+ designTokens: DesignTokens;
108
+ seeded: { products?: Product[]; posts?: unknown[]; collections?: Record<string, unknown[]> };
109
+ };
110
+ ```
111
+
112
+ ### What to produce (in this order)
113
+
114
+ #### 1. `src/styles/global.css`
115
+
116
+ The master stylesheet. Uses **Tailwind CSS v4** — CSS-first configuration with `@theme` for brand tokens. The token set is the contract; downstream agents compose tokens at call sites as Tailwind utilities (`class="py-4xl bg-sand"`). See `references/shared/STYLING.md` for the three styling categories and decision rules.
117
+
118
+ **Default direction.** Layout, spacing, typography, alignment, simple background/text color, and aspect-ratio decisions belong in markup as utilities — NOT as semantic classes in this file. If a "class" you're tempted to write would be expressible as 2–4 Tailwind utilities derived from `@theme`, do NOT create it; the markup composes those utilities directly. The bug pattern this avoids: when designer-side classes go undeclared, Tailwind v4 silently drops references in markup and the site ships with broken styling. Tokens-as-utilities makes that miss impossible — there's no class to forget.
119
+
120
+ **Reserve `global.css` rules for** (the principled exceptions):
121
+ - Compound multi-element patterns (cart summary's bordered card, offer-callout's structured panel)
122
+ - Interactive states crossing utility boundaries (`.btn-primary:hover`, `.product-card:hover .product-card-media > img`)
123
+ - JS/React DOM query targets (`.cart-badge`, `.product-card`)
124
+ - Cross-cutting decorative selectors (`[data-decorative-slot]`, `.editorial-rule`)
125
+
126
+ For one-off page decoration that doesn't fit any of the above, the page or component author writes a co-located `<style>` block at the bottom of their `.astro` file — don't pre-declare per-page decoration here.
127
+
128
+ **Structure (in this order):**
129
+
130
+ ```css
131
+ @import "tailwindcss";
132
+
133
+ @theme {
134
+ /* Brand palette — derived from your prompt's aesthetic direction */
135
+ --color-paper: #FAF6EF;
136
+ --color-paper-warm: #F2EBDF;
137
+ --color-ink: #1B1A17;
138
+ --color-ink-soft: #2E2C28;
139
+ --color-mute: #6B655B;
140
+ --color-rule: #D8CFBE;
141
+ --color-accent: #B49A78;
142
+ /* ... full palette including semantic roles */
143
+
144
+ /* Typography — Google Fonts loaded in Layout.astro <head> */
145
+ --font-display: "Fraunces", serif;
146
+ --font-body: "Inter", sans-serif;
147
+
148
+ /* Spacing scale — every step from 2xs through 4xl, minimum */
149
+ --spacing-2xs: 0.125rem;
150
+ --spacing-xs: 0.25rem;
151
+ --spacing-sm: 0.5rem;
152
+ --spacing-md: 1rem;
153
+ --spacing-lg: 1.5rem;
154
+ --spacing-xl: 2rem;
155
+ --spacing-2xl: 3rem;
156
+ --spacing-3xl: 5rem;
157
+ --spacing-4xl: 7rem;
158
+
159
+ /* Radii, shadows, transitions, eases as needed */
160
+ }
161
+
162
+ @layer base {
163
+ /* Resets and typography: *, body, h1–h6, p, a, button, input, img, ul/ol */
164
+ }
165
+
166
+ /* Global semantic classes — ONLY for compound patterns / interactive states / JS targets */
167
+ .btn-primary {
168
+ @apply inline-flex items-center justify-center px-lg py-md;
169
+ background: var(--color-ink); color: var(--color-paper);
170
+ border-radius: var(--radius-sm);
171
+ }
172
+ .btn-primary:hover:not(:disabled) { background: var(--color-accent); }
173
+ .btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
174
+
175
+ .product-card { transition: transform 400ms var(--ease-out); }
176
+ .product-card:hover { transform: translateY(-2px); }
177
+ .product-card:hover .product-card-media > img { transform: scale(1.03); }
178
+ ```
179
+
180
+ Contains:
181
+
182
+ - **`@import "tailwindcss"`** — must be the first line. Loads all Tailwind v4 utilities.
183
+ - **`@theme { }` block** — the token contract. Publish a complete set covering colors (full palette including semantic roles like `paper`, `paper-warm`, `cream`, `ink`, `ink-soft`, `mute`, `rule`, plus brand accents), font families (display, body, mono if needed), the spacing scale (every step from `2xs` through `4xl` minimum — pages will reference `py-4xl`, `mt-3xl`, `gap-sm` etc.), radii, shadows, transitions, and eases. Tailwind auto-generates utilities from these (`--color-bark` → `bg-bark`/`text-bark`/`border-bark`; `--spacing-4xl` → `py-4xl`/`mt-4xl`/`gap-4xl`). Derive every token from the aesthetic direction in your prompt — never use Tailwind's default color palette. **Token completeness is the contract** — if a value would be referenced anywhere in your shell markup or a downstream pack's typical page, it belongs as a token. Skipping a token forces downstream agents to invent classes (the failure mode this protocol exists to prevent).
184
+ - **`@layer base { }` block** — resets and base typography for `*`, `body`, `h1`–`h6`, `p`, `a`, `button`, `input`, `img`, `ul`/`ol`. Use `@apply` with brand-token utilities where possible.
185
+ - **Global semantic class rules** — only the principled exceptions listed above. Use `@apply` to compose Tailwind utilities for the token-derived properties; supplement with explicit CSS for state, position, transitions, etc. Include hover/focus/disabled states where appropriate for interactive elements.
186
+
187
+ **Tailwind v4 `@apply` constraint — custom classes are NOT @apply-able by default.** In v4 you can `@apply` built-in utilities (`px-4`, `text-amber`, `flex`) but NOT plain contract classes you defined earlier in the same file. The following **WILL fail the build** with `Cannot apply unknown utility class`:
188
+
189
+ ```css
190
+ /* WRONG — v4 rejects both */
191
+ .btn-primary { @apply btn bg-amber; } /* btn is a custom class */
192
+ .faq-section { @apply section container-reading; } /* both custom */
193
+ ```
194
+
195
+ Two correct patterns:
196
+
197
+ **Option A (preferred when ≥3 contract classes share the same base) — declare shared primitives with `@utility`:**
198
+ ```css
199
+ @utility btn {
200
+ @apply inline-flex items-center px-lg py-md rounded-md font-medium;
201
+ }
202
+ @utility section { @apply py-3xl; }
203
+
204
+ .btn-primary { @apply btn bg-amber text-walnut; } /* now OK */
205
+ .btn-secondary { @apply btn border-rule text-paper; } /* now OK */
206
+ ```
207
+
208
+ **Option B (preferred for a single variant) — inline the base rules into each contract class:**
209
+ ```css
210
+ .btn-primary {
211
+ @apply inline-flex items-center px-lg py-md rounded-md font-medium bg-amber text-walnut;
212
+ }
213
+ ```
214
+
215
+ Never write `@apply <custom-class-name>` unless `<custom-class-name>` is declared with `@utility`. The build validates this — a failing build is your signal.
216
+
217
+ **Tailwind v4 `@apply` forbidden patterns — collapse silently at runtime.** These DO build successfully but produce broken CSS because the utilities reference theme keys you didn't declare in `@theme`:
218
+
219
+ - **`@apply group`** — `group` is an interaction modifier target, not an applyable utility. Use `.parent:hover .child { … }` selectors instead. This fails the build with `Cannot apply unknown utility class 'group'`.
220
+ - **`@apply max-w-<name>`, `@apply w-<name>`, `@apply h-<name>`** when the `--container-*` / `--size-*` scale is NOT declared in your `@theme` block. Tailwind v4 resolves `max-w-md` to `var(--container-md)`; unset, the rule collapses to `min-content` — columns shrink to one word per line. Use explicit `max-width: 40ch` / `width: 28rem` in CSS.
221
+ - **Any Tailwind utility whose theme key you did not define in `@theme`.** If you add a color/font/spacing/container value to `@theme`, it may be referenced via `@apply`. Anything else must be written as explicit CSS (`margin-top: var(--spacing-xl); max-width: 40ch;`).
222
+
223
+ **Do NOT write CSS for `scoped` keys.** Those belong to Phase 3 Components agents who write `components-<pack>.css`. Writing scoped CSS here duplicates work and inflates the file.
224
+
225
+ **Pack-CSS token discipline.** If you're the designer writing `global.css` with a `--spacing-*` scale, the Phase 3 Components agents' `components-<pack>.css` files MUST use the same scale. Mismatched prefixes (e.g. designer ships `--spacing-*` but a pack CSS uses `--space-*`) collapse layouts at runtime — the undefined CSS vars resolve to nothing. Cross-reference your `@theme` token prefixes (`--spacing-*`, `--color-*`, etc.) with pack CSS templates; if a mismatch exists, flag it in your return JSON's `errors` array so the orchestrator can patch.
226
+
227
+ **Line budget:** target 150-300 lines. Soft warning at 500, hard cap 800. Under the tokens-as-utilities default, `global.css` shrinks dramatically — most layout/spacing/typography moves to markup. **If your file exceeds 500 lines:** open `references/shared/STYLING.md` § "What does NOT belong as a global semantic class" and self-audit your file against that list. If you find any scoped/component-only classes (e.g. `.product-card-*`, `.cart-summary`, `.offer-callout` family) that should live in `components-<pack>.css`, remove them and re-check the line count. **If, after removing all violations, the file is still over 500 lines and under 800:** ship it with `notes: [{code: "GLOBAL_CSS_OVER_TARGET", lines: <count>}]` in your return — this is fine, brand needed more cross-cutting rules than the budget assumed. **Only return `status: "partial"` with `errors: [{code: "GLOBAL_CSS_OVERBUDGET"}]` if you exceed 800 lines OR find scoped classes you cannot remove.**
228
+
229
+ > **NEVER rewrite `global.css` from scratch to fit the line count.** A measured rewrite cycle costs ~60 s of subagent wall time (the dominant cause of a 326 s vs 197 s DS regression observed in the 2026-05-05 Magnific run, where v1 was 654 lines and the agent rewrote to 321). The line budget is a soft signal to audit for leaks, not a build constraint — every legitimate cross-cutting rule between 500 and 800 lines ships fine with `notes: [{code: "GLOBAL_CSS_OVER_TARGET"}]`. Only the audit-and-remove-leaks pass is allowed when over 500; full regenerations are not. If you are tempted to rewrite, that means the audit failed to find enough leaks — which is the signal to ship at the current line count, not to start over.
230
+
231
+ **Coverage rule.** Two checks before returning:
232
+
233
+ 1. **Token completeness.** Every spacing/color/font/radius value referenced in your shell markup (`index.astro`, `Layout.astro`, `Navigation.astro`, `Footer.astro`) must exist as a token in `@theme`. If you wrote `class="py-4xl"`, then `--spacing-4xl` must be declared — Tailwind v4 generates the utility from the token, and silently omits it if the token is absent.
234
+ 2. **Always-required class rules.** Every class on the principled retained list below (when its pack is loaded) must have a rule. Verify with the grep checks at the end of each section.
235
+
236
+ If a check fails, STOP — fix and re-verify rather than shipping a partial global.css.
237
+
238
+ ### Always-required global semantic classes
239
+
240
+ The designer's `global.css` carries only **truly cross-cutting** classes — patterns that appear on every page regardless of vertical. Component-specific CSS (a product card, a cart row, a discount callout) is owned by the Phase 3 components agent of the relevant pack and lives in `src/styles/components-<pack>.css`. See `references/shared/STYLING.md` § "Component-specific CSS is owned by the component, not the designer" for the boundary rule.
241
+
242
+ The retained set:
243
+
244
+ - **Button family** (`btn`, `btn-primary`, `btn-secondary`, `btn-ghost`) — compound + `:hover`/`:disabled`. Used on every page in every vertical.
245
+ - **`[data-decorative-slot]`** — cross-cutting decorative pattern. The orchestrator injects images into these slots after Image Phase 1 returns regardless of which packs loaded.
246
+ - **`editorial-rule`** — cross-cutting decorative pattern (gold-rule / accent dividers used as hero/section dividers across verticals).
247
+ - **`.site-nav`, `.site-footer`, `.nav-progress`** — universal site chrome. Sticky header shell, footer scaffold, top progress bar. Verticals contribute INTO these shells via named markers (`<!-- nav:links -->`, `<!-- nav:actions -->`); the shells themselves stay vertical-agnostic.
248
+
249
+ **Coverage check:** `grep -E "^\.(btn|btn-primary|btn-secondary|btn-ghost|site-nav|site-footer|nav-progress|editorial-rule)\b|^\[data-decorative-slot\]" src/styles/global.css` returns at least eight matches (one per class plus the attribute selector).
250
+
251
+ **Moved out of `global.css`** — these are component-specific and now live in `components-<pack>.css` (written by the matching Phase 3 components agent):
252
+
253
+ - Stores pack: `.product-card`, `.product-card-media`, `.product-card-ribbon`, `.product-card-index`, `.product-grid`, `.offer-callout` family → `src/styles/components-stores.css`
254
+ - Ecom pack: `.cart-summary`, `.cart-total`, `.cart-empty`, `.checkout-btn` → `src/styles/components-ecom.css`
255
+
256
+ Do NOT publish stub rules for these classes in `global.css` and assume a downstream agent will fill in the layout. A stub like `.product-grid { transition: opacity 200ms ease; }` with no `display: grid` ships `/products` as a stacked column — the rule wins specificity over a Phase 3-defined version, and the layout collapses. Either own the full rule here or leave the class undefined entirely.
257
+
258
+ ### Pre-return component-class leak check (mandatory)
259
+
260
+ Before returning, run this grep against the plugin's pack templates:
261
+
262
+ ```bash
263
+ grep -rE "class(?:Name)?=.*\\b(product-card|product-grid|product-card-media|product-card-ribbon|product-card-index|offer-callout|cart-summary|cart-total|cart-empty|checkout-btn)\\b" \
264
+ $SKILL_ROOT/templates/*/
265
+ ```
266
+
267
+ If any of those class names appear in templates, your `global.css` MUST NOT declare them. They live in the matching `components-<pack>.css`, owned by the pack's Phase 3 components agent. If you ship a partial rule for any of them in `global.css`, the leak this section is preventing recurs.
268
+
269
+ #### 1b. Register `@tailwindcss/vite` in `astro.config.mjs`
270
+
271
+ Read the existing `astro.config.mjs` and add the Tailwind Vite plugin. The scaffold template does NOT include it — you must add it:
272
+
273
+ ```js
274
+ import tailwindcss from "@tailwindcss/vite";
275
+
276
+ export default defineConfig({
277
+ // ... existing config
278
+ vite: {
279
+ plugins: [tailwindcss()],
280
+ },
281
+ });
282
+ ```
283
+
284
+ Merge with any existing `vite` config — do not overwrite other Vite settings.
285
+
286
+ **While editing this file, also fix any bare `process.env` reference** (the scaffold ships `const isBuild = process.env.NODE_ENV == "production";`). Without `@types/node`, strict `tsc --noEmit` fails with "Cannot find name 'process'" and blocks release. Rewrite as:
287
+
288
+ ```js
289
+ const isBuild = (/** @type {any} */ (globalThis)).process?.env?.NODE_ENV === "production";
290
+ ```
291
+
292
+ This keeps the line node-runnable at build time while satisfying TS without adding a `@types/node` dependency.
293
+
294
+ #### 2. `src/layouts/Layout.astro`
295
+
296
+ **Pre-write check:** Read the scaffolded `src/layouts/Layout.astro` first. The scaffold ships a **bare stub** with a hardcoded `<title>Wix Astro Basics</title>`, no `global.css` import, no `<Navigation />`/`<Footer />`, no head slot, no `hasSeoTags` prop. You MUST fully replace it — do not merge into the stub. If you skip the full rewrite, downstream Phase-2 agents detect the stub (`LAYOUT_SIGNATURE_MISSING`) and have to re-extend it themselves, duplicating work.
297
+
298
+ After writing, self-verify the file contains all of: `import '../styles/global.css'`, every required `components-<pack>.css` import (see Concrete import example below), `<Navigation />`, `<slot />`, `<Footer />`, `<slot name="head" />` inside `<head>`, the `hasSeoTags` prop pattern, and the `Props` interface. Missing any of these means you didn't fully replace the stub — rewrite.
299
+
300
+ The site shell. Contains:
301
+
302
+ - `<head>` with meta tags, Google Fonts link for the chosen fonts, favicon, viewport. Do not rely on `/favicon.svg` as the browser-facing href; Wix may intercept that root path. If you create a custom SVG favicon, keep the readable source in `public/favicon.svg` and embed the browser-facing icon as `data:image/svg+xml;base64,...` in `<link rel="icon">` unless the orchestrator gives you a verified site-favicon URL.
303
+ - `import '../styles/global.css'`
304
+ - One `import '../styles/components-<pack>.css'` per pack **that has a `components` agent** (listed in your prompt as "Packs with shared wiring"). Packs without shared wiring (e.g., `cms`) do NOT get an import — no agent writes that file, and importing it breaks the build.
305
+ - `import { ClientRouter } from 'astro:transitions'` and `<ClientRouter />` rendered inside `<head>` — enables Astro View Transitions across the site so category-rail clicks feel like in-place filtering instead of full page loads.
306
+ - `<Navigation />` component
307
+ - `<main><slot /></main>`
308
+ - `<Footer />` component
309
+ - `<slot name="head" />` inside `<head>` for per-page SEO injection
310
+ - `hasSeoTags` prop pattern: when true, skip the default `<title>` and `<meta name="description">` (Phase 2 injects `SeoTags` via the head slot)
311
+ - A top-of-body progress bar (`<div class="nav-progress" data-nav-progress aria-hidden="true"></div>`) that lights up between `astro:before-preparation` and `astro:after-swap` — paired with a small inline `<script>` block (see "View Transitions wiring" below) that drives the bar, syncs the persisted CategoryRail's `aria-current`, and anchors the rail's viewport position across listing-to-listing navigations.
312
+
313
+ **Concrete import example** for a stores + ecom + cms run — these exact lines MUST appear in frontmatter, in this order:
314
+ ```astro
315
+ import '../styles/global.css';
316
+ import '../styles/components-stores.css';
317
+ import '../styles/components-ecom.css';
318
+ ```
319
+
320
+ Missing any `components-<pack>.css` import = every React island that uses scoped contract classes (quantity selectors, variant pills, cart badges, cart line items) renders unstyled in production. Do not ship without all imports.
321
+
322
+ **Self-check before finishing:** for every pack listed in "Packs with shared wiring", grep your own Layout.astro output for `components-<pack>.css`. If missing, add it. If still unrecoverable, return `status: "partial"` with `errors: [{code: "MISSING_COMPONENT_CSS_IMPORT", pack: "<name>"}]`.
323
+
324
+ Interface:
325
+ ```typescript
326
+ interface Props {
327
+ title?: string;
328
+ description?: string;
329
+ hasSeoTags?: boolean;
330
+ }
331
+ ```
332
+
333
+ ##### 2a. View Transitions wiring (mandatory)
334
+
335
+ The Layout owns the cross-page swap behavior used by the stores pack's category rail and pagination. Without this wiring, every category-pill click is a full page reload and the persisted rail re-renders on every navigation.
336
+
337
+ Required additions inside `Layout.astro`:
338
+
339
+ ```astro
340
+ ---
341
+ import { ClientRouter } from 'astro:transitions';
342
+ // ... other imports
343
+ ---
344
+ <!doctype html>
345
+ <html lang="en">
346
+ <head>
347
+ <!-- ... meta, fonts, css imports ... -->
348
+ <slot name="head" />
349
+ <ClientRouter />
350
+ </head>
351
+ <body>
352
+ <div class="nav-progress" data-nav-progress aria-hidden="true"></div>
353
+ <Navigation />
354
+ <main><slot /></main>
355
+ <Footer />
356
+ <script>
357
+ // Persisted rail aria-current sync + top loading bar + rail-anchored
358
+ // scroll across listing-to-listing navigation. Stores pack relies on
359
+ // all three; do not split into separate scripts.
360
+ function syncCategoryRail() {
361
+ const path = window.location.pathname;
362
+ const activeSlug = path.startsWith("/category/")
363
+ ? path.slice("/category/".length).replace(/\/$/, "")
364
+ : path === "/products" || path === "/products/"
365
+ ? ""
366
+ : null;
367
+ if (activeSlug === null) return;
368
+ const pills = document.querySelectorAll<HTMLAnchorElement>(
369
+ "[data-category-rail] .category-pill",
370
+ );
371
+ for (const pill of pills) {
372
+ const slug = pill.dataset.categorySlug ?? "";
373
+ if (slug === activeSlug) pill.setAttribute("aria-current", "page");
374
+ else pill.removeAttribute("aria-current");
375
+ }
376
+ }
377
+ // Eager click feedback — flip aria-current before the network call.
378
+ document.addEventListener("click", (event) => {
379
+ const target = event.target as HTMLElement | null;
380
+ const pill = target?.closest<HTMLAnchorElement>(
381
+ "[data-category-rail] .category-pill",
382
+ );
383
+ if (!pill) return;
384
+ if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;
385
+ const pills = document.querySelectorAll<HTMLAnchorElement>(
386
+ "[data-category-rail] .category-pill",
387
+ );
388
+ for (const p of pills) p.removeAttribute("aria-current");
389
+ pill.setAttribute("aria-current", "page");
390
+ }, true);
391
+ const progress = document.querySelector<HTMLElement>("[data-nav-progress]");
392
+ function startProgress() {
393
+ if (!progress) return;
394
+ progress.dataset.state = "loading";
395
+ document.body.dataset.navigating = "true";
396
+ }
397
+ function endProgress() {
398
+ if (!progress) return;
399
+ progress.dataset.state = "done";
400
+ delete document.body.dataset.navigating;
401
+ window.setTimeout(() => {
402
+ if (progress.dataset.state === "done") delete progress.dataset.state;
403
+ }, 320);
404
+ }
405
+ // Anchor the persisted rail across listing-to-listing navigation. The
406
+ // page-header above the rail differs between /products and /category/[slug]
407
+ // (breadcrumbs, lede, optional image), so naive scroll preservation reads
408
+ // as a jump. Capture rail.getBoundingClientRect().top before the swap and
409
+ // re-equalize after.
410
+ const isListing = (p: string) =>
411
+ p === "/products" || p === "/products/" || p.startsWith("/category/");
412
+ let railAnchorTop: number | null = null;
413
+ document.addEventListener("astro:before-preparation", (event: any) => {
414
+ const from = window.location.pathname;
415
+ const to = event?.to?.pathname ?? from;
416
+ const rail = document.querySelector<HTMLElement>("[data-category-rail]");
417
+ railAnchorTop =
418
+ rail && isListing(from) && isListing(to)
419
+ ? rail.getBoundingClientRect().top
420
+ : null;
421
+ startProgress();
422
+ });
423
+ document.addEventListener("astro:after-swap", () => {
424
+ syncCategoryRail();
425
+ if (railAnchorTop !== null) {
426
+ const rail = document.querySelector<HTMLElement>("[data-category-rail]");
427
+ if (rail) {
428
+ const delta = rail.getBoundingClientRect().top - railAnchorTop;
429
+ if (Math.abs(delta) > 0.5) {
430
+ window.scrollBy({ top: delta, left: 0, behavior: "instant" as ScrollBehavior });
431
+ }
432
+ }
433
+ }
434
+ railAnchorTop = null;
435
+ endProgress();
436
+ });
437
+ document.addEventListener("astro:page-load", endProgress);
438
+ syncCategoryRail();
439
+ </script>
440
+ </body>
441
+ </html>
442
+ ```
443
+
444
+ Mandatory companion CSS (insert into `global.css` — do not split into a separate file):
445
+
446
+ ```css
447
+ /* Disable default ClientRouter root cross-fade. With rail-anchored scroll
448
+ adjustment, an instant swap reads as "header content changed in place"
449
+ instead of "whole page faded between two heights". The progress bar +
450
+ grid-dim handle navigation feedback. */
451
+ ::view-transition-old(root),
452
+ ::view-transition-new(root) {
453
+ animation: none;
454
+ mix-blend-mode: normal;
455
+ }
456
+
457
+ .nav-progress {
458
+ position: fixed;
459
+ top: 0;
460
+ left: 0;
461
+ right: 0;
462
+ height: 2px;
463
+ background: var(--color-accent, currentColor);
464
+ transform: scaleX(0);
465
+ transform-origin: left;
466
+ z-index: 1000;
467
+ pointer-events: none;
468
+ opacity: 0;
469
+ }
470
+ .nav-progress[data-state="loading"] {
471
+ opacity: 1;
472
+ transform: scaleX(0.85);
473
+ transition: transform 1.6s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 120ms ease;
474
+ }
475
+ .nav-progress[data-state="done"] {
476
+ opacity: 0;
477
+ transform: scaleX(1);
478
+ transition: transform 200ms ease, opacity 240ms ease 60ms;
479
+ }
480
+
481
+ /* Dim the product grid while ClientRouter fetches/swaps so the click has
482
+ immediate visual response. */
483
+ body[data-navigating="true"] .product-grid {
484
+ opacity: 0.55;
485
+ transition: opacity 140ms ease;
486
+ pointer-events: none;
487
+ }
488
+ .product-grid {
489
+ transition: opacity 200ms ease;
490
+ }
491
+ ```
492
+
493
+ The `--color-accent` token is the fallback the bar uses; if the design tokens don't expose `accent`, fall back to a brand-appropriate `--color-*` value or `currentColor`. The bar must be visible against the background — pick something with at least 3:1 contrast against `--color-paper` or whatever the topmost background is.
494
+
495
+ ##### 2b. Navigation submenu CSS (mandatory)
496
+
497
+ The stores pack's `pages-home-and-nav` scope inserts a Shop submenu (`.site-nav-submenu` containing `.site-nav-sublink` anchors) at the `<!-- nav:links -->` marker in `Navigation.astro`. The submenu must be styled by the designer's `global.css` — vertical packs do NOT write nav CSS. Required classes (only when the stores pack is loaded):
498
+
499
+ - `.site-nav-item.has-submenu` — relative-positioned wrapper
500
+ - `.site-nav-submenu` — absolutely-positioned dropdown, hidden by default, revealed on hover/focus-within
501
+ - `.site-nav-sublink` — submenu item styling (smaller text, `aria-current="page"` highlight)
502
+
503
+ Use the same typographic scale and color vocabulary as the rest of the nav. Keyboard-accessible: `:focus-within` on `.site-nav-item.has-submenu` must reveal the submenu.
504
+
505
+ ##### 2c. CategoryRail + pagination CSS (mandatory)
506
+
507
+ The stores pack ships a shared `CategoryRail` component (`src/components/CategoryRail.astro`) with these classes — designer's `global.css` must style them:
508
+
509
+ - `.category-rail` — horizontal strip, paper-warm background, bottom rule
510
+ - `.category-rail-inner` — flex-wrap container with token-based gaps and padding-block
511
+ - `.category-pill` — pill button (border, radius, uppercase letter-spacing); `:hover` and `[aria-current="page"]` states
512
+ - `.pagination`, `.pagination-inner`, `.pagination-link` (with `.is-disabled` modifier) — Prev/Next anchors
513
+ - `.breadcrumbs` — used on `/category/[slug]` page header
514
+
515
+ Style with the published design tokens (`--color-rule`, `--color-paper-warm`, `--color-ink`, `--color-ink-soft`, `--color-taupe` or accent equivalents, `--spacing-md`).
516
+
517
+ #### 3. `src/components/Navigation.astro`
518
+
519
+ Top navigation bar. Contains:
520
+
521
+ - Brand name / logo linking to `/`
522
+ - Navigation links — **must exactly match the `Navigation links:` list in the prompt**. Use the hrefs and labels verbatim. Do NOT coin editorial rebrands (no "Journal" for `/about`, no "Notes" for `/faq`, no "Collection" for `/products`, etc.). Do NOT add links for routes not in the list. One `<a>` per list entry — no duplicates. Never include cart, login, account, or other action pages — those are handled by interactive components in the `nav-actions` slot.
523
+
524
+ **Pre-filter context.** The orchestrator pre-filters the `Navigation links:` list to exclude routes from packs that contribute at `<!-- nav:links -->` (today: stores splices a Shop submenu there in Phase 4; gift-cards, when its runtime probe returns active, splices a Gift Cards link). If your prompt's list omits `/products` even though stores is loaded, that's intentional — do NOT "helpfully" add a Products link. Adding it produces duplicate top-level links pointing at the same route once Phase 4's marker patch runs. If your prompt is missing the `Navigation links:` line entirely, return `status: "partial"` with `errors: [{code: "NAV_LINKS_NOT_PROVIDED"}]` rather than guessing — the orchestrator should compute and pass it.
525
+ - Mobile-responsive hamburger menu (CSS-only or minimal inline `<script>`)
526
+ - A `<div class="nav-actions"></div>` slot for Phase 2 to mount interactive components (CartBadge, etc.) — leave it empty, do not place placeholder links or icons there
527
+ - Uses contract classes where applicable (e.g., `cart-badge` class on the mount point)
528
+ - **`transition:persist="site-nav"` on the root `<header>`** — keeps the nav alive across `<ClientRouter />` swaps (instead of re-rendering on every navigation). The directive must be on the root element directly; setting it on the `<Navigation />` mount in Layout doesn't propagate to the rendered root.
529
+ - A `<!-- nav:links -->` marker comment in the link `<ul>` where vertical packs splice their primary nav contributions. Stores splices a Shop link + submenu of categories here in Phase 4.
530
+
531
+ **Why the verbatim rule:** an editorial brand vibe tempts the designer to coin label rebrands ("Journal" → /about, "Notes" → /faq, "Collection" alongside Shop). Users notice the drift immediately and the duplicates produce broken navigation. Use the labels supplied in `Navigation links:` verbatim.
532
+
533
+ **CartBadge ownership:** `CartBadge.tsx` is a React island that renders its own `<a href="/cart">` link with cart text and count badge. Do NOT wrap it in another `<a>` tag, do NOT add cart SVG icons or cart links inside `nav-actions`. Browsers break nested `<a>` elements apart, which produces multiple cart icons rendering side by side.
534
+
535
+ #### 4. `src/components/Footer.astro`
536
+
537
+ Site footer. Contains:
538
+
539
+ - Brand name / copyright
540
+ - Navigation links (mirror of header or subset) — same exclusion: no cart, login, or account links
541
+ - Minimal, on-brand styling
542
+ - **`transition:persist="site-footer"` on the root `<footer>`** — same rationale as Navigation: keeps the footer alive across `<ClientRouter />` swaps. Apply to the root element directly, not to `<Footer />` in Layout.
543
+
544
+
545
+ ---
546
+
547
+ ## Page Designer Scopes (Phase 4 — Step 7, background)
548
+
549
+ All page scopes share common inputs and rules. Scope-specific details follow.
550
+
551
+ ### Common inputs (from your prompt)
552
+
553
+ - **Brand context** — name, vibe, aesthetic direction, colors, fonts, mood
554
+ - **Pages to design** — list of routes and their contract class associations
555
+ - **Pack home-section snippet** (home scope only) — section stubs from every loaded pack
556
+ - **Placeholder data instruction** — use plausible brand-contextual placeholder text, prices, images where live data is not yet available
557
+
558
+ ### Common rules for all page scopes
559
+
560
+ 1. **Use contract classes.** Every component that corresponds to a contract key uses that class name. Do not invent replacements.
561
+ 2. **Use the Layout.** Every page wraps content in `<Layout>`:
562
+ ```astro
563
+ ---
564
+ import Layout from '../layouts/Layout.astro';
565
+ ---
566
+ <Layout title="Page Title">
567
+ <!-- page content -->
568
+ </Layout>
569
+ ```
570
+ 3. **Placeholder data, not empty.** Write plausible placeholder text, prices, and image placeholders that match the brand. The designed page must look complete and reviewable on its own.
571
+ 4. **No SDK imports in design-only scopes.** The designer's pure design scopes do not import `@wix/stores`, `@wix/data`, `@wix/blog`, or any SDK package. Use hardcoded placeholder arrays/objects that mirror the shape live data will have. (Merged design+wire Phase 4 scopes owned by vertical packs DO import SDKs — this rule applies to designer scopes only.)
572
+ 5. **No React islands.** Do not import or mount `.tsx` components. Phase 3 Components writes the islands; Phase 4 Pages mounts them. Page designers write pure `.astro` files.
573
+ 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`.
574
+ 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:**
575
+
576
+ | Key | Where it lives | Required when |
577
+ |---|---|---|
578
+ | `hero` | Homepage hero image | Always |
579
+ | `about` | About-page (or home brand-story) editorial visual | Always |
580
+ | `productsHeader` | `/products` listing header decorative | Stores pack loaded |
581
+ | `cmsHeader` | `/about` or `/faq` page header decorative | CMS pack loaded (optional) |
582
+
583
+ 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. The vocabulary is intentionally small to keep the slot ↔ image agent contract tight; 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 (SKILL.md Step 4.6) that injects the actual `<img>` for each slot once Image Phase 1 finishes; your job is to make the slot visible. Rules:
584
+ - Use aspect-ratio + background-color on the placeholder so the page looks complete even if Image Phase 1 never completes.
585
+ - 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).
586
+ - Do NOT conditionally read `.wix/image-urls.md` — the file won't exist at designer-time because Image Phase 1 runs in parallel with you. The slot mechanism is the replacement for the old "read the file if it exists" branch and must not coexist with it.
587
+ - Do not use external placeholder services (picsum, unsplash, etc.).
588
+
589
+ Example:
590
+ ```astro
591
+ <section class="hero-section relative">
592
+ <div
593
+ class="hero-image"
594
+ data-decorative-slot="hero"
595
+ style="aspect-ratio: 4/5; background-color: var(--color-bark);"
596
+ >
597
+ <!-- orchestrator injects <img src={decorativeImages.hero} …> here -->
598
+ </div>
599
+ <div class="hero-stamp">{/* decorative overlay, stays outside the slot */}</div>
600
+ </section>
601
+ ```
602
+ 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.
603
+ 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`.
604
+ 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.
605
+ 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.
606
+ 12. **Do NOT write to `src/styles/components-<pack>.css`** — these files are owned by Phase 3 Components agents. Writing to them causes double-write conflicts when Phase 3 also writes the same file.
607
+
608
+ ### Scope: `home`
609
+
610
+ Composes the home page from every loaded pack's `homeSection` snippet plus brand-specific hero and CTA sections.
611
+
612
+ **Inputs (additional):**
613
+ - `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.
614
+
615
+ **Structure:**
616
+ 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, even if `.wix/image-urls.md` happens to exist; the orchestrator injects the `<img>` after Image Phase 1 completes.
617
+ 2. **Pack sections** — one section per loaded pack's `homeSection`, in a sensible order (typically: featured content first, then story, then CTA).
618
+ 3. **Optional closing CTA** — if no pack contributes a CTA section, add a minimal brand-appropriate closing.
619
+
620
+ **Files:** `src/pages/index.astro`
621
+
622
+ **Return:**
623
+ ```json
624
+ {
625
+ "status": "complete",
626
+ "phase": "designer-home",
627
+ "scope": "home",
628
+ "data": {
629
+ "pagesDesigned": ["src/pages/index.astro"],
630
+ "contractClassesHonored": ["hero-section", "product-grid", "product-card", "brand-story", ...]
631
+ },
632
+ "files": ["src/pages/index.astro"]
633
+ }
634
+ ```
635
+
636
+ ### Scope: `static`
637
+
638
+ About and FAQ pages — content pages with similar layout demands.
639
+
640
+ **Files:** `src/pages/about.astro`, `src/pages/faq.astro`
641
+
642
+ **About page:**
643
+ - Hero/header section with `about-hero` class
644
+ - Body content with `about-body` class
645
+ - Placeholder brand story text (2-3 paragraphs, brand-contextual)
646
+ - Image placeholder for brand/team visual
647
+
648
+ **FAQ page:**
649
+ - Section wrapper with `faq-section` class
650
+ - Individual Q&A items with `faq-item`, `faq-question`, `faq-answer` classes
651
+ - 4-6 placeholder FAQ items contextual to the business type
652
+ - Accordion or expandable pattern (CSS-only, using `<details>`/`<summary>` or checkbox hack)
653
+
654
+ **Return:**
655
+ ```json
656
+ {
657
+ "status": "complete",
658
+ "phase": "designer-static",
659
+ "scope": "static",
660
+ "data": {
661
+ "pagesDesigned": ["about", "faq"],
662
+ "contractClassesHonored": ["about-hero", "about-body", "faq-section", "faq-item", "faq-question", "faq-answer"]
663
+ },
664
+ "files": ["src/pages/about.astro", "src/pages/faq.astro"]
665
+ }
666
+ ```
667
+
668
+ ### Scope: `store-pages`
669
+
670
+ All store-facing pages designed together for visual coherence.
671
+
672
+ **Files:** `src/pages/products/index.astro`, `src/pages/products/[slug].astro`, `src/components/ProductCard.astro`, `src/pages/cart.astro`, `src/pages/thank-you.astro`
673
+
674
+ **Products listing (`/products`):**
675
+ - Page heading
676
+ - Product grid using `product-grid` class
677
+ - 3-6 placeholder product cards using `ProductCard` component
678
+
679
+ **Product detail (`/products/[slug]`):**
680
+ - Product image (large, placeholder)
681
+ - Product info section with `product-detail` class
682
+ - Purchase area with `product-purchase` class — placeholder price, placeholder variant selector, Add to Cart button with `add-to-cart-btn` class
683
+ - Product description area
684
+
685
+ **ProductCard component:**
686
+ - Accepts a single `product` prop (object with name, price, slug, image fields)
687
+ - Uses `product-card` class
688
+ - Image, name, price, link to `/products/${product.slug}`
689
+ - **Important:** Phase 2 `product-pages` rewrites this to accept the full Wix product object. Design with a simple prop interface: `{ product: { name: string; slug: string; price: number; image?: string } }`
690
+
691
+ **Cart (`/cart`):**
692
+ - Two-column grid layout: `.cart-grid` — items column left, order summary right. Stacks vertically on mobile
693
+ - 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
694
+ - Quantity selector with `.cart-item-qty`, `.qty-btn`, `.qty-value` classes — include `:disabled` states (reduced opacity + `cursor: not-allowed`)
695
+ - 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
696
+ - Remove button with `.cart-item-remove` class (muted color, underline on hover)
697
+ - Summary column with `.cart-summary` (sticky on desktop), `.cart-subtotal`, `.checkout-btn` (with `:disabled` state), `.cart-empty` classes
698
+ - Unavailable item warning with `.cart-item-unavailable` class (red text)
699
+ - Empty state with `.cart-empty` class (centered, muted text + "Browse Products" link)
700
+ - **All cart CSS must be in `<style is:global>`** — `CartView` is a React island; scoped Astro styles do not reach its children
701
+ - Placeholder cart items (2-3)
702
+
703
+ **Thank you (`/thank-you`):**
704
+ - Confirmation message with `order-summary` class
705
+ - Placeholder order details
706
+
707
+ **Return:**
708
+ ```json
709
+ {
710
+ "status": "complete",
711
+ "phase": "designer-store-pages",
712
+ "scope": "store-pages",
713
+ "data": {
714
+ "pagesDesigned": ["products/index.astro", "products/[slug].astro", "ProductCard.astro", "cart.astro", "thank-you.astro"],
715
+ "contractClassesHonored": <count>
716
+ },
717
+ "files": [
718
+ "src/pages/products/index.astro",
719
+ "src/pages/products/[slug].astro",
720
+ "src/components/ProductCard.astro",
721
+ "src/pages/cart.astro",
722
+ "src/pages/thank-you.astro"
723
+ ]
724
+ }
725
+ ```
726
+
727
+ ### Scope: `blog-pages`
728
+
729
+ Blog feed listing and post detail designed together.
730
+
731
+ **Files:** `src/pages/blog/index.astro`, `src/pages/blog/[slug].astro`
732
+
733
+ **Blog listing (`/blog`):**
734
+ - Page heading
735
+ - Post grid/list using `blog-feed` class
736
+ - 3 placeholder post cards using `blog-post-card` class (title, date, excerpt, cover image placeholder)
737
+
738
+ **Blog post detail (`/blog/[slug]`):**
739
+ - Post header with title, date, author, cover image placeholder
740
+ - Body area with `blog-post` and `blog-post-body` classes
741
+ - Meta section with `blog-post-meta` class (tags, share links)
742
+ - Good reading typography (max-width prose container, comfortable line height)
743
+
744
+ **Return:**
745
+ ```json
746
+ {
747
+ "status": "complete",
748
+ "phase": "designer-blog-pages",
749
+ "scope": "blog-pages",
750
+ "data": {
751
+ "pagesDesigned": ["blog/index.astro", "blog/[slug].astro"],
752
+ "contractClassesHonored": ["blog-feed", "blog-post-card", "blog-post", "blog-post-body", "blog-post-meta"]
753
+ },
754
+ "files": ["src/pages/blog/index.astro", "src/pages/blog/[slug].astro"]
755
+ }
756
+ ```
757
+
758
+ ### Scope: `contact-page`
759
+
760
+ Contact page with form placeholder.
761
+
762
+ **Files:** `src/pages/contact.astro`
763
+
764
+ **Contact page:**
765
+ - Page heading and descriptive text
766
+ - Contact CTA section using `contact-cta` class (if on home, this mirrors the home CTA's visual language)
767
+ - Form placeholder area — a styled `<div>` where Phase 2 mounts the `ContactForm.tsx` island. Use a placeholder form layout (name, email, message fields, submit button) so the page looks complete, but Phase 2 replaces this with the real React island.
768
+ - Optional: map embed placeholder, business hours, address (if brand context suggests it)
769
+
770
+ **Return:**
771
+ ```json
772
+ {
773
+ "status": "complete",
774
+ "phase": "designer-contact-page",
775
+ "scope": "contact-page",
776
+ "data": {
777
+ "pagesDesigned": ["contact.astro"],
778
+ "contractClassesHonored": ["contact-cta"]
779
+ },
780
+ "files": ["src/pages/contact.astro"]
781
+ }
782
+ ```
783
+
784
+ ---
785
+
786
+ ## Return Contract
787
+
788
+ At the end of your work, emit a structured JSON block per `../shared/RETURN_CONTRACT.md`. Do **not** write sidecar files to `.wix/logs/*`.
789
+
790
+ 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 ` ``` `.
791
+
792
+ ## Anti-Patterns (apply to all scopes)
793
+
794
+ | WRONG | CORRECT |
795
+ |-------|---------|
796
+ | Import `@wix/stores`, `@wix/data`, or any SDK package | Page designers are visual-only — SDK imports belong to Phase 4 vertical-pack scopes |
797
+ | Import or mount `.tsx` React islands | Phase 3 Components writes islands; Phase 4 Pages mounts them |
798
+ | 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 `references/shared/STYLING.md` for the three categories |
799
+ | Override `global.css` rules from page `<style>` blocks | Pages can add co-located styles for one-off decoration; never override designer-owned global classes |
800
+ | HTML `<!-- comment -->` in `.astro` frontmatter | Use `//` or `/* */` — frontmatter is TypeScript |
801
+ | Use external placeholder image services (picsum, unsplash) | Use colored `<div>` placeholders or `.wix/image-urls.md` URLs |
802
+ | Write `components-<pack>.css` (Phase 2 or page scope) | Phase 3 Components creates that file — Phase 2 imports it in Layout; page scopes must not write it |
803
+ | Write CSS for scoped contract keys (Phase 2 scope) | Only global keys get CSS in `global.css`; scoped keys → Phase 3 Components |
804
+ | Skip publishing tokens — "downstream agents will add what they need" | Token completeness IS the contract; missing tokens force downstream agents to invent classes (the failure mode this protocol prevents) |
805
+ | 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 |
806
+ | Generic unstyled HTML | Brand-first design — every element reflects the aesthetic direction |
807
+ | Fixed-width layouts | Responsive: mobile-first, breakpoints at 320/768/1024px |
808
+ | `ls src/`, `Glob src/**` to discover files | Your prompt lists every file and class contract. Write directly. |
809
+ | Use `<img src="https://...">` for product/content images | Placeholder `<div>` with aspect-ratio; Phase 4 wires real images |
810
+ | Omit `data-decorative-slot` on hero/about/background placeholders | Every decorative image placeholder MUST carry a slot attribute — the orchestrator's Step 4.6 patch depends on it (see common rule #7) |
811
+ | Read `.wix/image-urls.md` during design-system scope | File doesn't exist yet — emit `data-decorative-slot` placeholders instead; the orchestrator injects the URLs after Image Phase 1 returns |
812
+ | ProductCard with flat props (`name`, `price`, `slug` as separate props) | Single `product` object prop: `{ product }` — Phase 4 passes the full Wix product object |
813
+ | 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 |
814
+
815
+ ## Coordination with other agents
816
+
817
+ | Agent | Relationship | Rule |
818
+ |-------|-------------|------|
819
+ | Phase 3 Components (stores/blog/forms) | Writes React islands referencing contract classes | Phase 2 Design System writes global CSS; Phase 3 Components writes scoped CSS. No overlap. |
820
+ | Phase 4 Pages (vertical packs) | Reads your `.astro` files, swaps placeholders for live data (where the designer wrote placeholder-only scopes) | They preserve your layout and styling; they only change data-fetching code and island mounts |
821
+ | Image agent (Image Phase 1) | Writes `.wix/image-urls.md` with decorative image URLs | Designers do NOT read this file. Emit `data-decorative-slot="<key>"` placeholders; the orchestrator's Step 4.6 Edit pass injects the `<img>` once Image Phase 1 finishes. |
822
+ | Image agent (Image Phase 2) | PATCHes entity images onto products/posts via MCP | No direct interaction — images flow through product/post records that Phase 4 queries |
823
+
824
+ ## File ownership
825
+
826
+ Designer scopes own the **visual structure** of their files. Phase 4 scopes (vertical packs) own the **data wiring** of the same files where that split applies. When Phase 4 rewrites a file, it preserves the designer's markup structure and class usage, replacing only placeholder data sections with SDK queries and island mounts.
827
+
828
+ This means two agents touch the same file across phases (designer's page scope writes it, Phase 4 vertical-pack scope rewrites it). This is by design — Phase 4 dispatches in Step 7 after the designer's page scopes complete, so there's no race condition.