@wix/agent-skills 1.6.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/README.md +2 -2
  2. package/package.json +1 -1
  3. package/skills/wix-app/SKILL.md +49 -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/backend-event/COMMON-EVENTS.md +0 -44
  16. package/skills/wix-app/references/custom-element-widget/SETTINGS_PANEL.md +19 -330
  17. package/skills/wix-app/references/dashboard-menu-plugin/bookings-slots.md +0 -12
  18. package/skills/wix-app/references/dashboard-menu-plugin/ecommerce-slots.md +7 -0
  19. package/skills/wix-app/references/dashboard-menu-plugin/restaurants-slots.md +0 -12
  20. package/skills/wix-app/references/dashboard-plugin/SLOTS.md +3 -15
  21. package/skills/wix-app/references/service-plugin/ADDITIONAL-FEES.md +2 -18
  22. package/skills/wix-app/references/service-plugin/BOOKINGS-STAFF-SORTING.md +2 -42
  23. package/skills/wix-app/references/service-plugin/DISCOUNT-TRIGGERS.md +1 -11
  24. package/skills/wix-app/references/service-plugin/GIFT-CARDS.md +1 -11
  25. package/skills/wix-app/references/service-plugin/PAYMENT-SETTINGS.md +2 -40
  26. package/skills/wix-app/references/service-plugin/SHIPPING-RATES.md +2 -19
  27. package/skills/wix-app/references/service-plugin/VALIDATIONS.md +2 -18
  28. package/skills/wix-app/references/site-plugin/SLOTS.md +17 -68
  29. package/skills/wix-headless/SKILL.md +111 -389
  30. package/skills/wix-headless/references/BUILD.md +307 -0
  31. package/skills/wix-headless/references/DESIGN_SYSTEM.md +115 -0
  32. package/skills/wix-headless/references/DISCOVERY.md +237 -112
  33. package/skills/wix-headless/references/PLAN.md +82 -0
  34. package/skills/wix-headless/references/SEED.md +205 -0
  35. package/skills/wix-headless/references/SETUP.md +140 -134
  36. package/skills/wix-headless/references/astro/COMPOSE.md +142 -0
  37. package/skills/wix-headless/references/{blog → astro/blog}/BLOG_PAGES.md +1 -1
  38. package/skills/wix-headless/references/{blog → astro/blog}/BLOG_SETUP.md +2 -2
  39. package/skills/wix-headless/references/astro/cms/CMS_FOUNDATIONS.md +214 -0
  40. package/skills/wix-headless/references/{cms → astro/cms}/FAQ_KNOWLEDGE_BASE.md +6 -4
  41. package/skills/wix-headless/references/{cms → astro/cms}/PORTFOLIO.md +5 -5
  42. package/skills/wix-headless/references/{cms → astro/cms}/RESOURCE_LIBRARY.md +5 -5
  43. package/skills/wix-headless/references/{cms → astro/cms}/TEAM_DIRECTORY.md +5 -5
  44. package/skills/wix-headless/references/astro/designer/INSTRUCTIONS.md +331 -0
  45. package/skills/wix-headless/references/{ecom → astro/ecom}/CART_PAGES.md +1 -1
  46. package/skills/wix-headless/references/{ecom → astro/ecom}/CART_WIRING.md +1 -1
  47. package/skills/wix-headless/references/{ecom → astro/ecom}/COMPONENTS_CSS.md +3 -3
  48. package/skills/wix-headless/references/{forms → astro/forms}/CONTACT_FORM.md +13 -13
  49. package/skills/wix-headless/references/{gift-cards → astro/gift-cards}/COMPONENTS.md +1 -1
  50. package/skills/wix-headless/references/{gift-cards → astro/gift-cards}/PAGES.md +1 -1
  51. package/skills/wix-headless/references/{stores → astro/stores}/BACK_IN_STOCK.md +1 -1
  52. package/skills/wix-headless/references/{stores → astro/stores}/CATEGORY_PAGES.md +12 -13
  53. package/skills/wix-headless/references/{stores → astro/stores}/COMPONENTS_CSS.md +4 -4
  54. package/skills/wix-headless/references/{stores → astro/stores}/HOME_AND_NAV.md +11 -9
  55. package/skills/wix-headless/references/{stores → astro/stores}/PRODUCT_PAGES.md +5 -3
  56. package/skills/wix-headless/references/{stores → astro/stores}/SHARED_WIRING.md +3 -3
  57. package/skills/wix-headless/references/astro/templates/Footer.astro +27 -0
  58. package/skills/wix-headless/references/astro/templates/Layout.astro +132 -0
  59. package/skills/wix-headless/references/astro/templates/Navigation.astro +38 -0
  60. package/skills/wix-headless/references/astro/templates/astro.config.mjs +41 -0
  61. package/skills/wix-headless/references/astro/templates/ecom/components-ecom.css +302 -0
  62. package/skills/wix-headless/references/astro/templates/global.css +286 -0
  63. package/skills/wix-headless/references/astro/templates/index.astro +56 -0
  64. package/skills/wix-headless/{templates → references/astro/templates}/stores/back-in-stock.ts +1 -1
  65. package/skills/wix-headless/{templates → references/astro/templates}/stores/components-stores.css +138 -33
  66. package/skills/wix-headless/references/blog/BLOG_CONTENT.md +10 -11
  67. package/skills/wix-headless/references/blog/INSTRUCTIONS.md +5 -5
  68. package/skills/wix-headless/references/cms/CMS_FOUNDATIONS.md +31 -230
  69. package/skills/wix-headless/references/cms/INSTRUCTIONS.md +13 -8
  70. package/skills/wix-headless/references/custom/INSTRUCTIONS.md +38 -0
  71. package/skills/wix-headless/references/ecom/INSTRUCTIONS.md +10 -10
  72. package/skills/wix-headless/references/forms/INSTRUCTIONS.md +5 -5
  73. package/skills/wix-headless/references/gift-cards/INSTRUCTIONS.md +11 -11
  74. package/skills/wix-headless/references/images/INSTRUCTIONS.md +47 -50
  75. package/skills/wix-headless/references/seed-recipes.md +49 -0
  76. package/skills/wix-headless/references/shared/AUTHENTICATION.md +110 -0
  77. package/skills/wix-headless/references/shared/BUILD_NOISE.md +2 -2
  78. package/skills/wix-headless/references/shared/DOCS_SEARCH.md +41 -0
  79. package/skills/wix-headless/references/shared/IMAGE_GENERATION.md +17 -17
  80. package/skills/wix-headless/references/shared/IMPLEMENTER.md +20 -29
  81. package/skills/wix-headless/references/shared/PRODUCTION_SHARP_EDGES.md +1 -1
  82. package/skills/wix-headless/references/shared/RETURN_CONTRACT.md +25 -16
  83. package/skills/wix-headless/references/shared/STYLING.md +47 -10
  84. package/skills/wix-headless/references/stores/INSTRUCTIONS.md +25 -25
  85. package/skills/wix-headless/references/stores/PRODUCT_CATALOG_DATA.md +17 -17
  86. package/skills/wix-headless/references/verticals/_schema.json +31 -117
  87. package/skills/wix-headless/references/verticals/_schema.md +60 -150
  88. package/skills/wix-headless/references/verticals/blog.md +5 -99
  89. package/skills/wix-headless/references/verticals/cms.md +9 -100
  90. package/skills/wix-headless/references/verticals/ecom.md +5 -76
  91. package/skills/wix-headless/references/verticals/forms.md +5 -85
  92. package/skills/wix-headless/references/verticals/gift-cards.md +6 -103
  93. package/skills/wix-headless/references/verticals/stores.md +10 -144
  94. package/skills/wix-headless/scripts/check-manifest.mjs +5 -5
  95. package/skills/wix-headless/scripts/emit-design-tokens.mjs +29 -23
  96. package/skills/wix-headless/scripts/init-site-json.mjs +59 -21
  97. package/skills/wix-headless/scripts/patch-decorative-slots.mjs +67 -43
  98. package/skills/wix-headless/scripts/plan-entity-image-waves.mjs +3 -3
  99. package/skills/wix-headless/scripts/preview.sh +3 -3
  100. package/skills/wix-headless/scripts/release.sh +4 -4
  101. package/skills/wix-headless/scripts/scaffold.sh +75 -20
  102. package/skills/wix-headless/scripts/seed-utilities.sh +50 -12
  103. package/skills/wix-manage/SKILL.md +4 -8
  104. package/skills/wix-manage/references/blog/how-to-create-blog-posts.md +2 -0
  105. package/skills/wix-manage/references/cms/cms-data-items-crud.md +4 -0
  106. package/skills/wix-manage/references/cms/cms-references-and-relationships.md +2 -0
  107. package/skills/wix-manage/references/cms/cms-schema-management.md +4 -0
  108. package/skills/wix-manage/references/ecommerce/api-shipping.md +443 -0
  109. package/skills/wix-manage/references/ecommerce/flow-add-free-shipping.md +5 -6
  110. package/skills/wix-manage/references/ecommerce/flow-fix-coverage-gaps.md +4 -5
  111. package/skills/wix-manage/references/ecommerce/flow-optimize-shipping-rates.md +4 -5
  112. package/skills/wix-manage/references/ecommerce/goal-increase-aov.md +1 -1
  113. package/skills/wix-manage/references/ecommerce/goal-reduce-cart-abandonment.md +1 -2
  114. package/skills/wix-manage/references/ecommerce/guardrail-shipping-health.md +2 -2
  115. package/skills/wix-manage/references/ecommerce/recipe-apply-shipping-recommendations.md +4 -5
  116. package/skills/wix-manage/references/ecommerce/recommend-ecommerce-strategy.md +7 -7
  117. package/skills/wix-manage/references/ecommerce/setup-discount-rules.md +209 -72
  118. package/skills/wix-manage/references/ecommerce/setup-store-pickup-location.md +9 -10
  119. package/skills/wix-manage/references/ecommerce/skill-graph.md +4 -4
  120. package/skills/wix-manage/references/forms/create-form.md +2 -0
  121. package/skills/wix-manage/references/stores/bulk-create-products-with-options.md +2 -0
  122. package/skills/wix-manage/references/stores/create-product-from-image.md +91 -38
  123. package/skills/wix-manage/references/stores/setup-online-store-catalog-v3.md +2 -0
  124. package/skills/wix-app/references/custom-element-widget/default-thumbnail.png +0 -0
  125. package/skills/wix-app/references/data-collection/extension-template.ts +0 -107
  126. package/skills/wix-headless/references/ORCHESTRATION.md +0 -269
  127. package/skills/wix-headless/references/commands/install-app.md +0 -42
  128. package/skills/wix-headless/references/commands/mcp-bootstrap.md +0 -28
  129. package/skills/wix-headless/references/designer/INSTRUCTIONS.md +0 -828
  130. package/skills/wix-headless/references/shared/MCP_PREFIX.md +0 -105
  131. package/skills/wix-headless/scripts/copy-utility-templates.mjs +0 -153
  132. package/skills/wix-headless/templates/ecom/components-ecom.css +0 -215
  133. package/skills/wix-manage/references/events/list-events.md +0 -203
  134. /package/skills/wix-headless/{templates → references/astro/templates}/ecom/CartBadge.tsx +0 -0
  135. /package/skills/wix-headless/{templates → references/astro/templates}/ecom/CartView.tsx +0 -0
  136. /package/skills/wix-headless/{templates → references/astro/templates}/ecom/cart.astro +0 -0
  137. /package/skills/wix-headless/{templates → references/astro/templates}/ecom/discounts.ts +0 -0
  138. /package/skills/wix-headless/{templates → references/astro/templates}/ecom/thank-you.astro +0 -0
  139. /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/GiftCardPurchase.tsx +0 -0
  140. /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/_home-teaser-snippet.astro +0 -0
  141. /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/_nav-snippet.astro +0 -0
  142. /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/components-gift-cards.css +0 -0
  143. /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/gift-cards.astro +0 -0
  144. /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/gift-cards.ts +0 -0
  145. /package/skills/wix-headless/{templates → references/astro/templates}/stores/AddToCartButton.tsx +0 -0
  146. /package/skills/wix-headless/{templates → references/astro/templates}/stores/BackInStockForm.tsx +0 -0
  147. /package/skills/wix-headless/{templates → references/astro/templates}/stores/CategoryRail.astro +0 -0
  148. /package/skills/wix-headless/{templates → references/astro/templates}/stores/ProductCard.astro +0 -0
  149. /package/skills/wix-headless/{templates → references/astro/templates}/stores/ProductPurchase.tsx +0 -0
  150. /package/skills/wix-headless/{templates → references/astro/templates}/stores/SeoTags.astro +0 -0
  151. /package/skills/wix-headless/{templates → references/astro/templates}/stores/categories.ts +0 -0
  152. /package/skills/wix-headless/{templates → references/astro/templates}/stores/category/[slug].astro +0 -0
  153. /package/skills/wix-headless/{templates → references/astro/templates}/stores/products/[slug].astro +0 -0
  154. /package/skills/wix-headless/{templates → references/astro/templates}/stores/products/index.astro +0 -0
