@wix/agent-skills 1.9.0 → 1.10.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 (46) hide show
  1. package/package.json +1 -1
  2. package/skills/wix-headless/references/DESIGN_SYSTEM.md +6 -16
  3. package/skills/wix-headless/references/astro/bookings/COMPONENTS.md +1 -1
  4. package/skills/wix-headless/references/astro/bookings/SERVICES_PAGES.md +19 -0
  5. package/skills/wix-headless/references/astro/cms/FAQ_KNOWLEDGE_BASE.md +2 -2
  6. package/skills/wix-headless/references/astro/designer/INSTRUCTIONS.md +3 -3
  7. package/skills/wix-headless/references/astro/ecom/CART_WIRING.md +2 -2
  8. package/skills/wix-headless/references/astro/ecom/COMPONENTS_CSS.md +3 -3
  9. package/skills/wix-headless/references/astro/gift-cards/COMPONENTS.md +2 -2
  10. package/skills/wix-headless/references/astro/stores/BACK_IN_STOCK.md +7 -7
  11. package/skills/wix-headless/references/astro/stores/COMPONENTS_CSS.md +4 -4
  12. package/skills/wix-headless/references/astro/stores/PRODUCT_PAGES.md +2 -2
  13. package/skills/wix-headless/references/astro/templates/Footer.astro +4 -4
  14. package/skills/wix-headless/references/astro/templates/Navigation.astro +4 -4
  15. package/skills/wix-headless/references/astro/templates/bookings/AvailabilityCalendar.tsx +147 -6
  16. package/skills/wix-headless/references/astro/templates/bookings/ServiceBookingFlow.tsx +21 -4
  17. package/skills/wix-headless/references/astro/templates/bookings/ServiceCard.astro +11 -2
  18. package/skills/wix-headless/references/astro/templates/bookings/booking-confirmation.astro +8 -8
  19. package/skills/wix-headless/references/astro/templates/bookings/components-bookings.css +94 -26
  20. package/skills/wix-headless/references/astro/templates/bookings/services/[slug].astro +53 -10
  21. package/skills/wix-headless/references/astro/templates/bookings/services/index.astro +128 -20
  22. package/skills/wix-headless/references/astro/templates/ecom/CartView.tsx +3 -3
  23. package/skills/wix-headless/references/astro/templates/ecom/cart.astro +3 -3
  24. package/skills/wix-headless/references/astro/templates/ecom/components-ecom.css +17 -17
  25. package/skills/wix-headless/references/astro/templates/ecom/thank-you.astro +3 -3
  26. package/skills/wix-headless/references/astro/templates/gift-cards/_home-teaser-snippet.astro +4 -4
  27. package/skills/wix-headless/references/astro/templates/gift-cards/components-gift-cards.css +19 -18
  28. package/skills/wix-headless/references/astro/templates/gift-cards/gift-cards.astro +3 -3
  29. package/skills/wix-headless/references/astro/templates/global.css +17 -15
  30. package/skills/wix-headless/references/astro/templates/index.astro +4 -4
  31. package/skills/wix-headless/references/astro/templates/stores/components-stores.css +31 -31
  32. package/skills/wix-headless/references/astro/templates/stores/products/[slug].astro +4 -4
  33. package/skills/wix-headless/references/bookings/FLOW.md +93 -32
  34. package/skills/wix-headless/references/bookings/INSTRUCTIONS.md +8 -3
  35. package/skills/wix-headless/references/bookings/SERVICES_DATA.md +60 -0
  36. package/skills/wix-headless/references/custom/bookings/WIRING.md +60 -9
  37. package/skills/wix-headless/references/shared/DESIGN_MD.md +2 -3
  38. package/skills/wix-headless/references/shared/IMPLEMENTER.md +4 -4
  39. package/skills/wix-headless/references/shared/STYLING.md +15 -18
  40. package/skills/wix-headless/references/stores/INSTRUCTIONS.md +2 -2
  41. package/skills/wix-headless/references/verticals/bookings.md +5 -3
  42. package/skills/wix-headless/scripts/compose.mjs +4 -19
  43. package/skills/wix-headless/scripts/emit-design-tokens.mjs +0 -3
  44. package/skills/wix-manage/references/bookings/create-appointment-service.md +1 -13
  45. package/skills/wix-manage/references/bookings/create-class-service.md +1 -13
  46. package/skills/wix-manage/references/bookings/create-course-service.md +1 -13
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/agent-skills",
3
- "version": "1.9.0",
3
+ "version": "1.10.0",
4
4
  "description": "Wix Skills for AI coding agents — versioned npm distribution of the wix/skills content.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: design-system-designer
3
- description: "The Designer role of the wix-headless design-system phase. Picks the brand's visual identity and authors it as DESIGN.md — the single, portable design-token format (palette, type, spacing, rounded, content widths) plus a small block of brand-voice strings. Writes DESIGN.md directly (its only file, at the dispatch's designMdPath) and returns just data.shell + the designMdPath, so the orchestrator never re-emits the tokens. emit-design-tokens.mjs reads DESIGN.md's frontmatter and projects .wix/design-tokens.css + .wix/site.d.ts; compose.mjs (astro) reads DESIGN.md to write the design-system files. Makes no rendering decision (no CSS, no Tailwind, no Astro)."
3
+ description: "The Designer role of the wix-headless design-system phase. Picks the brand's visual identity and authors it as DESIGN.md — the single, portable design-token format (palette, type, rounded, content widths) plus a small block of brand-voice strings. Writes DESIGN.md directly (its only file, at the dispatch's designMdPath) and returns just data.shell + the designMdPath, so the orchestrator never re-emits the tokens. emit-design-tokens.mjs reads DESIGN.md's frontmatter and projects .wix/design-tokens.css + .wix/site.d.ts; compose.mjs (astro) reads DESIGN.md to write the design-system files. Makes no rendering decision (no CSS, no Tailwind, no Astro)."
4
4
  ---
5
5
 
6
6
  # Designer — the design itself
@@ -11,7 +11,7 @@ You author **`DESIGN.md`** (its YAML frontmatter is the spec) — see "What you
11
11
 
