@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,332 +1,76 @@
1
1
  # Discovery
2
2
 
3
- Infer as much as possible from the user's opening message; ask only what's genuinely unknown. Target: **~1:30 of discovery** including user think-time.
3
+ Capture brand + vibe + imagery + the per-vertical intent inferred from the user's prompt, present a slim plan, get approval, hold the captured contract in orchestrator scratch.
4
4
 
5
- ## Step 0 — Infer Vertical(s) and Business Context
5
+ Infer as much as possible from the user's opening message; ask only what's genuinely unknown. Target: **~1:30 of discovery** including user think-time, **≤ 80 s** excluding it.
6
6
 
7
- The user's opening message typically names what they want: *"build me a skincare store"*, *"I want to sell handmade jewelry"*, *"create a coffee shop website"*.
7
+ This phase owns the *domain* of discovery only. Run FLOW — when background work is dispatched, what waits on what, batching, and the transition into Setup/Seed — is owned by `references/PLAN.md` (pre-approval, which routes on **operation** to `PLAN-create.md` / `PLAN-connect.md`) and `references/BUILD.md` (post-approval, which routes on **framework**).
8
8
 
9
- From the opening message, extract:
10
- - **Vertical(s)** — which packs to load. See the routing table in `SKILL.md` § "When This Skill Triggers".
11
- - **Business / product context** — feeds into brand-name suggestions, vibe options, product templates, image prompts.
9
+ **This file is the discovery router, and it routes on OPERATION.** It holds the two things every run does regardless of operation — **Wave 0 field resolution** and the **CLI-auth pre-flight** — then opens the operation-specific discovery file. The actual interview/parse + plan content lives in `DISCOVERY-create.md` (create) or `DISCOVERY-connect.md` (connect). Read only the matching one.
12
10
 
13
- If the opening message is too vague to infer a vertical (e.g., *"build me a site"*, *"I want to go online"*), ask **one conversational clarifier** (NOT an `AskUserQuestion`): *"What do you want your site to do — sell things, publish content, take bookings?"* One sentence. Only ask if you genuinely cannot infer.
11
+ ## Wave 0 — Resolve `operation`, then `frontend` (BEFORE any user-facing question)
14
12
 
15
- **Do not ask the user what features they want.** Features are determined by the inferred vertical(s). The user reviews and adjusts the plan at Step 3.
13
+ Discovery routes on **operation** — *create* (the skill writes a new site from a prompt) vs *connect* (the user brings a finished design to wire to Wix). Resolve `operation` **first** from the user's prompt AND the working directory, then derive `frontend` (and `frontendBuild`) *within* that operation. Operation and framework are **orthogonal axes**: `frontendBuild` (`wix`/`none`/`own`) is derived inside the chosen operation, not implied by it — *create + framework-keyword* → `own`, *connect + SPA* → `own`, *connect + static HTML* → `none`, *create + default* → `wix`. Resolving operation first (then framework within it) is the seam that keeps the operation router untouched as frameworks are added (the framework-SPA plan; the extend plan).
16
14
 