@@ -0,0 +1,331 @@
1
+ ---
2
+ name: page-designer
3
+ description: "The page-design specification for Wix Managed Headless Phase 4 routes: home, static (about/faq), store-pages, blog-pages, contact-page. This is the visual-design guidance the merged Phase 4 `pages` scopes (vertical packs, BUILD.md Step 7) 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 astro/COMPOSE.md (Composer)."
4
+ ---
5
+
6
+ # Page Designer — Scope-Based Page Design
7
+
8
+ > **Single-write merged model (BUILD.md Step 7 is authoritative).** Phase 4 routes are written **once**, by the per-vertical `pages` scopes, 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). 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 (`data.designTokens`), `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`) — returns the framework-agnostic design spec (tokens + brand-voice strings) as JSON only.
16
+ > - **Composer** (`<SKILL_ROOT>/references/astro/COMPOSE.md`) — applies that spec 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 inlined `designTokens` contract in your prompt 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
+ **Do NOT `Read .wix/site.json`.** Every input you need (brand, the published `designTokens` contract, pages to design, pack home-section snippets) is inlined in your prompt.
28
+
29
+ ## Scope Routing
30
+
31
+ | Scope | Phase | Output (files) |
32
+ |-------|-------|----------------|
33
+ | `home` | Phase 4 — Step 7 | `src/pages/index.astro` (composes pack home-sections + brand hero/CTA into the Composer-written shell) |
34
+ | `static` | Phase 4 — Step 7 | `src/pages/about.astro`, `src/pages/faq.astro` |
35
+ | `store-pages` | Phase 4 — Step 7 | `src/pages/products/index.astro`, `src/pages/products/[slug].astro`, `src/components/ProductCard.astro`, `src/pages/cart.astro`, `src/pages/thank-you.astro` |
36
+ | `blog-pages` | Phase 4 — Step 7 | `src/pages/blog/index.astro`, `src/pages/blog/[slug].astro` |
37
+ | `contact-page` | Phase 4 — Step 7 | `src/pages/contact.astro` |
38
+
39
+ If your prompt's `Scope:` line names `design-system`, you have the wrong doc — that work lives in `DESIGN_SYSTEM.md` (Designer) and `astro/COMPOSE.md` (Composer). Stop and tell the parent.
40
+
41
+ If your prompt is missing a `Scope:` line, stop and ask the parent — do not guess.
42
+
43
+ **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.
44
+
45
+ ---
46
+
47
+ ## Page Designer Scopes (Phase 4 — Step 7, background)
48
+
49
+ All page scopes share common inputs and rules. Scope-specific details follow.
50
+
51
+ ### Common inputs (from your prompt)
52
+
53
+ - **Brand context** — name, vibe, aesthetic direction, colors, fonts, mood.
54
+ - **Published token contract** — the `designTokens` JSON (same shape the Designer returned, written into `@theme` by the Composer). 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.
55
+ - **Pages to design** — list of routes and their contract class associations.
56
+ - **Pack home-section snippet** (home scope only) — section stubs from every loaded pack.
57
+ - **Placeholder data instruction** — use plausible brand-contextual placeholder text, prices, images where live data is not yet available.
58
+
59
+ ### Common rules for all page scopes
60
+
61
+ 1. **Use contract classes.** Every component that corresponds to a contract key uses that class name. Do not invent replacements.
62
+ 2. **Use the Layout.** Every page wraps content in `<Layout>`:
63
+ ```astro
64
+ ---
65
+ import Layout from '../layouts/Layout.astro';
66
+ ---
67
+ <Layout title="Page Title">
68
+ <!-- page content -->
69
+ </Layout>
70
+ ```
71
+ 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.
72
+ 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.
73
+ 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.
74
+ 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`.
75
+ 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:**
76
+
77
+ | Key | Where it lives | Required when |
78
+ |---|---|---|
79
+ | `hero` | Homepage hero image | Always |
80
+ | `about` | About-page (or home brand-story) editorial visual | Always |
81
+ | `productsHeader` | `/products` listing header decorative | Stores pack loaded |
82
+ | `cmsHeader` | `/about` or `/faq` page header decorative | CMS pack loaded (optional) |
83
+
84
+ 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:
85
+ - Use aspect-ratio + background-color on the placeholder so the page looks complete even if Image Phase 1 never completes.
86
+ - 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).
87
+ - 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.
88
+ - Do not use external placeholder services (picsum, unsplash, etc.).
89
+
90
+ Example:
91
+ ```astro
92
+ <section class="hero-section relative">
93
+ <div
94
+ class="hero-image"
95
+ data-decorative-slot="hero"
96
+ style="aspect-ratio: 4/5; background-color: var(--color-paper-warm);"
97
+ >
98
+ <!-- orchestrator injects <img src={decorativeImages.hero} …> here -->
99
+ </div>
100
+ <div class="hero-stamp">{/* decorative overlay, stays outside the slot */}</div>
101
+ </section>
102
+ ```
103
+ 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.
104
+ 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`.
105
+ 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.
106
+ 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.
107
+ 12. **Do NOT write to `src/styles/components-<pack>.css` or `src/styles/global.css`** — `components-<pack>.css` is owned by Phase 3 Components agents; `global.css` is owned by the Composer. Writing to either causes double-write conflicts.
108
+
109
+ ### Scope: `home`
110
+
111
+ Composes the home page from every loaded pack's `homeSection` snippet plus brand-specific hero and CTA sections.
112
+
113
+ **Inputs (additional):**
114
+ - `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.
115
+
116
+ **Structure:**
117
+ 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.
118
+ 2. **Pack sections** — one section per loaded pack's `homeSection`, in a sensible order (typically: featured content first, then story, then CTA).
119
+ 3. **Optional closing CTA** — if no pack contributes a CTA section, add a minimal brand-appropriate closing.
120
+
121
+ **Files:** `src/pages/index.astro`
122
+
123
+ **Return:**
124
+ ```json
125
+ {
126
+ "status": "complete",
127
+ "phase": "designer-home",
128
+ "scope": "home",
129
+ "data": {
130
+ "pagesDesigned": ["src/pages/index.astro"],
131
+ "contractClassesHonored": ["hero-section", "product-grid", "product-card", "brand-story", ...]
132
+ },
133
+ "files": ["src/pages/index.astro"]
134
+ }
135
+ ```
136
+
137
+ ### Scope: `static`
138
+
139
+ About and FAQ pages — content pages with similar layout demands.
140
+
141
+ **Files:** `src/pages/about.astro`, `src/pages/faq.astro`
142
+
143
+ **About page:**
144
+ - Hero/header section with `about-hero` class
145
+ - Body content with `about-body` class
146
+ - Placeholder brand story text (2-3 paragraphs, brand-contextual)
147
+ - Image placeholder for brand/team visual
148
+
149
+ **FAQ page:**
150
+ - Section wrapper with `faq-section` class
151
+ - Individual Q&A items with `faq-item`, `faq-question`, `faq-answer` classes
152
+ - 4-6 placeholder FAQ items contextual to the business type
153
+ - Accordion or expandable pattern (CSS-only, using `<details>`/`<summary>` or checkbox hack)
154
+
155
+ **Return:**
156
+ ```json
157
+ {
158
+ "status": "complete",
159
+ "phase": "designer-static",
160
+ "scope": "static",
161
+ "data": {
162
+ "pagesDesigned": ["about", "faq"],
163
+ "contractClassesHonored": ["about-hero", "about-body", "faq-section", "faq-item", "faq-question", "faq-answer"]
164
+ },
165
+ "files": ["src/pages/about.astro", "src/pages/faq.astro"]
166
+ }
167
+ ```
168
+
169
+ ### Scope: `store-pages`
170
+
171
+ All store-facing pages designed together for visual coherence.
172
+
173
+ **Files:** `src/pages/products/index.astro`, `src/pages/products/[slug].astro`, `src/components/ProductCard.astro`, `src/pages/cart.astro`, `src/pages/thank-you.astro`
174
+
175
+ **Products listing (`/products`):**
176
+ - Page heading
177
+ - Product grid using `product-grid` class
178
+ - 3-6 placeholder product cards using `ProductCard` component
179
+
180
+ **Product detail (`/products/[slug]`):**
181
+ - Product image (large, placeholder)
182
+ - Product info section with `product-detail` class
183
+ - Purchase area with `product-purchase` class — placeholder price, placeholder variant selector, Add to Cart button with `add-to-cart-btn` class
184
+ - Product description area
185
+
186
+ **ProductCard component:**
187
+ - Accepts a single `product` prop (object with name, price, slug, image fields)
188
+ - Uses `product-card` class
189
+ - Image, name, price, link to `/products/${product.slug}`
190
+ - **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 } }`
191
+
192
+ **Cart (`/cart`):**
193
+ - Two-column grid layout: `.cart-grid` — items column left, order summary right. Stacks vertically on mobile
194
+ - 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
195
+ - Quantity selector with `.cart-item-qty`, `.qty-btn`, `.qty-value` classes — include `:disabled` states (reduced opacity + `cursor: not-allowed`)
196
+ - 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
197
+ - Remove button with `.cart-item-remove` class (muted color, underline on hover)
198
+ - Summary column with `.cart-summary` (sticky on desktop), `.cart-subtotal`, `.checkout-btn` (with `:disabled` state), `.cart-empty` classes
199
+ - Unavailable item warning with `.cart-item-unavailable` class (red text)
200
+ - Empty state with `.cart-empty` class (centered, muted text + "Browse Products" link)
201
+ - **All cart CSS must be in `<style is:global>`** — `CartView` is a React island; scoped Astro styles do not reach its children
202
+ - Placeholder cart items (2-3)
203
+
204
+ **Thank you (`/thank-you`):**
205
+ - Confirmation message with `order-summary` class
206
+ - Placeholder order details
207
+
208
+ **Return:**
209
+ ```json
210
+ {
211
+ "status": "complete",
212
+ "phase": "designer-store-pages",
213
+ "scope": "store-pages",
214
+ "data": {
215
+ "pagesDesigned": ["products/index.astro", "products/[slug].astro", "ProductCard.astro", "cart.astro", "thank-you.astro"],
216
+ "contractClassesHonored": <count>
217
+ },
218
+ "files": [
219
+ "src/pages/products/index.astro",
220
+ "src/pages/products/[slug].astro",
221
+ "src/components/ProductCard.astro",
222
+ "src/pages/cart.astro",
223
+ "src/pages/thank-you.astro"
224
+ ]
225
+ }
226
+ ```
227
+
228
+ ### Scope: `blog-pages`
229
+
230
+ Blog feed listing and post detail designed together.
231
+
232
+ **Files:** `src/pages/blog/index.astro`, `src/pages/blog/[slug].astro`
233
+
234
+ **Blog listing (`/blog`):**
235
+ - Page heading
236
+ - Post grid/list using `blog-feed` class
237
+ - 3 placeholder post cards using `blog-post-card` class (title, date, excerpt, cover image placeholder)
238
+
239
+ **Blog post detail (`/blog/[slug]`):**
240
+ - Post header with title, date, author, cover image placeholder
241
+ - Body area with `blog-post` and `blog-post-body` classes
242
+ - Meta section with `blog-post-meta` class (tags, share links)
243
+ - Good reading typography (max-width prose container, comfortable line height)
244
+
245
+ **Return:**
246
+ ```json
247
+ {
248
+ "status": "complete",
249
+ "phase": "designer-blog-pages",
250
+ "scope": "blog-pages",
251
+ "data": {
252
+ "pagesDesigned": ["blog/index.astro", "blog/[slug].astro"],
253
+ "contractClassesHonored": ["blog-feed", "blog-post-card", "blog-post", "blog-post-body", "blog-post-meta"]
254
+ },
255
+ "files": ["src/pages/blog/index.astro", "src/pages/blog/[slug].astro"]
256
+ }
257
+ ```
258
+
259
+ ### Scope: `contact-page`
260
+
261
+ Contact page with form placeholder.
262
+
263
+ **Files:** `src/pages/contact.astro`
264
+
265
+ **Contact page:**
266
+ - Page heading and descriptive text
267
+ - Contact CTA section using `contact-cta` class (if on home, this mirrors the home CTA's visual language)
268
+ - 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.
269
+ - Optional: map embed placeholder, business hours, address (if brand context suggests it)
270
+
271
+ **Return:**
272
+ ```json
273
+ {
274
+ "status": "complete",
275
+ "phase": "designer-contact-page",
276
+ "scope": "contact-page",
277
+ "data": {
278
+ "pagesDesigned": ["contact.astro"],
279
+ "contractClassesHonored": ["contact-cta"]
280
+ },
281
+ "files": ["src/pages/contact.astro"]
282
+ }
283
+ ```
284
+
285
+ ---
286
+
287
+ ## Return Contract
288
+
289
+ At the end of your work, emit a structured JSON block per `../../shared/RETURN_CONTRACT.md`. Do **not** write sidecar files to `.wix/logs/*`.
290
+
291
+ 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 ` ``` `.
292
+
293
+ ## Anti-Patterns (apply to all page scopes)
294
+
295
+ | WRONG | CORRECT |
296
+ |-------|---------|
297
+ | Author a `.tsx` React island in a page scope | Phase 3 Components writes the islands; the route only **mounts** them (`client:load`) |
298
+ | 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 |
299
+ | Write `global.css` or `@theme` tokens | The Composer owns `global.css`; you consume the published token contract |
300
+ | 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` |
301
+ | Override `global.css` rules from page `<style>` blocks | Pages can add co-located styles for one-off decoration; never override Composer-owned global classes |
302
+ | HTML `<!-- comment -->` in `.astro` frontmatter | Use `//` or `/* */` — frontmatter is TypeScript |
303
+ | Use external placeholder image services (picsum, unsplash) | Use colored `<div>` placeholders with `data-decorative-slot` — the orchestrator injects Image Phase 1 URLs later |
304
+ | Write `components-<pack>.css` | Phase 3 Components creates that file — page scopes must not write it |
305
+ | Leave a section empty when a query returns nothing | Render a brand-contextual fallback / empty state so the page is always reviewable |
306
+ | 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 |
307
+ | Generic unstyled HTML | Brand-first design — every element reflects the aesthetic direction |
308
+ | Fixed-width layouts | Responsive: mobile-first, breakpoints at 320/768/1024px |
309
+ | `ls src/`, `Glob src/**` to discover files | Your prompt lists every file and class contract. Write directly. |
310
+ | `Read .wix/site.json` to get brand or verticals | Every field is in your prompt |
311
+ | 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 |
312
+ | 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) |
313
+ | Add a hero CTA / footer link to a disabled-pack route | Disabled packs (gift-cards) are dormant — no entry points to their routes |
314
+ | ProductCard with flat props (`name`, `price`, `slug` as separate props) | Single `product` object prop: `{ product }` — Phase 4 passes the full Wix product object |
315
+ | 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 |
316
+
317
+ ## Coordination with other agents
318
+
319
+ | Agent | Relationship | Rule |
320
+ |-------|-------------|------|
321
+ | 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 |
322
+ | Phase 3 Components (stores/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 |
323
+ | 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 |
324
+ | 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 |
325
+ | 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 |
326
+
327
+ ## File ownership
328
+
329
+ 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.
330
+
331
+ The shared shells the route composes into — `Layout.astro`, `Navigation.astro`, `index.astro`, `global.css`, `components-<pack>.css` — are owned by the Composer / Phase 3 Components, not by the route scope (see "Coordination" above and BUILD.md Step 7's shared-shell-patcher serialization rule).
@@ -117,4 +117,4 @@ Cart page → "Proceed to Checkout"
117
117
  ],
118
118
  "errors": []
119
119
  }
