@wix/agent-skills 1.5.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 (156) 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/EDITOR_REACT_COMPONENT.md +15 -1
  12. package/skills/wix-app/references/EMBEDDED_SCRIPT.md +41 -268
  13. package/skills/wix-app/references/EXTENSION_REGISTRATION.md +27 -76
  14. package/skills/wix-app/references/SERVICE_PLUGIN.md +35 -188
  15. package/skills/wix-app/references/SITE_PLUGIN.md +8 -92
  16. package/skills/wix-app/references/backend-event/COMMON-EVENTS.md +0 -44
  17. package/skills/wix-app/references/custom-element-widget/SETTINGS_PANEL.md +19 -330
  18. package/skills/wix-app/references/dashboard-menu-plugin/bookings-slots.md +0 -12
  19. package/skills/wix-app/references/dashboard-menu-plugin/ecommerce-slots.md +7 -0
  20. package/skills/wix-app/references/dashboard-menu-plugin/restaurants-slots.md +0 -12
  21. package/skills/wix-app/references/dashboard-plugin/SLOTS.md +3 -15
  22. package/skills/wix-app/references/data-collection/WIX_DATA.md +1 -1
  23. package/skills/wix-app/references/editor-react-component/COMPONENT-API.md +1 -1
  24. package/skills/wix-app/references/service-plugin/ADDITIONAL-FEES.md +2 -18
  25. package/skills/wix-app/references/service-plugin/BOOKINGS-STAFF-SORTING.md +2 -42
  26. package/skills/wix-app/references/service-plugin/DISCOUNT-TRIGGERS.md +1 -11
  27. package/skills/wix-app/references/service-plugin/GIFT-CARDS.md +1 -11
  28. package/skills/wix-app/references/service-plugin/PAYMENT-SETTINGS.md +2 -40
  29. package/skills/wix-app/references/service-plugin/SHIPPING-RATES.md +2 -19
  30. package/skills/wix-app/references/service-plugin/VALIDATIONS.md +2 -18
  31. package/skills/wix-app/references/site-plugin/SLOTS.md +17 -68
  32. package/skills/wix-headless/SKILL.md +112 -368
  33. package/skills/wix-headless/references/BUILD.md +307 -0
  34. package/skills/wix-headless/references/DESIGN_SYSTEM.md +115 -0
  35. package/skills/wix-headless/references/DISCOVERY.md +237 -112
  36. package/skills/wix-headless/references/PLAN.md +82 -0
  37. package/skills/wix-headless/references/SEED.md +205 -0
  38. package/skills/wix-headless/references/SETUP.md +250 -94
  39. package/skills/wix-headless/references/astro/COMPOSE.md +142 -0
  40. package/skills/wix-headless/references/{blog → astro/blog}/BLOG_PAGES.md +1 -1
  41. package/skills/wix-headless/references/{blog → astro/blog}/BLOG_SETUP.md +2 -2
  42. package/skills/wix-headless/references/astro/cms/CMS_FOUNDATIONS.md +214 -0
  43. package/skills/wix-headless/references/{cms → astro/cms}/FAQ_KNOWLEDGE_BASE.md +6 -4
  44. package/skills/wix-headless/references/{cms → astro/cms}/PORTFOLIO.md +5 -5
  45. package/skills/wix-headless/references/{cms → astro/cms}/RESOURCE_LIBRARY.md +5 -5
  46. package/skills/wix-headless/references/{cms → astro/cms}/TEAM_DIRECTORY.md +5 -5
  47. package/skills/wix-headless/references/astro/designer/INSTRUCTIONS.md +331 -0
  48. package/skills/wix-headless/references/{ecom → astro/ecom}/CART_PAGES.md +1 -1
  49. package/skills/wix-headless/references/{ecom → astro/ecom}/CART_WIRING.md +1 -1
  50. package/skills/wix-headless/references/{ecom → astro/ecom}/COMPONENTS_CSS.md +3 -3
  51. package/skills/wix-headless/references/{forms → astro/forms}/CONTACT_FORM.md +13 -13
  52. package/skills/wix-headless/references/{gift-cards → astro/gift-cards}/COMPONENTS.md +1 -1
  53. package/skills/wix-headless/references/{gift-cards → astro/gift-cards}/PAGES.md +1 -1
  54. package/skills/wix-headless/references/{stores → astro/stores}/BACK_IN_STOCK.md +1 -1
  55. package/skills/wix-headless/references/{stores → astro/stores}/CATEGORY_PAGES.md +12 -13
  56. package/skills/wix-headless/references/{stores → astro/stores}/COMPONENTS_CSS.md +4 -4
  57. package/skills/wix-headless/references/{stores → astro/stores}/HOME_AND_NAV.md +11 -9
  58. package/skills/wix-headless/references/{stores → astro/stores}/PRODUCT_PAGES.md +5 -3
  59. package/skills/wix-headless/references/{stores → astro/stores}/SHARED_WIRING.md +3 -3
  60. package/skills/wix-headless/references/astro/templates/Footer.astro +27 -0
  61. package/skills/wix-headless/references/astro/templates/Layout.astro +132 -0
  62. package/skills/wix-headless/references/astro/templates/Navigation.astro +38 -0
  63. package/skills/wix-headless/references/astro/templates/astro.config.mjs +41 -0
  64. package/skills/wix-headless/references/astro/templates/ecom/components-ecom.css +302 -0
  65. package/skills/wix-headless/references/astro/templates/global.css +286 -0
  66. package/skills/wix-headless/references/astro/templates/index.astro +56 -0
  67. package/skills/wix-headless/{templates → references/astro/templates}/stores/back-in-stock.ts +1 -1
  68. package/skills/wix-headless/{templates → references/astro/templates}/stores/components-stores.css +138 -33
  69. package/skills/wix-headless/references/blog/BLOG_CONTENT.md +10 -11
  70. package/skills/wix-headless/references/blog/INSTRUCTIONS.md +5 -5
  71. package/skills/wix-headless/references/cms/CMS_FOUNDATIONS.md +31 -230
  72. package/skills/wix-headless/references/cms/INSTRUCTIONS.md +13 -8
  73. package/skills/wix-headless/references/custom/INSTRUCTIONS.md +38 -0
  74. package/skills/wix-headless/references/ecom/INSTRUCTIONS.md +10 -10
  75. package/skills/wix-headless/references/forms/INSTRUCTIONS.md +5 -5
  76. package/skills/wix-headless/references/gift-cards/INSTRUCTIONS.md +11 -11
  77. package/skills/wix-headless/references/images/INSTRUCTIONS.md +47 -50
  78. package/skills/wix-headless/references/seed-recipes.md +49 -0
  79. package/skills/wix-headless/references/shared/AUTHENTICATION.md +110 -0
  80. package/skills/wix-headless/references/shared/BUILD_NOISE.md +2 -2
  81. package/skills/wix-headless/references/shared/DOCS_SEARCH.md +41 -0
  82. package/skills/wix-headless/references/shared/IMAGE_GENERATION.md +17 -17
  83. package/skills/wix-headless/references/shared/IMPLEMENTER.md +20 -29
  84. package/skills/wix-headless/references/shared/PRODUCTION_SHARP_EDGES.md +1 -1
  85. package/skills/wix-headless/references/shared/RETURN_CONTRACT.md +25 -16
  86. package/skills/wix-headless/references/shared/STYLING.md +47 -10
  87. package/skills/wix-headless/references/stores/INSTRUCTIONS.md +25 -25
  88. package/skills/wix-headless/references/stores/PRODUCT_CATALOG_DATA.md +17 -17
  89. package/skills/wix-headless/references/verticals/_schema.json +31 -117
  90. package/skills/wix-headless/references/verticals/_schema.md +60 -150
  91. package/skills/wix-headless/references/verticals/blog.md +5 -99
  92. package/skills/wix-headless/references/verticals/cms.md +9 -100
  93. package/skills/wix-headless/references/verticals/ecom.md +5 -76
  94. package/skills/wix-headless/references/verticals/forms.md +5 -85
  95. package/skills/wix-headless/references/verticals/gift-cards.md +6 -103
  96. package/skills/wix-headless/references/verticals/stores.md +10 -144
  97. package/skills/wix-headless/scripts/check-manifest.mjs +5 -5
  98. package/skills/wix-headless/scripts/emit-design-tokens.mjs +29 -23
  99. package/skills/wix-headless/scripts/init-site-json.mjs +59 -21
  100. package/skills/wix-headless/scripts/patch-decorative-slots.mjs +67 -43
  101. package/skills/wix-headless/scripts/plan-entity-image-waves.mjs +3 -3
  102. package/skills/wix-headless/scripts/preview.sh +3 -3
  103. package/skills/wix-headless/scripts/release.sh +4 -4
  104. package/skills/wix-headless/scripts/scaffold.sh +75 -20
  105. package/skills/wix-headless/scripts/seed-utilities.sh +50 -12
  106. package/skills/wix-manage/SKILL.md +4 -8
  107. package/skills/wix-manage/references/blog/how-to-create-blog-posts.md +70 -1
  108. package/skills/wix-manage/references/cms/cms-data-items-crud.md +4 -0
  109. package/skills/wix-manage/references/cms/cms-references-and-relationships.md +2 -0
  110. package/skills/wix-manage/references/cms/cms-schema-management.md +4 -0
  111. package/skills/wix-manage/references/ecommerce/api-shipping.md +443 -0
  112. package/skills/wix-manage/references/ecommerce/flow-add-free-shipping.md +5 -6
  113. package/skills/wix-manage/references/ecommerce/flow-fix-coverage-gaps.md +4 -5
  114. package/skills/wix-manage/references/ecommerce/flow-optimize-shipping-rates.md +4 -5
  115. package/skills/wix-manage/references/ecommerce/goal-increase-aov.md +1 -1
  116. package/skills/wix-manage/references/ecommerce/goal-reduce-cart-abandonment.md +1 -2
  117. package/skills/wix-manage/references/ecommerce/guardrail-shipping-health.md +2 -2
  118. package/skills/wix-manage/references/ecommerce/recipe-apply-shipping-recommendations.md +4 -5
  119. package/skills/wix-manage/references/ecommerce/recommend-ecommerce-strategy.md +7 -7
  120. package/skills/wix-manage/references/ecommerce/setup-discount-rules.md +209 -72
  121. package/skills/wix-manage/references/ecommerce/setup-store-pickup-location.md +9 -10
  122. package/skills/wix-manage/references/ecommerce/skill-graph.md +4 -4
  123. package/skills/wix-manage/references/forms/create-form.md +2 -0
  124. package/skills/wix-manage/references/stores/bulk-create-products-with-options.md +2 -0
  125. package/skills/wix-manage/references/stores/create-product-from-image.md +91 -38
  126. package/skills/wix-manage/references/stores/setup-online-store-catalog-v3.md +14 -7
  127. package/skills/wix-app/references/data-collection/extension-template.ts +0 -107
  128. package/skills/wix-headless/references/ORCHESTRATION.md +0 -269
  129. package/skills/wix-headless/references/commands/install-app.md +0 -42
  130. package/skills/wix-headless/references/commands/mcp-bootstrap.md +0 -28
  131. package/skills/wix-headless/references/designer/INSTRUCTIONS.md +0 -828
  132. package/skills/wix-headless/references/shared/MCP_PREFIX.md +0 -105
  133. package/skills/wix-headless/scripts/copy-utility-templates.mjs +0 -153
  134. package/skills/wix-headless/templates/ecom/components-ecom.css +0 -215
  135. package/skills/wix-manage/references/events/list-events.md +0 -203
  136. /package/skills/wix-headless/{templates → references/astro/templates}/ecom/CartBadge.tsx +0 -0
  137. /package/skills/wix-headless/{templates → references/astro/templates}/ecom/CartView.tsx +0 -0
  138. /package/skills/wix-headless/{templates → references/astro/templates}/ecom/cart.astro +0 -0
  139. /package/skills/wix-headless/{templates → references/astro/templates}/ecom/discounts.ts +0 -0
  140. /package/skills/wix-headless/{templates → references/astro/templates}/ecom/thank-you.astro +0 -0
  141. /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/GiftCardPurchase.tsx +0 -0
  142. /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/_home-teaser-snippet.astro +0 -0
  143. /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/_nav-snippet.astro +0 -0
  144. /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/components-gift-cards.css +0 -0
  145. /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/gift-cards.astro +0 -0
  146. /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/gift-cards.ts +0 -0
  147. /package/skills/wix-headless/{templates → references/astro/templates}/stores/AddToCartButton.tsx +0 -0
  148. /package/skills/wix-headless/{templates → references/astro/templates}/stores/BackInStockForm.tsx +0 -0
  149. /package/skills/wix-headless/{templates → references/astro/templates}/stores/CategoryRail.astro +0 -0
  150. /package/skills/wix-headless/{templates → references/astro/templates}/stores/ProductCard.astro +0 -0
  151. /package/skills/wix-headless/{templates → references/astro/templates}/stores/ProductPurchase.tsx +0 -0
  152. /package/skills/wix-headless/{templates → references/astro/templates}/stores/SeoTags.astro +0 -0
  153. /package/skills/wix-headless/{templates → references/astro/templates}/stores/categories.ts +0 -0
  154. /package/skills/wix-headless/{templates → references/astro/templates}/stores/category/[slug].astro +0 -0
  155. /package/skills/wix-headless/{templates → references/astro/templates}/stores/products/[slug].astro +0 -0
  156. /package/skills/wix-headless/{templates → references/astro/templates}/stores/products/index.astro +0 -0
