@wix/agent-skills 1.6.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (195) hide show
  1. package/README.md +5 -9
  2. package/package.json +1 -1
  3. package/skills/wix-app/SKILL.md +51 -42
  4. package/skills/wix-app/references/BACKEND_EVENT.md +10 -65
  5. package/skills/wix-app/references/CUSTOM_ELEMENT_WIDGET.md +101 -406
  6. package/skills/wix-app/references/DASHBOARD_MENU_PLUGIN.md +14 -111
  7. package/skills/wix-app/references/DASHBOARD_MODAL.md +56 -205
  8. package/skills/wix-app/references/DASHBOARD_PAGE.md +19 -98
  9. package/skills/wix-app/references/DASHBOARD_PLUGIN.md +6 -108
  10. package/skills/wix-app/references/DATA_COLLECTION.md +113 -198
  11. package/skills/wix-app/references/EMBEDDED_SCRIPT.md +41 -268
  12. package/skills/wix-app/references/EXTENSION_REGISTRATION.md +27 -76
  13. package/skills/wix-app/references/SERVICE_PLUGIN.md +35 -188
  14. package/skills/wix-app/references/SITE_PLUGIN.md +8 -92
  15. package/skills/wix-app/references/STORES_VERSIONING.md +1 -0
  16. package/skills/wix-app/references/backend-event/COMMON-EVENTS.md +0 -44
  17. package/skills/wix-app/references/custom-element-widget/SETTINGS_PANEL.md +19 -330
  18. package/skills/wix-app/references/dashboard-menu-plugin/bookings-slots.md +0 -12
  19. package/skills/wix-app/references/dashboard-menu-plugin/ecommerce-slots.md +7 -0
  20. package/skills/wix-app/references/dashboard-menu-plugin/restaurants-slots.md +0 -12
  21. package/skills/wix-app/references/dashboard-plugin/SLOTS.md +3 -15
  22. package/skills/wix-app/references/service-plugin/ADDITIONAL-FEES.md +2 -18
  23. package/skills/wix-app/references/service-plugin/BOOKINGS-STAFF-SORTING.md +2 -42
  24. package/skills/wix-app/references/service-plugin/DISCOUNT-TRIGGERS.md +1 -11
  25. package/skills/wix-app/references/service-plugin/GIFT-CARDS.md +1 -11
  26. package/skills/wix-app/references/service-plugin/PAYMENT-SETTINGS.md +2 -40
  27. package/skills/wix-app/references/service-plugin/SHIPPING-RATES.md +2 -19
  28. package/skills/wix-app/references/service-plugin/VALIDATIONS.md +2 -18
  29. package/skills/wix-app/references/site-plugin/SLOTS.md +17 -68
  30. package/skills/wix-design-system/SKILL.md +4 -0
  31. package/skills/wix-headless/SKILL.md +131 -386
  32. package/skills/wix-headless/references/BUILD-astro.md +246 -0
  33. package/skills/wix-headless/references/BUILD-own-build.md +167 -0
  34. package/skills/wix-headless/references/BUILD.md +105 -0
  35. package/skills/wix-headless/references/DESIGN_SYSTEM.md +175 -0
  36. package/skills/wix-headless/references/DISCOVERY-connect.md +55 -0
  37. package/skills/wix-headless/references/DISCOVERY-create.md +238 -0
  38. package/skills/wix-headless/references/DISCOVERY.md +50 -306
  39. package/skills/wix-headless/references/PLAN-connect.md +19 -0
  40. package/skills/wix-headless/references/PLAN-create.md +17 -0
  41. package/skills/wix-headless/references/PLAN.md +92 -0
  42. package/skills/wix-headless/references/SEED.md +214 -0
  43. package/skills/wix-headless/references/SETUP.md +73 -248
  44. package/skills/wix-headless/references/{blog → astro/blog}/BLOG_PAGES.md +6 -5
  45. package/skills/wix-headless/references/{blog → astro/blog}/BLOG_SETUP.md +2 -2
  46. package/skills/wix-headless/references/astro/bookings/COMPONENTS.md +337 -0
  47. package/skills/wix-headless/references/astro/bookings/SERVICES_PAGES.md +428 -0
  48. package/skills/wix-headless/references/astro/cms/CMS_FOUNDATIONS.md +214 -0
  49. package/skills/wix-headless/references/{cms → astro/cms}/FAQ_KNOWLEDGE_BASE.md +14 -12
  50. package/skills/wix-headless/references/{cms → astro/cms}/PORTFOLIO.md +15 -16
  51. package/skills/wix-headless/references/{cms → astro/cms}/RESOURCE_LIBRARY.md +13 -15
  52. package/skills/wix-headless/references/{cms → astro/cms}/TEAM_DIRECTORY.md +11 -11
  53. package/skills/wix-headless/references/astro/designer/INSTRUCTIONS.md +354 -0
  54. package/skills/wix-headless/references/{ecom → astro/ecom}/CART_PAGES.md +8 -9
  55. package/skills/wix-headless/references/{ecom → astro/ecom}/CART_WIRING.md +6 -6
  56. package/skills/wix-headless/references/{ecom → astro/ecom}/COMPONENTS_CSS.md +6 -6
  57. package/skills/wix-headless/references/{forms → astro/forms}/CONTACT_FORM.md +18 -32
  58. package/skills/wix-headless/references/{gift-cards → astro/gift-cards}/COMPONENTS.md +3 -3
  59. package/skills/wix-headless/references/{gift-cards → astro/gift-cards}/PAGES.md +2 -2
  60. package/skills/wix-headless/references/{stores → astro/stores}/BACK_IN_STOCK.md +7 -7
  61. package/skills/wix-headless/references/{stores → astro/stores}/CATEGORY_PAGES.md +12 -13
  62. package/skills/wix-headless/references/{stores → astro/stores}/COMPONENTS_CSS.md +7 -7
  63. package/skills/wix-headless/references/{stores → astro/stores}/HOME_AND_NAV.md +11 -9
  64. package/skills/wix-headless/references/{stores → astro/stores}/PRODUCT_PAGES.md +11 -9
  65. package/skills/wix-headless/references/{stores → astro/stores}/SHARED_WIRING.md +8 -7
  66. package/skills/wix-headless/references/astro/templates/Footer.astro +27 -0
  67. package/skills/wix-headless/references/astro/templates/Layout.astro +132 -0
  68. package/skills/wix-headless/references/astro/templates/Navigation.astro +38 -0
  69. package/skills/wix-headless/references/astro/templates/astro.config.mjs +41 -0
  70. package/skills/wix-headless/references/astro/templates/bookings/AvailabilityCalendar.tsx +218 -0
  71. package/skills/wix-headless/references/astro/templates/bookings/BookingForm.tsx +194 -0
  72. package/skills/wix-headless/references/astro/templates/bookings/ManageBooking.tsx +84 -0
  73. package/skills/wix-headless/references/astro/templates/bookings/SeoTags.astro +25 -0
  74. package/skills/wix-headless/references/astro/templates/bookings/ServiceBookingFlow.tsx +50 -0
  75. package/skills/wix-headless/references/astro/templates/bookings/ServiceCard.astro +45 -0
  76. package/skills/wix-headless/references/astro/templates/bookings/api/confirm-booking.ts +34 -0
  77. package/skills/wix-headless/references/astro/templates/bookings/api/waitlist.ts +74 -0
  78. package/skills/wix-headless/references/astro/templates/bookings/booking-confirmation.astro +111 -0
  79. package/skills/wix-headless/references/astro/templates/bookings/components-bookings.css +413 -0
  80. package/skills/wix-headless/references/astro/templates/bookings/manage-booking.astro +76 -0
  81. package/skills/wix-headless/references/astro/templates/bookings/services/[slug].astro +81 -0
  82. package/skills/wix-headless/references/astro/templates/bookings/services/index.astro +65 -0
  83. package/skills/wix-headless/references/astro/templates/ecom/components-ecom.css +302 -0
  84. package/skills/wix-headless/references/astro/templates/global.css +286 -0
  85. package/skills/wix-headless/references/astro/templates/index.astro +56 -0
  86. package/skills/wix-headless/{templates → references/astro/templates}/stores/back-in-stock.ts +1 -1
  87. package/skills/wix-headless/{templates → references/astro/templates}/stores/components-stores.css +138 -33
  88. package/skills/wix-headless/references/blog/BLOG_CONTENT.md +28 -19
  89. package/skills/wix-headless/references/blog/INSTRUCTIONS.md +6 -6
  90. package/skills/wix-headless/references/bookings/INSTRUCTIONS.md +106 -0
  91. package/skills/wix-headless/references/bookings/SERVICES_DATA.md +295 -0
  92. package/skills/wix-headless/references/cms/CMS_FOUNDATIONS.md +35 -232
  93. package/skills/wix-headless/references/cms/INSTRUCTIONS.md +39 -8
  94. package/skills/wix-headless/references/commands/known-apps.json +2 -1
  95. package/skills/wix-headless/references/custom/CONNECTION_PLAN.md +142 -0
  96. package/skills/wix-headless/references/custom/INSTRUCTIONS.md +88 -0
  97. package/skills/wix-headless/references/custom/blog/WIRING.md +52 -0
  98. package/skills/wix-headless/references/custom/bookings/WIRING.md +88 -0
  99. package/skills/wix-headless/references/custom/cms/WIRING.md +97 -0
  100. package/skills/wix-headless/references/custom/ecom/WIRING.md +67 -0
  101. package/skills/wix-headless/references/custom/forms/WIRING.md +101 -0
  102. package/skills/wix-headless/references/custom/stores/WIRING.md +80 -0
  103. package/skills/wix-headless/references/ecom/INSTRUCTIONS.md +12 -12
  104. package/skills/wix-headless/references/forms/INSTRUCTIONS.md +6 -6
  105. package/skills/wix-headless/references/gift-cards/INSTRUCTIONS.md +13 -13
  106. package/skills/wix-headless/references/images/INSTRUCTIONS.md +58 -60
  107. package/skills/wix-headless/references/seed-recipes.md +49 -0
  108. package/skills/wix-headless/references/shared/AGENTS_MD.md +47 -0
  109. package/skills/wix-headless/references/shared/AUTHENTICATION.md +108 -0
  110. package/skills/wix-headless/references/shared/BUILD_NOISE.md +2 -2
  111. package/skills/wix-headless/references/shared/DESIGN_MD.md +85 -0
  112. package/skills/wix-headless/references/shared/DOCS_SEARCH.md +41 -0
  113. package/skills/wix-headless/references/shared/IMAGE_GENERATION.md +40 -39
  114. package/skills/wix-headless/references/shared/IMPLEMENTER.md +92 -41
  115. package/skills/wix-headless/references/shared/PRODUCTION_SHARP_EDGES.md +3 -3
  116. package/skills/wix-headless/references/shared/RETURN_CONTRACT.md +32 -312
  117. package/skills/wix-headless/references/shared/STYLING.md +48 -21
  118. package/skills/wix-headless/references/stores/INSTRUCTIONS.md +59 -29
  119. package/skills/wix-headless/references/stores/PRODUCT_CATALOG_DATA.md +31 -28
  120. package/skills/wix-headless/references/verticals/_schema.json +31 -117
  121. package/skills/wix-headless/references/verticals/_schema.md +60 -150
  122. package/skills/wix-headless/references/verticals/blog.md +5 -99
  123. package/skills/wix-headless/references/verticals/bookings.md +41 -0
  124. package/skills/wix-headless/references/verticals/cms.md +9 -100
  125. package/skills/wix-headless/references/verticals/ecom.md +6 -77
  126. package/skills/wix-headless/references/verticals/forms.md +5 -85
  127. package/skills/wix-headless/references/verticals/gift-cards.md +6 -103
  128. package/skills/wix-headless/references/verticals/stores.md +10 -144
  129. package/skills/wix-headless/scripts/check-manifest.mjs +148 -11
  130. package/skills/wix-headless/scripts/compose.mjs +540 -0
  131. package/skills/wix-headless/scripts/emit-design-tokens.mjs +136 -53
  132. package/skills/wix-headless/scripts/flatten.sh +61 -0
  133. package/skills/wix-headless/scripts/generate-images.mjs +242 -0
  134. package/skills/wix-headless/scripts/patch-decorative-slots.mjs +67 -43
  135. package/skills/wix-headless/scripts/plan-entity-image-waves.mjs +3 -3
  136. package/skills/wix-headless/scripts/scaffold.sh +113 -27
  137. package/skills/wix-headless/scripts/seed-utilities.sh +50 -12
  138. package/skills/wix-headless/scripts/write-decorative-json.mjs +62 -0
  139. package/skills/wix-manage/SKILL.md +4 -8
  140. package/skills/wix-manage/references/blog/how-to-create-blog-posts.md +2 -0
  141. package/skills/wix-manage/references/cms/cms-data-items-crud.md +4 -0
  142. package/skills/wix-manage/references/cms/cms-references-and-relationships.md +2 -0
  143. package/skills/wix-manage/references/cms/cms-schema-management.md +4 -0
  144. package/skills/wix-manage/references/domains/domain-search-and-purchase.md +10 -7
  145. package/skills/wix-manage/references/ecommerce/api-shipping.md +443 -0
  146. package/skills/wix-manage/references/ecommerce/flow-add-free-shipping.md +5 -6
  147. package/skills/wix-manage/references/ecommerce/flow-fix-coverage-gaps.md +4 -5
  148. package/skills/wix-manage/references/ecommerce/flow-optimize-shipping-rates.md +4 -5
  149. package/skills/wix-manage/references/ecommerce/goal-increase-aov.md +1 -1
  150. package/skills/wix-manage/references/ecommerce/goal-reduce-cart-abandonment.md +1 -2
  151. package/skills/wix-manage/references/ecommerce/guardrail-shipping-health.md +2 -2
  152. package/skills/wix-manage/references/ecommerce/recipe-apply-shipping-recommendations.md +4 -5
  153. package/skills/wix-manage/references/ecommerce/recommend-ecommerce-strategy.md +7 -7
  154. package/skills/wix-manage/references/ecommerce/setup-discount-rules.md +209 -72
  155. package/skills/wix-manage/references/ecommerce/setup-store-pickup-location.md +9 -10
  156. package/skills/wix-manage/references/ecommerce/skill-graph.md +4 -4
  157. package/skills/wix-manage/references/forms/create-form.md +50 -0
  158. package/skills/wix-manage/references/stores/bulk-create-products-with-options.md +2 -0
  159. package/skills/wix-manage/references/stores/create-product-from-image.md +91 -38
  160. package/skills/wix-manage/references/stores/setup-online-store-catalog-v3.md +2 -0
  161. package/skills/wix-app/references/custom-element-widget/default-thumbnail.png +0 -0
  162. package/skills/wix-app/references/data-collection/extension-template.ts +0 -107
  163. package/skills/wix-headless/references/ORCHESTRATION.md +0 -269
  164. package/skills/wix-headless/references/commands/install-app.md +0 -42
  165. package/skills/wix-headless/references/commands/mcp-bootstrap.md +0 -28
  166. package/skills/wix-headless/references/designer/INSTRUCTIONS.md +0 -828
  167. package/skills/wix-headless/references/shared/MCP_PREFIX.md +0 -105
  168. package/skills/wix-headless/scripts/copy-utility-templates.mjs +0 -153
  169. package/skills/wix-headless/scripts/finalize-run-json.mjs +0 -141
  170. package/skills/wix-headless/scripts/init-site-json.mjs +0 -63
  171. package/skills/wix-headless/scripts/preview.sh +0 -45
  172. package/skills/wix-headless/scripts/release.sh +0 -73
  173. package/skills/wix-headless/templates/ecom/components-ecom.css +0 -215
  174. package/skills/wix-manage/references/events/list-events.md +0 -203
  175. /package/skills/wix-headless/{templates → references/astro/templates}/ecom/CartBadge.tsx +0 -0
  176. /package/skills/wix-headless/{templates → references/astro/templates}/ecom/CartView.tsx +0 -0
  177. /package/skills/wix-headless/{templates → references/astro/templates}/ecom/cart.astro +0 -0
  178. /package/skills/wix-headless/{templates → references/astro/templates}/ecom/discounts.ts +0 -0
  179. /package/skills/wix-headless/{templates → references/astro/templates}/ecom/thank-you.astro +0 -0
  180. /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/GiftCardPurchase.tsx +0 -0
  181. /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/_home-teaser-snippet.astro +0 -0
  182. /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/_nav-snippet.astro +0 -0
  183. /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/components-gift-cards.css +0 -0
  184. /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/gift-cards.astro +0 -0
  185. /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/gift-cards.ts +0 -0
  186. /package/skills/wix-headless/{templates → references/astro/templates}/stores/AddToCartButton.tsx +0 -0
  187. /package/skills/wix-headless/{templates → references/astro/templates}/stores/BackInStockForm.tsx +0 -0
  188. /package/skills/wix-headless/{templates → references/astro/templates}/stores/CategoryRail.astro +0 -0
  189. /package/skills/wix-headless/{templates → references/astro/templates}/stores/ProductCard.astro +0 -0
  190. /package/skills/wix-headless/{templates → references/astro/templates}/stores/ProductPurchase.tsx +0 -0
  191. /package/skills/wix-headless/{templates → references/astro/templates}/stores/SeoTags.astro +0 -0
  192. /package/skills/wix-headless/{templates → references/astro/templates}/stores/categories.ts +0 -0
  193. /package/skills/wix-headless/{templates → references/astro/templates}/stores/category/[slug].astro +0 -0
  194. /package/skills/wix-headless/{templates → references/astro/templates}/stores/products/[slug].astro +0 -0
  195. /package/skills/wix-headless/{templates → references/astro/templates}/stores/products/index.astro +0 -0