17
- ---
18
-
19
- ## Step 1 — Brand Name
20
-
21
- Use `AskUserQuestion` with a single-select question.
22
-
23
- Generate **3–4 brand name suggestions** relevant to the business context, plus a "Type my own" option:
24
-
25
- > *"What should we call your brand?"*
26
-
27
- Options: [3–4 generated names], Type my own.
28
-
29
- Guidelines for generated names:
30
- - Short (1–3 words), memorable, relevant to the business context
31
- - Mix styles: one punchy/modern, one descriptive, one abstract/evocative
32
- - Avoid generic filler (*"Pro Store"*, *"Best Shop"*)
33
-
34
- If the user picks *"Type my own"*, follow up conversationally: *"Sure — what should I call it?"*
35
-
36
- If the user already named the brand in the opening message, skip this step.
37
-
38
- ### Background actions on Q1 answer
39
-
40
- Immediately after the brand name is confirmed (before Q2), emit **one concurrent batch** containing both the scaffold dispatch AND prefetch reads of the shared contract docs. These reads cost nothing during Q2 + plan review wait time but save ~1 min of post-approval latency that prior runs spent reading these docs serially.
41
-
42
- 1. **Scaffold dispatch.** Derive the project slug from the brand, validate it, then run `bash <SKILL_ROOT>/scripts/scaffold.sh <slug> "<Brand>"` as a background shell. The script handles the npm-create invocation + slug pre-flight (regex `^[a-z0-9]{3,20}$`); the orchestrator handles slug derivation from the human-readable brand.
43
-
44
- **Slug derivation (apply to brand before invoking the script):**
45
- 1. Lowercase
46
- 2. Strip every char that isn't `[a-z0-9]` (drop hyphens, spaces, punctuation, accents — the Wix CLI rejects them)
47
- 3. Truncate to 20 chars
48
- 4. If the result is shorter than 3 chars, ask the user explicitly for a slug (`AskUserQuestion`)
49
-
50
- Examples: `"Acme-Co" → "acmeco"`; `"Sole Society" → "solesociety"`; `"E&E Co." → "eeco"`; `"AB" → ask the user`.
51
-
52
- The Wix CLI requires `[a-z0-9]{3,20}` — hyphens, underscores, uppercase, and other punctuation are rejected.
53
-
54
- **Pre-flight validation (orchestrator-side, before invoking the script).** Both must pass; if either fails, regenerate the slug or re-prompt the user — do NOT rely solely on the script's pre-flight (it'll exit non-zero, but that costs a round-trip):
55
- - `slug` matches `^[a-z0-9]{3,20}$`
56
- - `brand` is non-empty after trimming whitespace
57
-
58
- **The scaffold call (background shell, with timing capture):**
59
-
60
- ```bash
61
- STARTED_AT=$(date -u +%Y-%m-%dT%H:%M:%SZ)
62
- bash "<SKILL_ROOT>/scripts/scaffold.sh" "<slug>" "<brand>"
63
- ENDED_AT=$(date -u +%Y-%m-%dT%H:%M:%SZ)
64
- ```
65
-
66
- - Substitute `<brand>` with the user's confirmed brand (preserve original case; quotes are passed by the shell). Substitute `<slug>` with the validated slug.
67
- - The script pins `--site-template-id` to the pure-headless blank template (`212b41cb-0da6-4401-9c72-7c579e6477a2`). Vibe-compatible templates trigger an interactive prompt that blocks non-TTY runs — the template ID is intentionally hardcoded inside the script.
68
- - Append timing to `.wix/run.json.phases[]` as `{ phase: "scaffold", seconds: <duration>, started: $STARTED_AT, ended: $ENDED_AT }`.
69
-
70
- **Strict-then-recover:**
71
- 1. Script exit 2 (slug or brand validation failed) → orchestrator-side bug; the orchestrator should have caught this in pre-flight. Fix the slug derivation and retry.
72
- 2. Auth error from npm/Wix CLI → surface `"Run \`npx @wix/cli login\` and retry."` and stop.
73
- 3. `invalid template` error → the template ID inside `scaffold.sh` is stale. Look up the current ID via `<prefix>SearchWixCLIDocumentation` query `create headless template`, edit the script's `TEMPLATE_ID` constant, retry once, log to `.wix/run.json.commandDrift[]` so the script can be tightened.
74
- 4. Other errors → surface stderr to the user.
75
-
76
- Launch with background.
77
-
78
- 2. **Prefetch shared contracts** — siblings in the same concurrent batch (resolve `<SKILL_ROOT>` per SKILL.md § "Path resolution"):
79
- - `Read <SKILL_ROOT>/references/shared/RETURN_CONTRACT.md`
80
- - `Read <SKILL_ROOT>/references/shared/IMAGE_GENERATION.md`
81
- - `Read <SKILL_ROOT>/references/shared/MCP_PREFIX.md`
82
-
83
- 3. **Prefetch loaded pack files** — siblings in the same message:
84
- - `Read <SKILL_ROOT>/references/verticals/<pack>.md` for each loaded pack
85
-
86
- Then continue to Q2. The scaffold runs during Q2 + plan review (~30–60s, usually finishes before approval); the reads resolve near-instantly and pre-load the docs the orchestrator needs at Step 3 and Step 7, eliminating mid-flow read churn.
87
-
88
- **Do NOT also prefetch these docs after plan approval.** Reading them between plan approval and Step 3 adds ~1 min of user-visible wait with zero overlap to useful work.
89
-
90
- ---
91
-
92
- ## Step 2 — Vibe
93
-
94
- Use `AskUserQuestion` with a single-select question. Generate **4 brand personality options** tailored to the inferred business context, plus "Something else":
95
-
96
- > *"What's the vibe for [brand name]?"*
97
-
98
- Example options for a jewelry store:
99
- - **Bold & premium** — luxury feel, dark tones, sharp typography
100
- - **Clean & modern** — minimal, lots of whitespace, crisp lines
101
- - **Warm & approachable** — friendly, inviting, earthy tones
102
- - **Something else** — let me describe it
103
-
104
- If the user picks "Something else", follow up with `AskUserQuestion` using a text input.
105
-
106
- ### Craft the aesthetic direction (in session scratch)
107
-
108
- Based on vertical + brand personality + audience, craft a **2–3 sentence aesthetic direction** like a designer would. Decide — don't ask more questions.
109
-
110
- Example:
111
- > *"For Bloom & Root, I'm going with an organic editorial aesthetic — think Kinfolk magazine meets a botanical garden. Warm cream backgrounds, deep forest green accents, Playfair Display for headings paired with Source Sans 3 for body text. Subtle leaf-pattern overlays and generous whitespace to let the products breathe."*
112
-
113
- > **Do NOT print this aesthetic direction as a standalone message.** Hold it in session scratch and weave it into the plan (Step 3) as the opening **Design Direction** section. Printing it above the plan detaches the most emotionally important content from the rest. Keep Q2 → plan presentation tight.
114
-
115
- ---
116
-
117
- ## Step 3 — Present the Plan
118
-
119
- Present the plan as formatted markdown. After presenting, use `AskUserQuestion` for approval.
120
-
121
- > **Do NOT show implementation details.** Users do not want to read about scaffolding, `npm install`, `env pull`, MCP calls, phase agents, designer handoffs, sidecars, or build/preview steps. They care about their site. The TaskList conveys progress; the plan conveys outcome. Never open with SDK packages or CMS collection fields.
122
-
123
- The plan is composed from the loaded vertical packs. Each pack contributes: apps, packages, pages, CMS collections, features blurbs. The skill assembles; the packs supply.
124
-
125
- ### Plan structure (in order)
126
-
127
- The plan has TWO halves: a short **decision card** (Sections A + B — what the user actually weighs in on) and a longer **technical scope** block (Sections C + D + E — what comes "for free" from the loaded packs). The user reads A and B carefully; C–E are reference material they skim or skip.
128
-
129
- > **Sections C, D, E are markdown tables.** Each section below leads with the exact header skeleton — copy it verbatim. Do NOT type column headers from memory: that's the root cause of every plan-format regression.
130
-
131
- **Section A: Design Direction** — Lead with this. Open with the aesthetic paragraph crafted in Step 2, then a compact detail block:
132
- - Aesthetic tone (e.g., "organic editorial")
133
- - Color palette (2–3 dominant colors with hex codes)
134
- - Typography pairing (display + body)
135
- - Mood and key visual elements
136
- - Page color strategy: Uniform Light / Uniform Dark / Defined Hybrid
137
-
138
- **Section B: Features** — 1–2 line descriptions of user-facing functionality from each pack. Bullet list is correct here. Explain what the user's visitors will be able to do. Tag CMS-powered features with **(CMS-based)** so the user knows which content they can edit from the dashboard.
139
-
140
- **Skip features from packs with `disabled: true`** (today: only `gift-cards`). Its surfaces are inactive by default — they light up only when the user enables the matching Wix app from the dashboard. The plan must not promise a feature that isn't active out of the box. The code still ships (the `/gift-cards` page file is created plus the nav/home contributions) so activation is instant once the user opts in — but the plan stays silent until then. Packs without `disabled: true` (including transitive ones like ecom) contribute their features normally.
141
-
142
- → **Verify B:** No bullet derives from a `disabled: true` pack. Today: no "Gift cards" bullet, no "(when enabled)" / "(auto)" markers anywhere in B.
143
-
144
- > **Visual separator before the technical scope.** After Section B, emit a `---` rule and a single line: *"Technical scope below — auto-decided from the features above. Skim if you want; not required reading."* This signals to the user that the decision is essentially made and the rest is reference material. Without the cue, users feel obligated to read every table cell before approving and stall the build for tens of minutes.
145
-
146
- ---
147
-
148
- **Section C: Pages.** Emit exactly this header, then one row per loaded pack's `routes:` entry:
149
-
150
- ```
151
- | Page | Route | Source |
152
- |------|-------|--------|
153
- ```
154
-
155
- > **STOP if you typed anything else.** `| Route | Purpose |` (drops Source), `| Page | Route |` (no Source), bullet list `- **Cart** (/cart)`, or Source merged into Route (`/cart (Stores)`) — each is a known regression. **Three columns, exact names, in that order.** Re-read the skeleton above before typing rows; do not type column headers from memory.
156
-
157
- **Compose rows from each loaded pack's `routes:` array.** Do not hardcode rows; do not omit declared rows; do not invent rows. For every loaded pack (top-level OR transitive via `requires:`), iterate its `routes:` array.
158
-
159
- **Skip rule.** Skip every route from any pack with `disabled: true`. Today that's only `gift-cards` — its `/gift-cards` row does NOT appear in the plan. The page file still ships so the runtime probe lights up the surface the moment the user enables the Wix Gift Card app from the dashboard, but the plan must not promise a surface the user did not ask for. Surfacing it with a `Source: "Wix Stores (auto)"` marker has been tried and rejected — users push back ("Giftcard shouldn't appear unless the user asked for it").
160
-
161
- Each surviving entry → one table row:
162
-
163
- ```
164
- Page name (Page cell):
165
- - Use the entry's `name:` field if present (override).
166
- - Else derive from the route path:
167
- "/" → "Home"
168
- "/<seg>/[slug]" → title-case(seg, singular) + " Detail"
169
- otherwise → title-case the last static segment, replacing
170
- "-" with space ("/thank-you" → "Thank You")
171
-
172
- Route cell:
173
- - The entry's `route:` value verbatim (e.g. "/cart" — or the literal
174
- string "Hosted by Wix" for Wix-hosted endpoints with no path).
175
-
176
- Source cell:
177
- - For top-level packs with non-empty `apps:`, use apps[0].name
178
- (e.g. "Wix Stores", "Wix Blog").
179
- - For transitive packs (loaded via another pack's `requires:`),
180
- walk up the requires chain to the top-level puller and use ITS
181
- apps[0].name. So ecom's "/cart" shows Source: "Wix Stores"
182
- (because stores requires ecom and the user opted into "selling
183
- things", not into "an ecommerce SDK").
184
- - For the `cms` pack, use the literal "CMS (builtin)".
185
- - No suffixes (no "(auto)", no "(passive)", etc.) — disabled packs
186
- don't contribute rows at all.
187
- ```
188
-
189
- **Order rows by user-facing flow:** CMS pages first (Home, About, FAQ), then catalog/content pages, then transactional pages (cart, thank-you, checkout). Within a pack, preserve declaration order from the pack's `routes:` array.
190
-
191
- → **Verify C:** Header is exactly `| Page | Route | Source |`. Row count = sum of `routes:` entries across all loaded packs that are NOT `disabled: true`. Every Route is either a `/`-prefixed path matching the slugified Page name OR the literal `Hosted by Wix`. No "(auto)"/"(passive)" suffixes anywhere. No "Gift Cards" row when gift-cards loads transitively.
192
-
193
- ---
194
-
195
- **Section D: CMS Collections.** Emit exactly this header, then one row per `cmsCollections:` entry from each loaded pack:
196
-
197
- ```
198
- | Collection | Key Fields |
199
- |------------|------------|
200
- ```
201
-
202
- > **STOP if you typed `Fields` instead of `Key Fields`.** Re-read the skeleton above.
203
-
204
- Iterate `cmsCollections:` from each loaded pack and emit one row per collection (collections from the `cms` pack always appear; other packs may declare their own).
205
-
206
- → **Verify D:** Header is exactly `| Collection | Key Fields |`.
207
-
208
- ---
209
-
210
- **Section E: Apps & SDK Packages.** Last. Reference table for developer-minded users. Emit exactly this header, then **one row per loaded pack** (NOT one row per package):
211
-
212
- ```
213
- | App | SDK Packages |
214
- |-----|--------------|
215
- ```
216
-
217
- > **STOP if you wrote one row per package.** `| Item | Type |` with `@wix/stores | SDK`, `@wix/ecom | SDK`, … is the wrong shape. Two columns, comma-joined packages in cell two, **one row per App**, not per SDK. Re-read the skeleton above.
218
-
219
- **Compose Section E from loaded pack frontmatter:**
15
+ > **Intent is primary; the directory only confirms.** The bug to avoid: an *empty* CWD does **not** automatically mean create. If the prompt brings a design to connect — even one that will be **fetched into the empty dir** — it's connect. Read the prompt first.
220
16
 