@@ -8,7 +8,7 @@ Read **only** the files your scope needs. The reading set varies by scope:
8
8
 
9
9
  | Your scope | Mandatory | Conditional |
10
10
  |---|---|---|
11
- | `seed` | this file, `RETURN_CONTRACT.md`, `MCP_PREFIX.md` | — |
11
+ | `seed` | this file, `RETURN_CONTRACT.md`, `DOCS_SEARCH.md` | — |
12
12
  | `components`, `components-css`, `pages`, `pages-*` | this file, `RETURN_CONTRACT.md`, `STYLING.md` | — |
13
13
  | Image scopes | (read `references/images/INSTRUCTIONS.md` § Self-Loading) | — |
14
14
 
@@ -19,50 +19,41 @@ Then read the specific reference(s) for your declared scope (see your vertical's
19
19
  Your prompt includes a line `Scope: <name>`. Map to exactly one reference set per your vertical's `INSTRUCTIONS.md` scope table. If the `Scope:` line is missing, stop and ask the parent — do not guess.
20
20
 
21
21
  Standard scope names (see architecture-proposal §3):
22
- - `seed` — Seed phase (MCP data setup, no frontend code)
22
+ - `seed` — Seed phase (REST data setup, no frontend code)
23
23
  - `components` — Components phase (reusable React/Astro islands, SDK wiring)
24
24
  - `pages` — Pages phase (route files with visual design + data queries, single scope per vertical)
25
25
  - `pages-<name>` — Pages phase sub-scope (only when a vertical has multiple pages groups, e.g. stores has `pages-products`, `pages-home-and-nav`)
26
26
 
27
- ## MCP tool prefix
27
+ ## REST auth
28
28
 
29
- Your prompt includes `MCP tool prefix: <prefix>`. Substitute it for `mcp__wix-mcp-remote__` wherever it appears in your reference files. See `references/shared/MCP_PREFIX.md` for discovery rules.
29
+ Scopes that call Wix APIs (`seed`, image phases) receive `siteId` in the prompt. Mint once: `TOKEN=$(npx @wix/cli@latest token --site "$SITE_ID")`. Every `curl` uses the headers in `references/shared/AUTHENTICATION.md`. Doc lookups use the public REST endpoints listed in `references/shared/DOCS_SEARCH.md`.
30
30
 
31
- If your scope is `components` or `pages`, you should NOT make MCP calls — those scopes are frontend-only. If you find yourself needing MCP, it's a scope violation — return `status: "partial"` with an error note, do not proceed.
31
+ If your scope is `components` or `pages`, you should NOT make REST calls — those scopes are frontend-only. If you find yourself needing a site API call, it's a scope violation — return `status: "partial"` with an error note, do not proceed.
32
32
 
33
- ## Reading `.wix/site.json`
33
+ ## Do NOT read `.wix/site.json`
34
34
 
35
- Every agent reads `.wix/site.json` at the start of its run. The file is the single source of truth for per-project data:
35
+ Every input you need is inlined in your prompt. The orchestrator is the sole reader/writer of `.wix/site.json`; the file is a slim metadata snapshot for run.json composition + resume detection, not a coordination channel.
36
36
 
37
- ```jsonc
38
- {
39
- "brand": { "name": "...", "description": "..." },
40
- "seeded": { "stores": { "products": [...] }, "cms": { "collections": {...} }, ... },
41
- "designTokens": { "colors": {...}, "fonts": {...}, "radii": {...}, "spacing": {...} },
42
- "verticals": ["stores", "ecom", "cms"]
43
- }
44
- ```
45
-
46
- **Phase-specific reads:**
37
+ **Phase-specific inputs (all inlined in your prompt):**
47
38
 
48
- | Scope | What to read from site.json |
39
+ | Scope | What the prompt inlines |
49
40
  |---|---|
50
- | `seed` | `brand` (for copy generation — product descriptions, FAQ answers). Do NOT read `seeded.<self>` — you're writing it. |
51
- | `components` | `brand`, `designTokens` (via `var(--color-*)` in CSS). |
52
- | `pages` / `pages-*` | `brand`, `seeded.<vertical>` (products, posts, collections), `designTokens`. Page data comes from `seeded`, NOT from re-querying MCP. |
41
+ | `seed` | `brand`, `intent.<pack>`, `siteId`, recipe path(s). Do NOT re-derive these. |
42
+ | `components` | `brand`, the full `designTokens` JSON (same shape Designer returned). CSS variables are also on disk at `.wix/design-tokens.css` for the build. |
43
+ | `pages` / `pages-*` | `brand`, the `designTokens` JSON, and the relevant `seeded.<vertical>` slice (products, posts, collections IDs). Page data wiring uses live SDK queries; the `seeded` data in your prompt is for path resolution + demo content authoring. |
53
44
 
54
- If a required key is missing (e.g. `seeded.stores.products` absent when you're dispatched as `pages-products`), fail fast — return `status: "failed"` with `errors: [{ code: "SITE_JSON_INCOMPLETE", missing: "seeded.stores.products" }]`. Do NOT re-query MCP — the data gap means a seeder didn't complete, and re-querying would mask the real bug.
45
+ If a required input is missing from your prompt (e.g. the orchestrator forgot to inline `seeded.stores` when dispatching you as `pages-products`), fail fast — return `status: "failed"` with `errors: [{ code: "PROMPT_INCOMPLETE", missing: "seeded.stores.products" }]`. Do NOT re-fetch from `.wix/site.json` or via curl — the data gap means an upstream phase didn't complete, and re-querying would mask the real bug.
55
46
 
56
- ## Seeders write their data for the orchestrator to aggregate
47
+ ## Seeders return data; orchestrator aggregates
57
48
 
58
- Agents with `Scope: seed` return their seeded entities in the `data` block of the standard return (see `RETURN_CONTRACT.md`). The parent skill merges your return into `.wix/site.json.seeded.<vertical>` after your run completes. You do NOT write `site.json` yourself — return the data and let the orchestrator aggregate.
49
+ Agents with `Scope: seed` return their seeded entities in the `data` block of the standard return (see `RETURN_CONTRACT.md`). The orchestrator collects every seeder return into its session scratch and inlines the relevant slice into the prompts of Phase 3 Components / Phase 4 Pages / Image Phase 2 subagents. You do NOT write `site.json` yourself and you do NOT write `.wix/seed-returns/<pack>.json` — your JSON return is the contract.
59
50
 
60
51
  ## Writing page files
61
52
 
62
53
  Pages-phase agents write route files (`.astro`) with:
63
54
 
64
55
  1. **Visual design via design tokens and Tailwind.** Reference tokens as `var(--color-primary)` in `<style>` blocks or `bg-[--color-primary]` as Tailwind arbitrary values. Use canonical component templates (`agents/<vertical>/templates/*.astro`) as starting points — adapt, don't invent.
65
- 2. **Data queries against seeded data.** Read the seeded entities from `.wix/site.json.seeded.<vertical>` at build time (Astro frontmatter `import { site } from "../../.wix/site"`) or at request time via the SDK if the page is server-rendered.
56
+ 2. **Data queries against seeded data.** The seeded entity IDs / slugs are inlined in your prompt (`seeded.<vertical>`). Pages query the Wix SDK at request time (`await productsV3.queryProducts(...)`) — that's the production-correct pattern. Use the inlined `seeded` data for path generation (e.g. `getStaticPaths` slugs) and for authoring demo content where needed; do NOT `import` `.wix/site.json` from page files.
66
57
  3. **Imports from shared components.** Pages import components your Components-phase agent wrote (`src/components/*.tsx`, `.astro`).
67
58
  4. **Imports from skill shared utilities.** `from "../utils/wix-image"` and `from "../utils/analytics"` — these are skill-shipped (copied into the project by `seed-utilities.sh` during Setup); do NOT import them from anywhere else.
68
59
 
@@ -133,7 +124,7 @@ The full styling contract (tokens-as-utilities default, when global semantic cla
133
124
  @reference "./global.css";
134
125
  ```
135
126
  Without it, the build breaks at release time even though `tsc` and `astro check` pass clean — only the bundler catches it.
136
- - **Fail loud, never silently.** If data is missing, a required field is absent, or an MCP call returns an unexpected shape, return `status: "failed"` with details. Do not invent placeholders or swallow errors.
127
+ - **Fail loud, never silently.** If data is missing, a required field is absent, or an REST call returns an unexpected shape, return `status: "failed"` with details. Do not invent placeholders or swallow errors.
137
128
 
138
129
  ## Return contract
139
130
 
@@ -144,12 +135,12 @@ Every agent ends its message with a fenced JSON block per `RETURN_CONTRACT.md`.
144
135
  | Wrong | Right |
145
136
  |---|---|
146
137
  | Reading references for scopes other than the declared `Scope:` | Read only your scope's references |
147
- | Querying MCP from a `components` or `pages` scope | Components/Pages are frontend-only; use `seeded` data from `site.json` |
148
- | Re-querying when `site.json.seeded.<vertical>` is missing | Fail fast with `SITE_JSON_INCOMPLETE` — the seeder didn't complete |
138
+ | Issuing REST calls from a `components` or `pages` scope | Components/Pages are frontend-only; use `seeded` data inlined in your prompt |
139
+ | Re-querying when `seeded.<vertical>` is missing from your prompt | Fail fast with `PROMPT_INCOMPLETE` — the orchestrator forgot to inline it (upstream bug) |
149
140
  | Writing `.wix/site.json` from a seeder | Seeders return data; orchestrator writes site.json |
150
141
  | Inventing class names for layout/spacing/typography (`.productCard`, `.heroSection`) | Tailwind utilities derived from `@theme` tokens (`class="flex flex-col gap-md"`, `class="py-4xl"`). For one-off page decoration, co-located `<style>` block. |
151
142
  | Removing a marker after inserting at it | Marker stays; other verticals may contribute after you |
152
143
  | Trailing narrative prose after the return JSON | JSON block must be the last content |
153
144
  | Fabricated timestamps in the return JSON | Do not include timing fields — orchestrator captures them |
154
145
  | Inline `style="color: red"` | Use design tokens: `style="color: var(--color-primary)"` |
155
- | Creating a new cross-cutting class name | Extract a shared primitive component instead |
146
+ | Creating a new cross-cutting class name | Extract a shared primitive component instead |
@@ -94,4 +94,4 @@ For production checks, verify the final rendered HTML and edge-controlled files
94
94
  - For `llms.txt`: fetch `/llms.txt` after the REST update and account for Wix-injected sections.
95
95
  - For custom domains: check both the Wix-hosted URL and custom domain when available, because domain propagation and redirects can differ.
96
96
 
97
- Do not construct URLs by editing the release URL from memory. Use the exact release URL printed by the CLI or the configured custom domain.
97
+ Do not construct URLs by editing the release URL from memory. Use the exact release URL printed by the CLI or the configured custom domain.
@@ -1,18 +1,22 @@
1
1
  # Agent Return Contract
2
2
 
3
- Replaces the sidecar-file coordination model (`.wix/logs/*.md`) with **in-memory structured returns**. Every agent returns a JSON block at the end of its completion message; the skill parses these returns directly from session context.
3
+ Coordination between agents uses **in-memory structured returns**, not sidecar files (`.wix/logs/*.md`, `.wix/seed-returns/*.json`, `.wix/image-urls.md`). Every agent returns a JSON block at the end of its completion message; the skill parses these returns directly from session context.
4
4
 
5
5
  At end of run, the skill writes ONE file (`.wix/run.json`) aggregating every return. This is the only observability artifact on the project side.
6
6
 
7
- ## Why this replaces sidecars
7
+ ## The JSON return is your sole output channel
8
8
 
9
- Sidecar files were designed assuming agents are independent processes without shared memory. But subagents run as child model calls under the parent skill's context — they can return structured data directly. Writing/reading markdown files between them adds:
9
+ Subagents MUST NOT write coordination files (`.wix/seed-returns/<pack>.json`, `.wix/image-urls.md`, `.wix/logs/*.md`, etc.). The orchestrator parses your fenced JSON block from the message body and either acts on the data directly or pipes it to a deterministic helper script via stdin (e.g. `emit-design-tokens.mjs`, `patch-decorative-slots.mjs`). Any data the orchestrator needs from you belongs under `data` in the return block — files in `.wix/` that aren't build-consumed (CSS, .d.ts) or external-system-owned (`wix.config.json`) are not part of the contract.
10
+
11
+ ## Why structured returns, not files
12
+
13
+ Writing markdown files between agents assumes they're independent processes without shared memory. But subagents run as child model calls under the parent skill's context — they can return structured data directly. File-based coordination adds:
10
14
 
11
15
  - ~10s per sidecar write (file I/O + narration)
12
16
  - ~5s per sidecar read from the parent (another tool call)
13
17
  - Coordination complexity (timing, status-line parsing, retry logic)
14
18
 
15
- Prior runs spent **~1–2 minutes total** on sidecar ceremony. Eliminating that buys back meaningful critical-path time.
19
+ That overhead is pure critical-path cost with no benefit here.
16
20
 
17
21
  ## The contract
18
22
 
@@ -60,7 +64,7 @@ Agents sometimes end with prose like:
60
64
 
61
65
  > *"All three files are correctly written. Let me verify the key requirements… Everything looks good."*
62
66
 
63
- …with no fenced JSON block at the end. The parent skill then has to reconstruct `data.products` etc. from narrative text — fragile, and when Phase 4 relies on pre-seeded data from Phase 1 Seed returns (see `SKILL.md` Step 7), a missing JSON block means Phase 4 agents don't get their pre-seeded data inline and fall back to re-querying MCP, costing 5–15s each.
67
+ …with no fenced JSON block at the end. The parent skill then has to reconstruct `data.products` etc. from narrative text — fragile, and when Phase 4 relies on pre-seeded data from Phase 1 Seed returns (see `SKILL.md` Step 7), a missing JSON block means Phase 4 agents don't get their pre-seeded data inline and fall back to re-querying the REST API, costing 5–15s each.
64
68
 
65
69
  **Correct pattern — end with the fenced block, no trailing prose:**
66
70
 
@@ -265,21 +269,26 @@ Phase 4 CMS page agents reference these collection names; the image agent attach
265
269
 
266
270
  The image agent runs in two scopes dispatched by the parent in different steps. Each emits its own return block.
267
271
 
268
- **`image-phase-1-decorative` — dispatched in Step 3 (no dependencies):**
272
+ **`image-phase-1-decorative` — dispatched in `SEED.md` Step 2 Wave 3 batch (no dependencies):**
269
273
 
270
274
  ```json
271
275
  {
272
276
  "status": "complete",
273
277
  "phase": "image-phase-1-decorative",
274
278
  "scope": "image-phase-1-decorative",
275
- "summary": "Generated 3 decorative images; uploaded to Wix Media; wrote .wix/image-urls.md",
279
+ "summary": "Generated 3 decorative images; uploaded to Wix Media; returned slot→URL map",
276
280
  "data": {
277
281
  "decorativeCount": 3,
278
282
  "purposes": ["hero", "about", "background"],
283
+ "slots": {
284
+ "hero": "https://static.wixstatic.com/media/...",
285
+ "about": "https://static.wixstatic.com/media/...",
286
+ "background": "https://static.wixstatic.com/media/..."
287
+ },
279
288
  "model": "google:4@2",
280
289
  "totalCredits": 0.297
281
290
  },
282
- "files": [".wix/image-urls.md"],
291
+ "files": [],
283
292
  "errors": []
284
293
  }
285
294
  ```
@@ -302,7 +311,7 @@ The image agent runs in two scopes dispatched by the parent in different steps.
302
311
  }
303
312
  ```
304
313
 
305
- (Image agent writes to Wix Media via MCP, not to project files — Image Phase 2 `files` is empty.)
314
+ (Image agent writes to Wix Media via REST, not to project files — Image Phase 2 `files` is empty.)
306
315
 
307
316
  ## Failure returns
308
317
 
@@ -395,20 +404,20 @@ Agents should check their output for these before returning `complete`:
395
404
  | Missing `variantId` in cart operations | Check `catalogReference.options` | Always include — single-variant products have one |
396
405
  | React island using default Tailwind color class | `grep 'bg-blue-\|bg-green-\|text-red-\|bg-gray-' *.tsx` | Use brand `@theme` utilities (`bg-bark`, `text-cream`) or contract class names |
397
406
 
398
- ### MCP
407
+ ### REST API
399
408
 
400
409
  | Failure | How to detect | Fix |
401
410
  |---------|---------------|-----|
402
- | `UNSUPPORTED_FORM_NAMESPACE` after app install | Error on first MCP call post-install | Wait 10s, retry up to 3x (namespace propagation) |
403
- | `CallWixSiteAPI` with stringified `body` | Tool rejects the call shape | Load the tool schema via your runtime's tool-discovery primitive, then pass `body` as a real object |
404
- | Tool-not-found on Wix MCP call | Tool name without the session's prefix | Use `<prefix>ToolName`; see `MCP_PREFIX.md` recovery |
411
+ | `UNSUPPORTED_FORM_NAMESPACE` after app install | Error on first REST call post-install | Wait 10s, retry up to 3x (namespace propagation) |
412
+ | `curl` with stringified `body` | Endpoint rejects the call shape | Pass `body` as a real JSON object via `-d` (not a stringified blob). See `AUTHENTICATION.md` for the standard REST headers. |
413
+ | 401/403 on Wix REST call | Expired or wrong token | Re-mint per `AUTHENTICATION.md` recovery ladder; one retry then surface body |
405
414
 
406
415
  ### Build
407
416
 
408
417
  | Failure | How to detect | Fix |
409
418
  |---------|---------------|-----|
410
- | `Legacy HTML single-line comments` | `npx @wix/cli build` stderr | See Astro/React row 1 above — Phase 2 agent emitted HTML comments |
411
- | `Missing environment variable WIX_CLIENT_ID` | Build stderr | Run `npx @wix/cli env pull` then retry |
419
+ | `Legacy HTML single-line comments` | `npx @wix/cli@latest build` stderr | See Astro/React row 1 above — Phase 2 agent emitted HTML comments |
420
+ | `Missing environment variable WIX_CLIENT_ID` | Build stderr | Run `npx @wix/cli@latest env pull --json` then retry |
412
421
  | `Cannot find module '@wix/…'` | Build stderr | npm install didn't include that package; check pack's `packages` list |
413
422
 
414
423
  ## Notes for agent authors
@@ -420,4 +429,4 @@ When writing a new agent, include a **Returns** section in its `INSTRUCTIONS.md`
420
429
  3. Known `error.code` values
421
430
  4. Required `files` entries
422
431
 
423
- Agents should produce the JSON return block deterministically — don't let creative prose overrun the fenced block. Parent skill parsing assumes the JSON is well-formed and complete.
432
+ Agents should produce the JSON return block deterministically — don't let creative prose overrun the fenced block. Parent skill parsing assumes the JSON is well-formed and complete.
@@ -1,12 +1,14 @@
1
1
  # Styling — Three Categories, One Default
2
2
 
3
- Every visual decision in a generated site falls into one of three categories. Each has a single owner and a single home. This file is the canonical reference; designer `INSTRUCTIONS.md` and `IMPLEMENTER.md` link here.
3
+ Every visual decision in a generated site falls into one of three categories. Each has a single owner and a single home. This file is the canonical reference; `DESIGN_SYSTEM.md` (Designer), `COMPOSE.md` (Composer), `astro/designer/INSTRUCTIONS.md` (Phase 4 page designers), and `IMPLEMENTER.md` link here.
4
+
5
+ > **Design-system ownership (the design-vs-application split).** The **Designer** (`DESIGN_SYSTEM.md`) owns the token *values* and their *completeness* — a coherent, complete brand visual returned as a framework-agnostic JSON spec (`data.designTokens`). The **Composer** (`COMPOSE.md`) owns the *application* — it writes the `@theme` block in `global.css` from those values (mapping each semantic role to a `--var` name) and guarantees the required-token contract below resolves. Component and page authors still compose those tokens as Tailwind utilities at their call sites. So: Designer picks "paper = `#FAF6EF`"; Composer writes `--color-paper: #FAF6EF` into `@theme`; a page writes `class="bg-paper"`.
4
6
 
5
7
  ## The three categories
6
8
 
7
9
  | Category | Lives in | Owned by | Use for |
8
10
  |---|---|---|---|
9
- | **Tokens (composed as utilities)** | `@theme` block in `src/styles/global.css`, mirrored to `.wix/site.json.designTokens`, `.wix/design-tokens.css`, `.wix/site.d.ts` | Designer (Phase 2) | All color, spacing, typography scale, radii, aspect ratios, shadows, transitions. Pages compose tokens at call sites as Tailwind utilities — `class="py-4xl bg-sand aspect-[16/5]"`. |
11
+ | **Tokens (composed as utilities)** | `@theme` block in `src/styles/global.css`, mirrored to `.wix/design-tokens.css` + `.wix/site.d.ts` (emitted by `scripts/emit-design-tokens.mjs` from Designer's `data.designTokens`) | Designer picks values (Phase 2); Composer writes `@theme` | All color, spacing, typography scale, radii, aspect ratios, shadows, transitions. Pages compose tokens at call sites as Tailwind utilities — `class="py-4xl bg-sand aspect-[16/5]"`. |
10
12
  | **Global semantic classes** | `src/styles/global.css` (outside `@theme`) and `src/styles/components-<pack>.css` | Designer + Phase 3 component agents | Compound multi-element patterns, interactive states (`:hover`, `:focus`, `:disabled`), and JS/React DOM query targets. |
11
13
  | **Co-located styles** | `<style>` block at the bottom of the same `.astro` file (or component CSS module for islands) | Page or component author | One-off page decoration: hero stamps, custom dividers, ornamental overlays that won't be reused elsewhere. |
12
14
 
@@ -14,7 +16,7 @@ Every visual decision in a generated site falls into one of three categories. Ea
14
16
 
15
17
  **Tokens-as-utilities is the default.** When you're about to write a class for layout, spacing, typography, alignment, simple background/text color, or aspect ratio, write Tailwind utilities derived from `@theme` instead. The site's design tokens give you `py-4xl`, `gap-sm`, `bg-paper-warm`, `text-ink`, `font-display`, `aspect-[16/5]` etc. Compose them in markup; do not invent semantic classes for these concerns.
16
18
 
17
- The token namespace is the contract. Read `.wix/site.json.designTokens` (or its typed mirror at `.wix/site.d.ts`) at the start of any pages or components scope to know which tokens this run published. If a token you need isn't there, that's a designer-side gap — flag it in your return JSON, don't paper over it with a custom class.
19
+ The token namespace is the contract. The orchestrator inlines the full `designTokens` JSON in your prompt (same shape Designer returned) — at start of any pages or components scope, read from your prompt to know which tokens this run published. `.wix/design-tokens.css` and `.wix/site.d.ts` are on disk for the build to consume, but you do NOT need to read them. If a token you need isn't in the inlined contract, that's a designer-side gap — flag it in your return JSON, don't paper over it with a custom class.
18
20
 
19
21
  ## Decision tree
20
22
 
@@ -24,7 +26,7 @@ When you find yourself reaching for a `class="..."` value, ask:
24
26
  2. **Is it a compound multi-element pattern** (e.g., a bordered card with header + body + foot rules), an **interactive state** (`:hover`/`:focus`/`:disabled`/`:hover .child`), or a **JS query target** the DOM is inspected for? → Global semantic class in `global.css` (designer-owned) or `components-<pack>.css` (Phase 3 components agent-owned).
25
27
  3. **Is it a one-off page decoration** that won't be reused on any other route? → Co-located `<style>` block at the bottom of the same `.astro` file. Reference tokens via `var(--color-foo)` from `:root` (auto-loaded by `design-tokens.css`).
26
28
 
27
- If none fit, you're probably trying to do something the tokens don't support yet — talk to the designer (for new runs, return a `MISSING_TOKEN` error; for existing projects, add the token to `@theme` and propagate to `.wix/site.json.designTokens`).
29
+ If none fit, you're probably trying to do something the tokens don't support yet — talk to the designer (for new runs, return a `MISSING_TOKEN` error; for existing projects, add the token to `@theme`).
28
30
 
29
31
  ## What does NOT belong as a global semantic class
30
32
 
@@ -35,10 +37,45 @@ These are layout/spacing/typography concerns that should always be utilities, ne
35
37
  - Aspect ratios (`aspect-[4/5]`, `aspect-square`)
36
38
  - Plain typography choices (`text-display-lg font-display`, `text-mute uppercase tracking-wide`)
37
39
  - Background / foreground color application without state (`bg-paper`, `text-ink-soft`)
38
- - Container widths derived from tokens (`max-w-prose`, `w-full`)
40
+ - Container widths derived from tokens (`max-w-prose`, `w-full`) **only when** the designer declared matching `--container-*` keys in `@theme`
41
+
42
+ ### Prose / reading width (CMS, FAQ, About)
43
+
44
+ Tailwind v4 resolves `max-w-3xl` to `var(--container-3xl)`, **not** `var(--spacing-3xl)`. If the designer published `--spacing-3xl: 5rem` but no `--container-3xl`, FAQ/About columns collapse to ~80px.
45
+
46
+ **Page agents (Phase 4):**
47
+
48
+ - **Do not** use `max-w-2xl`, `max-w-3xl`, etc. unless `global.css` `@theme` documents the matching `--container-*` key (grep `@theme` before choosing).
49
+ - **Prefer** `container-reading` (designer `@utility`), `max-w-6xl` when `--container-6xl` exists, or explicit arbitrary width `max-w-[48rem]`.
50
+ - **Do not** confuse spacing scale with container scale — `py-3xl` uses `--spacing-3xl`; `max-w-3xl` uses `--container-3xl`.
39
51
 
40
52
  If a designer's `global.css` contains rules like `.featured-section { padding-block: var(--spacing-4xl); }` or `.product-card-body { display: flex; flex-direction: column; gap: var(--spacing-xs); }`, those are misplaced — they belong in markup as utilities. Inventing such classes ships broken layouts: every consumer needs the designer to have pre-declared the class, and Tailwind v4 silently drops the references when the rule is missing.
41
53
 
54
+ ## Required tokens — the component-CSS template contract
55
+
56
+ The per-pack `components-<pack>.css` templates at `<SKILL_ROOT>/references/astro/templates/<pack>/components-<pack>.css` reference a fixed set of CSS custom properties via `var(--token)` (never `@apply`). Those templates are copied verbatim into the project by the orchestrator at BUILD.md § Step 4.5, so **the Composer's `@theme` block MUST declare every token below** for the build to pass (the Composer maps the Designer's framework-agnostic spec onto these `--var` names, deriving any required role the Designer omitted). If a token is missing, the rule that references it collapses silently and the corresponding component renders unstyled (or worse, half-styled).
57
+
58
+ | Token | Required? | Fallback in templates | Used by |
59
+ |---|---|---|---|
60
+ | `--color-paper` | **required** | — | every pack — primary background |
61
+ | `--color-paper-warm` | **required** | `var(--color-paper, var(--color-cream))` | stores summary bg, ecom cart-summary bg, gift-cards |
62
+ | `--color-ink` | **required** | — | every pack — primary text + dark fills |
63
+ | `--color-ink-soft` | optional | `var(--color-mute)` | stores option-label, ecom cart-item-option |
64
+ | `--color-mute` | **required** | — | every pack — muted text + remove buttons |
65
+ | `--color-rule` | **required** | — | every pack — borders + dividers |
66
+ | `--color-accent` | **required** | — | every pack — brand emphasis |
67
+ | `--color-cream` | optional | inner fallback in `var(--color-paper-warm, var(--color-paper, var(--color-cream)))` | stores form bg, gift-cards |
68
+ | `--color-error` | optional | `var(--color-accent)` or hardcode | ecom cart-item-unavailable, stores back-in-stock-error |
69
+ | `--font-display` | **required** | — | every pack — headings + labels |
70
+ | `--font-body` | **required** | — | every pack — body text + UI |
71
+ | `--spacing-2xs` … `--spacing-4xl` | **required (full scale)** | — | every template uses `gap: var(--spacing-md)` and similar |
72
+ | `--radius-sm`, `--radius-md` | **required** | — | buttons, inputs, cards |
73
+ | `--radius-lg`, `--radius-xl` | optional | — | stores product-card |
74
+
75
+ The templates do NOT use `@apply` — every rule is `property: var(--token);` directly. This means missing utilities don't fail at build time (the way `@apply gap-sm` would). Missing tokens degrade silently to `var(missing) → unset → initial`. That makes the failure mode "ugly component" not "broken build" — easier to recover from but harder to detect, so verify the full set above is in `@theme` before returning.
76
+
77
+ **Why this contract exists.** The component templates are authored against a stable, brand-agnostic token vocabulary so they don't need to be regenerated per run. Using `@apply` against brand-specific tokens (e.g. `bark`, `cream`, `parchment`) that designers don't publish fails the build with `Cannot apply unknown utility class`. Direct `var()` against the required-token list above avoids that class of failure entirely.
78
+
42
79
  ## What DOES belong in `global.css` (designer-owned)
43
80
 
44
81
  The designer's `global.css` is small — tokens plus a short list of truly cross-cutting patterns. Anything specific to a single vertical's component (a product card, a cart row, a discount callout) does NOT belong here. Those live with the component, in `components-<pack>.css` (Phase 3 components agent-owned) or in a co-located `<style>` block inside the component's `.astro` file.
@@ -54,7 +91,7 @@ That's it. The full list of always-required classes for a site lives in designer
54
91
 
55
92
  ## Component-specific CSS is owned by the component, not the designer
56
93
 
57
- The boundary that previously caused leaks: the designer published partial rules for `.product-card`, `.product-grid`, `.product-card-media`, `.offer-callout`, `.cart-summary`, etc. — all classes used by exactly one vertical's component. The designer doesn't know how those components should be laid out for a particular brand, so the rules ship as stubs and templates quietly add the missing layout in scoped CSS. Result: the same class behaves differently on different pages (e.g. `/products` rendering with `.product-grid { transition: opacity }` and no `display: grid`, while `/category/<slug>` defines a separate scoped `.product-grid` with the actual grid).
94
+ The boundary that causes leaks: if the designer publishes partial rules for `.product-card`, `.product-grid`, `.product-card-media`, `.offer-callout`, `.cart-summary`, etc. — all classes used by exactly one vertical's component — the designer doesn't know how those components should be laid out for a particular brand, so the rules ship as stubs and templates quietly add the missing layout in scoped CSS. The same class then behaves differently on different pages (e.g. `/products` rendering with `.product-grid { transition: opacity }` and no `display: grid`, while `/category/<slug>` defines a separate scoped `.product-grid` with the actual grid).
58
95
 
59
96
  The fix is structural: move component-specific CSS out of `global.css` entirely.
60
97
 
@@ -75,15 +112,15 @@ Tokens + truly cross-cutting patterns (buttons, decorative slots, site shell) ar
75
112
  - Verticals can ship new component variants without round-tripping the designer.
76
113
  - `overflow: hidden` + `border-radius` traps are caught by the same person who set the radius — no second author who has to *know* the radius value.
77
114
 
78
- ### Pre-return checklist for the designer
115
+ ### Pre-return checklist for the Composer
79
116
 
80
- Before returning the design-system scope, the designer agent runs:
117
+ The Composer writes `global.css` by substituting the `@theme` palette into a pinned skeleton, so the component-class leak below is **structurally prevented** — the skeleton declares no `.product-card`/`.cart-summary`-family rules at all. The check remains as a guard: before returning, confirm the Composer-written `global.css` declares none of these (it shouldn't, unless the skeleton was edited):
81
118
 
82
119
  ```
83
120
  grep -r --include="*.astro" --include="*.tsx" -lE "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" $SKILL_ROOT/templates/*/
84
121
  ```
85
122
 
86
- For every class name listed above that the designer's `global.css` declares: if any template references it, the class is component-specific and must NOT be in `global.css`. Move the rule to the appropriate `components-<pack>.css` template (or to a scoped `<style>` block in the component template). Do NOT ship a partial rule in `global.css` that the template "completes" — that's the leak this file is preventing.
123
+ For every class name listed above that the Composer's `global.css` declares: if any template references it, the class is component-specific and must NOT be in `global.css`. Move the rule to the appropriate `components-<pack>.css` template (or to a scoped `<style>` block in the component template). Do NOT ship a partial rule in `global.css` that the template "completes" — that's the leak this file is preventing.
87
124
 
88
125
  The check is mechanical and bounded — it scans templates, not the live project.
89
126
 
@@ -114,4 +151,4 @@ No coordination with the designer needed; no entry to forget on the always-requi
114
151
 
115
152
  ## Why this protocol
116
153
 
117
- The bug class this prevents: markup writers (designer's shells, vertical pages agents, committed templates) and the CSS writer (designer's `global.css`) operate in different phases with no handshake. When the markup writer types a class string the CSS writer didn't pre-declare, Tailwind v4 silently drops it and ships a site with broken styling. Tokens-as-utilities collapses that handshake — there's no class to forget, only utilities derived from a token list everyone reads.
154
+ The bug class this prevents: markup writers (designer's shells, vertical pages agents, committed templates) and the CSS writer (designer's `global.css`) operate in different phases with no handshake. When the markup writer types a class string the CSS writer didn't pre-declare, Tailwind v4 silently drops it and ships a site with broken styling. Tokens-as-utilities collapses that handshake — there's no class to forget, only utilities derived from a token list everyone reads.
@@ -5,20 +5,20 @@ description: "Implements Wix Stores vertical — product catalog, categories, ad
5
5
 
6
6
  # Stores Implementer
7
7
 
8
- Extends `references/shared/IMPLEMENTER.md`. Read that file first for phase routing, MCP prefix, site.json read pattern, return contract, style conventions, and common failure modes.
8
+ Extends `references/shared/IMPLEMENTER.md`. Read that file first for phase routing, REST auth + doc lookups, prompt-inlined inputs (no site.json reads), return contract, style conventions, and common failure modes.
9
9
 
10
10
  ## Scope routing
11
11
 
12
12
  | Scope | Phase | Reference |
13
13
  |-------|-------|-----------|
14
- | `seed` | Seed (MCP catalog setup — products only; categories are merchant-driven, not seeded) | `./PRODUCT_CATALOG_DATA.md` |
15
- | `components` | Components (React islands + SeoTags + back-in-stock util — TSX/Astro only, **no CSS**) | `./SHARED_WIRING.md` |
16
- | `components-css` | Components (scoped CSS — `components-stores.css` only; runs concurrently with `components`) | `./COMPONENTS_CSS.md` |
17
- | `pages-categories` | Pages (`/category/[slug]` listing + shared CategoryRail + `utils/categories.ts`) | `./CATEGORY_PAGES.md` |
18
- | `pages-products` | Pages (products listing + detail + ProductCard; mounts the rail written by `pages-categories`) | `./PRODUCT_PAGES.md` |
19
- | `pages-home-and-nav` | Pages (home-page contribution + Shop submenu in Navigation) | `./HOME_AND_NAV.md` |
14
+ | `seed` | Seed (REST catalog setup — products only; categories are merchant-driven, not seeded) | `./PRODUCT_CATALOG_DATA.md` |
15
+ | `components` | Components (React islands + SeoTags + back-in-stock util — TSX/Astro only, **no CSS**) | `../astro/stores/SHARED_WIRING.md` |
16
+ | ~~`components-css`~~ | **Do not dispatch.** `src/styles/components-stores.css` is copied from `<SKILL_ROOT>/references/astro/templates/stores/components-stores.css` by the orchestrator's pre-Step-4.5 batch (see BUILD.md § Step 4.5). The template uses direct `var(--token)` CSS, so it works against any designer-published vocabulary without per-run rewrites. `COMPONENTS_CSS.md` documents that CSS for reference — there is no `components-css` subagent to dispatch. | — |
17
+ | `pages-categories` | Pages (`/category/[slug]` listing + shared CategoryRail + `utils/categories.ts`) | `../astro/stores/CATEGORY_PAGES.md` |
18
+ | `pages-products` | Pages (products listing + detail + ProductCard; mounts the rail written by `pages-categories`) | `../astro/stores/PRODUCT_PAGES.md` |
19
+ | `pages-home-and-nav` | Pages (home-page contribution + Shop submenu in Navigation) | `../astro/stores/HOME_AND_NAV.md` |
20
20
 
21
- > **Why `components` is split.** A single agent writing five .tsx/.astro files plus the scoped CSS dominated Phase 3 wall time (228 s on a 3-product run, 320 s on an 8-product run). The CSS file has no runtime coupling to the TSX components — it's referenced only by class name at build time — so it splits cleanly into a sibling agent that runs in the same dispatch batch. Each scope gets a smaller reading set and a smaller write list. See `./COMPONENTS_CSS.md` § "What this scope owns".
21
+ > **Why `components` is split.** A single agent writing five .tsx/.astro files plus the scoped CSS dominated Phase 3 wall time (228 s on a 3-product run, 320 s on an 8-product run). The CSS file has no runtime coupling to the TSX components — it's referenced only by class name at build time — so it splits cleanly into a sibling agent that runs in the same dispatch batch. Each scope gets a smaller reading set and a smaller write list. See `../astro/stores/COMPONENTS_CSS.md` § "What this scope owns".
22
22
 
23
23
  ## Files this vertical creates / contributes
24
24
 
@@ -32,38 +32,38 @@ If a declared file is missing, return `status: "partial"` with `errors: [{ code:
32
32
 
33
33
  ## Templates
34
34
 
35
- Canonical templates live at `<SKILL_ROOT>/templates/stores/`. Your `components` and `pages-*` scopes read these and adapt them — don't invent markup or logic.
35
+ Canonical templates live at `<SKILL_ROOT>/references/astro/templates/stores/`. Your `components` and `pages-*` scopes read these and adapt them — don't invent markup or logic.
36
36
 
37
37
  Components (`components` scope — TSX/Astro only):
38
- - `<SKILL_ROOT>/templates/stores/AddToCartButton.tsx`
39
- - `<SKILL_ROOT>/templates/stores/ProductPurchase.tsx`
40
- - `<SKILL_ROOT>/templates/stores/BackInStockForm.tsx`
41
- - `<SKILL_ROOT>/templates/stores/SeoTags.astro`
38
+ - `<SKILL_ROOT>/references/astro/templates/stores/AddToCartButton.tsx`
39
+ - `<SKILL_ROOT>/references/astro/templates/stores/ProductPurchase.tsx`
40
+ - `<SKILL_ROOT>/references/astro/templates/stores/BackInStockForm.tsx`
41
+ - `<SKILL_ROOT>/references/astro/templates/stores/SeoTags.astro`
42
42
 
43
43
  Components CSS (`components-css` scope — scoped CSS only):
44
- - `<SKILL_ROOT>/templates/stores/components-stores.css`
44
+ - `<SKILL_ROOT>/references/astro/templates/stores/components-stores.css`
45
45
 
46
46
  Pages (`pages-products` scope):
47
- - `<SKILL_ROOT>/templates/stores/ProductCard.astro`
48
- - `<SKILL_ROOT>/templates/stores/products/index.astro`
49
- - `<SKILL_ROOT>/templates/stores/products/[slug].astro`
47
+ - `<SKILL_ROOT>/references/astro/templates/stores/ProductCard.astro`
48
+ - `<SKILL_ROOT>/references/astro/templates/stores/products/index.astro`
49
+ - `<SKILL_ROOT>/references/astro/templates/stores/products/[slug].astro`
50
50
 
51
51
  Pages (`pages-categories` scope):
52
- - `<SKILL_ROOT>/templates/stores/CategoryRail.astro`
53
- - `<SKILL_ROOT>/templates/stores/category/[slug].astro`
52
+ - `<SKILL_ROOT>/references/astro/templates/stores/CategoryRail.astro`
53
+ - `<SKILL_ROOT>/references/astro/templates/stores/category/[slug].astro`
54
54
 
55
55
  ### Pre-copied by the orchestrator (do NOT write these yourself)
56
56
 
57
57
  The following utility files are deterministically copied by the orchestrator BEFORE your phase dispatches (`components` for the first, `pages` for the second). They are mechanical SDK wrappers with no brand-specific content; reading or rewriting them as part of your scope wastes tokens and risks drift. Just import the helpers at the listed paths:
58
58
 
59
- - `src/utils/back-in-stock.ts` — pre-copied from `<SKILL_ROOT>/templates/stores/back-in-stock.ts` before `components` dispatches.
60
- - `src/utils/categories.ts` — pre-copied from `<SKILL_ROOT>/templates/stores/categories.ts` before `pages` dispatches.
59
+ - `src/utils/back-in-stock.ts` — pre-copied from `<SKILL_ROOT>/references/astro/templates/stores/back-in-stock.ts` before `components` dispatches.
60
+ - `src/utils/categories.ts` — pre-copied from `<SKILL_ROOT>/references/astro/templates/stores/categories.ts` before `pages` dispatches.
61
61
 
62
62
  If you find one of these missing at runtime, that's an orchestrator-side bug — return `status: "partial"` with `errors: [{code: "UTILITY_TEMPLATE_NOT_PRECOPIED", path: "<missing>"}]` and continue. Do NOT write your own version; the post-phase manifest check will recover by template-copy and the right helper lands on disk.
63
63
 
64
64
  ## CSS ownership — stores pack
65
65
 
66
- Stores-specific component CSS lives in `src/styles/components-stores.css` (written by the `components-css` scope — see `./COMPONENTS_CSS.md`), NOT in the designer's `global.css`. The classes the pack owns:
66
+ Stores-specific component CSS lives in `src/styles/components-stores.css` (written by the `components-css` scope — see `../astro/stores/COMPONENTS_CSS.md`), NOT in the designer's `global.css`. The classes the pack owns:
67
67
 
68
68
  - `.product-card`, `.product-card-media`, `.product-card-ribbon`, `.product-card-index` — the product card itself, including the `overflow: hidden` + `border-radius` clipping context. Whoever writes the `border-radius` here also writes any inner padding required to keep child content inside the rounded edges. Without inner padding, a price `<p>` sits flush against the rounded bottom corner and descenders get clipped. Add `padding-bottom: var(--spacing-md)` on the card plus horizontal padding on each text block when you set the radius. See `references/shared/STYLING.md` § "Component-specific CSS is owned by the component, not the designer".
69
69
  - `.product-grid` — the layout that lists product cards. Both `/products` (pages-products scope) and `/category/[slug]` (pages-categories scope) consume it from one place. Include `display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--spacing-xl);` plus the View-Transitions opacity fade for in-flight navigations.
@@ -75,8 +75,8 @@ The designer's `global.css` declares only tokens, the `.btn` family, decorative
75
75
 
76
76
  Back-in-stock is a dashboard-toggleable feature: it ships in every stores build but only lights up when the merchant clicks "Start Collecting Requests" in the Back in Stock dashboard. The implementation is split across the two scopes the same way every other stores feature is:
77
77
 
78
- - **`components` scope** writes the SSR probe (`src/utils/back-in-stock.ts`) and the React form island (`src/components/BackInStockForm.tsx`). See `./BACK_IN_STOCK.md` for the full rules — especially the two app ids (use `1380b703-…` for back-in-stock, NOT the Stores install id `215238eb-…`) and the bare-fields rule (no `itemUrl`, no `image` on the SDK call).
79
- - **`components-css` scope** appends the back-in-stock form rules to `src/styles/components-stores.css` as part of writing that file. See `./BACK_IN_STOCK.md` § 3 for the CSS append.
78
+ - **`components` scope** writes the SSR probe (`src/utils/back-in-stock.ts`) and the React form island (`src/components/BackInStockForm.tsx`). See `../astro/stores/BACK_IN_STOCK.md` for the full rules — especially the two app ids (use `1380b703-…` for back-in-stock, NOT the Stores install id `215238eb-…`) and the bare-fields rule (no `itemUrl`, no `image` on the SDK call).
79
+ - **`components-css` scope** appends the back-in-stock form rules to `src/styles/components-stores.css` as part of writing that file. See `../astro/stores/BACK_IN_STOCK.md` § 3 for the CSS append.
80
80
  - **`pages-products` scope** imports `getBackInStockEnabled` in `[slug].astro`, awaits the probe, and passes `backInStockEnabled` + `priceAmount` to `<ProductPurchase>`. ProductPurchase renders the form in its three OOS branches when the prop is true.
81
81
 
82
82
  If the merchant hasn't enabled "Start Collecting Requests", the probe returns `false`, the prop stays `false`, and the form never mounts — no rebuild needed when the merchant flips the toggle in the dashboard.
@@ -93,4 +93,4 @@ If the merchant hasn't enabled "Start Collecting Requests", the probe returns `f
93
93
  | Use the back-in-stock app id `1380b703-…` when adding items to a category | Use the **Stores install id** `215238eb-22a5-4c36-9e7b-e7c08025e04e` for `appId` on `bulkAddItemsToCategory` items — it's the same id Wix Stores writes to its products |
94
94
  | Call `categories.queryCategories(...).limit(N).find()` with no filter | The SDK builder rejects empty filter expressions with `INVALID_FILTER`. Always chain at least `.eq("visible", true)` before `.find()` |
95
95
  | Call `categories.listCategoriesForItems(items, ...)` from the SDK | The SDK function ships items via GET querystring and breaks on arrays. Use `POST /categories/v1/categories/list-categories-for-items` directly, or fan out per-category via `listItemsInCategory` |
96
- | Ship a client-side filter (`data-category-ids` + JS hide) on the product grid | Filter server-side via `/category/[slug]` routes; client-side filtering doesn't scale past ~100 products and breaks SEO. The `<CategoryRail/>` swaps cards via `<ClientRouter />`, not by hiding them |
96
+ | Ship a client-side filter (`data-category-ids` + JS hide) on the product grid | Filter server-side via `/category/[slug]` routes; client-side filtering doesn't scale past ~100 products and breaks SEO. The `<CategoryRail/>` swaps cards via `<ClientRouter />`, not by hiding them |
@@ -1,28 +1,28 @@
1
1
  # Recipe: Product Catalog Data Setup (Phase 1)
2
2
 
3
- Replace the default sample products Wix Stores installs with on-brand products via MCP. This file covers the `seed-seed` scope — data seeding only. Frontend wiring lives in the Phase 2 scope references (`SHARED_WIRING.md`, `PRODUCT_PAGES.md`, `CART_CHECKOUT.md`, `HOME_AND_NAV.md`) and should not be read by `seed-seed`.
3
+ Replace the default sample products Wix Stores installs with on-brand products via the Stores REST API (`curl` against `wixapis.com/stores/v3/...` with the standard headers from `../shared/AUTHENTICATION.md`). This file covers the `seed-seed` scope — data seeding only. Frontend wiring lives in the astro scope references (`../astro/stores/SHARED_WIRING.md`, `../astro/stores/PRODUCT_PAGES.md`, `../astro/ecom/CART_PAGES.md`, `../astro/stores/HOME_AND_NAV.md`) and should not be read by `seed-seed`.
4
4
 
5
5
  > **Critical Rules — Read Before Starting**
6
6
  > 1. **V3 only** — all endpoints under `/stores/v3/...` for products.
7
- > 2. **No improvised endpoints** — if an MCP call returns 404, stop and report. Do not guess alternative URLs. Do not loop on `SearchWixRESTDocumentation` more than twice on the same topic.
7
+ > 2. **No improvised endpoints** — if an REST call returns 404, stop and report. Do not guess alternative URLs. Do not loop on `docs-search REST (see DOCS_SEARCH.md)` more than twice on the same topic.
8
8
  > 3. **Do not seed categories.** Categories are merchant-driven — created in the Wix dashboard, not by this scope. The storefront's rail, Shop submenu, and `/category/[slug]` route are still wired (Phase 4) and light up automatically once the merchant adds at least one visible category with items (≤ 5 min after creation, the helper's TTL).
9
9
 
10
10
  > **V3 Catalog:** New Wix sites use Catalog V3. All endpoints below live under `/stores/v3/...`. The V1 product endpoints should not be used — they silently return 0 results on V3 catalogs.
11
11
 
12
12
  ## Prerequisites
13
13
 
14
- - Wix Stores app must be installed on the site (via MCP after scaffolding, or installed via MCP if missing — see Step 0)
14
+ - Wix Stores app must be installed on the site (installed via the apps-installer REST endpoint after scaffolding — see Step 0)
15
15
 
16
- ## Setup: Replace Default Products via MCP
16
+ ## Setup: Replace Default Products via REST
17
17
 
18
18
  > **Conditional:** This section only applies when ALL of these are true:
19
19
  > - The Stores app was just installed (default sample products exist)
20
- > - Wix MCP tools are available (`mcp__wix-mcp-remote__CallWixSiteAPI` exists)
20
+ > - CLI auth works (`npx @wix/cli@latest token --site "$SITE_ID"` returns a token)
21
21
  > - Discovery context is available in your prompt (business type, brand name, style)
22
22
  >
23
- > **If MCP tools are not available, skip this entire section.** The 12 default products remain and can be customized later in the Wix dashboard.
23
+ > **If CLI auth is not available, skip this entire section.** The 12 default products remain and can be customized later in the Wix dashboard.
24
24
 
25
- > **API error guard:** If any MCP call in Phase 1 returns a 404 or an unexpected error, do **not** retry the same call with a guessed alternative URL or namespace. Report the failing endpoint, request body, and error verbatim to the user, then stop. Improvised endpoints have caused multi-minute silent stalls in past runs.
25
+ > **API error guard:** If any REST call in Phase 1 returns a 404 or an unexpected error, do **not** retry the same call with a guessed alternative URL or namespace. Report the failing endpoint, request body, and error verbatim to the user, then stop.
26
26
 
27
27
  > **Stores appDefId** for install and `catalogReference.appId`: `215238eb-22a5-4c36-9e7b-e7c08025e04e`. (A different defId — `1380b703-ce81-ff05-f115-39571d94dfcd` — is used for `wixMetadata.appDefId` in Phase 2. Do not swap them.)
28
28
 
@@ -30,16 +30,16 @@ Replace the default sample products Wix Stores installs with on-brand products v
30
30
 
31
31
  Before querying products, verify the Stores app is installed:
32
32
 
33
- 1. **Probe** — `CallWixSiteAPI: POST /stores/v3/products/query` with body `{ "query": { "paging": { "limit": 1 } } }`
33
+ 1. **Probe** — `REST: POST https://www.wixapis.com/stores/v3/products/query`
34
34
  2. **If the API returns a "REQUIRED_APP_NOT_INSTALLED" error** → install the Wix Stores app:
35
35
  ```
36
- CallWixSiteAPI: POST https://www.wixapis.com/apps-installer-service/v1/app-instance/install
36
+ REST: POST https://www.wixapis.com/apps-installer-service/v1/app-instance/install
37
37
  body: {
38
38
  "tenant": { "tenantType": "SITE", "id": "<siteId>" },
39
39
  "appInstance": { "appDefId": "215238eb-22a5-4c36-9e7b-e7c08025e04e", "enabled": true }
40
40
  }
41
41
  ```
42
- > 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".
42
+ > 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.
43
43
 
44
44
  Then retry the probe query to confirm installation succeeded.
45
45
  3. **If the probe succeeds** → proceed to Step 1.
@@ -51,7 +51,7 @@ Replace the 12 generic sample products with 3 on-brand products that match the u
51
51
  ### Step 1: Query Default Products
52
52
 
53
53
  ```
54
- CallWixSiteAPI: POST /stores/v3/products/query
54
+ REST: POST https://www.wixapis.com/stores/v3/products/query
55
55
  body: {
56
56
  "query": {
57
57
  "paging": { "limit": 50 }
@@ -64,7 +64,7 @@ Collect all product IDs from the response.
64
64
  ### Step 2: Bulk Delete Defaults
65
65
 
66
66
  ```
67
- CallWixSiteAPI: POST /stores/v3/bulk/products/delete
67
+ REST: POST https://www.wixapis.com/stores/v3/bulk/products/delete
68
68
  body: {
69
69
  "productIds": ["<id1>", "<id2>", ..., "<id12>"]
70
70
  }
@@ -98,7 +98,7 @@ Adapt names, descriptions, and pricing to match the brand's tone and style. Use
98
98
  **Product with variants** (e.g., skincare with 30ml/50ml sizes):
99
99
 
100
100
  ```
101
- CallWixSiteAPI: POST /stores/v3/bulk/products-with-inventory/create
101
+ REST: POST https://www.wixapis.com/stores/v3/bulk/products-with-inventory/create
102
102
  body: {
103
103
  "products": [
104
104
  {
@@ -183,7 +183,7 @@ Include all products in the same `products` array. Do not include `media` — pr
183
183
  ### Step 5: Verify
184
184
 
185
185
  ```
186
- CallWixSiteAPI: POST /stores/v3/products/query
186
+ REST: POST https://www.wixapis.com/stores/v3/products/query
187
187
  body: {
188
188
  "query": { "paging": { "limit": 50 } }
189
189
  }
@@ -201,11 +201,11 @@ If the merchant later creates visible categories in the Wix dashboard and assign
201
201
  - The `Navigation` Shop submenu lists the categories.
202
202
  - `/category/<slug>` becomes a reachable, server-side-filtered listing.
203
203
 
204
- This works because the frontend (`src/utils/categories.ts`, written by the `pages-categories` scope in Phase 4) live-queries the Wix API at SSR time with a 5-min cache — no redeploy or regen is needed.
204
+ This works because the frontend (`src/utils/categories.ts`, pre-copied by the orchestrator before Phase 4 and imported by the `pages-*` scopes) live-queries the Wix API at SSR time with a 5-min cache — no redeploy or regen is needed.
205
205
 
206
206
  ### Step 7: Return Results
207
207
 
208
- Emit a structured JSON block at the end of your completion message per `../../shared/RETURN_CONTRACT.md`. Do NOT write a sidecar file.
208
+ Emit a structured JSON block at the end of your completion message per `../shared/RETURN_CONTRACT.md`. Do NOT write a sidecar file.
209
209
 
210
210
  ```json
211
211
  {
@@ -246,4 +246,4 @@ Phase 1 is complete after Step 7. Do **not** attempt any of the following, even
246
246
  - Creating, renaming, or deleting any category — categories are merchant-driven (see Step 6). The auto-managed "All Products" category (handle `online_stores_all_products`) stays in place; the frontend filters it out by handle.
247
247
  - Verifying your work via additional `query` calls beyond the Step 5 verification already performed.
248
248
 
249
- Phase 2+ (frontend wiring) is covered in the scope-specific references (`SHARED_WIRING.md`, `PRODUCT_PAGES.md`, `CATEGORY_PAGES.md`, `CART_CHECKOUT.md`, `HOME_AND_NAV.md`) — do not read them during `seed-seed`.
249
+ Phase 2+ (frontend wiring) is covered in the astro scope references (`../astro/stores/SHARED_WIRING.md`, `../astro/stores/PRODUCT_PAGES.md`, `../astro/stores/CATEGORY_PAGES.md`, `../astro/ecom/CART_PAGES.md`, `../astro/stores/HOME_AND_NAV.md`) — do not read them during `seed-seed`.