12
12
  Your output is small and mostly thinking: a coherent, complete brand visual expressed as `DESIGN.md` frontmatter, plus a handful of brand-voice strings (returned as `data.shell`). Speed comes from staying in this lane — one small spec file + a small return, not site files.
13
13
 
14
- > **DESIGN.md is the single design artifact — there is no separate "design tokens" JSON contract.** What you author *is* the DESIGN.md frontmatter (DESIGN.md vocabulary: `colors` / `typography` / `spacing` / `rounded` / `containers` / `googleFontsHref`). **You write `DESIGN.md` directly**; `emit-design-tokens.mjs` then projects `.wix/design-tokens.css` + `.wix/site.d.ts` from its frontmatter; `compose.mjs` (astro) reads the same frontmatter to write the site files; non-astro frontends import the token CSS. Because the **frontmatter** is what every consumer reads, your completeness bar is the whole game — a thin spec yields a thin DESIGN.md.
14
+ > **DESIGN.md is the single design artifact — there is no separate "design tokens" JSON contract.** What you author *is* the DESIGN.md frontmatter (DESIGN.md vocabulary: `colors` / `typography` / `rounded` / `containers` / `googleFontsHref`). **You write `DESIGN.md` directly**; `emit-design-tokens.mjs` then projects `.wix/design-tokens.css` + `.wix/site.d.ts` from its frontmatter; `compose.mjs` (astro) reads the same frontmatter to write the site files; non-astro frontends import the token CSS. Because the **frontmatter** is what every consumer reads, your completeness bar is the whole game — a thin spec yields a thin DESIGN.md.
15
15
 
16
16
  ## Self-Loading
17
17
 
@@ -38,7 +38,7 @@ You do **not** receive (and do not need) loaded packs, navigation links, disable
38
38
  - Open the file with `---` on its own line and close the frontmatter with `---`.
39
39
  - **QUOTE every string value with double quotes — especially hex colors** (`paper: "#FFFBF0"`). An unquoted `#hex` after `: ` is read as a YAML comment and the token vanishes.
40
40
  - **2-space indent** for nested groups. `typography` entries may use an indented `fontFamily:` line or flow style `{ fontFamily: "..." }`.
41
- - Groups: `colors`, `typography`, `spacing`, `rounded`, `containers`; plus the top-level `googleFontsHref`. Fill every color role (completeness is your bar — see below).
41
+ - Groups: `colors`, `typography`, `rounded`, `containers`; plus the top-level `googleFontsHref`. Fill every color role (completeness is your bar — see below).
42
42
 
43
43
  **The `DESIGN.md` you write** (frontmatter is canonical; the body is documentation, never parsed):
44
44
 
@@ -59,16 +59,6 @@ colors:
59
59
  typography:
60
60
  display: { fontFamily: "..." }
61
61
  body: { fontFamily: "..." }
62
- spacing:
63
- 2xs: "..."
64
- xs: "..."
65
- sm: "..."
66
- md: "..."
67
- lg: "..."
68
- xl: "..."
69
- 2xl: "..."
70
- 3xl: "..."
71
- 4xl: "..."
72
62
  rounded:
73
63
  sm: "..."
74
64
  md: "..."