@@ -1,105 +0,0 @@
1
- # Wix MCP Tool Prefix — Discovery & Propagation
2
-
3
- Wix MCP tools are exposed under one of two prefixes depending on how the user installed the integration:
4
-
5
- | Install mode | Prefix |
6
- |---|---|
7
- | **Plugin** (typical for end users) | `mcp__plugin_<plugin-name>_wix-mcp-remote__` (e.g. `mcp__plugin_wix-headless_wix-mcp-remote__WixREADME`) |
8
- | **Direct MCP server** | `mcp__wix-mcp-remote__` (e.g. `mcp__wix-mcp-remote__WixREADME`) |
9
-
10
- Tool **suffixes** are identical in both modes: `WixREADME`, `CallWixSiteAPI`, `ListWixSites`, `ManageWixSite`, `SearchWixHeadlessDocumentation`, `SearchWixSDKDocumentation`, `SearchWixRESTDocumentation`, `BrowseWixRESTDocsMenu`, `ReadFullDocsArticle`, `ReadFullDocsMethodSchema`. Only the prefix differs.
11
-
12
- Documentation in this plugin uses the canonical short form (`mcp__wix-mcp-remote__<suffix>`) for readability — substitute the discovered prefix at runtime.
13
-
14
- ---
15
-
16
- ## Discovery — entry-point skills only, once per session
17
-
18
- The entry-point skill (`wix-headless`) MUST run this before any other MCP call:
19
-
20
- 1. Use whatever tool-discovery primitive your runtime provides to look up `WixREADME`.
21
- 2. From the returned tool name, strip the trailing `WixREADME` — what remains (ending in `wix-mcp-remote__`) is the **MCP prefix**. Examples:
22
- - Returned name `mcp__plugin_wix_wix-mcp-remote__WixREADME` → prefix `mcp__plugin_wix_wix-mcp-remote__`
23
- - Returned name `mcp__wix-mcp-remote__WixREADME` → prefix `mcp__wix-mcp-remote__`
24
- 3. Call `<prefix>WixREADME` once to verify connectivity.
25
- 4. **If discovery returns no match, or the verify call fails:** stop and tell the user:
26
- > *"Wix MCP tools are not available in this session. Please ensure the Wix MCP server is connected (or that the Wix plugin is enabled), then restart your client."*
27
- 5. Hold the discovered prefix in working memory for the rest of the session — use it for every MCP call AND pass it into every subagent prompt.
28
-
29
- ---
30
-
31
- ## Propagation to subagents
32
-
33
- Subagents (every Phase 1 / Phase 2 / Phase 3 / Phase 4 implementer) are isolated workers — they see only the prompt their parent gave them, not the parent's session state. Every subagent prompt MUST include this line verbatim near the top:
34
-
35
- ```
36
- MCP tool prefix: <discovered prefix>
37
- Use this prefix for every Wix MCP call. Example: <prefix>CallWixSiteAPI, <prefix>WixREADME.
38
- ```
39
-
40
- Without this line the subagent will try the canonical short form and fail in plugin mode.
41
-
42
- ---
43
-
44
- ## `CallWixSiteAPI` call conventions — read before the first call
45
-
46
- `CallWixSiteAPI` is the most error-prone tool in this plugin. Two failure modes recur; avoid both:
47
-
48
- **1. Missing required wrapper params.** The tool requires — in addition to `method`, `url`, `body` — these wrapper fields:
49
-
50
- - `siteId` — from `wix.config.json` (or the parent prompt)
51
- - `reason` — one-sentence human reason, e.g. `"Install Wix Stores app for <brand>"`
52
- - `sourceDocUrl` — the Wix docs URL the recipe is from, e.g. `"https://dev.wix.com/docs/picasso/wix-ai-docs/recipes-v2/manage/platform/recipe-install-wix-apps"`
53
-
54
- **2. `body` passed as a stringified JSON.** `body` is typed `anyOf: [object, array]` — pass it as a real structured value. `body: "{\"tenant\":…}"` will be rejected with `Expected object, received string`.
55
-
56
- **The safe pattern — follow on the first `CallWixSiteAPI` of each session:**
57
-
58
- 1. **Load the schema** via your runtime's tool-discovery primitive (the orchestrator's Step 0 already did this for the whole session per `<SKILL_ROOT>/references/commands/mcp-bootstrap.md` — only re-load if you hit a tool-not-found error).
59
- 2. Call with the full shape:
60
- ```
61
- <prefix>CallWixSiteAPI(
62
- siteId: "<siteId from wix.config.json>",
63
- reason: "<one-sentence reason>",
64
- sourceDocUrl: "<URL of the Wix docs recipe you're following>",
65
- method: "POST",
66
- url: "https://www.wixapis.com/<service>/<path>",
67
- body: { …as a real object, not a string }
68
- )
69
- ```
70
-
71
- **When you see reference snippets written in prose-HTTP form** (e.g. `CallWixSiteAPI: POST /blog/v3/posts` followed by `body: { … }`), translate them into the full tool-call shape above — the prose form omits the wrapper fields for readability, not because they're optional.
72
-
73
- ## Defensive fallback — required in every implementer agent
74
-
75
- If a Wix MCP call returns "tool not found" or the tool name appears unavailable for any reason:
76
-
77
- 1. Re-discover the tool via your runtime's tool-discovery primitive, looking up the suffix (e.g. `CallWixSiteAPI`).
78
- 2. Use the discovered tool name and retry the call.
79
- 3. **Do NOT bail.** Only escalate to the user if discovery itself returns no match.
80
-
81
- This guards against parents that forgot to pass the prefix and against future prefix-scheme changes.
82
-
83
- ---
84
-
85
- ## Prefer bundled reference docs over external doc reads
86
-
87
- Your agent directory includes `.md` reference files with API recipes, call templates, and error handling tailored to your scope. These are your primary source — they document the exact call patterns, body shapes, and edge cases for your use case.
88
-
89
- The Wix MCP also exposes documentation tools (`SearchWixRESTDocumentation`, `ReadFullDocsArticle`, `SearchWixSDKDocumentation`, etc.). These are useful when you hit an error or edge case not covered by your reference files. But **prefer your bundled `.md` files first** — each external doc read costs a tool call and 15-30s, and the bundled recipes are already validated for this plugin's flows.
90
-
91
- **Rule of thumb:** read your reference files → try the documented recipe → only if you get an unexpected error or need an endpoint not covered, fall back to the MCP doc tools.
92
-
93
- ---
94
-
95
- ## Absolute paths — never trust CWD-relative instruction locations
96
-
97
- Subagents launched by the orchestrator run with the project directory as CWD (e.g. `/Users/.../headless-projects/chairloom/`), not the skill root. Your instruction file and its sibling references live **inside the skill**, not in your CWD — e.g. the stores instructions live at `<skill-root>/references/stores/INSTRUCTIONS.md`.
98
-
99
- **Rule:** every implementer prompt MUST include an `Instruction file (absolute path)` line pointing at the right `INSTRUCTIONS.md`. Read that file and only that path. Then use the absolute paths it lists for sibling references. Never:
100
-
101
- - Resolve `references/stores/INSTRUCTIONS.md` against your CWD — it doesn't exist there.
102
- - `Glob **/INSTRUCTIONS.md` or `**/agents/**` to "find" your instructions — that walks the project tree and finds nothing relevant; it's the most expensive failure mode in current runs.
103
- - Walk up from the project directory looking for the skill root — guess wrong and you'll burn minutes globbing.
104
-
105
- If your prompt is missing the absolute `Instruction file` line, ask the parent (don't guess). The `wix-headless` skill is responsible for computing and passing this absolute path in every agent-launch prompt (see `references/ORCHESTRATION.md` § "Agent prompt template").
@@ -1,153 +0,0 @@
1
- #!/usr/bin/env node
2
- // Copy templated utility files into the project for the named phase.
3
- // Invoked by the wix-headless skill orchestrator before Phase 3 Components or
4
- // Phase 4 Pages dispatches, so that mechanical SDK-wrapper utilities
5
- // (back-in-stock.ts, discounts.ts, categories.ts) are on disk by the time
6
- // agents start.
7
- //
8
- // These files are pure templates — same shape regardless of brand. Letting an
9
- // LLM regenerate them costs tokens and risks drift. Pre-copying is structurally
10
- // better.
11
- //
12
- // Usage (both modes work):
13
- // node <SKILL_ROOT>/scripts/copy-utility-templates.mjs <project-dir> <phase>
14
- // curl -s https://dev.wix.com/skills/wix-headless/scripts/copy-utility-templates.mjs \
15
- // | node --input-type=module - <project-dir> <phase>
16
- //
17
- // <phase> ∈ { "components", "pages" }
18
- //
19
- // Note: `node <(curl ...)` does NOT work for .mjs files — Node sees /dev/fd/N
20
- // with no extension and rejects ESM syntax. Use the stdin form above.
21
- //
22
- // Template files auto-detect whether they can be read on disk (tgz install)
23
- // and fall back to HTTP fetch when streamed via stdin.
24
- //
25
- // Reads `.wix/site.json` to discover which packs are loaded, then copies the
26
- // matching templates for the given phase. Never overwrites an existing file
27
- // (so user customisations and earlier orchestrator state are preserved).
28
-
29
- import { readFileSync, writeFileSync, existsSync, mkdirSync, copyFileSync } from "node:fs";
30
- import { join, dirname, resolve } from "node:path";
31
- import { fileURLToPath } from "node:url";
32
-
33
- const SKILL_URL = "https://dev.wix.com/skills/wix-headless";
34
-
35
- // Mode detection — see check-manifest.mjs for the same pattern.
36
- let SKILL_ROOT_DISK = null;
37
- try {
38
- const scriptDir = dirname(fileURLToPath(import.meta.url));
39
- const candidate = resolve(scriptDir, "..");
40
- if (existsSync(join(candidate, "templates"))) {
41
- SKILL_ROOT_DISK = candidate;
42
- }
43
- } catch {
44
- // fileURLToPath may fail on non-file URLs; fall through to URL mode.
45
- }
46
-
47
- // Copy a template file (path relative to <SKILL_ROOT>/templates/) into the
48
- // project at destPath. Returns { ok: true } on success, or { ok: false,
49
- // reason: "..." } on failure (source missing, HTTP error, IO error).
50
- async function copyTemplate(sourceRel, destPath) {
51
- if (SKILL_ROOT_DISK) {
52
- const src = join(SKILL_ROOT_DISK, "templates", sourceRel);
53
- if (!existsSync(src)) return { ok: false, reason: `missing on disk: ${src}` };
54
- try {
55
- mkdirSync(dirname(destPath), { recursive: true });
56
- copyFileSync(src, destPath);
57
- return { ok: true };
58
- } catch (e) {
59
- return { ok: false, reason: e.message };
60
- }
61
- }
62
- const url = `${SKILL_URL}/templates/${sourceRel}`;
63
- try {
64
- const r = await fetch(url);
65
- if (r.status === 404) return { ok: false, reason: `missing at ${url}` };
66
- if (!r.ok) return { ok: false, reason: `fetch ${url}: HTTP ${r.status}` };
67
- const text = await r.text();
68
- mkdirSync(dirname(destPath), { recursive: true });
69
- writeFileSync(destPath, text);
70
- return { ok: true };
71
- } catch (e) {
72
- return { ok: false, reason: e.message };
73
- }
74
- }
75
-
76
- // Hardcoded mapping: { pack, phase, source (relative to templates dir), dest (relative to project) }.
77
- // To add a new templated utility: ship the file under templates/<pack>/, then add
78
- // an entry here. Keep this list small — only files that are pure SDK wrappers
79
- // with no brand-specific content belong here.
80
- const TEMPLATES = [
81
- { pack: "stores", phase: "components", source: "stores/back-in-stock.ts", dest: "src/utils/back-in-stock.ts" },
82
- { pack: "ecom", phase: "components", source: "ecom/discounts.ts", dest: "src/utils/discounts.ts" },
83
- { pack: "stores", phase: "pages", source: "stores/categories.ts", dest: "src/utils/categories.ts" },
84
- ];
85
-
86
- const projectDir = process.argv[2];
87
- const phase = process.argv[3];
88
-
89
- if (!projectDir || !phase) {
90
- console.error("usage: copy-utility-templates.mjs <project-dir> <phase>");
91
- console.error(" <phase> ∈ { components, pages }");
92
- process.exit(2);
93
- }
94
-
95
- if (phase !== "components" && phase !== "pages") {
96
- console.error(`copy-utility-templates: invalid phase "${phase}" — must be "components" or "pages"`);
97
- process.exit(2);
98
- }
99
-
100
- const sitePath = join(projectDir, ".wix/site.json");
101
- let loadedPacks;
102
- try {
103
- const site = JSON.parse(readFileSync(sitePath, "utf8"));
104
- loadedPacks = new Set(site.verticals ?? []);
105
- if (loadedPacks.size === 0) {
106
- console.error(`copy-utility-templates: site.json.verticals is empty — has Setup completed?`);
107
- process.exit(1);
108
- }
109
- } catch (e) {
110
- console.error(`copy-utility-templates: cannot read ${sitePath} (${e.message}). Has Setup completed?`);
111
- process.exit(1);
112
- }
113
-
114
- const candidates = TEMPLATES.filter((t) => t.phase === phase && loadedPacks.has(t.pack));
115
-
116
- if (candidates.length === 0) {
117
- console.log(`copy-utility-templates: no templates for phase "${phase}" with loaded packs ${[...loadedPacks].join(", ")} — nothing to do`);
118
- process.exit(0);
119
- }
120
-
121
- const copied = [];
122
- const skipped = [];
123
- const errors = [];
124
-
125
- for (const { pack, source, dest } of candidates) {
126
- const destPath = join(projectDir, dest);
127
-
128
- if (existsSync(destPath)) {
129
- skipped.push(dest);
130
- continue;
131
- }
132
-
133
- const result = await copyTemplate(source, destPath);
134
- if (result.ok) {
135
- copied.push(dest);
136
- } else {
137
- errors.push(`failed to copy ${source} → ${dest} (pack "${pack}"): ${result.reason}`);
138
- }
139
- }
140
-
141
- const summary = {
142
- phase,
143
- packs: [...loadedPacks],
144
- copied,
145
- skipped,
146
- errors,
147
- };
148
-
149
- console.log(JSON.stringify(summary, null, 2));
150
-
151
- if (errors.length > 0) {
152
- process.exit(1);
153
- }
@@ -1,141 +0,0 @@
1
- #!/usr/bin/env node
2
- // Finalize and write .wix/run.json at the end of the build.
3
- //
4
- // The orchestrator collects agent returns, timings, and outcome data over the
5
- // run. This script takes the orchestrator's draft as a JSON blob via stdin,
6
- // runs the timing-completeness gate (every required phase MUST have non-null
7
- // seconds, otherwise emit MISSING_TIMING errors), computes totalSeconds from
8
- // started/ended, writes the canonical .wix/run.json, and prints the perf
9
- // one-liner the orchestrator shows in the final message.
10
- //
11
- // Usage:
12
- // echo "$DRAFT_JSON" | node finalize-run-json.mjs <project-dir>
13
- //
14
- // Input shape (via stdin):
15
- // {
16
- // "run": { started, ended, brand, prompt, verticals, packs },
17
- // "outcome": { build, previewUrl, dashboardUrl, ... },
18
- // "phases": [ { phase, status, seconds, data?, errors? }, ... ],
19
- // "recoveries": [ ... ], // optional; from manifest-check script outputs
20
- // "errors": [ ... ], // optional; from agent returns / orchestrator
21
- // "notes": [ ... ], // optional
22
- // "requiredPhases": ["scaffold","app-install-Wix Stores","env-pull",...]
23
- // }
24
- //
25
- // `requiredPhases` is the orchestrator's set of skill-invoked phases that MUST
26
- // have a captured duration (scaffold, every app-install-*, env-pull,
27
- // seed-utilities, npm-install, build, release|preview, etc.). The set is
28
- // run-specific (number of app-install-* depends on loaded packs), so the
29
- // orchestrator passes it in rather than the script guessing.
30
- //
31
- // Output:
32
- // - Writes .wix/run.json (full shape, with timing-completeness gate applied).
33
- // - Prints to stdout: a JSON object with { perfLine, missingTiming, totalSeconds }.
34
-
35
- import { writeFileSync, mkdirSync, readFileSync } from "node:fs";
36
- import { join } from "node:path";
37
-
38
- const projectDir = process.argv[2];
39
-
40
- if (!projectDir) {
41
- console.error("usage: cat draft.json | finalize-run-json.mjs <project-dir>");
42
- process.exit(2);
43
- }
44
-
45
- let draft;
46
- try {
47
- draft = JSON.parse(readFileSync(0, "utf8"));
48
- } catch (e) {
49
- console.error(`finalize-run-json: stdin is not valid JSON (${e.message})`);
50
- process.exit(2);
51
- }
52
-
53
- const run = draft.run ?? {};
54
- const phases = Array.isArray(draft.phases) ? [...draft.phases] : [];
55
- const errors = Array.isArray(draft.errors) ? [...draft.errors] : [];
56
- const recoveries = Array.isArray(draft.recoveries) ? draft.recoveries : [];
57
- const notes = Array.isArray(draft.notes) ? draft.notes : [];
58
- const outcome = draft.outcome ?? {};
59
- const requiredPhases = Array.isArray(draft.requiredPhases) ? draft.requiredPhases : [];
60
-
61
- // ---- 1. Timing completeness gate ------------------------------------------
62
- const phasesByName = new Map();
63
- for (const p of phases) {
64
- phasesByName.set(p.phase, p);
65
- }
66
-
67
- const missingTiming = [];
68
-
69
- for (const required of requiredPhases) {
70
- const existing = phasesByName.get(required);
71
- if (!existing) {
72
- // Missing entry entirely.
73
- const entry = { phase: required, status: "unknown", seconds: null };
74
- phases.push(entry);
75
- phasesByName.set(required, entry);
76
- errors.push({ code: "MISSING_TIMING", phase: required });
77
- missingTiming.push(required);
78
- } else if (existing.seconds === null || existing.seconds === undefined) {
79
- existing.seconds = null;
80
- if (!errors.some((e) => e.code === "MISSING_TIMING" && e.phase === required)) {
81
- errors.push({ code: "MISSING_TIMING", phase: required });
82
- }
83
- missingTiming.push(required);
84
- }
85
- }
86
-
87
- // ---- 2. totalSeconds derivation -------------------------------------------
88
- if (!run.totalSeconds && run.started && run.ended) {
89
- const started = Date.parse(run.started);
90
- const ended = Date.parse(run.ended);
91
- if (!Number.isNaN(started) && !Number.isNaN(ended) && ended >= started) {
92
- run.totalSeconds = Math.round((ended - started) / 1000);
93
- }
94
- }
95
-
96
- // ---- 3. Compose final shape -----------------------------------------------
97
- const final = {
98
- version: "1.0",
99
- run,
100
- outcome,
101
- phases,
102
- ...(recoveries.length > 0 ? { recoveries } : {}),
103
- ...(errors.length > 0 ? { errors } : {}),
104
- ...(notes.length > 0 ? { notes } : { notes: [] }),
105
- };
106
-
107
- const wixDir = join(projectDir, ".wix");
108
- mkdirSync(wixDir, { recursive: true });
109
- const runJsonPath = join(wixDir, "run.json");
110
- writeFileSync(runJsonPath, JSON.stringify(final, null, 2) + "\n");
111
-
112
- // ---- 4. Perf one-liner ----------------------------------------------------
113
- // Format: "Built in <Nm Ss> — design-system <n>s · images (phase 1 + phase 2) <n>s · build+release <n>s"
114
- const fmtSeconds = (sec) => (sec === null || sec === undefined ? "–" : `${sec}s`);
115
- const fmtTotal = (sec) => {
116
- if (sec === null || sec === undefined) return "–";
117
- const m = Math.floor(sec / 60);
118
- const s = sec % 60;
119
- return `${m}m ${s}s`;
120
- };
121
- const phaseSeconds = (name) => {
122
- const p = phasesByName.get(name);
123
- return p && p.seconds !== null && p.seconds !== undefined ? p.seconds : null;
124
- };
125
- const designSystem = phaseSeconds("design-system");
126
- const img1 = phaseSeconds("image-phase-1-decorative");
127
- const img2 = phaseSeconds("image-phase-2-entity");
128
- const imgTotal = img1 !== null && img2 !== null ? img1 + img2 : null;
129
- const build = phaseSeconds("build");
130
- const release = phaseSeconds("release") ?? phaseSeconds("preview");
131
- const buildPlusRelease = build !== null && release !== null ? build + release : null;
132
-
133
- const perfLine = `Built in ${fmtTotal(run.totalSeconds)} — design-system ${fmtSeconds(designSystem)} · images (phase 1 + phase 2) ${fmtSeconds(imgTotal)} · build+release ${fmtSeconds(buildPlusRelease)}`;
134
-
135
- console.log(JSON.stringify({
136
- status: missingTiming.length > 0 ? "partial" : "ok",
137
- path: runJsonPath,
138
- totalSeconds: run.totalSeconds ?? null,
139
- missingTiming,
140
- perfLine,
141
- }, null, 2));
@@ -1,63 +0,0 @@
1
- #!/usr/bin/env node
2
- // Write the initial .wix/site.json shape during Setup. Site.json is the
3
- // single source of truth that every downstream phase reads from / appends
4
- // to. This script writes the canonical initial structure deterministically
5
- // so the orchestrator never has to compose the shape inline (which used
6
- // to be LLM-emitted JSON, with the obvious drift risks).
7
- //
8
- // Usage:
9
- // node init-site-json.mjs <project-dir> <brand-name> <brand-description> <verticals-csv>
10
- //
11
- // Example:
12
- // node init-site-json.mjs /tmp/proj "Acme Coffee" "Warm cream-and-forest editorial" "stores,ecom,cms,gift-cards"
13
- //
14
- // Behavior:
15
- // - Refuses to overwrite an existing .wix/site.json (exit 2). The orchestrator
16
- // should call this exactly once during Setup. To re-init for testing, the
17
- // caller can rm the file first.
18
- // - Creates .wix/ if it doesn't exist.
19
- // - Outputs a JSON summary to stdout.
20
-
21
- import { writeFileSync, existsSync, mkdirSync } from "node:fs";
22
- import { join } from "node:path";
23
-
24
- const [, , projectDir, brandName, brandDescription, verticalsCsv] = process.argv;
25
-
26
- if (!projectDir || !brandName || brandDescription === undefined || !verticalsCsv) {
27
- console.error("usage: init-site-json.mjs <project-dir> <brand-name> <brand-description> <verticals-csv>");
28
- process.exit(2);
29
- }
30
-
31
- const verticals = verticalsCsv
32
- .split(",")
33
- .map((v) => v.trim())
34
- .filter(Boolean);
35
-
36
- if (verticals.length === 0) {
37
- console.error("init-site-json: <verticals-csv> resolved to zero verticals — cms is always loaded, so this is a bug");
38
- process.exit(2);
39
- }
40
-
41
- const wixDir = join(projectDir, ".wix");
42
- const sitePath = join(wixDir, "site.json");
43
-
44
- if (existsSync(sitePath)) {
45
- console.error(`init-site-json: ${sitePath} already exists — refusing to overwrite. Setup should call this exactly once.`);
46
- process.exit(2);
47
- }
48
-
49
- mkdirSync(wixDir, { recursive: true });
50
-
51
- const site = {
52
- brand: {
53
- name: brandName,
54
- description: brandDescription,
55
- },
56
- seeded: {},
57
- designTokens: {},
58
- verticals,
59
- };
60
-
61
- writeFileSync(sitePath, JSON.stringify(site, null, 2) + "\n");
62
-
63
- console.log(JSON.stringify({ status: "ok", path: sitePath, verticals }, null, 2));
@@ -1,45 +0,0 @@
1
- #!/usr/bin/env bash
2
- # Build the project and deploy a rotating preview URL.
3
- #
4
- # Usage:
5
- # bash <SKILL_ROOT>/scripts/preview.sh
6
- #
7
- # Run from the project directory (CWD = <project>/). Requires wix.config.json.
8
- #
9
- # Output: stdout is the preview URL that `npx @wix/cli preview` printed; the
10
- # orchestrator captures it and records as outcome.previewUrl in run.json. All
11
- # other CLI output goes to stderr.
12
- #
13
- # `preview` does NOT populate the Frontend link in headless settings — that's
14
- # what `release.sh` is for. Use preview for fast iteration on a rotating URL;
15
- # use release for production deploy + transactional-email URL stability.
16
- #
17
- # Exit codes:
18
- # 0 — ok; preview URL on stdout
19
- # <other> — build or preview failed; stderr surfaces the underlying error
20
- # (TypeScript / Astro errors are code bugs, not endpoint drift —
21
- # the orchestrator's recovery ladder doesn't retry build).
22
-
23
- set -euo pipefail
24
-
25
- # Build first; surface compile errors verbatim if it fails.
26
- npx @wix/cli build 1>&2
27
-
28
- # Preview captures the deployed URL on stdout. We tee its output to stderr for
29
- # the user-visible log AND parse the URL out for the orchestrator's stdout.
30
- PREVIEW_OUTPUT="$(mktemp)"
31
- trap 'rm -f "$PREVIEW_OUTPUT"' EXIT
32
-
33
- npx @wix/cli preview 2>&1 | tee "$PREVIEW_OUTPUT" 1>&2
34
-
35
- # Wix CLI prints `Site preview URL: <url>` (or similar) — extract the first
36
- # https URL from the output. If multiple are printed, the first is the canonical
37
- # preview URL.
38
- PREVIEW_URL="$(grep -oE 'https://[A-Za-z0-9.-]+\.wix-host\.com[^[:space:]]*' "$PREVIEW_OUTPUT" | head -n 1 || true)"
39
-
40
- if [[ -z "$PREVIEW_URL" ]]; then
41
- echo "preview.sh: could not extract a *.wix-host.com URL from preview output" >&2
42
- exit 1
43
- fi
44
-
45
- echo "$PREVIEW_URL"
@@ -1,73 +0,0 @@
1
- #!/usr/bin/env bash
2
- # Build the project and release to production. Unlike preview.sh, this populates
3
- # the Frontend link in dashboard → Settings → Headless Settings → Manage URLs,
4
- # which Wix injects into transactional emails (order confirmations, password
5
- # resets, member invites). Use release.sh for production deploys.
6
- #
7
- # Usage:
8
- # bash <SKILL_ROOT>/scripts/release.sh
9
- #
10
- # Run from the project directory (CWD = <project>/). Requires wix.config.json.
11
- #
12
- # Output: stdout is the released URL that `npx @wix/cli release` printed
13
- # (extracted from the line `Site published on <url>`); the orchestrator
14
- # captures it as outcome.releaseUrl in run.json. All other CLI output goes
15
- # to stderr.
16
- #
17
- # Exit codes:
18
- # 0 — ok; release URL on stdout
19
- # <other> — build or release failed; stderr surfaces the underlying error.
20
- # Build failures are code bugs (TypeScript / Astro / missing
21
- # module) — the orchestrator does NOT retry. Release auth failures
22
- # surface as `Run npx @wix/cli login and retry.`
23
- # Known transient release failures are retried by this script.
24
-
25
- set -euo pipefail
26
-
27
- npx @wix/cli build 1>&2
28
-
29
- RELEASE_OUTPUT="$(mktemp)"
30
- trap 'rm -f "$RELEASE_OUTPUT"' EXIT
31
-
32
- release_is_retryable() {
33
- grep -Eiq 'ECONNRESET|ETIMEDOUT|EAI_AGAIN|STATE_MISMATCH|temporary system error|temporarily unavailable|try again shortly' "$RELEASE_OUTPUT"
34
- }
35
-
36
- MAX_RELEASE_ATTEMPTS="${WIX_RELEASE_ATTEMPTS:-3}"
37
- RELEASE_STATUS=1
38
-
39
- for ((attempt = 1; attempt <= MAX_RELEASE_ATTEMPTS; attempt++)); do
40
- : >"$RELEASE_OUTPUT"
41
- set +e
42
- npx @wix/cli release 2>&1 | tee "$RELEASE_OUTPUT" 1>&2
43
- RELEASE_STATUS=${PIPESTATUS[0]}
44
- set -e
45
-
46
- if [[ "$RELEASE_STATUS" -eq 0 ]]; then
47
- break
48
- fi
49
-
50
- if [[ "$attempt" -lt "$MAX_RELEASE_ATTEMPTS" ]] && release_is_retryable; then
51
- sleep_seconds=$((attempt * 5))
52
- echo "release.sh: release attempt $attempt failed with a retryable Wix error; retrying in ${sleep_seconds}s" >&2
53
- sleep "$sleep_seconds"
54
- continue
55
- fi
56
-
57
- exit "$RELEASE_STATUS"
58
- done
59
-
60
- # CLI prints `Site published on <url>` — extract the URL after that marker.
61
- # Fall back to the first Wix-hosted URL if the marker line is not found
62
- # (CLI wording may vary between versions).
63
- RELEASE_URL="$(sed -nE 's/.*Site published on ([^[:space:]]+).*/\1/p' "$RELEASE_OUTPUT" | head -n 1 || true)"
64
- if [[ -z "$RELEASE_URL" ]]; then
65
- RELEASE_URL="$(grep -oE 'https://[A-Za-z0-9.-]+\.wix-(site-)?host\.com[^[:space:]]*' "$RELEASE_OUTPUT" | head -n 1 || true)"
66
- fi
67
-
68
- if [[ -z "$RELEASE_URL" ]]; then
69
- echo "release.sh: could not extract a release URL from release output" >&2
70
- exit 1
71
- fi
72
-
73
- echo "$RELEASE_URL"