221
17
  ```
222
- A pack contributes a Section E row iff:
223
- - Its `apps:` array is non-empty (top-level user-facing app), OR
224
- - Its `include: true` (the cms pack — built-in, no app to install).
225
-
226
- The "App" cell:
227
- - For packs with non-empty `apps:`: apps[0].name (e.g. "Wix Stores").
228
- - For the cms pack: the literal "CMS (builtin)".
229
-
230
- The "SDK Packages" cell:
231
- - This pack's `packages:` ∪ packages from every pack in its transitive
232
- `requires:` chain — deduped, in declared order.
233
- - So when stores is loaded (and pulls in ecom + gift-cards via requires),
234
- the "Wix Stores" row's SDK Packages cell is the union of stores +
235
- ecom + gift-cards packages — typically: @wix/stores, @wix/ecom,
236
- @wix/redirects, @wix/site, @wix/essentials.
237
-
238
- Packs with `apps: []` AND `include: false` (ecom, gift-cards) do
239
- NOT get their own row. Their packages roll up under whichever loaded
240
- top-level pack pulled them in. There is no "@wix/gift-cards" SDK on
241
- npm; the gift-cards pack is runtime-detected via REST and contributes
242
- zero npm packages of its own.
18
+ Read the prompt, then inspect CWD — resolve OPERATION:
19
+
20
+ 1. CONNECT/IMPLEMENT-AN-EXISTING-DESIGN intent in the prompt → operation: connect,
21
+ EVEN IF THE CWD IS EMPTY. Signals: "connect this to wix", "implement this design",
22
+ "host/deploy this site", "this is a working site", or a design-file URL to fetch +
23
+ implement (Claude Design / v0 / Lovable / any tool). The design arrives by fetch into
24
+ the empty dir — emptiness at check time does not make it create.
25
+ 2. CWD already contains a working frontend (`index.html`, `*.html`, `*.jsx`/`*.tsx`/`*.vue`,
26
+ a design-handoff bundle) → operation: connect — connect the brought-in site.
27
+ 3. CWD contains `wix.config.json` → an existing wix-headless project (resume/extend; see
28
+ SKILL.md § "When NOT to use this skill" — out of pivot scope for now; the extend plan
29
+ adds `operation: extend` here, ahead of the emptiness tests).
30
+ 4. Otherwise — empty CWD AND a CREATE-A-NEW-SITE prompt ("build me a store", "I want to
31
+ sell tables online", "make a blog") with no design to connect → operation: create.
243
32
  ```