@@ -111,7 +101,7 @@ Concrete values with **semantic roles**, in the DESIGN.md vocabulary (`DESIGN_MD
111
101
  - **`colors`** — a complete palette covering semantic roles, not just brand accents. **All six core roles are required** (emit every one): `paper` (primary background), `paper-warm` (secondary surface), `ink` (primary text / dark fills), `mute` (muted text), `rule` (borders / dividers), `accent` (brand emphasis). Also emit the recommended `ink-soft`, `cream`, `error`. Every value a concrete hex string. These wix-native role names are valid DESIGN.md color tokens — use them directly. **Map the approved palette to roles — do not re-pick hues.** The **accent** hex from the Color palette input → `accent`; the dominant **background** → `paper`; the primary **text** → `ink`. The remaining roles (`paper-warm`, `ink-soft`, `mute`, `rule`, `cream`, `error`) are **tonal derivatives of that approved palette** — lighten/darken/desaturate **within the same hue family**, never a new hue and never a generic editorial default set. **`compose.mjs` derives a missing role only as a last-resort fail-safe** (e.g. `ink-soft` ≈ `ink` lightened) — that yields a less intentional palette, so completeness is on you.
112
102
  - **`typography`** — a map of levels to type tokens. **Use the exact `display` and `body` font families from the Typography input, verbatim** — no substitution, no "better" pairing, no swapping the approved serif for a different serif. The families are **given to you, not chosen by you**; you decide only `fontSize`/`fontWeight`/`lineHeight`/`letterSpacing` (optional — the wix pipeline consumes only `fontFamily`). Each level is `{ "fontFamily": "<the given family>" }` (e.g. `"Fraunces"`, `"Inter"`). Add `mono` only if the brand needs it.
113
103
  - **`googleFontsHref`** (top-level key in `data.design`) — the **ready** Google Fonts stylesheet href for the **given** `display` + `body` families, with the weight/optical axes each family actually supports. Emit the finished URL for those exact families: e.g. `"https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600&family=Inter:wght@400;500;600&display=swap"`. If **both** families are system fonts (`system-ui`, `sans-serif`, etc.), emit `""` (the `<link>` is dropped). (If you omit it, `compose.mjs` builds a valid fallback with a standard 400–700 weight set, but the family-specific axes are lost — so emit it.)
114
- - **`spacing`** — a full rhythm scale, every step `2xs` through `4xl` (`2xs, xs, sm, md, lg, xl, 2xl, 3xl, 4xl`), each a concrete length (e.g. `"1rem"`). The brand's spacing rhythm, not container widths.
104
+ - **(no `spacing`)** — do not author a spacing scale. The build uses Tailwind v4's built-in numeric spacing (`gap-4`, `py-24`, …); a named `--spacing-<size>` scale was removed because its t-shirt names collided with the width utilities. Spacing is not your concern.
115
105
  - **`rounded`** — corner radii (DESIGN.md's name for radius tokens): `sm` and `md` required; `lg`, `xl` if the brand uses larger curves. Concrete lengths.
116
106
  - **`containers`** — content/reading widths (a DESIGN.md extension this skill uses), **conceptually separate from spacing**: `prose` (a readable text column, ~`42rem`), plus `md`, `3xl`, `6xl` as page max-widths. Widths, not spacing steps — never reuse a spacing value as a container value (a reading column is ~`42rem`, not `5rem`).
117
107
 
@@ -141,12 +131,12 @@ You pick *what the brand looks like* — "paper = `#FAF6EF`", "display face = Fr
141
131
  | Write `global.css`, token CSS, or any **site** file | Write **only** `DESIGN.md` (your design spec) — `emit-design-tokens.mjs` projects the token CSS from it, `compose.mjs` authors site files |
142
132
  | Echo the tokens inline in your return | They live in `DESIGN.md`; return only `data.shell` + the `designMdPath` you wrote (keeps the tokens out of the orchestrator's output) |
143
133
  | Unquoted hex in frontmatter (`paper: #FFFBF0`) | Quote every string value (`paper: "#FFFBF0"`) — an unquoted `#hex` parses as a comment and the token is lost |
144
- | Emit an `@theme` block, `--color-*` names, or Tailwind utilities | Return DESIGN.md frontmatter (`colors`/`typography`/`spacing`/`rounded`/`containers`); `compose.mjs` maps them |
134
+ | Emit an `@theme` block, `--color-*` names, or Tailwind utilities | Return DESIGN.md frontmatter (`colors`/`typography`/`rounded`/`containers`); `compose.mjs` maps them |
145
135
  | Return the old `designTokens` shape (`fonts`, `radii`) | Use the DESIGN.md vocabulary: `typography` (with `fontFamily`), `rounded` — there is no separate token JSON anymore |
146
136
  | Decide CSS structure, View-Transitions, `@apply`, markers, file layout | All application — `compose.mjs`'s domain |
147
137
  | Read `STYLING.md`, templates, or `.astro` files | Every input is inlined; read only `DESIGN_MD.md` + `RETURN_CONTRACT.md` |
148
138
  | Branch on framework (astro vs custom) or loaded packs | The DESIGN.md is framework- and pack-blind by construction |
149
- | Alias a container width to a spacing value | `containers.prose` ≈ `42rem`; `spacing.3xl` ≈ `5rem` — different axes |
139
+ | Author a `spacing` scale | Removed — the build uses Tailwind's numeric spacing (`gap-4`, `py-24`); only `colors`/`typography`/`rounded`/`containers`/`googleFontsHref` |
150
140
  | Ship a thin palette ("downstream will add what it needs") | Completeness is the contract — fill every semantic role |
151
141
  | Substitute or "upgrade" the display/body family (swap the approved Fraunces for Playfair) | Use the exact `display`/`body` families from the Typography input verbatim; you choose only weights/axes |
152
142
  | Introduce a hue not in the approved palette for `paper`/`ink`/`accent`, or "improve" the brand color | `accent` = approved accent hex, `paper` = approved background, `ink` = approved text; other roles are tonal variants of those |
@@ -17,7 +17,7 @@ Read `references/shared/IMPLEMENTER.md` + `references/shared/STYLING.md` first.
17
17
  | File | From template | Role |
18
18
  |------|---------------|------|
19
19
  | `src/components/ServiceBookingFlow.tsx` | `…/ServiceBookingFlow.tsx` | `client:only` coordinator — holds the selected slot, swaps calendar → form, redirects on success. Mounted by `services/[slug].astro`. |
20
- | `src/components/AvailabilityCalendar.tsx` | `…/AvailabilityCalendar.tsx` | the **week calendar** — week strip + nav → the picked day's slots. APPOINTMENT → `availabilityTimeSlots`; CLASS → `eventTimeSlots`. |
20
+ | `src/components/AvailabilityCalendar.tsx` | `…/AvailabilityCalendar.tsx` | the **week calendar** — week strip + nav → the picked day's slots. APPOINTMENT → `availabilityTimeSlots`; CLASS → `eventTimeSlots`. Optional **staff picker** (shown when >1 staff; filters availability + records `slot.resource`) and **location picker** (shown when the service has >1 business location; **always scopes availability to one location** — defaulting to the carried/first — so a multi-location service doesn't return duplicate per-location slots). Both fed by props from the SSR page. |
21
21
  | `src/components/BookingForm.tsx` | `…/BookingForm.tsx` | the **schema-driven** form — renders the `@wix/forms` field list (passed in from the SSR page), keys values by `target`, calls `bookingDriver.book()`. |
22
22
 
23
23
  ## astro-specific rules
@@ -29,6 +29,17 @@ Plus the nav/home links (shell chain — see below).
29
29
  in frontmatter 500s in the deployed runtime (the env var is client-only).
30
30
  Always include **`appId`** in the filter. Single service by slug: the
31
31
  `.eq("mainSlug.name", slug).eq("appId", BOOKING_APP_ID).limit(1).find()` chain.
32
+ The same elevation works for `services.queryLocations` and
33
+ `categoriesV2.queryCategories` (used by the optional catalog filters, below).
34
+ 1b. **Optional catalog filters (location + category) — auto-skip; see `../../bookings/FLOW.md` §7.**
35
+ The catalog page reads `?locationId`/`?category` from the request URL and merges
36
+ them into the **same** `queryServices` filter (location → `locations.business.id`
37
+ $hasSome, or the synthetic `locations.type` mapping; category → `category.id` $eq).
38
+ It SSRs `queryLocations()` (show the selector only when business+custom+customer
39
+ count > 1) and `queryCategories().find()` (non-fatal — render without the bar on
40
+ failure; show only when > 1 category). The chosen location is carried into the
41
+ detail link (`ServiceCard` `locationId`/`locationType` props) so availability is
42
+ scoped to it. Reference: `…/templates/bookings/services/index.astro`.
32
43
  2. **The detail page fetches the booking-form schema server-side.** Read
33
44
  `service.form._id`'s form via `@wix/forms` (`auth.elevate(forms.getForm)(formId)`),
34
45
  map `formFields` to `{ label, target, required, componentType, identifier, options }`,
@@ -37,6 +48,14 @@ Plus the nav/home links (shell chain — see below).
37
48
  complex object-valued fields (e.g. the default form's multi-line `ADDRESS`), or
38
49
  `createBooking` fails with "must be object". Pass the full `service` too — the
39
50
  booking step reads its payment/policy. Same field-mapping as `../forms/CONTACT_FORM.md`.
51
+ Also pass, through to `<ServiceBookingFlow>`: `service.staffMemberDetails?.staffMembers`
52
+ (the staff picker — the service was queried with `STAFF_MEMBER_DETAILS`); the
53
+ service's **business `locations`** — sourced from `auth.elevate(services.queryLocations)()`
54
+ (the site's real business locations) intersected with the service's own location ids,
55
+ NOT from `service.locations` alone (its ids can be ones the availability engine doesn't
56
+ recognize → 0 slots) — so the calendar scopes availability to one location and avoids
57
+ duplicate per-location slots (FLOW.md §7); and the `?locationId` read from the request
58
+ URL (the picker's default).
40
59
  3. **Only the read pages are SSR.** The detail page SSRs the service info for SEO,
41
60
  then the booking UI runs in the `client:only` island. Do not SSR availability.
42
61
  4. **Confirmation renders from query params.** The booking step redirects with
@@ -180,7 +180,7 @@ Key details:
180
180
 
181
181
  ### 3. FAQ Page (`src/pages/faq/index.astro`)
182
182
 
183
- **Layout width:** Center the page column with `container-reading` (from designer `global.css`) or `max-w-6xl mx-auto px-lg` when `--container-6xl` exists in `@theme`. **Do not** use `max-w-3xl` unless `--container-3xl` is declared in `@theme` — with only a spacing scale, Tailwind maps `max-w-3xl` to ~5rem and the FAQ collapses to one word per line. See `references/shared/STYLING.md` § "Prose / reading width".
183
+ **Layout width:** Center the page column with `container-reading` (from designer `global.css`) or `max-w-6xl mx-auto px-6` when `--container-6xl` exists in `@theme`. **Do not** use `max-w-3xl` unless `--container-3xl` is declared in `@theme` — with only a spacing scale, Tailwind maps `max-w-3xl` to ~5rem and the FAQ collapses to one word per line. See `references/shared/STYLING.md` § "Prose / reading width".
184
184
 
185
185
  ```astro
186
186
  ---
@@ -195,7 +195,7 @@ const categories = [...grouped.entries()].map(([name, items]) => ({ name, items
195
195
 
196
196
  <Layout title="FAQ">
197
197
  <main>
198
- <div class="container-reading px-lg">
198
+ <div class="container-reading px-6">
199
199
  <h1>Frequently Asked Questions</h1>
200
200
  <p>Find answers to common questions below, or use the search to find what you need.</p>
201
201
 
@@ -102,8 +102,8 @@ All page scopes share common inputs and rules. Scope-specific details follow.
102
102
  </section>
103
103
  ```
104
104
  8. **Comments in frontmatter.** Use `//` or `/* */` — never HTML `<!-- -->` comments in `.astro` frontmatter (it's TypeScript, not HTML). HTML comments in the template section are fine.
105
- 9. **Responsive.** All pages must work at mobile (320px), tablet (768px), and desktop (1024px+). Use Tailwind responsive prefixes (`md:`, `lg:`) and the spacing scale from `@theme`.
106
- 10. **Use Tailwind utility classes in templates.** For layout, spacing, typography, and responsive design — use utility classes directly in the markup. Contract classes are still required for components referenced by Phase 3/4 agents. Mix both: `<div class="product-grid grid grid-cols-1 md:grid-cols-3 gap-lg">`. Always use brand `@theme` tokens (e.g., `bg-bark`, `text-cream`) — never default Tailwind colors.
105
+ 9. **Responsive.** All pages must work at mobile (320px), tablet (768px), and desktop (1024px+). Use Tailwind responsive prefixes (`md:`, `lg:`) and Tailwind's numeric spacing scale (`gap-4`, `py-24`, …).
106
+ 10. **Use Tailwind utility classes in templates.** For layout, spacing, typography, and responsive design — use utility classes directly in the markup. Contract classes are still required for components referenced by Phase 3/4 agents. Mix both: `<div class="product-grid grid grid-cols-1 md:grid-cols-3 gap-6">`. Always use brand `@theme` tokens (e.g., `bg-bark`, `text-cream`) — never default Tailwind colors.
107
107
  11. **No duplicate files.** If two scopes list the same file (rare), the scope whose prompt explicitly names it as "owned" takes precedence. If unclear, write it and note the overlap in your return.
108
108
  12. **Do NOT write to `src/styles/components-<pack>.css` or `src/styles/global.css`** — `components-<pack>.css` is pre-copied from the skill template by the orchestrator (build-wave pre-batch); `global.css` is owned by the Composer. Writing to either causes double-write conflicts.
109
109
 
@@ -317,7 +317,7 @@ The JSON block MUST be the **last** content in your message — the parent parse
317
317
  | Author a `.tsx` React island in a page scope | Phase 3 Components writes the islands; the route only **mounts** them (`client:load`) |
318
318
  | Ship hardcoded data arrays as the final page | Query live SDK data in frontmatter (per the vertical reference) and bind it; hardcoded shapes are only a fallback for empty queries |
319
319
  | Write `global.css` or `@theme` tokens | The Composer owns `global.css`; you consume the published token contract |
320
- | Invent global semantic classes for layout/spacing/typography (`.featured-section`, `.page-header`) | Use Tailwind utilities derived from `@theme` tokens at the call site (`<section class="py-4xl">`); see `../../shared/STYLING.md` |
320
+ | Invent global semantic classes for layout/spacing/typography (`.featured-section`, `.page-header`) | Use Tailwind utilities derived from `@theme` tokens at the call site (`<section class="py-24">`); see `../../shared/STYLING.md` |
321
321
  | Override `global.css` rules from page `<style>` blocks | Pages can add co-located styles for one-off decoration; never override Composer-owned global classes |
322
322
  | HTML `<!-- comment -->` in `.astro` frontmatter | Use `//` or `/* */` — frontmatter is TypeScript |
323
323
  | Use external placeholder image services (picsum, unsplash) | Use colored `<div>` placeholders with `data-decorative-slot` — the orchestrator injects Image Phase 1 URLs later |
@@ -22,7 +22,7 @@ Files this agent MUST NOT touch:
22
22
 
23
23
  Read the design tokens from `.wix/design-tokens.css` (on disk, gate-verified present before the wave).
24
24
 
25
- For layout/spacing/typography, compose Tailwind utilities derived from `@theme` tokens at the call site (`<div class="grid grid-cols-1 md:grid-cols-[1fr_22rem] gap-2xl">`). For published global semantic classes (`cart-summary`, `cart-total`, `checkout-btn`, `cart-empty` — the compound + interactive-state patterns), use the ACTUAL class name verbatim. Row-internal class names (`cart-item-qty`, `qty-btn`, etc.) come from the template — keep them as-is and live in `components-ecom.css`. See `references/shared/STYLING.md` and `references/shared/IMPLEMENTER.md` § "Styling: tokens-first, classes as exception".
25
+ For layout/spacing/typography, compose Tailwind utilities derived from `@theme` tokens at the call site (`<div class="grid grid-cols-1 md:grid-cols-[1fr_22rem] gap-12">`). For published global semantic classes (`cart-summary`, `cart-total`, `checkout-btn`, `cart-empty` — the compound + interactive-state patterns), use the ACTUAL class name verbatim. Row-internal class names (`cart-item-qty`, `qty-btn`, etc.) come from the template — keep them as-is and live in `components-ecom.css`. See `references/shared/STYLING.md` and `references/shared/IMPLEMENTER.md` § "Styling: tokens-first, classes as exception".
26
26
 
27
27
  ## Template files
28
28
 
@@ -61,7 +61,7 @@ Full cart display with two-column layout, quantity editing, remove, unavailable
61
61
  Class names used (template provides them — do not invent):
62
62
  - **Global semantic classes** (in `global.css`, designer-owned): `cart-summary`, `cart-total`, `checkout-btn`, `cart-empty` — compound patterns + interactive states
63
63
  - **Row-internal classes** (in `components-ecom.css`, written by this scope): `cart-item-qty`, `qty-btn`, `qty-value`, `cart-item-unavailable`, `cart-item-actions`, `cart-item-prices`, `cart-item-full-price`, `cart-item-unit-price`, `cart-item-line-total`, `cart-item-remove`, `cart-item-image-link`, `cart-item-name-link`, `cart-discount`, `cart-discount-name`, `cart-discount-amount`, `cart-applied-discounts`, `cart-applied-discounts-name`, `cart-item-option`, `cart-item-modifiers`
64
- - **Layout/spacing in markup as utilities**: `cart-grid` → `<div class="grid grid-cols-1 md:grid-cols-[1fr_22rem] gap-2xl md:gap-3xl md:items-start">`; `cart-items` → `<div class="flex flex-col gap-lg">`; `cart-item` → `<div class="flex gap-lg pb-lg border-b border-rule last:border-0">`; `cart-subtotal` → `<div class="flex justify-between items-baseline">`; `cart-item-image` → utilities; `cart-item-info` → utilities; `cart-item-name` → `class="font-display text-lg leading-tight"`
64
+ - **Layout/spacing in markup as utilities**: `cart-grid` → `<div class="grid grid-cols-1 md:grid-cols-[1fr_22rem] gap-12 md:gap-16 md:items-start">`; `cart-items` → `<div class="flex flex-col gap-6">`; `cart-item` → `<div class="flex gap-6 pb-6 border-b border-rule last:border-0">`; `cart-subtotal` → `<div class="flex justify-between items-baseline">`; `cart-item-image` → utilities; `cart-item-info` → utilities; `cart-item-name` → `class="font-display text-lg leading-tight"`
65
65
 
66
66
  ### 2. `src/components/CartBadge.tsx`
67
67
 
@@ -23,7 +23,7 @@ You only need:
23
23
  2. **`<SKILL_ROOT>/references/shared/STYLING.md`** — the styling-contract conventions (how to use `@apply`, the `@theme` token utilities, the no-default-Tailwind-colors rule, and the global-vs-scoped CSS ownership boundary).
24
24
  3. **`<SKILL_ROOT>/references/shared/RETURN_CONTRACT.md`** — the return JSON shape.
25
25
  4. **`src/styles/global.css`** in the project — read to audit for ecom-class leaks (see § "Global-CSS leak audit" below).
26
- 5. **Design tokens (on disk)** — read the design tokens (the DESIGN.md vocabulary — `colors`/`typography`/`spacing`/`rounded`/`containers`) from `.wix/design-tokens.css` (gate-verified present before the wave). They are NOT inlined in your prompt.
26
+ 5. **Design tokens (on disk)** — read the design tokens (the DESIGN.md vocabulary — `colors`/`typography`/`rounded`/`containers`; spacing is Tailwind's numeric scale, not a token) from `.wix/design-tokens.css` (gate-verified present before the wave). They are NOT inlined in your prompt.
27
27
 
28
28
  You do NOT need to read `INSTRUCTIONS.md`, `CART_WIRING.md`, the TSX templates, the `discounts.ts` util, or any other reference. Skipping those reads is the point of the split.
29
29
 
@@ -35,7 +35,7 @@ You do NOT need to read `INSTRUCTIONS.md`, `CART_WIRING.md`, the TSX templates,
35
35
  <SKILL_ROOT>/references/astro/templates/ecom/components-ecom.css
36
36
  ```
37
37
 
38
- This is the canonical scoped CSS for the ecom pack. Adapt sizing/spacing to the brand's aesthetic — use the design tokens from your prompt (`--color-bark`, `--color-cream`, `--spacing-md`, `--font-display`, etc.). **Do not rename the class names or state modifiers** — they must match the contract keys the TSX components reference.
38
+ This is the canonical scoped CSS for the ecom pack. Adapt sizing/spacing to the brand's aesthetic — use the design tokens from your prompt (`--color-bark`, `--color-cream`, `--radius-md`, `--font-display`, etc.); spacing uses Tailwind's numeric scale (`gap-4`, `py-24`), not a token. **Do not rename the class names or state modifiers** — they must match the contract keys the TSX components reference.
39
39
 
40
40
  ### 2. The two `@reference` directives are mandatory
41
41
 
@@ -46,7 +46,7 @@ The first two non-comment lines of `components-ecom.css` MUST be:
46
46
  @reference "./global.css";
47
47
  ```
48
48
 
49
- Without these, Tailwind v4 fails the build with `"Cannot apply unknown utility class"` on any `@apply` rule that uses a utility like `size-6` or `gap-md`. The template ships them; do not remove.
49
+ Without these, Tailwind v4 fails the build with `"Cannot apply unknown utility class"` on any `@apply` rule that uses a utility like `size-6` or `gap-4`. The template ships them; do not remove.
50
50
 
51
51
  ### 3. Class ownership
52
52
 
@@ -18,7 +18,7 @@ Files this agent MUST NOT touch:
18
18
 
19
19
  ## Coordination: design tokens
20
20
 
21
- Read the design tokens from `.wix/design-tokens.css` (on disk, gate-verified present before the wave). Reference token CSS variables (`var(--color-cream)`, `var(--spacing-lg)`, etc.) from `components-gift-cards.css`.
21
+ Read the design tokens from `.wix/design-tokens.css` (on disk, gate-verified present before the wave). Reference token CSS variables (`var(--color-cream)`, `1.5rem`, etc.) from `components-gift-cards.css`.
22
22
 
23
23
  ## Critical rules
24
24
 
@@ -81,7 +81,7 @@ Scoped styles for:
81
81
 
82
82
  The page-section and teaser styles live here (not inside the .astro `<style>` blocks) so the same separation as `components-stores.css` / `components-ecom.css` holds. The pages-scope agent imports this stylesheet via `Layout.astro`'s existing CSS chain (designer foundation already wires up the `components-*.css` import).
83
83
 
84
- Use brand `@theme` utilities (`bg-cream`, `text-ink`, etc.) where natural; fall back to `var(--color-*)` / `var(--spacing-*)` directly when a property isn't covered. Do not introduce new design-token names.
84
+ Use brand `@theme` utilities (`bg-cream`, `text-ink`, etc.) where natural; fall back to `var(--color-*)` directly (spacing is Tailwind's numeric scale — `gap-4`, `py-24`) when a property isn't covered. Do not introduce new design-token names.
85
85
 
86
86
  ## Return format
87
87
 
@@ -77,11 +77,11 @@ The `components-stores.css` template already covers options/quantity/modifiers/s
77
77
  ```css
78
78
  /* --- Back-in-stock subscribe form (BackInStockForm.tsx) --- */
79
79
  .back-in-stock-form {
80
- @apply flex flex-col gap-md mt-md p-lg border border-rule rounded;
80
+ @apply flex flex-col gap-4 mt-4 p-6 border border-rule rounded;
81
81
  background-color: var(--color-cream);
82
82
  }
83
83
  .back-in-stock-headline {
84
- @apply flex flex-col gap-sm;
84
+ @apply flex flex-col gap-3;
85
85
  }
86
86
  .back-in-stock-eyebrow {
87
87
  @apply font-heading text-xs uppercase tracking-wider text-bark/70;
@@ -94,10 +94,10 @@ The `components-stores.css` template already covers options/quantity/modifiers/s
94
94
  @apply font-heading text-xs uppercase tracking-wider text-bark/70;
95
95
  }
96
96
  .back-in-stock-row {
97
- @apply flex flex-row flex-wrap gap-sm;
97
+ @apply flex flex-row flex-wrap gap-3;
98
98
  }
99
99
  .back-in-stock-input {
100
- @apply flex-1 px-md py-sm font-body text-sm border border-rule rounded bg-parchment text-ink;
100
+ @apply flex-1 px-4 py-3 font-body text-sm border border-rule rounded bg-parchment text-ink;
101
101
  min-width: 0;
102
102
  transition: border-color 0.15s ease;
103
103
  }
@@ -108,7 +108,7 @@ The `components-stores.css` template already covers options/quantity/modifiers/s
108
108
  @apply border-rust;
109
109
  }
110
110
  .back-in-stock-submit {
111
- @apply px-lg py-sm font-heading text-xs uppercase tracking-wider bg-bark text-cream rounded cursor-pointer transition-colors;
111
+ @apply px-6 py-3 font-heading text-xs uppercase tracking-wider bg-bark text-cream rounded cursor-pointer transition-colors;
112
112
  border: 1px solid var(--color-bark);
113
113
  }
114
114
  .back-in-stock-submit:hover:not(:disabled) {
@@ -121,7 +121,7 @@ The `components-stores.css` template already covers options/quantity/modifiers/s
121
121
  @apply font-body text-sm text-rust;
122
122
  }
123
123
  .back-in-stock-success {
124
- @apply mt-md p-lg border border-rule rounded;
124
+ @apply mt-4 p-6 border border-rule rounded;
125
125
  background-color: var(--color-cream);
126
126
  }
127
127
  .back-in-stock-success-headline {
@@ -134,7 +134,7 @@ The `components-stores.css` template already covers options/quantity/modifiers/s
134
134
  margin: 0;
135
135
  }
136
136
  .stock-status.back-in-stock-alt {
137
- @apply mt-sm font-body text-sm italic text-bark/70;
137
+ @apply mt-3 font-body text-sm italic text-bark/70;
138
138
  }
139
139
  ```
140
140
 
@@ -23,7 +23,7 @@ You only need:
23
23
  2. **`<SKILL_ROOT>/references/shared/STYLING.md`** — the styling-contract conventions (how to use `@apply`, the `@theme` token utilities, the no-default-Tailwind-colors rule, and the global-vs-scoped CSS ownership boundary).
24
24
  3. **`<SKILL_ROOT>/references/shared/RETURN_CONTRACT.md`** — the return JSON shape.
25
25
  4. **`src/styles/global.css`** in the project — read to audit for stores-class leaks (see § "Global-CSS leak audit" below).
26
- 5. **Design tokens (on disk)** — read the design tokens (the DESIGN.md vocabulary — `colors`/`typography`/`spacing`/`rounded`/`containers`) from `.wix/design-tokens.css` (gate-verified present before the wave). They are NOT inlined in your prompt.
26
+ 5. **Design tokens (on disk)** — read the design tokens (the DESIGN.md vocabulary — `colors`/`typography`/`rounded`/`containers`; spacing is Tailwind's numeric scale, not a token) from `.wix/design-tokens.css` (gate-verified present before the wave). They are NOT inlined in your prompt.
27
27
 
28
28
  You do NOT need to read `INSTRUCTIONS.md`, `SHARED_WIRING.md`, `BACK_IN_STOCK.md`, the TSX templates, the back-in-stock util, or any other reference. Skipping those reads is the point of the split — they would consume tokens for context this scope doesn't use.
29
29
 
@@ -35,7 +35,7 @@ You do NOT need to read `INSTRUCTIONS.md`, `SHARED_WIRING.md`, `BACK_IN_STOCK.md
35
35
  <SKILL_ROOT>/references/astro/templates/stores/components-stores.css
36
36
  ```
37
37
 
38
- This is the canonical scoped CSS for the stores pack. Adapt sizing/spacing to the brand's aesthetic — use the design tokens from your prompt (`--color-bark`, `--color-cream`, `--spacing-md`, `--font-display`, etc.). **Do not rename the class names or state modifiers** — they must match the contract keys the TSX components reference.
38
+ This is the canonical scoped CSS for the stores pack. Adapt sizing/spacing to the brand's aesthetic — use the design tokens from your prompt (`--color-bark`, `--color-cream`, `--radius-md`, `--font-display`, etc.); spacing uses Tailwind's numeric scale (`gap-4`, `py-24`), not a token. **Do not rename the class names or state modifiers** — they must match the contract keys the TSX components reference.
39
39
 
40
40
  ### 2. Use `@apply` with brand `@theme` utilities
41
41
 
@@ -49,8 +49,8 @@ Do **NOT** use default Tailwind colors (`bg-green-50`, `text-red-600`). The bran
49
49
 
50
50
  Classes you own (define rules in `components-stores.css`):
51
51
 
52
- - **`.product-card`, `.product-card-media`, `.product-card-ribbon`, `.product-card-index`** — the product card itself, including the `overflow: hidden` + `border-radius` clipping context. Whoever writes the `border-radius` here also writes any inner padding required to keep child content inside the rounded edges. Without inner padding, a price `<p>` sits flush against the rounded bottom corner and descenders get clipped. Add `padding-bottom: var(--spacing-md)` on the card plus horizontal padding on each text block when you set the radius.
53
- - **`.product-grid`** — the layout that lists product cards. Both `/products` (pages-products scope) and `/category/[slug]` (pages-categories scope) consume it from one place. Include `display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--spacing-xl);` plus the View-Transitions opacity fade for in-flight navigations.
52
+ - **`.product-card`, `.product-card-media`, `.product-card-ribbon`, `.product-card-index`** — the product card itself, including the `overflow: hidden` + `border-radius` clipping context. Whoever writes the `border-radius` here also writes any inner padding required to keep child content inside the rounded edges. Without inner padding, a price `<p>` sits flush against the rounded bottom corner and descenders get clipped. Add `padding-bottom: 1rem` on the card plus horizontal padding on each text block when you set the radius.
53
+ - **`.product-grid`** — the layout that lists product cards. Both `/products` (pages-products scope) and `/category/[slug]` (pages-categories scope) consume it from one place. Include `display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 2rem;` plus the View-Transitions opacity fade for in-flight navigations.
54
54
  - **`.offer-callout` family (`.offer-callout`, `-item`, `-badge`, `-name`, `-detail`, `-foot`)** — discount panel rendered above `<ProductPurchase>` on `/products/[slug]`.
55
55
  - **Option-selector contract classes** — `option-group`, `option-label`, `option-choices`, `option-pill` (with `.selected` state modifier).
56
56
  - **Quantity-stepper contract classes** — `quantity-selector`, `quantity-btn`, `quantity-value`.
@@ -21,7 +21,7 @@ Files this agent MUST NOT touch:
21
21
  ## Inputs (from parent prompt)
22
22
 
23
23
  - **Phase 1 return data** — `products: [{id, name, slug, variantId, price, inventory, sku}]` — use slugs when needed (rarely; `queryProducts` returns them already).
24
- - **Design tokens** — read the design tokens (the DESIGN.md vocabulary) from `.wix/design-tokens.css` (on disk) for the published color/spacing/typography vocabulary; compose Tailwind utilities derived from those tokens (`class="py-4xl flex flex-col gap-md font-display"`) at the call site rather than inventing semantic classes for layout/spacing/typography. Retained global semantic classes are limited to compound patterns (`offer-callout`, `cart-summary`), interactive primitives (`btn-primary`, `product-card`), and JS targets — see `references/shared/STYLING.md`.
24
+ - **Design tokens** — read the design tokens (the DESIGN.md vocabulary) from `.wix/design-tokens.css` (on disk) for the published color/spacing/typography vocabulary; compose Tailwind utilities derived from those tokens (`class="py-24 flex flex-col gap-4 font-display"`) at the call site rather than inventing semantic classes for layout/spacing/typography. Retained global semantic classes are limited to compound patterns (`offer-callout`, `cart-summary`), interactive primitives (`btn-primary`, `product-card`), and JS targets — see `references/shared/STYLING.md`.
25
25
  - **Designer visual spec** — the layout, contract classes, and decorative-slot conventions for `products/index.astro`, `products/[slug].astro`, `ProductCard.astro` (from `references/astro/designer/INSTRUCTIONS.md` → `store-pages`), applied in the same pass as the live queries.
26
26
 
27
27
  ## Critical rules (all must be honored)
@@ -33,7 +33,7 @@ Files this agent MUST NOT touch:
33
33
  5. **Mount `ProductPurchase` with `client:load` and a single `product` prop, plus the back-in-stock probe + price props.** `<ProductPurchase client:load product={product} inventoryByVariant={inventoryByVariant} backInStockEnabled={backInStockEnabled} priceAmount={priceAmount} />`. The component destructures internally; passing flat props (`productId={product._id}`, `options={product.options}`, …) silently renders nothing because the new contract expects `product`. The `backInStockEnabled` boolean comes from `await getBackInStockEnabled()` (template imports it from `../../utils/back-in-stock`); `priceAmount` is the numeric price already computed in the frontmatter. See `BACK_IN_STOCK.md` for why both are needed.
34
34
  6. **SSR only — do NOT add `export const prerender = true` or `getStaticPaths()`.** The productsV3 SDK depends on request-context auth (tenant resolution, site headers). At prerender time there is no request, and `.queryProducts().limit()` short-circuits to `"is not a function"`. Keep `[slug].astro` server-rendered with `Astro.params.slug`.
35
35
  7. **No HTML comments in `.astro` frontmatter.** Build fails with "Legacy HTML single-line comments are not allowed".
36
- 8. **Default to tokens-as-utilities for layout/spacing/typography.** When you need a section padding, a flex column, a typographic treatment — write Tailwind utilities derived from `@theme` tokens (`<section class="py-4xl flex flex-col gap-md">`, `<h1 class="font-display text-4xl">`). Do NOT invent semantic classes like `.featured-section`, `.page-header`, `.products-header-image` — Tailwind v4 silently drops undeclared classes. Use a global semantic class only when one is published in designer `INSTRUCTIONS.md`'s always-required list (`product-card`, `product-card-ribbon`, `offer-callout` family). For one-off page decoration, write a co-located `<style>` block at the bottom of the same `.astro` file using `var(--color-foo)` token references.
36
+ 8. **Default to tokens-as-utilities for layout/spacing/typography.** When you need a section padding, a flex column, a typographic treatment — write Tailwind utilities derived from `@theme` tokens (`<section class="py-24 flex flex-col gap-4">`, `<h1 class="font-display text-4xl">`). Do NOT invent semantic classes like `.featured-section`, `.page-header`, `.products-header-image` — Tailwind v4 silently drops undeclared classes. Use a global semantic class only when one is published in designer `INSTRUCTIONS.md`'s always-required list (`product-card`, `product-card-ribbon`, `offer-callout` family). For one-off page decoration, write a co-located `<style>` block at the bottom of the same `.astro` file using `var(--color-foo)` token references.
37
37
  9. **Preserve designer classes.** When the designer used a published global semantic class on existing markup, keep it; don't rename. Add Tailwind utilities alongside if you need additional layout adjustment.
38
38
 
39
39
  ## Wix Site Structure — `wixMetadata` + `@wix/astro-pages`
@@ -10,18 +10,18 @@
10
10
  const year = new Date().getFullYear();
11
11
  ---
12
12
  <footer class="site-footer" transition:persist="site-footer">
13
- <div class="max-w-6xl mx-auto px-lg py-3xl flex flex-col md:flex-row md:items-start md:justify-between gap-xl">
14
- <div class="flex flex-col gap-sm max-w-prose">
13
+ <div class="max-w-6xl mx-auto px-6 py-16 flex flex-col md:flex-row md:items-start md:justify-between gap-8">
14
+ <div class="flex flex-col gap-3 max-w-prose">
15
15
  <span class="font-display text-lg text-ink">{{brand.name}}</span>
16
16
  <p class="text-sm">{{shell.footerTagline}}</p>
17
17
  </div>
18
18
  <nav>
19
- <ul class="flex flex-col gap-sm text-sm">
19
+ <ul class="flex flex-col gap-3 text-sm">
20
20
  {{nav.links}}
21
21
  </ul>
22
22
  </nav>
23
23
  </div>
24
- <div class="max-w-6xl mx-auto px-lg pb-xl text-xs">
24
+ <div class="max-w-6xl mx-auto px-6 pb-8 text-xs">
25
25
  <p>© {year} {{brand.name}}. All rights reserved.</p>
26
26
  </div>
27
27
  </footer>
@@ -9,7 +9,7 @@
9
9
  // the empty <div class="nav-actions"> mount, the mobile hamburger toggle.
10
10
  ---
11
11
  <header class="site-nav" transition:persist="site-nav">
12
- <nav class="max-w-6xl mx-auto px-lg flex items-center justify-between gap-lg py-md">
12
+ <nav class="max-w-6xl mx-auto px-6 flex items-center justify-between gap-6 py-4">
13
13
  <a href="/" class="font-display text-lg tracking-tight">{{shell.navBrandMark}}</a>
14
14
 
15
15
  <input type="checkbox" id="nav-toggle" class="peer hidden" aria-hidden="true" />
@@ -25,10 +25,10 @@
25
25
 
26
26
  <div
27
27
  class="hidden peer-checked:flex md:flex absolute md:static top-full left-0 right-0 md:right-auto
28
- flex-col md:flex-row gap-md md:gap-lg items-start md:items-center
29
- bg-paper md:bg-transparent border-b md:border-0 border-rule px-lg md:px-0 py-md md:py-0"
28
+ flex-col md:flex-row gap-4 md:gap-6 items-start md:items-center
29
+ bg-paper md:bg-transparent border-b md:border-0 border-rule px-6 md:px-0 py-4 md:py-0"
30
30
  >
31
- <ul class="flex flex-col md:flex-row gap-md md:gap-lg items-start md:items-center">
31
+ <ul class="flex flex-col md:flex-row gap-4 md:gap-6 items-start md:items-center">
32
32
  {{nav.links}}
33
33
  <!-- nav:links -->
34
34
  </ul>