120
- ```
120
+ ```
@@ -100,4 +100,4 @@ Contract keys: `cartBadge`, `cartBadgeCount`
100
100
  ],
101
101
  "errors": []
102
102
  }
103
- ```
103
+ ```
@@ -19,7 +19,7 @@ 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).
@@ -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.
@@ -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,25 +12,25 @@ 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
36
  3. **If forms list is empty** → create a form (two-step atomic operation):
@@ -125,9 +125,9 @@ Before writing any form code, ensure a contact form exists on the site via MCP:
125
125
  }
126
126
  ```
127
127
 
128
- Full MCP call structure:
128
+ Full REST call structure:
129
129
  ```
130
- CallWixSiteAPI: POST https://www.wixapis.com/form-schema-service/v4/forms
130
+ REST: POST https://www.wixapis.com/form-schema-service/v4/forms
131
131
  body: {
132
132
  "form": {
133
133
  "formFields": [ <selected fields from above> ],
@@ -162,7 +162,7 @@ Before writing any form code, ensure a contact form exists on the site via MCP:
162
162
  - PATCH using the procedure in step 5 below
163
163
  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
164
  ```
165
- CallWixSiteAPI: PATCH https://www.wixapis.com/form-schema-service/v4/forms/<formId>
165
+ REST: PATCH https://www.wixapis.com/form-schema-service/v4/forms/<formId>
166
166
  body: {
167
167
  "form": {
168
168
  "revision": "<current revision from GET>",
@@ -427,7 +427,7 @@ const wixForm = listResult.forms?.[0];
427
427
  const formId = wixForm?._id;
428
428
  ```
429
429
 
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).
430
+ 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
431
 
432
432
  ## Form Field Schema (SDK Types)
433
433
 
@@ -471,7 +471,7 @@ After form verification, write a sidecar file at `.wix/logs/forms-data.md` (form
471
471
 
472
472
  ## Testing
473
473
 
474
- 1. Run `npx @wix/cli dev`
474
+ 1. Run `npx @wix/cli@latest dev`
475
475
  2. Navigate to `/contact`
476
476
  3. Fill in the form and submit
477
- 4. Check the Wix dashboard → Forms → Submissions to verify the data arrived
477
+ 4. Check the Wix dashboard → Forms → Submissions to verify the data arrived
@@ -116,4 +116,4 @@ Use brand `@theme` utilities (`bg-cream`, `text-ink`, etc.) where natural; fall
116
116
  | Throw or log+rethrow on probe failure | Return `null`; callers gate the UI on null |
117
117
  | Hardcode denomination amounts (€10, €25, etc.) | Always render from `product.presetVariants` |
118
118
  | Skip `wixGiftCardsAppNewCatalog: true` in cart options | Required — without it the cart line is the wrong item type and `ORDER_PAID` does not issue a gift card |
119
- | Write your own `wix-image.ts` / `analytics.ts` | Import from the shared utilities |
119
+ | Write your own `wix-image.ts` / `analytics.ts` | Import from the shared utilities |
@@ -126,4 +126,4 @@ If a marker is missing, return `status: "partial"` with `errors: [{ code: "MARKE
126
126
  | Replace the marker comment with the inserted snippet | Insert AFTER the marker; preserve the marker line |
127
127
  | Move CSS into `<style>` blocks inside `.astro` files | Page/teaser CSS lives in `components-gift-cards.css` (Components scope) |
128
128
  | Hardcode `<title>"Gift Cards"</title>` | Use `title={\`${product.name}\`}` so the dashboard owner controls naming |
129
- | Conditionally re-render the page when the app is enabled later | The Astro page is server-rendered each request — the probe runs every time, so dashboard changes are picked up without rebuild |
129
+ | Conditionally re-render the page when the app is enabled later | The Astro page is server-rendered each request — the probe runs every time, so dashboard changes are picked up without rebuild |
@@ -175,4 +175,4 @@ The full components scope return must mention back-in-stock:
175
175
  | Send `"$385"` as `price` | Numeric string `"385"` only; the API rejects formatted prices with `400 DECIMAL_GTE` |
176
176
  | Wrap the subscribe call in `auth.elevate(...)` from the React island | Visitor scope is enough; elevation belongs only to the SSR probe |
177
177
  | Add a custom `src/pages/api/back-in-stock-subscribe.ts` route | Not needed — SDK from the island works. The Wix cloud adapter returned 403 on app-defined POST routes during the trial. |
178
- | Drop the module-memoization in `back-in-stock.ts` | Keep it; multiple SSR awaits in the same request coalesce into one `getSettings` call |
178
+ | Drop the module-memoization in `back-in-stock.ts` | Keep it; multiple SSR awaits in the same request coalesce into one `getSettings` call |
@@ -1,8 +1,8 @@
1
1
  # Phase 4 Category Pages — Stores
2
2
 
3
- Scope: `pages-categories`. Launched in **Step 7** alongside `pages-products` and `pages-home-and-nav`. This scope writes the dedicated category landing route and the shared `<CategoryRail/>` + `categories.ts` helper that `pages-products` and `pages-home-and-nav` also import.
3
+ Scope: `pages-categories`. Launched in **Step 7** alongside `pages-products` and `pages-home-and-nav`. This scope writes the dedicated category landing route and the shared `<CategoryRail/>`. The `categories.ts` helper that all three scopes import is **pre-copied by the orchestrator before this phase** (BUILD.md Step 7 pre-batch) — do NOT write it here.
4
4
 
5
- **Dispatch:** all three stores Phase-4 scopes are dispatched in parallel — Astro resolves the cross-file imports at build time (Step 8). The orchestrator does not need to serialize. Each scope only needs its own declared files to exist by the time `astro build` runs.
5
+ **Dispatch:** all three stores Phase-4 scopes are dispatched in parallel — Astro resolves the cross-file imports at build time (Step 8). The orchestrator does not need to serialize them. Each scope only needs its own declared files to exist by the time `astro build` runs; `categories.ts` is already on disk from the pre-batch.
6
6
 
7
7
  ## Scope
8
8
 
@@ -10,7 +10,9 @@ Files this agent OWNS (writes):
10
10
 
11
11
  - `src/pages/category/[slug].astro` — category landing (server-side filtered, cursor-paginated)
12
12
  - `src/components/CategoryRail.astro` — shared rail + Prev/Next pagination, persisted across `<ClientRouter />` swaps
13
- - `src/utils/categories.ts` — TTL-cached helpers: `listStoreCategories`, `getCategoryBySlug`, `listProductsInCategory`
13
+
14
+ Files this agent imports but MUST NOT write:
15
+ - `src/utils/categories.ts` — TTL-cached helpers (`listStoreCategories`, `getCategoryBySlug`, `listProductsInCategory`). **Pre-copied by the orchestrator** before this phase (it's a static, brand-agnostic SDK wrapper); import the helpers, never author the file. Writing it races `pages-products`/`pages-home-and-nav`, which import the same path.
14
16
 
15
17
  Files this agent MUST NOT touch:
16
18
  - `src/pages/products/index.astro`, `[slug].astro`, `src/components/ProductCard.astro` — owned by `pages-products`
@@ -21,7 +23,7 @@ Files this agent MUST NOT touch:
21
23
  ## Inputs (from parent prompt)
22
24
 
23
25
  - **Phase 1 return data** — `categories: []`. Phase 1 does not seed categories (they're merchant-driven). This scope still writes the helper + rail + route — they're harmless when no categories exist, and they light up automatically once the merchant creates visible categories with items in the dashboard. `listStoreCategories()` queries the API live at SSR time (5-min TTL cache), so no redeploy is needed when categories are added later.
24
- - **Design tokens** — `.wix/site.json.designTokens` for the published vocabulary. Page header / breadcrumbs / pill / pagination styling should follow `references/shared/STYLING.md` (utilities derived from tokens, semantic classes only for primitives).
26
+ - **Design tokens** — the full `designTokens` JSON is inlined in your prompt (same shape Designer returned). Page header / breadcrumbs / pill / pagination styling should follow `references/shared/STYLING.md` (utilities derived from tokens, semantic classes only for primitives).
25
27
  - **Designer output summary** — confirm `Layout.astro` already includes `<ClientRouter />`, `transition:persist` markers on nav/footer, and the `[data-nav-progress]` element + after-swap hook. If any of those is missing, return `status: "partial"` with `errors: [{ code: "DESIGNER_LAYOUT_MISSING_TRANSITIONS", path: "src/layouts/Layout.astro" }]`.
26
28
 
27
29
  ## Critical rules (all must be honored)
@@ -31,18 +33,17 @@ Files this agent MUST NOT touch:
31
33
  3. **`queryCategories(...)` rejects empty filters.** The SDK builder's `.find()` validates that at least one predicate has been chained. Always include `.eq("visible", true)` (the constraint we want anyway). Provided template already does this.
32
34
  4. **Filter out the auto-managed "All Products" category** by `handle === "online_stores_all_products"`. It's installed by Wix Stores automatically and contains every product; surfacing it in the rail makes the All pill duplicate.
33
35
  5. **Filter out empty categories** by `itemCounter === 0` so the rail doesn't show buckets that 404 in practice (the route still works, but the pill leads to "Nothing in <name> just now").
34
- 6. **Use the Stores app id `215238eb-22a5-4c36-9e7b-e7c08025e04e`** as `STORES_APP_ID` in `categories.ts`. Same id used for cart ops and Phase 1 product seed. NOT the back-in-stock id `1380b703-…`.
36
+ 6. **`STORES_APP_ID` lives in the pre-copied `categories.ts`** — the template already sets it to the Stores app id `215238eb-22a5-4c36-9e7b-e7c08025e04e` (same id used for cart ops and Phase 1 product seed; NOT the back-in-stock id `1380b703-…`). You do not write that file; this is documented so the helpers you import behave as expected.
35
37
  7. **Cursor pagination** uses `productsV3.queryProducts().limit(24).skipTo(cursor)`. Cursor lives in `?cursor=…` on the URL, surfaced from `result.cursors.next` / `result.cursors.prev`. Prev/Next links use `data-astro-prefetch="hover"` so hovering them warms the cache.
36
38
  8. **Module-level TTL cache (5 min)** in `categories.ts` is opportunistic; safe under the Cloudflare-style fetch adapter (each worker isolate is single-tenant). Errors don't poison the cache.
37
39
  9. **Two-call pipeline** in `listProductsInCategory`: first `listItemsInCategory(categoryId, { appNamespace: "@wix/stores" })` for IDs, then `productsV3.queryProducts().in("_id", ids).limit(24).skipTo(cursor).find()`. There is no Wix endpoint that does category filter + cursor paging in one shot — don't attempt `listCategoriesForItems` from the SDK; it ships items via GET querystring and breaks on arrays. If you need product → categories mapping (e.g. for breadcrumbs on product detail), call the REST POST endpoint directly: `POST /categories/v1/categories/list-categories-for-items`.
38
40
 
39
41
  ## Writing the templates
40
42
 
41
- Read each template at `templates/stores/` and write it verbatim to the corresponding `src/` path, with three small adjustments:
43
+ Read each template at `templates/stores/` and write it verbatim to the corresponding `src/` path, with three small adjustments. (`categories.ts` is **not** in this list — the orchestrator pre-copies it; you only import its helpers.)
42
44
 
43
45
  | Template path | Site path |
44
46
  |---|---|
45
- | `templates/categories.ts` | `src/utils/categories.ts` |
46
47
  | `templates/CategoryRail.astro` | `src/components/CategoryRail.astro` |
47
48
  | `templates/category/[slug].astro` | `src/pages/category/[slug].astro` |
48
49
 
@@ -54,13 +55,12 @@ Adjustments at the call site:
54
55
 
55
56
  ## Pre-return file-existence assertion
56
57
 
57
- Before returning `status: "complete"`, verify all three files exist:
58
+ Before returning `status: "complete"`, verify the two files you write exist:
58
59
 
59
- - `src/utils/categories.ts`
60
60
  - `src/components/CategoryRail.astro`
61
61
  - `src/pages/category/[slug].astro`
62
62
 
63
- If any is missing, return `status: "partial"` with `errors: [{ code: "PHASE4_FILE_MISSING", path: "<expected path>" }]`. The orchestrator's manifest check will also catch this, but an agent-side assertion gives a faster and more precise failure.
63
+ If either is missing, return `status: "partial"` with `errors: [{ code: "PHASE4_FILE_MISSING", path: "<expected path>" }]`. The orchestrator's manifest check will also catch this, but an agent-side assertion gives a faster and more precise failure. Also confirm the pre-copied `src/utils/categories.ts` is on disk (you import it); if it's missing, that's an orchestrator-side bug — return `status: "partial"` with `errors: [{ code: "UTILITY_TEMPLATE_NOT_PRECOPIED", path: "src/utils/categories.ts" }]` and do NOT write your own.
64
64
 
65
65
  ## Return contract
66
66
 
@@ -69,11 +69,10 @@ If any is missing, return `status: "partial"` with `errors: [{ code: "PHASE4_FIL
69
69
  "status": "complete",
70
70
  "phase": "stores-pages",
71
71
  "scope": "pages-categories",
72
- "summary": "Wrote shared CategoryRail + categories helper; /category/[slug] route renders M categories.",
72
+ "summary": "Wrote shared CategoryRail + /category/[slug] route (imports the pre-copied categories helper); route renders M categories.",
73
73
  "data": {
74
74
  "categoriesRendered": 0,
75
75
  "filesWritten": [
76
- "src/utils/categories.ts",
77
76
  "src/components/CategoryRail.astro",
78
77
  "src/pages/category/[slug].astro"
79
78
  ]
@@ -83,4 +82,4 @@ If any is missing, return `status: "partial"` with `errors: [{ code: "PHASE4_FIL
83
82
  }
84
83
  ```
85
84
 
86
- Phase 1 always reports zero categories (it does not seed them). Set `categoriesRendered: 0` and return `status: "complete"` — the helper, rail, and route are still written so the storefront lights up automatically the first time the merchant creates a visible category with items in the dashboard, with no code change needed.
85
+ Phase 1 always reports zero categories (it does not seed them). Set `categoriesRendered: 0` and return `status: "complete"` — the helper, rail, and route are still written so the storefront lights up automatically the first time the merchant creates a visible category with items in the dashboard, with no code change needed.
@@ -19,7 +19,7 @@ Exactly one file:
19
19
 
20
20
  You only need:
21
21
 
22
- 1. **`<SKILL_ROOT>/templates/stores/components-stores.css`** — the canonical template. Read it once.
22
+ 1. **`<SKILL_ROOT>/references/astro/templates/stores/components-stores.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 stores-class leaks (see § "Global-CSS leak audit" below).
@@ -32,7 +32,7 @@ You do NOT need to read `INSTRUCTIONS.md`, `SHARED_WIRING.md`, `BACK_IN_STOCK.md
32
32
  ### 1. Read the template
33
33
 
34
34
  ```
35
- <SKILL_ROOT>/templates/stores/components-stores.css
35
+ <SKILL_ROOT>/references/astro/templates/stores/components-stores.css
36
36
  ```
37
37
 
38
38
  This is the canonical scoped CSS for the stores 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.
@@ -68,7 +68,7 @@ The boundary: **rules referenced by exactly one pack's TSX live in that pack's s
68
68
 
69
69
  ### 4. Global-CSS leak audit
70
70
 
71
- Before writing your file, **read `src/styles/global.css`** and grep for any class your scope owns. Stores-specific rules sometimes leak into the designer's foundation (observed across runs):
71
+ Before writing your file, **read `src/styles/global.css`** and grep for any class your scope owns. Stores-specific rules sometimes leak into the designer's foundation:
72
72
 
73
73
  - `.product-grid` and `body[data-navigating="true"] .product-grid` — designer drift; should be in `components-stores.css`, not `global.css`.
74
74
  - Any `.product-card-*` rule.
@@ -126,4 +126,4 @@ If a leak was found and overridden, include `errors: [{code: "GLOBAL_CSS_LEAK",
126
126
  | Use default Tailwind colors (`bg-green-50`, `text-red-600`) | Brand `@theme` utilities (`bg-bark`, `text-cream`) or `var(--color-...)` |
127
127
  | Write rules for `.add-to-cart-btn` here | That's a global contract class — owned by the designer's `global.css` |
128
128
  | Rename a class because the brand is "more elegant" with kebab-cased variants | Class names are contract keys; renaming breaks every TSX import that references them |
129
- | Skip the leak audit | Skipping ships double-defined rules; the audit is < 5 s and prevents downstream visual regressions |
129
+ | Skip the leak audit | Skipping ships double-defined rules; the audit is < 5 s and prevents downstream visual regressions |