244
33
 
245
- → **Verify E:** Header is exactly `| App | SDK Packages |`. One row per loaded pack with non-empty `apps:` OR `include: true`. SDK Packages cell is comma-joined within a single cell, NOT split across rows. No "Wix Gift Cards" row when gift-cards loads transitively (no `@wix/gift-cards` SDK exists).
246
-
247
- ### Example (skincare ecommerce brand)
248
-
249
- ```markdown
250
- Here's my plan for **Bloom & Root**:
251
-
252
- ## Design Direction
34
+ Then derive `frontend` and `frontendBuild` **within** the chosen operation, and capture all three in session scratch (the Plan→Build contract core, `PLAN.md` § "The Plan→Build contract"):
253
35
 
254
- For Bloom & Root, I'm going with **clean luxury with organic warmth** —
255
- think a curated boutique where every product feels considered. Warm cream
256
- backgrounds paired with deep charcoal text and rose gold accents. Cormorant
257
- Garamond headlines bring editorial gravity; DM Sans keeps the body text
258
- tactile and approachable.
36
+ > **Within `create`, branch `frontendBuild` on an explicit framework keyword.** A create prompt that **explicitly names a client-build framework** — `vite`, `react`, `vue`, `svelte`, "SPA", or similar (the same keyword set the connect SPA detector uses) — resolves to **`frontend: custom`, `frontendBuild: own`** (scaffold that framework, then connect via the SPA spine). A create prompt with **no** framework keyword stays **`frontend: astro`, `frontendBuild: wix`** — astro remains the default for a bare *"create a bakery site"*. **Only an explicit keyword flips it** — never infer a framework the user didn't ask for. A framework keyword on a *connect* prompt still routes to connect (the brought-in SPA), per `DISCOVERY-connect.md` § 1.5.
259
37
 
260
- - **Colors:** Warm cream (#FFF8F0), deep charcoal (#1A1A1A), rose gold (#B76E79)
261
- - **Fonts:** Cormorant Garamond (headings) + DM Sans (body)
262
- - **Mood:** Premium, approachable, tactile
263
- - **Color strategy:** Uniform Light
38
+ | `operation` | `frontend` | `frontendBuild` | Wave 0 next |
39
+ |---|---|---|---|
40
+ | `connect` — connect/implement an existing design, OR a working site on disk | `custom` | `none` (static HTML) **or** `own` (framework SPA) — resolved from disk in `DISCOVERY-connect.md` § 1.5 | Pre-flight, then **`DISCOVERY-connect.md`** |
41
+ | `create` — create-a-new-site prompt, **no** framework keyword (the default) | `astro` | `wix` | Pre-flight, then **`DISCOVERY-create.md`** (astro branch) |
42
+ | `create` — create-a-new-site prompt that **explicitly names a client-build framework** (*"…using vite"*) | `custom` | `own` | Pre-flight, then **`DISCOVERY-create.md`** (own branch — minimal scaffold; runs vibe + Designer for brand tokens, but not astro `compose.mjs`) |
264
43
 
265
- ## Features
44
+ > **No `AskUserQuestion` for operation/frontend detection.** They are inferred from the prompt + directory, never asked. When intent is unclear, default to `operation: connect` — connecting/implementing what the user brings is the safe interpretation; creating a brand-new site over their intent is the destructive one. **A prompt that fetches or names a design to "connect"/"implement" is `connect` regardless of whether the CWD is empty.**
266
45
 
267
- - **Product catalog** — Browse all products with images, prices, and variants.
268
- - **Cart & checkout** — Add to cart, review, check out via Wix's hosted checkout.
269
- - **About (CMS-based)** — Brand story, editable from the Wix dashboard.
270
- - **FAQ (CMS-based)** — Q&A about products, editable from the dashboard.
46
+ These flow into:
47
+ - The **Plan→Build contract** held in orchestrator scratch (`PLAN.md` § "The Plan→Build contract"). `frontend`, `operation`, and `frontendBuild` all live in scratch — **none** is persisted to disk. The conductor reads `frontendBuild` from scratch to decide whether to run `wix build` before release — `wix` builds, `none` doesn't.
48
+ - **Bootstrap is (operation × framework)-keyed** (`BUILD.md` § "Bootstrap cell"): create+astro runs `scaffold.sh --frontend astro`; create+own runs the framework's own create command (`npm create vite`/…) then `init`; connect (own/none) does **not** scaffold — it bootstraps via `npm create @wix/new@latest init` over the brought-in/scaffolded source.
49
+ - Orchestrator session scratch — every downstream branch reads the scratch values. For `connect`, the frontend track runs the connect flow (`references/custom/INSTRUCTIONS.md`); the create-only project-prep (`seed-utilities.sh`) and the Designer/Composer do not run. (Business-track steps — app install, seeders — never read these fields.)
271
50
 
272
- ---
51
+ ## Pre-flight — Verify CLI auth (BEFORE any user-facing question)
273
52
 
274
- *Technical scope below — auto-decided from the features above. Skim if you want; not required reading.*
53
+ The first Wix touch is the post-approval project bootstrap — create/astro: `scaffold.sh` → `npm create @wix/new@latest headless`; connect: `npm create @wix/new@latest init` — which creates a business + project against the user's Wix account and so requires an active CLI session. Without one it fails — and because the bootstrap runs **after** approval (`BUILD-astro.md` run-step 0 / the connect bootstrap cell, `BUILD.md` § "Bootstrap cell"), a logged-out user wouldn't find out until they'd done discovery *and* approved, only to have it fail immediately. Run the auth check foreground here (both operations) so a logged-out user sees the login prompt first.
275
54
 
276
- ## Pages (8)
277
-
278
- | Page | Route | Source |
279
- |----------------|-------------------|---------------|
280
- | Home | / | CMS (builtin) |
281
- | About | /about | CMS (builtin) |
282
- | FAQ | /faq | CMS (builtin) |
283
- | Products | /products | Wix Stores |
284
- | Product Detail | /products/[slug] | Wix Stores |
285
- | Cart | /cart | Wix Stores |
286
- | Thank You | /thank-you | Wix Stores |
287
- | Checkout | Hosted by Wix | Wix Stores |
288
-
289
- ## CMS Collections
290
-
291
- | Collection | Key Fields |
292
- |----------------|-----------------------------|
293
- | About Content | heading, body, image |
294
- | FAQ | question, answer, sortOrder |
295
-
296
- ## Apps & SDK Packages
297
-
298
- | App | SDK Packages |
299
- |---------------|--------------------------------------------------------------------|
300
- | Wix Stores | @wix/stores, @wix/ecom, @wix/redirects, @wix/site, @wix/essentials |
301
- | CMS (builtin) | @wix/data, @wix/essentials |
302
-
303
- Should I proceed?
55
+ ```bash
56
+ npx @wix/cli@latest whoami >/dev/null 2>&1
304
57
  ```
305
58
 
306
- The Cart, Thank You, and Checkout rows show `Source: Wix Stores` — not "Wix eCommerce" — because ecom is loaded transitively via stores's `requires:` and the orchestrator walks up the chain. The user opted into "selling things", not into "an ecommerce SDK".
307
-
308
- ### Final scan (MANDATORY)
309
-
310
- Before sending the plan, confirm each inline → Verify above (B, C, D, E) passed. If any failed, regenerate that section and re-scan before emitting. Plans that violate multiple inline checks at once cost a full plan replay (~25 min of user time) when caught post-hoc. The inline → Verify lines exist to catch them before sending.
311
-
312
- ### Approval
313
-
314
- Use `AskUserQuestion`: *"Ready to build?"* Options: **Yes, build it** / **Adjust something**.
315
-
316
- If the user wants to adjust, handle it conversationally (swap brand, change vibe, add/remove a page). Re-present the plan and re-ask for approval.
317
-
318
- ---
59
+ - Exit 0 → open the matching operation discovery file (create → `DISCOVERY-create.md` Step 0; connect → `DISCOVERY-connect.md`).
60
+ - Exit non-zero → **run `npx @wix/cli@latest login` yourself; do NOT punt to the user.** Steps:
61
+ 1. `Bash` tool with command `npx @wix/cli@latest login`, `run_in_background: true`. No shell `&`, no `mktemp` redirect, no chaining.
62
+ 2. Read the harness output-file path from the tool reply's `<bash-stdout>` (or use `TaskOutput`).
63
+ 3. Parse line 1 for `{"event":"awaiting_user","userCode":"…","verificationUri":"…"}` (ignore any `TimeoutNaNWarning` on later lines).
64
+ 4. Surface in one plain-prose message — *not* `AskUserQuestion`: *"Open `<verificationUri>` in your browser and enter the code `<userCode>` — I'll continue once you've completed the login."*
65
+ 5. Wait for the harness `task-notification` with `<status>completed</status>`; confirm with `whoami`, then open the matching operation discovery file.
319
66
 
320
- ## After Approval
67
+ Full recovery reference: [`shared/AUTHENTICATION.md`](shared/AUTHENTICATION.md#wix-login-from-a-non-interactive-agent).
321
68
 
322
- Save the project context to memory (type: `project`) so future sessions can resume:
323
- - Brand name, vertical(s) inferred
324
- - Apps, packages, pages from the loaded packs
325
- - Project name + absolute project directory
326
- - Current phase: `scaffolding`
69
+ ## Next — open the operation-specific discovery
327
70
 
328
- > **Do NOT narrate the internal sub-steps.** After approval, proceed silently through setup, launch phases, etc. The user tracks progress via TaskList — that's enough. No *"Now I'll install Wix Stores via MCP"*, no *"Launching Phase 1 agents"*, no MCP / sidecar / agent-name / `.wix/` leakage.
71
+ With `operation` (and the derived `frontend`/`frontendBuild`) resolved and auth confirmed:
329
72
 
330
- Brief transition messages are fine when major milestones complete (e.g., *"Products seeded, designing pages now"* or the final preview URL), but never surface tool-layer mechanics.
73
+ - **`create`** → `DISCOVERY-create.md` — the interview (Steps 0–2.5) → plan → approval → hold the contract in scratch.
74
+ - **`connect`** → `DISCOVERY-connect.md` — parse the brought-in site → infer domain → light plan → approval → hold the contract in scratch.
331
75
 
332
- Proceed to **Setup** (see `SETUP.md`).
76
+ Read only the matching file. The pre-approval funnel (`PLAN-create.md` / `PLAN-connect.md`) names *when* to apply each discovery step.
@@ -0,0 +1,19 @@
1
+ # Plan — connect operation (custom)
2
+
3
+ The pre-approval funnel when `operation === "connect"` (the user brought a finished site to connect; `frontend: custom`, `frontendBuild: none` for static HTML or `own` for a framework SPA — resolved in `DISCOVERY-connect.md` § 1.5). Shared funnel rules — concurrency vocabulary, the two-track model, the Plan→Build contract, user-facing output, batching discipline — live in `PLAN.md`; this file is the connect funnel only. Domain (parse + infer + plan content) is owned by `DISCOVERY-connect.md`. **The funnel is framework-blind** — it parses, presents a light plan, and approves identically whether the brought-in frontend is static HTML or an SPA; only the downstream Build mechanics differ (Build routes on `frontendBuild`).
4
+
5
+ **Input = the brought-in site**, processed by parse + infer (`DISCOVERY-connect.md` §§ 1–2). **Plan shape = a light plan** (detected-site summary + what to wire/add/persist + apps, `DISCOVERY-connect.md` § 3) — not the astro Design-Direction card. The plan also resolves the **connection plan** that fills the contract's operation section (binding-map / augmentation / persistence-swap), consumed downstream only at the wiring cell.
6
+
7
+ ## Wave 0 — Connect discovery → plan → approval (Path B)
8
+
9
+ **The funnel dispatches nothing.** Its only job is to parse the site, present the plan, and get approval. Same three-step shape as the create funnel, planning content aside:
10
+
11
+ 1. **Parse + infer** — apply `DISCOVERY-connect.md` §§ 1–2: read the brought-in site (markup, copy, tokens; opportunistically a Claude-Design bundle), infer the domain → Wix capability (the universal floor is a Wix Forms contact/lead form), and infer the brand.
12
+ 2. **Compose and PRESENT the light plan — as a standalone assistant message.** Render the connect plan (`DISCOVERY-connect.md` § 3): *what I found* (site type + detected regions) and *what I'll connect* (regions to **wire** + the component to **add** + apps to install). The user sees the plan before being asked to approve — do not fold the plan into the approval question.
13
+ 3. **Approval gate** — *only after* the plan message has been sent, ask the approval question (`AskUserQuestion`).
14
+
15
+ **On approval** — hold the contract in scratch (`frontend: custom` + inferred capabilities + brand + `frontendBuild`), then **open `BUILD.md`** — it routes Build on `frontendBuild` to `BUILD-own-build.md`:
16
+ - **`none` (static HTML):** bootstrap cell (`init` + connection plan) → shared Setup (app installs only; **no `env pull`, no per-pack `npm install`**) → shared Seed → wiring cell (inject `<script>`) → **inline no-build release** (`npx @wix/cli@latest release` — no `wix build`).
17
+ - **`own` (framework SPA):** bootstrap cell (`init` over the SPA + connection plan reading source) → shared Setup + **bundled `npm install @wix/sdk`** → shared Seed (incl. the CMS collection a persistence swap targets) → wiring cell (rewrite the source data layer → `@wix/data`) → **the project's own `npm run build`** → release. Never `wix build`.
18
+
19
+ > **Always connect.** The connect operation must end with the site reading from or writing to Wix; `init`+`release` of a static page with no connection is not acceptable (`references/custom/INSTRUCTIONS.md` § "Two locked principles"). The per-capability `custom/<cap>/WIRING.md` guides own the wiring step.
@@ -0,0 +1,17 @@
1
+ # Plan — create operation
2
+
3
+ The pre-approval funnel when `operation === "create"` (the skill writes the site). Shared funnel rules — concurrency vocabulary, the two-track model, the Plan→Build contract, user-facing output, batching discipline — live in `PLAN.md`; this file is the create funnel only. Domain (the questions, the plan content) is owned by `DISCOVERY-create.md`. The funnel **dispatches nothing** in either framework branch; it differs only in plan shape and where it hands off (Build routes on `frontendBuild`):
4
+ - **`frontendBuild: wix` (astro — default):** the full interview + decision card below.
5
+ - **`frontendBuild: own` (framework SPA — named-framework create):** the **light** plan from `DISCOVERY-create.md` § "Framework-SPA branch" (no astro decision card, but it **does** run the vibe question + the Designer — the brand tokens are framework-agnostic and the SPA imports them); on approval, hold the contract in scratch (`frontend: custom`, `frontendBuild: own`), then `BUILD.md` routes `own` → `BUILD-own-build.md` (create × own cells). The astro funnel below does not apply.
6
+
7
+ **Input = the user's prompt** (astro branch), processed by the interview (`DISCOVERY-create.md` Steps 0–2.5). **Plan shape = the full decision card** (Design Direction + Features + Pages, `DISCOVERY-create.md` § "Step 3").
8
+
9
+ ## Wave 0 — Discovery → plan → approval (Path A)
10
+
11
+ **The funnel dispatches nothing — scaffold + Designer dispatch post-approval in `BUILD-astro.md`.** Its only job is to talk to the user, present the plan, and get approval. So the funnel is exactly three things:
12
+
13
+ 1. **The interview** — Wave-0 field resolution (operation/frontend/frontendBuild) + CLI auth already ran in `DISCOVERY.md` (shared). Now apply `DISCOVERY-create.md` (Q0 vertical inference, Q1 brand, Q2 vibe, Q2.5 imagery). **Read only what the next question needs** — do not pre-read `BUILD-astro.md`; read the vertical packs for plan composition (not before the vibe question).
14
+ 2. **Compose and PRESENT the plan — as a standalone assistant message.** The moment Q&A ends and the aesthetic-direction craft is done, **render the full plan** (Design Direction from the Q2 craft + the Pages/Features tables, per `DISCOVERY-create.md` § "Step 3") as a normal message the user reads. **The user MUST SEE the rendered plan before being asked to approve.** Do **not** fold the plan into the approval question, do **not** replace it with a one-line "here's the plan" + dispatch, and do **not** do any other work (no scaffold, no Designer, no scaffold-output reads) between the craft and the plan — there is nothing to dispatch here, so present the plan immediately.
15
+ 3. **Approval gate** — *only after* the plan message has been sent, ask the approval question (`AskUserQuestion`).
16
+
17
+ **On approval** — hold the contract in scratch (`frontend: astro`, `frontendBuild: wix`), then **open `BUILD.md`** — it routes Build on `frontendBuild` (`wix` here) to `BUILD-astro.md`; continue from its run-step 0 (which dispatches the scaffold + Designer, then runs Setup).
@@ -0,0 +1,92 @@
1
+ # Plan — the pre-approval funnel
2
+
3
+ This file owns the run **from the first Discovery question to the user's approval of the plan** — operation routing, the questions, the background dispatches that hide latency, and the plan/approval gate. Its job is to get the user to the commitment moment **fast**, so keep it lean.
4
+
5
+ **This file is the funnel router, and it routes on OPERATION.** It holds the shared funnel rules (concurrency vocabulary, the two-track model, operation routing, the Plan→Build contract, user-facing output, batching). The operation-specific funnel — how input is processed and how the plan looks — lives in `PLAN-create.md` (create a new site) and `PLAN-connect.md` (connect a brought-in design). **Read `operation` (set by `DISCOVERY.md` § Wave 0), then open the matching one and read only that:** `create` → `PLAN-create.md`, `connect` → `PLAN-connect.md`. (Today `create` coincides with `frontend: astro` and `connect` with `frontend: custom` — but the funnel branches on the *operation*, not the frontend; that is the seam the framework-SPA and extend plans build on.)
6
+
7
+ **On approval, open `BUILD.md`** — the post-approval conductor that owns execution (Setup → design-system bridge → Seed → Components → Pages → Build → Release). Everything past the approval gate lives there, so it is not read until the user has committed.
8
+
9
+ **The contract with the other files.** The domain/step files answer *what each step does* (the questions Discovery asks, the recipes, the prompt templates). This file + the operation funnels + `BUILD.md` answer *when, in what order, in parallel with what, gated on what*. The step files do not name the sequence or chain to each other; the conductor names when to apply each one. Neither prescribes a tool API — map each step to whatever subagent / parallel-execution primitive your runtime offers.
10
+
11
+ ## Concurrency vocabulary
12
+
13
+ The terms below appear throughout this skill. They describe the *shape* of work; the runtime decides how to implement them:
14
+
15
+ - **Subagent** — an isolated worker with its own context. The orchestrator sends it a prompt (an `Instruction file` path + inputs); the subagent reads the instruction file, performs the scope, and returns a structured result.
16
+ - **Concurrent batch** — N subagents (or N tool calls) launched together so they execute in parallel rather than serially.
17
+ - **Background subagent** — a subagent the orchestrator does not block on; it runs while the orchestrator continues with downstream work and reports its result asynchronously.
18
+ - **Foreground subagent** — a subagent the orchestrator blocks on before continuing.
19
+ - **Wait (gate)** — the orchestrator pauses until specified background work (subagents or background `Bash` jobs like the scaffold) finishes. **Waiting means awaiting the harness's background-task completion notification — never a `sleep`/poll loop against an output file.** A poll loop burns the whole wait as blocked orchestrator time and delays everything gated behind it (e.g. sleep-polling the scaffold lands the Composer late). The completion notification is the only signal you need; the same rule covers the `wix login` wait (`shared/AUTHENTICATION.md`) and the no-sidecar-poll rule for image phases (`images/INSTRUCTIONS.md`).
20
+ - **Result** — the structured JSON block each subagent returns at the end of its run, per `references/shared/RETURN_CONTRACT.md`.
21
+
22
+ ## Two tracks (business vs frontend)
23
+
24
+ The run is two semi-independent tracks that the orchestrator interleaves for wall-time:
25
+
26
+ - **Business track** (frontend-blind) — create/connect the site, **install Wix apps**, **seed backend data**. Inputs: `siteId`, `verticals`, `intent`, `brand`. It never reads `frontend`/template — a product (or collection, post, form) is the same regardless of what renders it. Its domain content lives in `SETUP.md` (app installs) + `SEED.md` (seeders).
27
+ - **Frontend track** (frontend-aware) — scaffold/prep the local project, Designer + design tokens, `compose.mjs` (the Composer script), components, pages, SDK wiring, build. Every `frontend`/template branch lives here. Its domain content lives in `scaffold.sh` + `seed-utilities.sh` + `DESIGN_SYSTEM.md` + `scripts/compose.mjs` (self-documenting) + the per-vertical references (frontend guides under `references/astro/`).
28
+
29
+ The only cross-track data flow is **one-way, business → frontend**: seeders produce entity IDs which the orchestrator inlines into the frontend track's Page-subagent prompts. There is no frontend → business dependency.
30
+
31
+ ## Operation routing
32
+
33
+ The Plan phase routes on **operation** — *create* (scaffold a new site from a prompt) vs *connect* (integrate a brought-in design). `operation` is captured by `DISCOVERY.md` § "Wave 0", held by the orchestrator in scratch, and selects the funnel:
34
+
35
+ | `operation` | What it is | Funnel → Build |
36
+ |---|---|---|
37
+ | `create` | The user asks for a new site; the skill writes it | **`PLAN-create.md`** → on approval → `BUILD.md` routes Build on **framework**. The full astro playbook lives under `<SKILL_ROOT>/references/astro/`. |
38
+ | `connect` | The user brings a finished design to wire to Wix | **`PLAN-connect.md`** → on approval → `BUILD.md` routes Build on **framework**. The frontend-track playbook is `<SKILL_ROOT>/references/custom/INSTRUCTIONS.md`. No scaffold, no Designer/Composer; init + shared Setup/Seed + connect/augment/persistence-swap; release is no-build (`none`) or the project's own build (`own` SPA). |
39
+
40
+ > **Operation ≠ frontend.** The funnel branches on the *operation* (what the user is doing), not the frontend (what renders it). The two are orthogonal: *create* spans `frontendBuild` `wix` (astro default) and `own` (a named framework); *connect* spans `none` (static HTML), `own` (a brought SPA), and could span `wix` (a brought astro project) — none of which forks the operation router. Keeping operation and framework distinct is what lets these combinations be independently expressible without a new phase fork — see the framework-SPA plan and the extend plan.
41
+
42
+ This is the **operation-selection routing layer**: `SETUP.md`'s steps assume the routing already happened; the conductor owns the branch. **Build does NOT route on operation** — it routes on framework (`BUILD.md`); operation feeds Build only through the contract below (specifically the bootstrap/wiring cells).
43
+
44
+ ## The Plan→Build contract
45
+
46
+ Plan resolves a small, explicit contract that Build consumes. It is carried **in the orchestrator's in-context session scratch** and threaded into each subagent's dispatch prompt — it is **not persisted to disk** (nothing in this contract lands on disk). The orchestrator already resolves these fields in Wave 0 and holds them for the whole run, so a disk round-trip buys nothing; on scratch loss, `frontend`/`frontendBuild` are recovered from `package.json` (`@wix/astro` ⇒ astro/wix, else custom + re-derive from `scripts.build`).
47
+
48
+ **Core (every operation resolves these identically; Build's install/build/release spine reads only these):**
49
+
50
+ | Field | Today's values | Meaning |
51
+ |---|---|---|
52
+ | `operation` | `create` \| `connect` | what the user is doing (*extend* added later by its own plan) |
53
+ | `frontend` | `astro` \| `custom` | what renders the site (held in scratch; recovered from `package.json` on scratch loss) |
54
+ | `frontendBuild` | `wix` \| `none` \| `own` | the build-class Build routes on: `wix` (astro, `wix build`), `none` (brought static HTML, no build), `own` (framework SPA — the project's own `npm run build`; brought-in *or* scaffolded from a named framework) |
55
+ | `verticals[]` | e.g. `["stores","ecom","cms"]` | loaded packs (top-level + transitive) |
56
+ | `designSource` | `generate-fresh` \| `derive-from-brought` | create generates; connect derives from the brought design's own tokens |
57
+ | `brand` | `{ name, description }` | brand metadata |
58
+
59
+ `frontendBuild` is **derived inside the operation, not implied by it** (the axes are orthogonal): connect resolves it from the brought-in project on disk (`none` static HTML vs `own` framework SPA — `DISCOVERY-connect.md` § 1.5); create resolves it from an explicit framework keyword (`wix` astro default vs `own` named framework — `DISCOVERY.md` § "Wave 0"). Resolve it in Wave 0 alongside `frontend` and hold it in scratch (on scratch loss, recover from `package.json`). Build branches its install/build/release **purely off `frontendBuild`** — never off `operation`.
60
+
61
+ **Operation section (feeds ONLY the bootstrap + wiring cells, never the build/release spine):**
62
+ - `connect` carries the **connection plan** (binding-map / augmentation spec) inferred in Discovery.
63
+ - `create` carries nothing extra.
64
+ - *(extend will carry existing-state + delta — added by the extend plan.)*
65
+
66
+ That is the precise sense in which the contract stays uniform across operations: the build/release spine is contract-uniform (it reads only the core), and **only** the bootstrap/wiring cells read the operation-specific payload. A *fresh session over an existing project* (extend) reconstructs the equivalent core from durable disk artifacts (`@wix/astro` dep, `package.json`, on-disk pages) rather than from scratch — same contract, sourced differently by lifecycle.
67
+
68
+ ## User-facing output (keep the machinery invisible)
69
+
70
+ This rule governs the **whole run**, both modes. The user should see **milestones in plain language, never the orchestration machinery.** Between the Discovery approval and the final summary the run is largely silent — the orchestrator is dispatching, waiting, and gating, none of which is the user's concern.
71
+
72
+ **Never put internal orchestration vocabulary in a user-facing message.** That includes: background-handle names (`*_handle`), dispatch markers ("→ dispatch:", "dispatching X", "launching Wave 3"), subagent START/END, "seed gate" / "all handles complete", wave/step numbers ("Wave 3", "Step 4.5"), in-flight **subagent/handle status tables** (especially any "Handle" column), and internal paths (`wix-manage-root`, the scaffold subdir). These describe *how the conductor works*, not *what the user is getting*.
73
+
74
+ **The only user-facing messages in a run are:**
75
+ 1. **Discovery** — the questions, the plan, and the approval gate (the mode discovery file's domain).
76
+ 2. **One brief seed-progress sentence** (`SEED.md` Step 5) — plain prose naming what was seeded, no tables.
77
+ 3. **The final summary** (`BUILD.md` § "Final Message").
78
+
79
+ Everything else is silent. If a long phase (Components, Pages) would otherwise look stalled, at most **one short plain-language line** ("Building your product and category pages…") — never a status table, handle list, or wave number. The in-flight subagent tables that runs have emitted ("Phase 3 Components running: | Subagent | Handle |…", "🎉 Seed gate open! All handles complete") are the anti-pattern this rule removes.
80
+
81
+ ## Batching discipline
82
+
83
+ This rule governs **every** concurrent batch in the run, in both modes — the Wave-0 pack reads (mode funnel), and the post-approval dispatch batches owned by the conductor (`BUILD.md` and its mode files): the astro BUILD-entry scaffold + Designer dispatch, the Setup app-installs, the Wave-3 seed batch, the integration connection-plan + init batch. The step files describe *what* is in each batch; the rule that they go out as one batch lives here.
84
+
85
+ Historical runs lost 1–2 minutes per phase to serialized dispatch — N operations emitted one-per-turn instead of in a single concurrent batch. Even when each ran fast, the inter-dispatch gaps accumulated to significant overhead per phase.
86
+
87
+ Two mitigations; use both:
88
+
89
+ 1. **Fire the whole batch as one assistant message** — N `Agent`/`Bash` tool_uses as siblings. **No narration between dispatches** ("Now installing apps:", "Dispatching seeders:"). Any text adjacent to a dispatch closes the batch and forces the rest into separate turns, adding seconds per dispatch. This holds even for a 2-item batch.
90
+ 2. **Use background-on-dispatch for anything that doesn't block downstream work.** Even if the runtime serializes the launch turns, background dispatch lets the work overlap in execution, compressing wall-time substantially versus serial.
91
+
92
+ If your runtime forces serialization across turns, make every subagent that can run in the background a background subagent — the Designer, seeders, and image phases all dispatch background so the foreground never blocks on them. (The Composer is no longer a subagent — it is the deterministic `compose.mjs` Bash step, sub-second and synchronous.)