@wix/agent-skills 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/package.json +1 -1
- package/skills/wix-app/SKILL.md +49 -42
- package/skills/wix-app/references/BACKEND_EVENT.md +10 -65
- package/skills/wix-app/references/CUSTOM_ELEMENT_WIDGET.md +101 -406
- package/skills/wix-app/references/DASHBOARD_MENU_PLUGIN.md +14 -111
- package/skills/wix-app/references/DASHBOARD_MODAL.md +56 -205
- package/skills/wix-app/references/DASHBOARD_PAGE.md +19 -98
- package/skills/wix-app/references/DASHBOARD_PLUGIN.md +6 -108
- package/skills/wix-app/references/DATA_COLLECTION.md +113 -198
- package/skills/wix-app/references/EMBEDDED_SCRIPT.md +41 -268
- package/skills/wix-app/references/EXTENSION_REGISTRATION.md +27 -76
- package/skills/wix-app/references/SERVICE_PLUGIN.md +35 -188
- package/skills/wix-app/references/SITE_PLUGIN.md +8 -92
- package/skills/wix-app/references/backend-event/COMMON-EVENTS.md +0 -44
- package/skills/wix-app/references/custom-element-widget/SETTINGS_PANEL.md +19 -330
- package/skills/wix-app/references/dashboard-menu-plugin/bookings-slots.md +0 -12
- package/skills/wix-app/references/dashboard-menu-plugin/ecommerce-slots.md +7 -0
- package/skills/wix-app/references/dashboard-menu-plugin/restaurants-slots.md +0 -12
- package/skills/wix-app/references/dashboard-plugin/SLOTS.md +3 -15
- package/skills/wix-app/references/service-plugin/ADDITIONAL-FEES.md +2 -18
- package/skills/wix-app/references/service-plugin/BOOKINGS-STAFF-SORTING.md +2 -42
- package/skills/wix-app/references/service-plugin/DISCOUNT-TRIGGERS.md +1 -11
- package/skills/wix-app/references/service-plugin/GIFT-CARDS.md +1 -11
- package/skills/wix-app/references/service-plugin/PAYMENT-SETTINGS.md +2 -40
- package/skills/wix-app/references/service-plugin/SHIPPING-RATES.md +2 -19
- package/skills/wix-app/references/service-plugin/VALIDATIONS.md +2 -18
- package/skills/wix-app/references/site-plugin/SLOTS.md +17 -68
- package/skills/wix-headless/SKILL.md +111 -389
- package/skills/wix-headless/references/BUILD.md +307 -0
- package/skills/wix-headless/references/DESIGN_SYSTEM.md +115 -0
- package/skills/wix-headless/references/DISCOVERY.md +237 -112
- package/skills/wix-headless/references/PLAN.md +82 -0
- package/skills/wix-headless/references/SEED.md +205 -0
- package/skills/wix-headless/references/SETUP.md +140 -134
- package/skills/wix-headless/references/astro/COMPOSE.md +142 -0
- package/skills/wix-headless/references/{blog → astro/blog}/BLOG_PAGES.md +1 -1
- package/skills/wix-headless/references/{blog → astro/blog}/BLOG_SETUP.md +2 -2
- package/skills/wix-headless/references/astro/cms/CMS_FOUNDATIONS.md +214 -0
- package/skills/wix-headless/references/{cms → astro/cms}/FAQ_KNOWLEDGE_BASE.md +6 -4
- package/skills/wix-headless/references/{cms → astro/cms}/PORTFOLIO.md +5 -5
- package/skills/wix-headless/references/{cms → astro/cms}/RESOURCE_LIBRARY.md +5 -5
- package/skills/wix-headless/references/{cms → astro/cms}/TEAM_DIRECTORY.md +5 -5
- package/skills/wix-headless/references/astro/designer/INSTRUCTIONS.md +331 -0
- package/skills/wix-headless/references/{ecom → astro/ecom}/CART_PAGES.md +1 -1
- package/skills/wix-headless/references/{ecom → astro/ecom}/CART_WIRING.md +1 -1
- package/skills/wix-headless/references/{ecom → astro/ecom}/COMPONENTS_CSS.md +3 -3
- package/skills/wix-headless/references/{forms → astro/forms}/CONTACT_FORM.md +13 -13
- package/skills/wix-headless/references/{gift-cards → astro/gift-cards}/COMPONENTS.md +1 -1
- package/skills/wix-headless/references/{gift-cards → astro/gift-cards}/PAGES.md +1 -1
- package/skills/wix-headless/references/{stores → astro/stores}/BACK_IN_STOCK.md +1 -1
- package/skills/wix-headless/references/{stores → astro/stores}/CATEGORY_PAGES.md +12 -13
- package/skills/wix-headless/references/{stores → astro/stores}/COMPONENTS_CSS.md +4 -4
- package/skills/wix-headless/references/{stores → astro/stores}/HOME_AND_NAV.md +11 -9
- package/skills/wix-headless/references/{stores → astro/stores}/PRODUCT_PAGES.md +5 -3
- package/skills/wix-headless/references/{stores → astro/stores}/SHARED_WIRING.md +3 -3
- package/skills/wix-headless/references/astro/templates/Footer.astro +27 -0
- package/skills/wix-headless/references/astro/templates/Layout.astro +132 -0
- package/skills/wix-headless/references/astro/templates/Navigation.astro +38 -0
- package/skills/wix-headless/references/astro/templates/astro.config.mjs +41 -0
- package/skills/wix-headless/references/astro/templates/ecom/components-ecom.css +302 -0
- package/skills/wix-headless/references/astro/templates/global.css +286 -0
- package/skills/wix-headless/references/astro/templates/index.astro +56 -0
- package/skills/wix-headless/{templates → references/astro/templates}/stores/back-in-stock.ts +1 -1
- package/skills/wix-headless/{templates → references/astro/templates}/stores/components-stores.css +138 -33
- package/skills/wix-headless/references/blog/BLOG_CONTENT.md +10 -11
- package/skills/wix-headless/references/blog/INSTRUCTIONS.md +5 -5
- package/skills/wix-headless/references/cms/CMS_FOUNDATIONS.md +31 -230
- package/skills/wix-headless/references/cms/INSTRUCTIONS.md +13 -8
- package/skills/wix-headless/references/custom/INSTRUCTIONS.md +38 -0
- package/skills/wix-headless/references/ecom/INSTRUCTIONS.md +10 -10
- package/skills/wix-headless/references/forms/INSTRUCTIONS.md +5 -5
- package/skills/wix-headless/references/gift-cards/INSTRUCTIONS.md +11 -11
- package/skills/wix-headless/references/images/INSTRUCTIONS.md +47 -50
- package/skills/wix-headless/references/seed-recipes.md +49 -0
- package/skills/wix-headless/references/shared/AUTHENTICATION.md +110 -0
- package/skills/wix-headless/references/shared/BUILD_NOISE.md +2 -2
- package/skills/wix-headless/references/shared/DOCS_SEARCH.md +41 -0
- package/skills/wix-headless/references/shared/IMAGE_GENERATION.md +17 -17
- package/skills/wix-headless/references/shared/IMPLEMENTER.md +20 -29
- package/skills/wix-headless/references/shared/PRODUCTION_SHARP_EDGES.md +1 -1
- package/skills/wix-headless/references/shared/RETURN_CONTRACT.md +25 -16
- package/skills/wix-headless/references/shared/STYLING.md +47 -10
- package/skills/wix-headless/references/stores/INSTRUCTIONS.md +25 -25
- package/skills/wix-headless/references/stores/PRODUCT_CATALOG_DATA.md +17 -17
- package/skills/wix-headless/references/verticals/_schema.json +31 -117
- package/skills/wix-headless/references/verticals/_schema.md +60 -150
- package/skills/wix-headless/references/verticals/blog.md +5 -99
- package/skills/wix-headless/references/verticals/cms.md +9 -100
- package/skills/wix-headless/references/verticals/ecom.md +5 -76
- package/skills/wix-headless/references/verticals/forms.md +5 -85
- package/skills/wix-headless/references/verticals/gift-cards.md +6 -103
- package/skills/wix-headless/references/verticals/stores.md +10 -144
- package/skills/wix-headless/scripts/check-manifest.mjs +5 -5
- package/skills/wix-headless/scripts/emit-design-tokens.mjs +29 -23
- package/skills/wix-headless/scripts/init-site-json.mjs +59 -21
- package/skills/wix-headless/scripts/patch-decorative-slots.mjs +67 -43
- package/skills/wix-headless/scripts/plan-entity-image-waves.mjs +3 -3
- package/skills/wix-headless/scripts/preview.sh +3 -3
- package/skills/wix-headless/scripts/release.sh +4 -4
- package/skills/wix-headless/scripts/scaffold.sh +75 -20
- package/skills/wix-headless/scripts/seed-utilities.sh +50 -12
- package/skills/wix-manage/SKILL.md +4 -8
- package/skills/wix-manage/references/blog/how-to-create-blog-posts.md +2 -0
- package/skills/wix-manage/references/cms/cms-data-items-crud.md +4 -0
- package/skills/wix-manage/references/cms/cms-references-and-relationships.md +2 -0
- package/skills/wix-manage/references/cms/cms-schema-management.md +4 -0
- package/skills/wix-manage/references/ecommerce/api-shipping.md +443 -0
- package/skills/wix-manage/references/ecommerce/flow-add-free-shipping.md +5 -6
- package/skills/wix-manage/references/ecommerce/flow-fix-coverage-gaps.md +4 -5
- package/skills/wix-manage/references/ecommerce/flow-optimize-shipping-rates.md +4 -5
- package/skills/wix-manage/references/ecommerce/goal-increase-aov.md +1 -1
- package/skills/wix-manage/references/ecommerce/goal-reduce-cart-abandonment.md +1 -2
- package/skills/wix-manage/references/ecommerce/guardrail-shipping-health.md +2 -2
- package/skills/wix-manage/references/ecommerce/recipe-apply-shipping-recommendations.md +4 -5
- package/skills/wix-manage/references/ecommerce/recommend-ecommerce-strategy.md +7 -7
- package/skills/wix-manage/references/ecommerce/setup-discount-rules.md +209 -72
- package/skills/wix-manage/references/ecommerce/setup-store-pickup-location.md +9 -10
- package/skills/wix-manage/references/ecommerce/skill-graph.md +4 -4
- package/skills/wix-manage/references/forms/create-form.md +2 -0
- package/skills/wix-manage/references/stores/bulk-create-products-with-options.md +2 -0
- package/skills/wix-manage/references/stores/create-product-from-image.md +91 -38
- package/skills/wix-manage/references/stores/setup-online-store-catalog-v3.md +2 -0
- package/skills/wix-app/references/custom-element-widget/default-thumbnail.png +0 -0
- package/skills/wix-app/references/data-collection/extension-template.ts +0 -107
- package/skills/wix-headless/references/ORCHESTRATION.md +0 -269
- package/skills/wix-headless/references/commands/install-app.md +0 -42
- package/skills/wix-headless/references/commands/mcp-bootstrap.md +0 -28
- package/skills/wix-headless/references/designer/INSTRUCTIONS.md +0 -828
- package/skills/wix-headless/references/shared/MCP_PREFIX.md +0 -105
- package/skills/wix-headless/scripts/copy-utility-templates.mjs +0 -153
- package/skills/wix-headless/templates/ecom/components-ecom.css +0 -215
- package/skills/wix-manage/references/events/list-events.md +0 -203
- /package/skills/wix-headless/{templates → references/astro/templates}/ecom/CartBadge.tsx +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/ecom/CartView.tsx +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/ecom/cart.astro +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/ecom/discounts.ts +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/ecom/thank-you.astro +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/GiftCardPurchase.tsx +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/_home-teaser-snippet.astro +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/_nav-snippet.astro +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/components-gift-cards.css +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/gift-cards.astro +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/gift-cards.ts +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/stores/AddToCartButton.tsx +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/stores/BackInStockForm.tsx +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/stores/CategoryRail.astro +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/stores/ProductCard.astro +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/stores/ProductPurchase.tsx +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/stores/SeoTags.astro +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/stores/categories.ts +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/stores/category/[slug].astro +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/stores/products/[slug].astro +0 -0
- /package/skills/wix-headless/{templates → references/astro/templates}/stores/products/index.astro +0 -0
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
# Build — the post-approval conductor
|
|
2
|
+
|
|
3
|
+
Opened the moment the user approves the plan in `DISCOVERY.md`. This file owns the **execution flow** — Setup → design-system bridge → Seed → Components → Pages → Build → Release: every subagent dispatch, background handle, wait/gate, and the imagery gates. Read it top to bottom from the approval point.
|
|
4
|
+
|
|
5
|
+
The **pre-approval** flow (mode routing, the Discovery questions, the plan + approval gate, and the background scaffold + Designer dispatches that hide latency) is in `PLAN.md`; it hands off here on approval. Three cross-cutting rules referenced below — **Two tracks**, **Batching discipline**, and **User-facing output** — also live in `PLAN.md`.
|
|
6
|
+
|
|
7
|
+
## Phase axis
|
|
8
|
+
|
|
9
|
+
Each phase belongs to one of the two tracks (`PLAN.md` § "Two tracks"). All phases are background (`bg`); this table is the *what* and *which track*, the sections below are the *when*.
|
|
10
|
+
|
|
11
|
+
| Phase | Track | Tier | What | When (bg) |
|
|
12
|
+
|---|---|---|---|---|
|
|
13
|
+
| **Phase 1 — Seed** | business | Fast | Per-pack seeders → orchestrator collects `seeded` map in scratch | Seed wave |
|
|
14
|
+
| **Phase 2 — Design System** | frontend | Default | **Designer** returns tokens + brand-voice JSON (no files); **Composer** writes the 6 files (`global.css`, `astro.config.mjs`, `Layout`, `Nav`, `Footer`, `index`) by substituting into pinned skeletons | Designer: BUILD entry (run-step 0) · Composer: Setup-window bridge |
|
|
15
|
+
| **Image Phase 1 — Decorative** | frontend | Fast | Hero/about/page-header decoratives | Seed wave (imagery-gated) |
|
|
16
|
+
| **Phase 3 — Components** | frontend | Default | Per-vertical React islands, styling contract inlined per prompt | Step 4.5 |
|
|
17
|
+
| **Phase 4 — Pages** | frontend | Default | Per-vertical routes; each agent writes its routes once with both visual design and live data queries | Step 7 |
|
|
18
|
+
| **Image Phase 2 — Entity** | business | Fast | Product / blog / CMS item images PATCHed onto Wix entities | Step 4.5 (imagery-gated) |
|
|
19
|
+
|
|
20
|
+
> **Set the model tier on every dispatch.** Tier policy lives in `SKILL.md` § "Subagent model tier" — apply by table lookup. The tier is selected via the dispatch primitive's model parameter, not the prompt; if you omit it, Default-tier roles silently run under-powered on the orchestrator's default model.
|
|
21
|
+
|
|
22
|
+
## The run from approval (Setup → Release)
|
|
23
|
+
|
|
24
|
+
The user just approved; `init-site-json.mjs` wrote the slim `.wix/site.json`. **Nothing is dispatched yet** — the funnel intentionally dispatched nothing so it could present the plan fast. Start by firing the two background jobs the rest of the run needs, then run Setup.
|
|
25
|
+
|
|
26
|
+
### 0. Dispatch scaffold + Designer (background, immediately on entry)
|
|
27
|
+
|
|
28
|
+
Fire both as one concurrent batch (`PLAN.md` § "Batching discipline") — they are independent:
|
|
29
|
+
- **Scaffold** — `scaffold.sh <slug> "<brand>" --frontend <value>` (background, capture `scaffold_handle` + its stderr tempfile). Slug derivation + the command shape are `DISCOVERY.md` § "After Q1". `npm install` is **not** chained here (Setup Step 4c dispatches it). The stderr tempfile is for **post-hoc error inspection only** (read it *if* the scaffold reports a failure) — it is **not** a progress file to poll.
|
|
30
|
+
- **Designer** — background, capture `designer_handle`. Dispatch with **Instruction file = `<SKILL_ROOT>/references/DESIGN_SYSTEM.md`** (the subagent opens it — **do not Read it in the orchestrator**, per `SKILL.md` § "Path resolution"). Inline Discovery's aesthetic craft held in scratch: brand, aesthetic direction, palette, type, mood, page color strategy. Judgment-only (~10–15 s; JSON `data.designTokens` + `data.shell`, no files). Do **not** pass application inputs (packs, nav links) — those go to the Composer.
|
|
31
|
+
|
|
32
|
+
The Designer's ~13 s overlaps the scaffold's ~23 s. Setup waits on `scaffold_handle` at Step 1; the bridge (step 2) waits on `designer_handle`.
|
|
33
|
+
|
|
34
|
+
### 1. Setup Step 1 (foreground)
|
|
35
|
+
|
|
36
|
+
Apply `SETUP.md` Step 1 only: wait `scaffold_handle` (load `wix-manage` in the same batch), then patch `site.json` with `siteId`/`appId`. **Do not run Setup Step 4 (the app-install batch) yet** — it goes in run-step 2 below, alongside the bridge.
|
|
37
|
+
|
|
38
|
+
> **How to wait — await the notification, never sleep-poll** (`PLAN.md` § "Concurrency vocabulary" → "Wait (gate)"). "Wait `scaffold_handle`" means await the harness's background-task **completion notification**. Do **not** run a `sleep`/poll loop against the scaffold's stdout/stderr/output file — that blocks the turn for the whole scaffold wall (~20–30 s, longer if you over-sleep) and pushes back the run-step 2 super-batch, landing the Composer late. A late Composer is the longest-pole regression called out at run-step 2 (~60–90 s of wall lost). Burn zero orchestrator time here: the notification is the only signal you need.
|
|
39
|
+
|
|
40
|
+
### 2. Setup Step 4 batch **+** design-system bridge — ONE concurrent super-batch
|
|
41
|
+
|
|
42
|
+
**Pin:** Setup Step 4 (business) and the design-system bridge (frontend) are independent and MUST go out as **one** assistant message (`PLAN.md` § "Batching discipline" — no narration between the tool calls, or the batch splits and the Composer starts late). `designer_handle` has been running since run-step 0, so it has returned by now: the bridge's wait→emit→dispatch collapses into two direct calls in the batch.
|
|
43
|
+
|
|
44
|
+
**Dispatch block — emit all of the following as siblings in ONE assistant message; no text between the tool calls:**
|
|
45
|
+
|
|
46
|
+
*business track (frontend-blind — `SETUP.md` owns the recipes/package set):*
|
|
47
|
+
1. `Bash` × N — app installs, one curl per `pack.apps[*]` → `SETUP.md` § Step 4a.
|
|
48
|
+
2. `Bash` — `npx @wix/cli@latest env pull --json` → `SETUP.md` § Step 4b (the `--json` flag suppresses the interactive spinner that otherwise bloats context).
|
|
49
|
+
3. `Bash` (background) — `npm install …`, capture `npm_handle` + its stderr tempfile → package set in `SETUP.md` § Step 4c.
|
|
50
|
+
|
|
51
|
+
*frontend track (Designer tokens already in scratch):*
|
|
52
|
+
4. `Bash` — emit tokens: pipe the Designer's `data.designTokens` JSON into `emit-design-tokens.mjs` (reads tokens from **stdin**, project dir as **`argv[2]`**; empty stdin → exits 2 `stdin was empty — pass the designTokens JSON object` and the bridge stalls). Quoted heredoc so the JSON survives unchanged. Writes `.wix/design-tokens.css` + `.wix/site.d.ts`; keep `designTokens` + `shell` in scratch for the Composer prompt.
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
node <SKILL_ROOT>/scripts/emit-design-tokens.mjs "<project-dir>" <<'TOKENS'
|
|
56
|
+
{ ...paste the Designer's data.designTokens JSON object here, verbatim from scratch... }
|
|
57
|
+
TOKENS
|
|
58
|
+
```
|
|
59
|
+
5. `Agent` (background) — Composer, capture `composer_handle`. Dispatch with **Instruction file = `<SKILL_ROOT>/references/astro/COMPOSE.md`** (the subagent opens it — **do not Read it in the orchestrator**; it is 14 KB of subagent-only substitution how-to, and reading it here just bloats the dispatch turn you're composing). Inline: tokens + shell + brand + nav links + packs. **SKIP** (record `{phase: "compose", status: "skipped"}`) if `frontend !== "astro"` (defensive — custom frontends never reach `BUILD.md`).
|
|
60
|
+
|
|
61
|
+
> **Rationale — do not re-derive.** The two tracks are independent: the Composer's only inputs are the Designer's tokens (ready from run-step 0) and the verified scaffold (ready at Setup Step 1) — neither depends on seeders, app installs, env, or npm. App installs / `env pull` / `npm install` are business-track work the bridge has zero dependency on. Firing the bridge alongside the Step 4 batch lets its ~80–160 s authoring wall absorb into Setup + the whole seed window; firing it *after* the Step 4 batch — or worse, in the seed wave — makes it start late and land as a fresh longest pole that ends *after* the seeders (~60–90 s of Composer wall lost in past runs). The Composer self-retries its pre-write scaffold reads if the scaffold is somehow still in flight (`COMPOSE.md` § "Pre-write").
|
|
62
|
+
|
|
63
|
+
### 3. Seed wave (Wave 3) — business track + co-scheduled frontend prep
|
|
64
|
+
|
|
65
|
+
**One concurrent batch** (§ "Wave 3" below for the detailed dispatch): `seed-utilities.sh --template <…>` (frontend project prep) + per-pack seeders (background) + Image Phase 1 Decorative (background, gated — § "Imagery gates"). Apply `SEED.md` for the recipe map + seeder prompt template. **No design-system dispatch here** — `composer_handle` is already running from the bridge in step 2.
|
|
66
|
+
|
|
67
|
+
### 4. Seed gate
|
|
68
|
+
|
|
69
|
+
Wait on the seeders + `composer_handle` + `npm_handle`; once `composer_handle` returns, run the post-Composer Layout-import verify; aggregate seeder returns into the `seeded` scratch map. Run `patch-decorative-slots.mjs` only when `imagery === "ai-generated"` and Image Phase 1 Decorative returned; otherwise skip and record `{phase: "decorative-slot-patch", status: "skipped"}`. Because the Composer started back in Setup, by the time the seeders return its wall is typically already complete — so the design-system phase no longer extends the seed window.
|
|
70
|
+
|
|
71
|
+
### 5. Continue
|
|
72
|
+
|
|
73
|
+
**Step 4.5** (Phase 3 Components + Image Phase 2) → **Step 7** (Phase 4 Pages) → **Build & Release** → **Final message** — all detailed below.
|
|
74
|
+
|
|
75
|
+
## Imagery gates
|
|
76
|
+
|
|
77
|
+
The `imagery` value (`"ai-generated"` | `"themed-blocks"`, captured in `DISCOVERY.md` Q2.5, default `"themed-blocks"`) gates **both** image phases. The conductor owns the gate; the step files describe what each image scope does when it runs.
|
|
78
|
+
|
|
79
|
+
- **Image Phase 1 — Decorative** (Wave-3 batch). Dispatch the `image-phase-1-decorative` subagent (`<SKILL_ROOT>/references/images/INSTRUCTIONS.md`) **only when `imagery === "ai-generated"`**. When `"themed-blocks"` (default): do **not** dispatch — decorative slots render as solid color blocks via the Composer-emitted decorative-slot CSS (color blocks tokenised against the Designer's palette); record `{phase: "image-phase-1-decorative", status: "skipped", notes: "themed-blocks mode"}` and **skip the post-seed `patch-decorative-slots.mjs`** too (`{phase: "decorative-slot-patch", status: "skipped"}`). Dispatching it regardless wastes ~140–175 s + 0.3–0.5 Wix AI credits.
|
|
80
|
+
- **Image Phase 2 — Entity** (Step 4.5 batch). Same gate — dispatch only on `ai-generated`; on `themed-blocks` skip and record `{phase: "image-phase-2-entity", status: "skipped"}`. Detailed dispatch + the hard build gate are in § "Step 4.5" and § "Wait: Phase 4 → Build" below.
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Wave 3 — Seed + frontend prep + Image Phase 1
|
|
85
|
+
|
|
86
|
+
The seed-wave dispatch list (the run's step 3). No design-system dispatch here — `composer_handle` is already running from the Setup-window bridge. Launch as **one concurrent batch** (`PLAN.md` § "Batching discipline"):
|
|
87
|
+
|
|
88
|
+
- `seed-utilities.sh --template astro` — frontend-track project prep (idempotent), run from the project dir. Apply `SEED.md` § "Pre-batch".
|
|
89
|
+
- Per-pack seed subagents (background) — apply `SEED.md` for the recipe map + seeder prompt template.
|
|
90
|
+
- Image Phase 1 Decorative (background) — `<SKILL_ROOT>/references/images/INSTRUCTIONS.md`, scope `image-phase-1-decorative` — **only when `imagery === "ai-generated"`** (§ "Imagery gates").
|
|
91
|
+
|
|
92
|
+
The **seed gate** that follows (wait on seeders + `composer_handle` + `npm_handle`, Layout-import verify, aggregate `seeded`, optional decorative patch) is run-step 4 above — then continue to **Step 4.5** below.
|
|
93
|
+
|
|
94
|
+
### Subagent prompt template
|
|
95
|
+
|
|
96
|
+
See `SEED.md` § "Subagent prompt template" for the base fields (Instruction file, Phase instruction, Scope, Project directory, siteId, Auth, Brand context). Phase 3 Components and Phase 4 Pages dispatches additionally inline the full styling-contract JSON, and Phase 3 / Phase 4 / Image Phase 2 inline the relevant pack-specific slice from the orchestrator's `seeded` scratch as JSON. Subagents do NOT read `.wix/site.json` during the run.
|
|
97
|
+
|
|
98
|
+
**`Instruction file` must point to one of these vertical instruction files:**
|
|
99
|
+
- `<SKILL_ROOT>/references/stores/INSTRUCTIONS.md` — Phase 3 Components + Phase 4 Pages
|
|
100
|
+
- `<SKILL_ROOT>/references/ecom/INSTRUCTIONS.md` — Phase 3 Components (cart/checkout — passive, required by stores)
|
|
101
|
+
- `<SKILL_ROOT>/references/cms/INSTRUCTIONS.md` — Phase 4 CMS Pages
|
|
102
|
+
- `<SKILL_ROOT>/references/blog/INSTRUCTIONS.md` — Phase 3 Components + Phase 4 Pages
|
|
103
|
+
- `<SKILL_ROOT>/references/forms/INSTRUCTIONS.md` — Phase 3 Components + Phase 4 Pages
|
|
104
|
+
- `<SKILL_ROOT>/references/gift-cards/INSTRUCTIONS.md` — Phase 3 Components + Phase 4 Pages (passive/dashboard-gated)
|
|
105
|
+
- `<SKILL_ROOT>/references/images/INSTRUCTIONS.md` — `image-phase-1-decorative` + `image-phase-2-entity`
|
|
106
|
+
- `<SKILL_ROOT>/references/DESIGN_SYSTEM.md` — Phase 2 Designer (design spec, JSON only); `<SKILL_ROOT>/references/astro/COMPOSE.md` — Phase 2 Composer (writes the 6 design-system files)
|
|
107
|
+
- `<SKILL_ROOT>/references/astro/designer/INSTRUCTIONS.md` — **page-design specification** (not a separately-dispatched scope). The merged Phase 4 `pages` scopes above apply this for the visual-design spec of their routes (layout, contract classes, decorative slots, per-scope structure for `home`/`static`/`store-pages`/`blog-pages`/`contact-page`) while writing live SDK data in the same pass. There is no separate placeholder-writing page-designer dispatch — single-write merged (see § "Step 7 Dispatch").
|
|
108
|
+
|
|
109
|
+
For **image subagents**, the prompt additionally includes: page list (for decorative brief), entity types to cover (products, about-content, etc.).
|
|
110
|
+
|
|
111
|
+
Phase 3 Components subagents (Step 4.5) additionally receive the full styling-contract JSON inlined in their prompt — they do not read `.wix/design-tokens.css` + `.wix/site.d.ts` from disk. See § "Styling contract coordination" below.
|
|
112
|
+
|
|
113
|
+
### Subagent return
|
|
114
|
+
|
|
115
|
+
Every subagent returns a structured JSON block at the end of its run, per `references/shared/RETURN_CONTRACT.md`. The orchestrator parses each return as it arrives.
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Step 4.5 — Phase 3 Components + Image Phase 2 Entity (one concurrent batch, all background)
|
|
120
|
+
|
|
121
|
+
**Gate (from the seed gate, run-step 4):** the `seeded` map is populated and the Composer has returned. Verify **both** `.wix/design-tokens.css` **and** `.wix/site.d.ts` exist on disk, and the Composer wrote `src/layouts/Layout.astro` + `src/styles/global.css` — the `cp` pre-batch and Layout imports below depend on them. If either design-tokens file is missing, do not dispatch Step 4.5 — surface the missing path and stop. (`patch-decorative-slots.mjs` was already run or skipped at the seed gate per § "4. Seed gate" — do not re-run it here.)
|
|
122
|
+
|
|
123
|
+
Read `.wix/design-tokens.css` + `.wix/site.d.ts` once.
|
|
124
|
+
|
|
125
|
+
**Pre-batch (same message, before subagent dispatches):** copy the per-pack component-CSS templates into the project. This is a deterministic `cp` — the templates are static and use direct `var(--token)` references against the standard designer vocabulary, so no subagent is needed to author them. The Phase 3 Components subagents below write only `.tsx` React islands; this step writes the matching `src/styles/components-<pack>.css`. **If you skip this `cp` step, `astro build` fails at Step 8 with `Could not resolve "../styles/components-<pack>.css"` from `src/layouts/Layout.astro`** — the Composer's Layout imports those files unconditionally for every pack that declares `components`. If the Phase 3 subagents write only `.tsx`, the build falls back to slow orchestrator recovery (`cp` + manual rewrite to strip `@apply`).
|
|
126
|
+
|
|
127
|
+
For each loaded pack whose vertical INSTRUCTIONS declares a `components` scope (today: `stores`, `ecom`, `blog`, `forms`, `gift-cards`), copy the template:
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
for pack in <loaded packs with components>; do
|
|
131
|
+
cp "<SKILL_ROOT>/references/astro/templates/$pack/components-$pack.css" \
|
|
132
|
+
"src/styles/components-$pack.css"
|
|
133
|
+
done
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Record `{ phase: "copy-component-css", packs: [...], seconds }` in `run.json`. Idempotent — re-running overwrites identical content. Packs without a `components-<pack>.css` template (today: `cms` — SSR inline, no component CSS) are skipped silently.
|
|
137
|
+
|
|
138
|
+
**Also pre-copy the Phase-3 utility templates in the same `cp` batch.** Each vertical's INSTRUCTIONS declares utility files under "Pre-copied by the orchestrator (do NOT write these yourself)" that its `components` scope only *imports* — the conductor must put them on disk before dispatch so no subagent races to author them. Today that is the **stores** pack:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
# only if the stores pack is loaded
|
|
142
|
+
cp "<SKILL_ROOT>/references/astro/templates/stores/back-in-stock.ts" "src/utils/back-in-stock.ts"
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
If you skip this, the `components` subagent falls back to writing `src/utils/back-in-stock.ts` itself, and on multi-pack runs two scopes can race the same path (`File has not been read yet` / `modified since read`). Record `{ phase: "copy-utils", scope: "components", files: [...] }`.
|
|
146
|
+
|
|
147
|
+
Then dispatch in a single concurrent batch:
|
|
148
|
+
|
|
149
|
+
1. **One Phase 3 Components subagent per loaded pack** that declares `components`. Each prompt carries:
|
|
150
|
+
- All standard fields (see "Subagent prompt template" above)
|
|
151
|
+
- The **full styling-contract JSON inlined** — not a file path
|
|
152
|
+
- A note: *"`src/styles/components-<pack>.css` is already on disk (copied from the skill template by the orchestrator). Do NOT write that file — write only `.tsx` islands and any `.astro` shells in your scope."*
|
|
153
|
+
|
|
154
|
+
2. **One Image Phase 2 Entity subagent** — imagery-gated (§ "Imagery gates"): not dispatched on `themed-blocks` (default). On `ai-generated`, when `seeded` scratch has entities, dispatch it — the prompt inlines the relevant `seeded.<pack>` slice (entity IDs + names + descriptions) + brand context (no disk reads). Instruction file: `<SKILL_ROOT>/references/images/INSTRUCTIONS.md` § "Scope: image-phase-2-entity".
|
|
155
|
+
|
|
156
|
+
The Phase 3 Components group is **background** regardless. Image Phase 2 (when dispatched) is also background — it starts immediately and continues running through Step 7 dispatch with no polling.
|
|
157
|
+
|
|
158
|
+
**Why Image Phase 2 lives here, not in Step 7.** Image Phase 2 only depends on entity IDs/names/descriptions + brand context (all inlined in its prompt). It does not read or write anything Phase 3 Components or Phase 4 Pages produce — its PATCH/PUT targets are Wix-side entities (`stores/v3/products`, `wix-data/v2/items`, `blog/v3/posts`). Launching it here lets it overlap entirely with Phase 3 (and often Phase 4 too) instead of becoming a post-Phase-4 tail blocker.
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## Wait: Phase 3 → Step 7
|
|
163
|
+
|
|
164
|
+
Phase 3 Components must complete before Step 7 dispatches — Phase 4 Pages mount the islands Components wrote, so launching early causes missing-island build failures. (Image Phase 2, if dispatched, keeps running through Phase 4 and is gated only at Build.)
|
|
165
|
+
|
|
166
|
+
**Data carry-forward:** Phase 4 subagents receive the relevant `seeded.<vertical>` slice inlined from scratch — **Stores** → `seeded.stores` (`productIds`, slugs, categories), **CMS** → `seeded.cms` (`collectionIds`, `itemIds`). The orchestrator built the `seeded` map at the seed gate — do not re-dispatch seeders. Subagents do NOT read `.wix/site.json`.
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## Step 7 Dispatch — Phase 4 (Pages)
|
|
171
|
+
|
|
172
|
+
### Pre-batch (same message, before subagent dispatches)
|
|
173
|
+
|
|
174
|
+
Pre-copy the Phase-4 utility templates each pack's INSTRUCTIONS declares under "Pre-copied by the orchestrator (do NOT write these yourself)" — the conductor puts them on disk so no `pages-*` scope authors them. Today that is the **stores** pack's category helper:
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
# only if the stores pack is loaded
|
|
178
|
+
cp "<SKILL_ROOT>/references/astro/templates/stores/categories.ts" "src/utils/categories.ts"
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
`categories.ts` is a static, brand-agnostic SDK wrapper. **It must be pre-copied, not written by a subagent.** `pages-categories`, `pages-products`, and `pages-home-and-nav` all *import* it; if it isn't on disk, two of those concurrently-dispatched scopes each fall back to writing it and race the same path (`File has not been read yet`). Record `{ phase: "copy-utils", scope: "pages", files: ["src/utils/categories.ts"] }`.
|
|
182
|
+
|
|
183
|
+
### Concurrent batch
|
|
184
|
+
|
|
185
|
+
For each loaded pack's `pages`:
|
|
186
|
+
- One Phase 4 subagent per scope — **background**. Each writes its routes ONCE with both visual design and live data queries (the merged design+wire model). Earlier flows split this into a placeholder-writing dispatch followed by a page-rewrite dispatch; that double-write was eliminated.
|
|
187
|
+
|
|
188
|
+
> **Shared-shell patchers serialize within the Phase 4 batch; non-overlapping scopes run concurrently.** Scopes that patch a shared shell file at a marker — `src/components/Navigation.astro` (`<!-- nav:links -->`, CartBadge) or `src/pages/index.astro` (`<!-- home:<pack> -->`, featured grid) — read-modify-write a file another scope also patches. Dispatching two such patchers concurrently trips the harness staleness guard (`File has been modified since read`). **Dispatch the shell-patching scopes one at a time** — launch one, wait for its return, then launch the next — so each sees the previous one's marker insertion. See the ecommerce-run example below: `home-and-nav` and `gift-cards pages` serialize (both touch `Navigation.astro` + `index.astro`); the private-file scopes (`product-pages`, `category-pages`, `cart-checkout`, `cms-pages`) stay in the concurrent batch. The serialized chain runs alongside the concurrent batch, not after it.
|
|
189
|
+
|
|
190
|
+
> **Image Phase 2 is NOT dispatched here.** When it was launched at Step 4.5 (i.e. on an `ai-generated` run), it has been running concurrent with Phase 3 + Phase 4 and is typically finished or near-finished by the time Step 7 fires; the Step 8 hard gate waits for it before invoking `release.sh`. **On a `themed-blocks` run (the default), Image Phase 2 was not dispatched at all** — no gate wait, no images, the build runs as soon as Phase 4 finishes.
|
|
191
|
+
|
|
192
|
+
### Example (ecommerce run — stores pack contributes 4 Phase 4 scopes + cms pack 1)
|
|
193
|
+
|
|
194
|
+
Five subagents launched concurrently:
|
|
195
|
+
|
|
196
|
+
1. **product-pages** — `products/index.astro`, `products/[slug].astro`, `ProductCard.astro`
|
|
197
|
+
2. **category-pages** — `category/[slug].astro`, `CategoryRail.astro` (imports the pre-copied `utils/categories.ts`)
|
|
198
|
+
3. **cart-checkout** — `cart.astro`, `thank-you.astro`
|
|
199
|
+
4. **home-and-nav** — patch `index.astro` product grid + `Navigation.astro` (CartBadge mount + Shop submenu insert at `<!-- nav:links -->`)
|
|
200
|
+
5. **cms-pages** — wire About + FAQ to live `@wix/data` queries
|
|
201
|
+
|
|
202
|
+
Scopes 1, 2, 3, 5 own their files exclusively → one concurrent background batch. `home-and-nav` (scope 4) patches the shared `Navigation.astro` + `index.astro` shells; on a run that also loads gift-cards, the gift-cards `pages` scope patches the same two shells — so those two serialize against each other per the shared-shell rule above. `product-pages` and `home-and-nav` import `CategoryRail.astro` and the pre-copied `utils/categories.ts`, but those imports resolve at build time (Step 8), not write time, so they don't force ordering against `category-pages`.
|
|
203
|
+
|
|
204
|
+
### Phase 4 prompt additions
|
|
205
|
+
|
|
206
|
+
```
|
|
207
|
+
Scope: <scope name from pack.pages[*].name>
|
|
208
|
+
Files to own (absolute paths): <from pack.pages[*].files>
|
|
209
|
+
Phase 1 Seed data: <the relevant seeded.<vertical> slice inlined here as JSON, from the orchestrator's scratch>
|
|
210
|
+
Design tokens: the styling-contract JSON is inlined above; .wix/design-tokens.css + .wix/site.d.ts are also on disk (already imported by the build)
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
Each scope subagent writes its `.astro` files directly with live SDK queries, wires up analytics events, and mounts the React islands written by Phase 3 Components.
|
|
214
|
+
|
|
215
|
+
Scope subagents MUST NOT:
|
|
216
|
+
- Modify files outside their declared scope
|
|
217
|
+
- Modify CSS (`global.css` owned by the Composer; `components-<pack>.css` owned by Phase 3 Components)
|
|
218
|
+
- Modify React islands (owned by Phase 3 Components)
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## Wait: Phase 4 → Build
|
|
223
|
+
|
|
224
|
+
Wait on all Step 7 Phase 4 Pages subagents to return, then:
|
|
225
|
+
|
|
226
|
+
- **If `imagery === "ai-generated"`** (Step 4.5 dispatched `image-phase-2-entity`): wait for that handle to return, with a hard **120 s timeout** from when Phase 4 Pages finish. On timeout, proceed to Build and record `{code: "IMAGE_PHASE_2_TIMEOUT"}` in `run.json`. Image Phase 2 has been running in parallel since Step 4.5, so under that dispatch model the timeout rarely fires.
|
|
227
|
+
- **If `imagery === "themed-blocks"`** (Step 4.5 skipped `image-phase-2-entity`): no wait — proceed to Build immediately.
|
|
228
|
+
|
|
229
|
+
Skipping this gate on an ai-generated run ships previews with no product images and leaves `run.json` recording `image-phase-2-entity` as `"in_progress"`.
|
|
230
|
+
|
|
231
|
+
Also ensure the background `npm install` (`npm_handle` from `SETUP.md` Step 4c, waited on at the seed gate) completed successfully before Build. On non-zero exit, follow the recovery ladder in `SETUP.md` § "npm install recovery".
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## Subagent rate / credit limits
|
|
236
|
+
|
|
237
|
+
Some runtimes apply per-session rate or credit limits to subagents. When a subagent return looks truncated, treat it as a rate-limit hit and recover.
|
|
238
|
+
|
|
239
|
+
### Detection
|
|
240
|
+
|
|
241
|
+
A subagent has hit a rate / credit limit when its return contains any of:
|
|
242
|
+
- Literal text `"You've hit your limit"`, `"quota exceeded"`, `"rate limit"`
|
|
243
|
+
- Total return under ~100 tokens with no fenced JSON block
|
|
244
|
+
- Return ending mid-sentence without a completion indicator
|
|
245
|
+
|
|
246
|
+
### Recovery procedure
|
|
247
|
+
|
|
248
|
+
1. **Check the subagent's declared output files on disk.** Each scope's reference lists the files it owns (e.g., the Phase 4 store-pages scope owns `products/index.astro`, `products/[slug].astro`, `cart.astro`, `thank-you.astro`, `ProductCard.astro`). Read each expected path.
|
|
249
|
+
2. **If all expected files exist on disk and look syntactically valid** (no empty files, no unterminated strings): synthesize a `status: "complete"` entry for `run.json` with `notes: "Sub-agent hit rate limit after writing all files; files on disk are valid."` Proceed with the next dispatch.
|
|
250
|
+
3. **If expected files are missing or empty:** retry the subagent once with an identical prompt. If the retry also hits the limit, mark the phase `status: "partial"` in `run.json` with `errors: [{code: "RATE_LIMIT", message: "Subagent rate-limited; <N> of <M> files produced"}]` and decide per-case — the orchestrator may fall back to inline emission of the missing files if they're trivial (single-file scope), or fail the run.
|
|
251
|
+
4. **Do not loop.** Retrying the same subagent more than once after a rate limit wastes budget — the limit is session-scoped and persists.
|
|
252
|
+
|
|
253
|
+
Record the rate-limit event in `run.json` `notes[]` regardless of recovery outcome — it's important observability for tuning scope sizes.
|
|
254
|
+
|
|
255
|
+
## Build & Release
|
|
256
|
+
|
|
257
|
+
1. `npx @wix/cli@latest build` — if it fails, inspect `.wix/debug.log` for the specific error, fix, retry. Common failure modes are listed in `references/shared/RETURN_CONTRACT.md` § "Common failure modes".
|
|
258
|
+
2. `npx @wix/cli@latest release` — extract the published URL from the `Site published on <url>` line in stdout. This command also populates the **Frontend link** in headless settings natively, so transactional emails link to the deployed frontend without any extra API calls.
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
## Final Message — summary FIRST, then run.json, in ONE turn
|
|
263
|
+
|
|
264
|
+
**Ordering is strict and user-perceived latency depends on it.** The summary prose is the **first content of your final turn**; the `Write .wix/run.json` is the **last tool call in that same message**. Composing `run.json` takes ~15–25 s (it aggregates every subagent return), so writing it *before* the summary makes the user wait that whole time to see their live URL — for no reason, since `run.json` is a silent observability artifact they never read.
|
|
265
|
+
|
|
266
|
+
Hard rules:
|
|
267
|
+
- **Do NOT write `run.json` before the summary.** A run that emits the `run.json` `Write` first (or in an earlier turn) is wrong even if the content is identical — it just delays the URL.
|
|
268
|
+
- **Do NOT emit a pre-narration turn** ("Site is live, writing run.json…", "delivering the summary…"). That is orchestration machinery (`PLAN.md` § "User-facing output") and it splits the single turn. The summary prose itself is the first thing the user sees after release.
|
|
269
|
+
- **One turn:** summary prose → then the `Write` tool call, as siblings in the same assistant message. The turn does not close until the `Write` completes, so the record still lands on disk before control returns — you get on-disk durability without making the user wait for it.
|
|
270
|
+
|
|
271
|
+
The summary prose contains, in order:
|
|
272
|
+
|
|
273
|
+
1. **Production URL** — bold link, first line (the exact `Site published on <url>` string; do not retype it).
|
|
274
|
+
2. **Dashboard link** — `https://manage.wix.com/dashboard/<siteId>`.
|
|
275
|
+
|
|
276
|
+
**Do not present timings.** No total-wall figure, no per-phase breakdown ("scaffold 26s · design-system 13s · …"), no "built in ~N min." Phase timings are machinery and the self-reported number is easy to get wrong (it has under-reported true wall in past runs); they belong in `run.json`, not the user-facing summary. The user wants their site, not a stopwatch.
|
|
277
|
+
|
|
278
|
+
Then, in the same turn after the summary prose, write `.wix/run.json` silently — the observability record aggregating every subagent return (format per `references/shared/RETURN_CONTRACT.md` § "Final run.json format"), including the phase timings. Use the subagent returns already in session context — do not re-read anything to compose it.
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## Styling contract coordination
|
|
283
|
+
|
|
284
|
+
The **design tokens** (`.wix/design-tokens.css` + `.wix/site.d.ts`) are the coordination artifacts between subagents. Read by every downstream phase that touches styled markup.
|
|
285
|
+
|
|
286
|
+
### Producer: Phase 2 (Designer Wave 0 + Composer Setup-window bridge)
|
|
287
|
+
|
|
288
|
+
Dispatch timing: the Designer is dispatched at BUILD entry (run-step 0); the Composer at the Setup-window bridge (run-step 2 above). Net: `emit-design-tokens.mjs` writes `.wix/design-tokens.css` + `.wix/site.d.ts` (pure projections of the Designer's `data.designTokens`); the **Composer** writes the `@theme` palette into `global.css` from the same tokens plus the other 5 files. `designTokens` is the single source of truth — the script projects it, the Composer applies it.
|
|
289
|
+
|
|
290
|
+
### Consumer: Phase 3 Components (Step 4.5)
|
|
291
|
+
|
|
292
|
+
Phase 3 is dispatched in Step 4.5 above. The styling contract is passed inline in each Phase 3 prompt.
|
|
293
|
+
|
|
294
|
+
### Consumers: Phase 4 Pages (Step 7)
|
|
295
|
+
|
|
296
|
+
Contract already exists when Phase 4 launches. Subagents receive the contract contents inline in their prompt (no polling).
|
|
297
|
+
|
|
298
|
+
---
|
|
299
|
+
|
|
300
|
+
## Diagnostic: did the concurrent batch actually run in parallel?
|
|
301
|
+
|
|
302
|
+
If a build feels slow, check whether dispatches that should have been concurrent actually overlapped in execution. Two failure modes:
|
|
303
|
+
|
|
304
|
+
1. **Serialized launch:** the orchestrator emitted subagent invocations one at a time across multiple turns instead of as a single batch. Symptom: multi-second gaps between subagent starts in the run log.
|
|
305
|
+
2. **Serialized execution:** the runtime dispatched the batch but executed it sequentially (rare; most runtimes parallelize properly).
|
|
306
|
+
|
|
307
|
+
The fix for (1) depends on the runtime — check whether your dispatch primitive supports a single concurrent batch and whether anything between the subagent invocations (status updates, narration, file writes) is splitting the batch into multiple turns. Even when (1) cannot be fixed, **background dispatch alone gives ~2× compression** by overlapping execution. Make every subagent that doesn't block downstream work a background subagent.
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: design-system-designer
|
|
3
|
+
description: "The Designer role of the wix-headless design-system phase. Picks the brand's visual identity and returns it as framework-agnostic JSON only — design tokens (palette, type, spacing, radii, content widths) plus a small block of brand-voice strings. Writes no files and makes no decision about how the design is rendered (no CSS, no Tailwind, no Astro). The orchestrator pipes data.designTokens to emit-design-tokens.mjs and hands data.shell + data.designTokens to the Composer."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Designer — the design itself
|
|
7
|
+
|
|
8
|
+
You are the **Designer**. You decide *what the brand looks like*. You do **not** decide *how that becomes code* — that is the Composer's job, downstream of you.
|
|
9
|
+
|
|
10
|
+
You return **JSON only**. You **write no files**. You make **no** decision about how the design is rendered: no CSS, no Tailwind, no `@theme`, no `--var` naming, no Astro/React, no file layout, no View-Transitions, no `@apply`, no markup. Anything that would differ between one frontend framework and another is, by definition, not yours.
|
|
11
|
+
|
|
12
|
+
Your output is small and mostly thinking: a coherent, complete brand visual expressed as a token spec, plus a handful of brand-voice strings. Speed comes from staying in this lane — a small JSON return, not files.
|
|
13
|
+
|
|
14
|
+
## Self-Loading
|
|
15
|
+
|
|
16
|
+
Read `<SKILL_ROOT>/references/shared/RETURN_CONTRACT.md` for the structured-return format. That is the only doc you need. Do **not** read `STYLING.md`, `COMPOSE.md`, the templates, or any `.astro`/`.css` file — those are application concerns the Composer owns. No REST calls, no MCP, no tool discovery: this role is pure judgment.
|
|
17
|
+
|
|
18
|
+
**Do NOT `Read .wix/site.json`.** Every input is inlined in your prompt (see Inputs). The file may not exist yet when you run, and it is not a coordination channel.
|
|
19
|
+
|
|
20
|
+
## Inputs (entirely from your prompt)
|
|
21
|
+
|
|
22
|
+
- **Brand** — `{ name, description }`.
|
|
23
|
+
- **Aesthetic direction** — a 2–3 sentence design brief.
|
|
24
|
+
- **Color palette** — seed hex codes.
|
|
25
|
+
- **Typography** — display + body font intent.
|
|
26
|
+
- **Mood** — personality and visual elements.
|
|
27
|
+
- **Page color strategy** — Uniform Light / Uniform Dark / Defined Hybrid.
|
|
28
|
+
|
|
29
|
+
You do **not** receive (and do not need) loaded packs, navigation links, disabled packs, or "packs with components" — those are application inputs the orchestrator routes to the Composer, not to you. Your spec is the same regardless of which verticals load: a brand looks the way it looks whether it sells coffee or publishes essays.
|
|
30
|
+
|
|
31
|
+
## What you return
|
|
32
|
+
|
|
33
|
+
A single fenced JSON block per `<SKILL_ROOT>/references/shared/RETURN_CONTRACT.md`, last content in your message:
|
|
34
|
+
|
|
35
|
+
```json
|
|
36
|
+
{
|
|
37
|
+
"status": "complete",
|
|
38
|
+
"phase": "design-system",
|
|
39
|
+
"data": {
|
|
40
|
+
"designTokens": {
|
|
41
|
+
"colors": { "...": "..." },
|
|
42
|
+
"fonts": { "display": "...", "body": "..." },
|
|
43
|
+
"spacing": { "...": "..." },
|
|
44
|
+
"radii": { "...": "..." },
|
|
45
|
+
"containers": { "...": "..." }
|
|
46
|
+
},
|
|
47
|
+
"shell": {
|
|
48
|
+
"heroHeadline": "...",
|
|
49
|
+
"heroSub": "...",
|
|
50
|
+
"footerTagline": "...",
|
|
51
|
+
"navBrandMark": "..."
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### `data.designTokens` — the visual values
|
|
58
|
+
|
|
59
|
+
Concrete values with **semantic roles**, framework-agnostic. The bare key names below are a contract (the Composer maps them to the framework's vocabulary, and the orchestrator's `emit-design-tokens.mjs` projects them to CSS variables), so use these names:
|
|
60
|
+
|
|
61
|
+
- **`colors`** — a complete palette covering semantic roles, not just brand accents. Provide at minimum: `paper` (primary background), `paper-warm` (secondary surface), `ink` (primary text / dark fills), `mute` (muted text), `rule` (borders / dividers), `accent` (brand emphasis). Recommended: `ink-soft`, `cream`, `error`. Every value a concrete hex. Derive from the aesthetic direction and seed palette — never a generic default set.
|
|
62
|
+
- **`fonts`** — `display` and `body` family names (e.g. `"Fraunces"`, `"Inter"`). Add `mono` only if the brand needs it.
|
|
63
|
+
- **`spacing`** — a full rhythm scale, every step from `2xs` through `4xl` (`2xs, xs, sm, md, lg, xl, 2xl, 3xl, 4xl`), each a concrete length (e.g. `"1rem"`). This is the spacing rhythm of the brand, not container widths.
|
|
64
|
+
- **`radii`** — corner rounding: `sm` and `md` required; `lg`, `xl` if the brand uses larger curves. Concrete lengths.
|
|
65
|
+
- **`containers`** — content/reading widths, **conceptually separate from spacing**: `prose` (a readable text column, ~`42rem`), plus `md`, `3xl`, `6xl` as page max-widths. These are widths, not spacing steps — never reuse a spacing value as a container value (a reading column is ~`42rem`, not `5rem`).
|
|
66
|
+
|
|
67
|
+
**Completeness is your bar.** The spec must describe a coherent, complete brand visual: every role above filled with an intentional value. If a color/spacing/width would plausibly be needed to render the brand, include it. A thin or generic spec forces the Composer to invent values — the failure this split exists to prevent. You do not need to know *which* utilities downstream pages use; provide a full, well-chosen scale and the contract is satisfied.
|
|
68
|
+
|
|
69
|
+
### `data.shell` — brand-voice strings
|
|
70
|
+
|
|
71
|
+
A few short strings in the brand's voice (no markup, no HTML):
|
|
72
|
+
|
|
73
|
+
- **`heroHeadline`** — the homepage hero headline.
|
|
74
|
+
- **`heroSub`** — a one-sentence supporting line under the headline.
|
|
75
|
+
- **`footerTagline`** — a short footer tagline.
|
|
76
|
+
- **`navBrandMark`** — the wordmark text shown in the nav (usually the brand name, optionally stylized as plain text).
|
|
77
|
+
|
|
78
|
+
These are *copy*, not layout. Where they go and how they're styled is the Composer's call.
|
|
79
|
+
|
|
80
|
+
## The boundary (one line)
|
|
81
|
+
|
|
82
|
+
You pick *what the brand looks like* — "surface/paper = `#FAF6EF`", "display face = Fraunces", "reading column ≈ 42rem", "hero headline = …". Turning any of that into `--color-paper` inside an `@theme` block, into a Google Fonts `<link>`, into `max-w-prose`, or into markup is the **Composer's** decision. When in doubt: if it's a value or a phrase, it's yours; if it's a file, a class, a variable name, or a tag, it's not.
|
|
83
|
+
|
|
84
|
+
## Anti-patterns
|
|
85
|
+
|
|
86
|
+
| WRONG | CORRECT |
|
|
87
|
+
|---|---|
|
|
88
|
+
| Write `global.css`, `Layout.astro`, or any file | Return JSON only — the Composer authors files |
|
|
89
|
+
| Emit an `@theme` block, `--color-*` names, or Tailwind utilities | Return bare-key `designTokens` values; the Composer maps them |
|
|
90
|
+
| Decide CSS structure, View-Transitions, `@apply`, markers, file layout | All application — the Composer's domain |
|
|
91
|
+
| `Read .wix/site.json`, `STYLING.md`, templates, or `.astro` files | Every input is inlined; read only `RETURN_CONTRACT.md` |
|
|
92
|
+
| Branch on framework (astro vs custom) or loaded packs | The spec is framework- and pack-blind by construction |
|
|
93
|
+
| Alias a container width to a spacing value | `containers.prose` ≈ `42rem`; `spacing.3xl` ≈ `5rem` — different axes |
|
|
94
|
+
| Ship a thin palette ("downstream will add what it needs") | Completeness is the contract — fill every semantic role |
|
|
95
|
+
| Trailing prose after the JSON block | The fenced JSON is the last content in your message |
|
|
96
|
+
|
|
97
|
+
## Prompt template (the orchestrator dispatches the Designer with this)
|
|
98
|
+
|
|
99
|
+
`.wix/site.json` does not exist yet when the Designer runs (`init-site-json.mjs` runs only after user approval), so the Designer cannot read brand + verticals from it. Every input is passed inline — this instruction file forbids reading `site.json` and takes every input from the prompt.
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
Instruction file (absolute path): <SKILL_ROOT>/references/DESIGN_SYSTEM.md
|
|
103
|
+
|
|
104
|
+
Brand: { "name": "<Q1 brand>", "description": "<one-line business context>" }
|
|
105
|
+
Aesthetic direction: <2–3 sentences from the craft step>
|
|
106
|
+
Color palette: <hex codes>
|
|
107
|
+
Typography: { "display": "<font>", "body": "<font>" }
|
|
108
|
+
Mood: <personality / visual elements>
|
|
109
|
+
Page color strategy: <Uniform Light | Uniform Dark | Defined Hybrid>
|
|
110
|
+
|
|
111
|
+
Auth: not required (frontend-only).
|
|
112
|
+
|
|
113
|
+
Return JSON only — data.designTokens + data.shell. Write no files.
|
|
114
|
+
Do NOT read .wix/site.json — it is not yet written and every input is inlined above.
|
|
115
|
+
```
|