@wix/agent-skills 1.13.0 → 1.15.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 +4 -1
- package/package.json +1 -1
- package/skills/README.md +23 -0
- package/skills/wix-app/SKILL.md +10 -2
- package/skills/wix-app/references/AUTO_PATTERNS_DASHBOARD.md +326 -0
- package/skills/wix-app/references/CODE_QUALITY.md +1 -0
- package/skills/wix-app/references/CUSTOM_ELEMENT_WIDGET.md +124 -115
- package/skills/wix-app/references/DASHBOARD_PAGE.md +3 -0
- package/skills/wix-app/references/EDITOR_REACT_COMPONENT.md +23 -9
- package/skills/wix-app/references/SITE_PLUGIN.md +1 -1
- package/skills/wix-app/references/auto-patterns-dashboard/action-cell.md +115 -0
- package/skills/wix-app/references/auto-patterns-dashboard/app-config-structure.md +264 -0
- package/skills/wix-app/references/auto-patterns-dashboard/app-context.md +37 -0
- package/skills/wix-app/references/auto-patterns-dashboard/bulk-actions.md +86 -0
- package/skills/wix-app/references/auto-patterns-dashboard/collection-page-actions.md +119 -0
- package/skills/wix-app/references/auto-patterns-dashboard/collection-page.md +103 -0
- package/skills/wix-app/references/auto-patterns-dashboard/custom-actions-override.md +76 -0
- package/skills/wix-app/references/auto-patterns-dashboard/custom-columns-override.md +82 -0
- package/skills/wix-app/references/auto-patterns-dashboard/custom-components-override.md +89 -0
- package/skills/wix-app/references/auto-patterns-dashboard/custom-header-override.md +124 -0
- package/skills/wix-app/references/auto-patterns-dashboard/custom-sections-override.md +91 -0
- package/skills/wix-app/references/auto-patterns-dashboard/custom-slots-override.md +71 -0
- package/skills/wix-app/references/auto-patterns-dashboard/entity-page-actions.md +70 -0
- package/skills/wix-app/references/auto-patterns-dashboard/entity-page-view-actions.md +73 -0
- package/skills/wix-app/references/auto-patterns-dashboard/entity-page.md +98 -0
- package/skills/wix-app/references/auto-patterns-dashboard/example-patterns.json +278 -0
- package/skills/wix-app/references/auto-patterns-dashboard/pages-configuration.md +94 -0
- package/skills/wix-app/references/auto-patterns-dashboard/resolved-action.md +43 -0
- package/skills/wix-app/references/auto-patterns-dashboard/sdk-utilities.md +66 -0
- package/skills/wix-app/references/auto-patterns-dashboard/views.md +76 -0
- package/skills/wix-app/references/editor-react-component/ACCESSIBILITY.md +1 -14
- package/skills/wix-app/references/editor-react-component/COMPONENT-API.md +54 -29
- package/skills/wix-app/references/editor-react-component/COMPONENT-CONFIGURATION.md +2 -2
- package/skills/wix-app/references/editor-react-component/CSS-GUIDELINES.md +17 -105
- package/skills/wix-app/references/editor-react-component/DESIGN-STATES.md +127 -0
- package/skills/wix-app/references/editor-react-component/PARTS.md +2 -1
- package/skills/wix-app/references/editor-react-component/REACT-GUIDELINES.md +15 -15
- package/skills/wix-app/references/editor-react-component/REACT-PATTERNS.md +25 -53
- package/skills/wix-app/scripts/generate-auto-patterns.js +510 -0
- package/skills/wix-auth/SKILL.md +12 -0
- package/skills/wix-auth/references/device-flow.md +140 -0
- package/skills/wix-docs/SKILL.md +188 -0
- package/skills/wix-docs/references/API_SPEC_SEARCH.md +213 -0
- package/skills/wix-docs/references/EXTRACTING.md +120 -0
- package/skills/wix-headless/SKILL.md +84 -130
- package/skills/wix-headless/entry/bootstrap.mjs +93 -0
- package/skills/wix-headless/entry/skill.md +78 -0
- package/skills/wix-headless/references/AI_FEATURES.md +178 -0
- package/skills/wix-headless/references/CAPABILITIES.md +84 -0
- package/skills/wix-headless/references/DISCOVERY.md +34 -56
- package/skills/wix-headless/references/DOC_DISCOVERY.md +37 -0
- package/skills/wix-headless/references/FEEDBACK.md +118 -0
- package/skills/wix-headless/references/IMAGE_GENERATION.md +69 -0
- package/skills/wix-headless/references/SDK_HANDOFF.md +97 -0
- package/skills/wix-headless/references/SEED.md +44 -188
- package/skills/wix-headless/references/SETUP.md +32 -103
- package/skills/wix-headless/references/astro.md +98 -0
- package/skills/wix-headless/references/inline-recipes/how-to-code-a-blog.md +196 -0
- package/skills/wix-headless/references/inline-recipes/how-to-code-a-store.md +236 -0
- package/skills/wix-headless/references/inline-recipes/how-to-code-bookings.md +279 -0
- package/skills/wix-headless/references/inline-recipes/how-to-code-cms.md +163 -0
- package/skills/wix-headless/references/inline-recipes/how-to-code-events.md +203 -0
- package/skills/wix-headless/references/inline-recipes/how-to-code-forms.md +222 -0
- package/skills/wix-headless/references/inline-recipes/how-to-code-members-astro.md +124 -0
- package/skills/wix-headless/references/inline-recipes/how-to-code-members-custom-login.md +160 -0
- package/skills/wix-headless/references/inline-recipes/how-to-code-members-non-astro.md +118 -0
- package/skills/wix-headless/references/inline-recipes/how-to-code-portfolio.md +132 -0
- package/skills/wix-headless/references/inline-recipes/how-to-code-pricing-plans.md +124 -0
- package/skills/wix-headless/references/inline-recipes/how-to-code-restaurant-orders.md +188 -0
- package/skills/wix-headless/references/inline-recipes/how-to-code-restaurant-reservations.md +173 -0
- package/skills/wix-headless/references/inline-recipes/how-to-code-restaurants.md +161 -0
- package/skills/wix-headless/references/inline-recipes/setup-blog.md +175 -0
- package/skills/wix-headless/references/inline-recipes/setup-bookings.md +228 -0
- package/skills/wix-headless/references/inline-recipes/setup-cms.md +200 -0
- package/skills/wix-headless/references/inline-recipes/setup-events.md +196 -0
- package/skills/wix-headless/references/inline-recipes/setup-forms.md +174 -0
- package/skills/wix-headless/references/inline-recipes/setup-online-store.md +176 -0
- package/skills/wix-headless/references/inline-recipes/setup-portfolio.md +153 -0
- package/skills/wix-headless/references/inline-recipes/setup-pricing-plans.md +229 -0
- package/skills/wix-headless/references/inline-recipes/setup-restaurant-orders.md +161 -0
- package/skills/wix-headless/references/inline-recipes/setup-restaurant-reservations.md +117 -0
- package/skills/wix-headless/references/inline-recipes/setup-restaurants.md +152 -0
- package/skills/wix-headless/references/managed/AUTHENTICATION.md +57 -0
- package/skills/wix-headless/references/managed/CONNECT.md +74 -0
- package/skills/wix-headless/references/managed/CREATE.md +130 -0
- package/skills/wix-headless/references/managed/DEPLOYMENT.md +57 -0
- package/skills/wix-headless/references/non-astro.md +59 -0
- package/skills/wix-headless/references/self-managed/AUTHENTICATION.md +22 -0
- package/skills/wix-headless/references/self-managed/DEPLOYMENT.md +7 -0
- package/skills/wix-headless/references/stripe/AUTHENTICATION.md +55 -0
- package/skills/wix-headless/references/stripe/DEPLOYMENT.md +63 -0
- package/skills/wix-manage/SKILL.md +24 -1
- package/skills/wix-manage/references/analytics/query-site-analytics.md +241 -0
- package/skills/wix-manage/references/bookings/create-and-update-booking-services.md +1 -1
- package/skills/wix-manage/references/bookings/diagnose-availability-issues.md +265 -0
- package/skills/wix-manage/references/marketing/create-and-publish-social-post.md +436 -0
- package/skills/wix-manage/references/marketing/generate-and-publish-marketing-plan.md +209 -0
- package/skills/wix-manage/references/rich-content/author-ricos-rich-content.md +249 -0
- package/skills/wix-manage/references/stores/create-product-with-options-catalog-v3.md +51 -0
- package/skills/wix-vibe-headless/SKILL.md +136 -0
- package/skills/wix-vibe-headless/references/blog/INSTRUCTIONS.md +128 -0
- package/skills/wix-vibe-headless/references/blog/wix-blog.js +217 -0
- package/skills/wix-vibe-headless/references/bookings/INSTRUCTIONS.md +153 -0
- package/skills/wix-vibe-headless/references/bookings/wix-bookings-checkout.js +147 -0
- package/skills/wix-vibe-headless/references/bookings/wix-bookings-services.js +215 -0
- package/skills/wix-vibe-headless/references/cms/INSTRUCTIONS.md +154 -0
- package/skills/wix-vibe-headless/references/cms/wix-cms.js +186 -0
- package/skills/wix-vibe-headless/references/events/INSTRUCTIONS.md +142 -0
- package/skills/wix-vibe-headless/references/events/wix-events-browse.js +135 -0
- package/skills/wix-vibe-headless/references/events/wix-events-registration.js +187 -0
- package/skills/wix-vibe-headless/references/members/INSTRUCTIONS.md +211 -0
- package/skills/wix-vibe-headless/references/members/wix-members-auth.js +387 -0
- package/skills/wix-vibe-headless/references/portfolio/INSTRUCTIONS.md +111 -0
- package/skills/wix-vibe-headless/references/portfolio/wix-portfolio.js +194 -0
- package/skills/wix-vibe-headless/references/pricing-plans/INSTRUCTIONS.md +127 -0
- package/skills/wix-vibe-headless/references/pricing-plans/wix-pricing-plans.js +157 -0
- package/skills/wix-vibe-headless/references/restaurants/INSTRUCTIONS.md +138 -0
- package/skills/wix-vibe-headless/references/restaurants/wix-restaurants-menu.js +224 -0
- package/skills/wix-vibe-headless/references/restaurants/wix-restaurants-ordering.js +156 -0
- package/skills/wix-vibe-headless/references/restaurants/wix-restaurants-reservations.js +107 -0
- package/skills/wix-vibe-headless/references/shared/wix-client.js +186 -0
- package/skills/wix-vibe-headless/references/storefront/INSTRUCTIONS.md +155 -0
- package/skills/wix-vibe-headless/references/storefront/wix-store-cart.js +147 -0
- package/skills/wix-vibe-headless/references/storefront/wix-store-catalog.js +142 -0
- package/skills/wix-headless/references/BUILD-astro.md +0 -244
- package/skills/wix-headless/references/BUILD-own-build.md +0 -167
- package/skills/wix-headless/references/BUILD.md +0 -105
- package/skills/wix-headless/references/DESIGN_SYSTEM.md +0 -165
- package/skills/wix-headless/references/DISCOVERY-connect.md +0 -55
- package/skills/wix-headless/references/DISCOVERY-create.md +0 -238
- package/skills/wix-headless/references/PLAN-connect.md +0 -19
- package/skills/wix-headless/references/PLAN-create.md +0 -17
- package/skills/wix-headless/references/PLAN.md +0 -92
- package/skills/wix-headless/references/astro/blog/BLOG_PAGES.md +0 -300
- package/skills/wix-headless/references/astro/blog/BLOG_SETUP.md +0 -218
- package/skills/wix-headless/references/astro/bookings/COMPONENTS.md +0 -45
- package/skills/wix-headless/references/astro/bookings/SERVICES_PAGES.md +0 -77
- package/skills/wix-headless/references/astro/cms/CMS_FOUNDATIONS.md +0 -214
- package/skills/wix-headless/references/astro/cms/FAQ_KNOWLEDGE_BASE.md +0 -231
- package/skills/wix-headless/references/astro/cms/PORTFOLIO.md +0 -453
- package/skills/wix-headless/references/astro/cms/RESOURCE_LIBRARY.md +0 -354
- package/skills/wix-headless/references/astro/cms/TEAM_DIRECTORY.md +0 -299
- package/skills/wix-headless/references/astro/designer/INSTRUCTIONS.md +0 -351
- package/skills/wix-headless/references/astro/ecom/CART_PAGES.md +0 -119
- package/skills/wix-headless/references/astro/ecom/CART_WIRING.md +0 -103
- package/skills/wix-headless/references/astro/ecom/COMPONENTS_CSS.md +0 -132
- package/skills/wix-headless/references/astro/forms/CONTACT_FORM.md +0 -463
- package/skills/wix-headless/references/astro/gift-cards/COMPONENTS.md +0 -119
- package/skills/wix-headless/references/astro/gift-cards/PAGES.md +0 -129
- package/skills/wix-headless/references/astro/stores/BACK_IN_STOCK.md +0 -178
- package/skills/wix-headless/references/astro/stores/CATEGORY_PAGES.md +0 -85
- package/skills/wix-headless/references/astro/stores/COMPONENTS_CSS.md +0 -129
- package/skills/wix-headless/references/astro/stores/HOME_AND_NAV.md +0 -229
- package/skills/wix-headless/references/astro/stores/PRODUCT_PAGES.md +0 -215
- package/skills/wix-headless/references/astro/stores/SHARED_WIRING.md +0 -165
- package/skills/wix-headless/references/astro/templates/Footer.astro +0 -27
- package/skills/wix-headless/references/astro/templates/Layout.astro +0 -132
- package/skills/wix-headless/references/astro/templates/Navigation.astro +0 -38
- package/skills/wix-headless/references/astro/templates/astro.config.mjs +0 -41
- package/skills/wix-headless/references/astro/templates/bookings/AvailabilityCalendar.tsx +0 -374
- package/skills/wix-headless/references/astro/templates/bookings/BookingForm.tsx +0 -136
- package/skills/wix-headless/references/astro/templates/bookings/SeoTags.astro +0 -25
- package/skills/wix-headless/references/astro/templates/bookings/ServiceBookingFlow.tsx +0 -71
- package/skills/wix-headless/references/astro/templates/bookings/ServiceCard.astro +0 -54
- package/skills/wix-headless/references/astro/templates/bookings/booking-confirmation.astro +0 -49
- package/skills/wix-headless/references/astro/templates/bookings/bookingDriver.ts +0 -245
- package/skills/wix-headless/references/astro/templates/bookings/components-bookings.css +0 -424
- package/skills/wix-headless/references/astro/templates/bookings/services/[slug].astro +0 -176
- package/skills/wix-headless/references/astro/templates/bookings/services/index.astro +0 -181
- package/skills/wix-headless/references/astro/templates/ecom/CartBadge.tsx +0 -84
- package/skills/wix-headless/references/astro/templates/ecom/CartView.tsx +0 -543
- package/skills/wix-headless/references/astro/templates/ecom/cart.astro +0 -13
- package/skills/wix-headless/references/astro/templates/ecom/components-ecom.css +0 -302
- package/skills/wix-headless/references/astro/templates/ecom/discounts.ts +0 -71
- package/skills/wix-headless/references/astro/templates/ecom/thank-you.astro +0 -24
- package/skills/wix-headless/references/astro/templates/gift-cards/GiftCardPurchase.tsx +0 -172
- package/skills/wix-headless/references/astro/templates/gift-cards/_home-teaser-snippet.astro +0 -42
- package/skills/wix-headless/references/astro/templates/gift-cards/_nav-snippet.astro +0 -11
- package/skills/wix-headless/references/astro/templates/gift-cards/components-gift-cards.css +0 -220
- package/skills/wix-headless/references/astro/templates/gift-cards/gift-cards.astro +0 -51
- package/skills/wix-headless/references/astro/templates/gift-cards/gift-cards.ts +0 -75
- package/skills/wix-headless/references/astro/templates/global.css +0 -288
- package/skills/wix-headless/references/astro/templates/index.astro +0 -56
- package/skills/wix-headless/references/astro/templates/stores/AddToCartButton.tsx +0 -77
- package/skills/wix-headless/references/astro/templates/stores/BackInStockForm.tsx +0 -176
- package/skills/wix-headless/references/astro/templates/stores/CategoryRail.astro +0 -69
- package/skills/wix-headless/references/astro/templates/stores/ProductCard.astro +0 -79
- package/skills/wix-headless/references/astro/templates/stores/ProductPurchase.tsx +0 -397
- package/skills/wix-headless/references/astro/templates/stores/SeoTags.astro +0 -21
- package/skills/wix-headless/references/astro/templates/stores/back-in-stock.ts +0 -67
- package/skills/wix-headless/references/astro/templates/stores/categories.ts +0 -155
- package/skills/wix-headless/references/astro/templates/stores/category/[slug].astro +0 -130
- package/skills/wix-headless/references/astro/templates/stores/components-stores.css +0 -400
- package/skills/wix-headless/references/astro/templates/stores/products/[slug].astro +0 -128
- package/skills/wix-headless/references/astro/templates/stores/products/index.astro +0 -101
- package/skills/wix-headless/references/blog/BLOG_CONTENT.md +0 -161
- package/skills/wix-headless/references/blog/INSTRUCTIONS.md +0 -32
- package/skills/wix-headless/references/bookings/FLOW.md +0 -246
- package/skills/wix-headless/references/bookings/INSTRUCTIONS.md +0 -95
- package/skills/wix-headless/references/bookings/SERVICES_DATA.md +0 -355
- package/skills/wix-headless/references/cms/CMS_FOUNDATIONS.md +0 -176
- package/skills/wix-headless/references/cms/INSTRUCTIONS.md +0 -71
- package/skills/wix-headless/references/commands/known-apps.json +0 -6
- package/skills/wix-headless/references/custom/CONNECTION_PLAN.md +0 -142
- package/skills/wix-headless/references/custom/INSTRUCTIONS.md +0 -88
- package/skills/wix-headless/references/custom/blog/WIRING.md +0 -52
- package/skills/wix-headless/references/custom/bookings/WIRING.md +0 -197
- package/skills/wix-headless/references/custom/cms/WIRING.md +0 -97
- package/skills/wix-headless/references/custom/ecom/WIRING.md +0 -67
- package/skills/wix-headless/references/custom/forms/WIRING.md +0 -101
- package/skills/wix-headless/references/custom/stores/WIRING.md +0 -80
- package/skills/wix-headless/references/ecom/INSTRUCTIONS.md +0 -59
- package/skills/wix-headless/references/forms/INSTRUCTIONS.md +0 -43
- package/skills/wix-headless/references/gift-cards/INSTRUCTIONS.md +0 -51
- package/skills/wix-headless/references/images/INSTRUCTIONS.md +0 -357
- package/skills/wix-headless/references/seed-recipes.md +0 -49
- package/skills/wix-headless/references/shared/AGENTS_MD.md +0 -47
- package/skills/wix-headless/references/shared/AUTHENTICATION.md +0 -108
- package/skills/wix-headless/references/shared/BUILD_NOISE.md +0 -8
- package/skills/wix-headless/references/shared/DESIGN_MD.md +0 -84
- package/skills/wix-headless/references/shared/DOCS_SEARCH.md +0 -41
- package/skills/wix-headless/references/shared/IMAGE_GENERATION.md +0 -186
- package/skills/wix-headless/references/shared/IMPLEMENTER.md +0 -206
- package/skills/wix-headless/references/shared/PRODUCTION_SHARP_EDGES.md +0 -97
- package/skills/wix-headless/references/shared/RETURN_CONTRACT.md +0 -143
- package/skills/wix-headless/references/shared/STYLING.md +0 -141
- package/skills/wix-headless/references/stores/INSTRUCTIONS.md +0 -126
- package/skills/wix-headless/references/stores/PRODUCT_CATALOG_DATA.md +0 -252
- package/skills/wix-headless/references/verticals/_schema.json +0 -74
- package/skills/wix-headless/references/verticals/_schema.md +0 -95
- package/skills/wix-headless/references/verticals/blog.md +0 -31
- package/skills/wix-headless/references/verticals/bookings.md +0 -41
- package/skills/wix-headless/references/verticals/cms.md +0 -30
- package/skills/wix-headless/references/verticals/ecom.md +0 -25
- package/skills/wix-headless/references/verticals/forms.md +0 -26
- package/skills/wix-headless/references/verticals/gift-cards.md +0 -24
- package/skills/wix-headless/references/verticals/stores.md +0 -33
- package/skills/wix-headless/scripts/check-manifest.mjs +0 -335
- package/skills/wix-headless/scripts/compose.mjs +0 -525
- package/skills/wix-headless/scripts/emit-design-tokens.mjs +0 -157
- package/skills/wix-headless/scripts/flatten.sh +0 -61
- package/skills/wix-headless/scripts/generate-images.mjs +0 -242
- package/skills/wix-headless/scripts/patch-decorative-slots.mjs +0 -148
- package/skills/wix-headless/scripts/plan-entity-image-waves.mjs +0 -190
- package/skills/wix-headless/scripts/scaffold.sh +0 -139
- package/skills/wix-headless/scripts/seed-utilities.sh +0 -93
- package/skills/wix-headless/scripts/write-decorative-json.mjs +0 -62
- package/skills/wix-headless/shared-utilities/analytics.ts +0 -40
- package/skills/wix-headless/shared-utilities/ricos.ts +0 -179
- package/skills/wix-headless/shared-utilities/wix-image.ts +0 -72
|
@@ -1,351 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: page-designer
|
|
3
|
-
description: "The page-design specification for Wix Managed Headless page routes: home, static (about/faq), store-pages, services-pages, blog-pages, contact-page. This is the visual-design guidance the merged build agents' `pages` scopes (vertical packs, BUILD-astro.md § 'Step 4.5' — the build wave) apply when they write each route ONCE with both visual design and live SDK data. It defines layout, contract classes, decorative-slot conventions, responsive rules, and anti-patterns — not a separate placeholder-writing pass. The design-system phase (tokens + global.css + Layout/Nav/Footer shells) is NOT here — it is split across DESIGN_SYSTEM.md (Designer) and scripts/compose.mjs (Composer)."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Page Designer — Scope-Based Page Design
|
|
7
|
-
|
|
8
|
-
> **Single-write merged model (BUILD-astro.md § "Step 4.5" — the build wave — is authoritative).** Routes are written **once**, by the per-vertical merged build agents' `pages` scopes (after that agent writes its islands), with both visual design **and** live SDK queries in the same pass — there is no separate "write a design placeholder, then rewrite it with data" dispatch (that double-write was eliminated), and no separate Components→Pages wave (those are merged into one per-vertical agent). This doc is the **visual-design specification** the merged author applies: the layout, typography, color, spacing, contract classes, decorative slots, and component composition each route should have. Where a section below says "placeholder data," read it as *the data shape* the live query maps onto — and the safe fallback to render if a query returns empty. The merged scope binds real SDK data into this structure; it does not ship hardcoded arrays as the final output.
|
|
9
|
-
|
|
10
|
-
Your prompt will contain a `Scope:` line naming exactly one of the page scopes below. **Read only the section for your scope. Do not read sections for other scopes — wastes context and blurs ownership.**
|
|
11
|
-
|
|
12
|
-
You own **page-level visual output**: the layout, typography, color, spacing, and component composition of one route group. The same merged scope also binds the live SDK data into that structure (the per-vertical reference under `references/astro/<vertical>/` supplies the exact queries).
|
|
13
|
-
|
|
14
|
-
> **The design-system phase is not in this doc.** Tokens (`DESIGN.md` / `data.design`), `global.css`, `astro.config.mjs`, `Layout.astro`, `Navigation.astro`, and `Footer.astro` are produced earlier in the run by a two-role split:
|
|
15
|
-
> - **Designer** (`<SKILL_ROOT>/references/DESIGN_SYSTEM.md`) — authors `DESIGN.md` (the framework-agnostic token spec) and returns the brand-voice strings.
|
|
16
|
-
> - **Composer** (`<SKILL_ROOT>/scripts/compose.mjs`, a deterministic script — self-documenting) — applies `DESIGN.md` to the astro skeletons and writes the 6 design-system files.
|
|
17
|
-
>
|
|
18
|
-
> By the time the Phase 4 routes are written, the `@theme` token contract, the `.astro` shells, and `.wix/design-tokens.css` already exist. You consume them; you do not write them.
|
|
19
|
-
|
|
20
|
-
## Self-Loading
|
|
21
|
-
|
|
22
|
-
1. Read `../../shared/RETURN_CONTRACT.md` — structured return format.
|
|
23
|
-
2. Read `../../shared/STYLING.md` — three styling categories (tokens-as-utilities, global semantic classes, co-located styles). Pages compose `@theme` tokens at call sites as Tailwind utilities; the design-token vocabulary on disk at `.wix/design-tokens.css` tells you which tokens this run published.
|
|
24
|
-
|
|
25
|
-
No REST calls required. Page-design scopes are frontend-only — no `curl`, no MCP tool-discovery.
|
|
26
|
-
|
|
27
|
-
**Every input you need (brand, the published design-token vocabulary, pages to design, pack home-section snippets) is inlined in your prompt.** Don't depend on mutable shared state.
|
|
28
|
-
|
|
29
|
-
## Scope Routing
|
|
30
|
-
|
|
31
|
-
| Scope | Phase | Output (files) |
|
|
32
|
-
|-------|-------|----------------|
|
|
33
|
-
| `home` | build wave | `src/pages/index.astro` (composes pack home-sections + brand hero/CTA into the Composer-written shell) |
|
|
34
|
-
| `static` | build wave | `src/pages/about.astro`, `src/pages/faq.astro` |
|
|
35
|
-
| `store-pages` | build wave | `src/pages/products/index.astro`, `src/pages/products/[slug].astro`, `src/components/ProductCard.astro`, `src/pages/cart.astro`, `src/pages/thank-you.astro` |
|
|
36
|
-
| `services-pages` | build wave | `src/pages/services/index.astro`, `src/pages/services/[slug].astro`, `src/pages/booking-confirmation.astro` |
|
|
37
|
-
| `blog-pages` | build wave | `src/pages/blog/index.astro`, `src/pages/blog/[slug].astro` |
|
|
38
|
-
| `contact-page` | build wave | `src/pages/contact.astro` |
|
|
39
|
-
|
|
40
|
-
If your prompt's `Scope:` line names `design-system`, you have the wrong doc — that work lives in `DESIGN_SYSTEM.md` (Designer) and `scripts/compose.mjs` (Composer). Stop and tell the parent.
|
|
41
|
-
|
|
42
|
-
If your prompt is missing a `Scope:` line, stop and ask the parent — do not guess.
|
|
43
|
-
|
|
44
|
-
**Disabled-pack route discipline.** Loaded packs with `disabled: true` (today: only `gift-cards`) ship dormant — their surfaces are runtime-gated and only appear once the user enables the matching app. Do NOT add hero CTAs, footer links, brand-story callouts, closing-CTA buttons, or ANY entry point pointing at a `disabled: true` pack's route in your page output. Users click through and the feature doesn't exist. The pack's own markers are the only acceptable touchpoint, and those get gated by the pack's runtime probe in Phase 4, not by you.
|
|
45
|
-
|
|
46
|
-
---
|
|
47
|
-
|
|
48
|
-
## Page Designer Scopes (build wave, background)
|
|
49
|
-
|
|
50
|
-
All page scopes share common inputs and rules. Scope-specific details follow.
|
|
51
|
-
|
|
52
|
-
### Common inputs (from your prompt)
|
|
53
|
-
|
|
54
|
-
- **Brand context** — name, vibe, aesthetic direction, colors, fonts, mood.
|
|
55
|
-
- **Published token contract** — the design-token vocabulary (the DESIGN.md tokens, written into `@theme` by `compose.mjs`). Compose these tokens as Tailwind utilities; if a token you need is absent, flag it in your return (`MISSING_TOKEN`) — do not invent a class.
|
|
56
|
-
- **Pages to design** — list of routes and their contract class associations.
|
|
57
|
-
- **Pack home-section snippet** (home scope only) — section stubs from every loaded pack.
|
|
58
|
-
- **Placeholder data instruction** — use plausible brand-contextual placeholder text, prices, images where live data is not yet available.
|
|
59
|
-
|
|
60
|
-
### Common rules for all page scopes
|
|
61
|
-
|
|
62
|
-
1. **Use contract classes.** Every component that corresponds to a contract key uses that class name. Do not invent replacements.
|
|
63
|
-
2. **Use the Layout.** Every page wraps content in `<Layout>`:
|
|
64
|
-
```astro
|
|
65
|
-
---
|
|
66
|
-
import Layout from '../layouts/Layout.astro';
|
|
67
|
-
---
|
|
68
|
-
<Layout title="Page Title">
|
|
69
|
-
<!-- page content -->
|
|
70
|
-
</Layout>
|
|
71
|
-
```
|
|
72
|
-
3. **Never empty — render real data, fall back gracefully.** Bind the live SDK query into the designed structure. When a query legitimately returns empty (collection not seeded, OOS, etc.), render a brand-contextual fallback (plausible copy / a tasteful empty state) so the page still looks complete and reviewable — never a blank section.
|
|
73
|
-
4. **SDK queries belong in the route frontmatter.** The merged `pages` scope imports the relevant SDK (`@wix/stores`, `@wix/data`, `@wix/blog`, …) in the route's frontmatter and queries live data — see the per-vertical reference under `references/astro/<vertical>/` for the exact queries. Wrap every SSR `await` in try/catch with a safe fallback (an unguarded SSR throw truncates Astro's response stream mid-body). Do **not** ship hardcoded arrays as the final page output.
|
|
74
|
-
5. **No React islands authored here.** Do not write `.tsx` components — Phase 3 Components writes the islands. Phase 4 routes **mount** the already-written islands (`client:load`, etc.) but never author them.
|
|
75
|
-
6. **Scoped page styles allowed.** Pages may add `<style>` blocks for page-specific ornamental styling (section backgrounds, decorative elements, page-specific spacing adjustments). These are local to the page — do not override contract class rules from `global.css`.
|
|
76
|
-
7. **Image placeholders — decorative slot convention.** Every decorative image (hero, about visual, page-header art) MUST be emitted as a `<div>` placeholder carrying a `data-decorative-slot="<key>"` attribute. **Use ONLY canonical slot keys from this fixed vocabulary:**
|
|
77
|
-
|
|
78
|
-
| Key | Where it lives | Required when |
|
|
79
|
-
|---|---|---|
|
|
80
|
-
| `hero` | Homepage hero image | Always |
|
|
81
|
-
| `about` | About-page (or home brand-story) editorial visual | Always |
|
|
82
|
-
| `productsHeader` | `/products` listing header decorative | Stores pack loaded |
|
|
83
|
-
| `cmsHeader` | `/about` or `/faq` page header decorative | CMS pack loaded (optional) |
|
|
84
|
-
|
|
85
|
-
Do NOT invent keys like `aboutFeature`, `background`, `heroAlt`, etc. The image agent receives this canonical list as its `decorativeSlots` input and generates exactly those keys — invented keys will not have images, and orphan generated images go unused. If a page needs more visual interest, use scoped CSS / SVG / brand-color blocks instead of additional generated images. The orchestrator runs a post-Phase-2 Edit pass that injects the actual `<img>` for each slot once Image Phase 1 finishes; your job is to make the slot visible. Rules:
|
|
86
|
-
- Use aspect-ratio + background-color on the placeholder so the page looks complete even if Image Phase 1 never completes.
|
|
87
|
-
- Keep decorative overlays (stamps, rules, frames) as siblings of the slot `<div>` — the orchestrator injects the `<img>` as the FIRST child of the slot, so anything you want to layer over it must stay outside the slot `<div>` (or inside with explicit z-index).
|
|
88
|
-
- Do NOT conditionally read any image-coordination file — Image Phase 1's slot→URL map flows to the orchestrator via its JSON return, and the orchestrator injects URLs into your slot placeholders. The slot mechanism is the contract; no file lookup is needed or correct.
|
|
89
|
-
- Do not use external placeholder services (picsum, unsplash, etc.).
|
|
90
|
-
|
|
91
|
-
Example:
|
|
92
|
-
```astro
|
|
93
|
-
<section class="hero-section relative">
|
|
94
|
-
<div
|
|
95
|
-
class="hero-image"
|
|
96
|
-
data-decorative-slot="hero"
|
|
97
|
-
style="aspect-ratio: 4/5; background-color: var(--color-paper-warm);"
|
|
98
|
-
>
|
|
99
|
-
<!-- orchestrator injects <img src={decorativeImages.hero} …> here -->
|
|
100
|
-
</div>
|
|
101
|
-
<div class="hero-stamp">{/* decorative overlay, stays outside the slot */}</div>
|
|
102
|
-
</section>
|
|
103
|
-
```
|
|
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 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
|
-
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
|
-
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
|
-
|
|
110
|
-
### Scope: `home`
|
|
111
|
-
|
|
112
|
-
Composes the home page from every loaded pack's `homeSection` snippet plus brand-specific hero and CTA sections.
|
|
113
|
-
|
|
114
|
-
**Inputs (additional):**
|
|
115
|
-
- `Pack home-section snippets` — one per loaded pack. Each names a section (e.g., "Featured products", "Brand story", "Latest posts", "Contact CTA") with a description and contract classes.
|
|
116
|
-
|
|
117
|
-
**Structure:**
|
|
118
|
-
1. **Hero section** — full-width, impactful brand moment. Uses `hero-section` contract class. Emit a `data-decorative-slot="hero"` placeholder per Common rule #7 — do not inline an Image Phase 1 URL; the orchestrator injects the `<img>` after Image Phase 1 completes.
|
|
119
|
-
2. **Pack sections** — one section per loaded pack's `homeSection`, in a sensible order (typically: featured content first, then story, then CTA).
|
|
120
|
-
3. **Optional closing CTA** — if no pack contributes a CTA section, add a minimal brand-appropriate closing.
|
|
121
|
-
|
|
122
|
-
**Files:** `src/pages/index.astro`
|
|
123
|
-
|
|
124
|
-
**Return:**
|
|
125
|
-
```json
|
|
126
|
-
{
|
|
127
|
-
"status": "complete",
|
|
128
|
-
"phase": "designer-home",
|
|
129
|
-
"scope": "home",
|
|
130
|
-
"data": {
|
|
131
|
-
"pagesDesigned": ["src/pages/index.astro"],
|
|
132
|
-
"contractClassesHonored": ["hero-section", "product-grid", "product-card", "brand-story", ...]
|
|
133
|
-
},
|
|
134
|
-
"files": ["src/pages/index.astro"]
|
|
135
|
-
}
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
### Scope: `static`
|
|
139
|
-
|
|
140
|
-
About and FAQ pages — content pages with similar layout demands.
|
|
141
|
-
|
|
142
|
-
**Files:** `src/pages/about.astro`, `src/pages/faq.astro`
|
|
143
|
-
|
|
144
|
-
**About page:**
|
|
145
|
-
- Hero/header section with `about-hero` class
|
|
146
|
-
- Body content with `about-body` class
|
|
147
|
-
- Placeholder brand story text (2-3 paragraphs, brand-contextual)
|
|
148
|
-
- Image placeholder for brand/team visual
|
|
149
|
-
|
|
150
|
-
**FAQ page:**
|
|
151
|
-
- Section wrapper with `faq-section` class
|
|
152
|
-
- Individual Q&A items with `faq-item`, `faq-question`, `faq-answer` classes
|
|
153
|
-
- 4-6 placeholder FAQ items contextual to the business type
|
|
154
|
-
- Accordion or expandable pattern (CSS-only, using `<details>`/`<summary>` or checkbox hack)
|
|
155
|
-
|
|
156
|
-
**Return:**
|
|
157
|
-
```json
|
|
158
|
-
{
|
|
159
|
-
"status": "complete",
|
|
160
|
-
"phase": "designer-static",
|
|
161
|
-
"scope": "static",
|
|
162
|
-
"data": {
|
|
163
|
-
"pagesDesigned": ["about", "faq"],
|
|
164
|
-
"contractClassesHonored": ["about-hero", "about-body", "faq-section", "faq-item", "faq-question", "faq-answer"]
|
|
165
|
-
},
|
|
166
|
-
"files": ["src/pages/about.astro", "src/pages/faq.astro"]
|
|
167
|
-
}
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
### Scope: `store-pages`
|
|
171
|
-
|
|
172
|
-
All store-facing pages designed together for visual coherence.
|
|
173
|
-
|
|
174
|
-
**Files:** `src/pages/products/index.astro`, `src/pages/products/[slug].astro`, `src/components/ProductCard.astro`, `src/pages/cart.astro`, `src/pages/thank-you.astro`
|
|
175
|
-
|
|
176
|
-
**Products listing (`/products`):**
|
|
177
|
-
- Page heading
|
|
178
|
-
- Product grid using `product-grid` class
|
|
179
|
-
- Bind the live `productsV3` query (per `references/astro/stores/PRODUCT_PAGES.md`) into a grid of `ProductCard` components; render a brand-contextual empty state if the query returns nothing
|
|
180
|
-
|
|
181
|
-
**Product detail (`/products/[slug]`):**
|
|
182
|
-
- Product image (large) resolved from the live product record
|
|
183
|
-
- Product info section with `product-detail` class
|
|
184
|
-
- Purchase area with `product-purchase` class — price, variant selector, and Add to Cart button (`add-to-cart-btn` class) bound to the live product/variant data
|
|
185
|
-
- Product description area
|
|
186
|
-
|
|
187
|
-
**ProductCard component:**
|
|
188
|
-
- Accepts a single `product` prop — the full Wix product object from `productsV3`
|
|
189
|
-
- Uses `product-card` class
|
|
190
|
-
- Image, name, price, link to `/products/${product.slug}`
|
|
191
|
-
- Design the prop interface around the full product object: `{ product }` (the canonical `productsV3` shape — see `references/astro/stores/PRODUCT_PAGES.md`)
|
|
192
|
-
|
|
193
|
-
**Cart (`/cart`):**
|
|
194
|
-
- Two-column grid layout: `.cart-grid` — items column left, order summary right. Stacks vertically on mobile
|
|
195
|
-
- Items column with `.cart-items`, `.cart-item`, `.cart-item.unavailable` (reduced opacity), `.cart-item-image`, `.cart-item-info`, `.cart-item-name`, `.cart-item-option`, `.cart-item-modifiers` classes
|
|
196
|
-
- Quantity selector with `.cart-item-qty`, `.qty-btn`, `.qty-value` classes — include `:disabled` states (reduced opacity + `cursor: not-allowed`)
|
|
197
|
-
- Price display with `.cart-item-actions`, `.cart-item-prices`, `.cart-item-full-price` (strikethrough for discounts), `.cart-item-unit-price`, `.cart-item-line-total` classes
|
|
198
|
-
- Remove button with `.cart-item-remove` class (muted color, underline on hover)
|
|
199
|
-
- Summary column with `.cart-summary` (sticky on desktop), `.cart-subtotal`, `.checkout-btn` (with `:disabled` state), `.cart-empty` classes
|
|
200
|
-
- Unavailable item warning with `.cart-item-unavailable` class (red text)
|
|
201
|
-
- Empty state with `.cart-empty` class (centered, muted text + "Browse Products" link)
|
|
202
|
-
- **All cart CSS must be in `<style is:global>`** — `CartView` is a React island; scoped Astro styles do not reach its children
|
|
203
|
-
- The live `CartView` island renders the items/summary at runtime; design the surrounding structure and an empty-cart fallback
|
|
204
|
-
|
|
205
|
-
**Thank you (`/thank-you`):**
|
|
206
|
-
- Confirmation message with `order-summary` class
|
|
207
|
-
- Order details bound to the live order data (per the ecom cart/checkout reference)
|
|
208
|
-
|
|
209
|
-
**Return:**
|
|
210
|
-
```json
|
|
211
|
-
{
|
|
212
|
-
"status": "complete",
|
|
213
|
-
"phase": "designer-store-pages",
|
|
214
|
-
"scope": "store-pages",
|
|
215
|
-
"data": {
|
|
216
|
-
"pagesDesigned": ["products/index.astro", "products/[slug].astro", "ProductCard.astro", "cart.astro", "thank-you.astro"],
|
|
217
|
-
"contractClassesHonored": <count>
|
|
218
|
-
},
|
|
219
|
-
"files": [
|
|
220
|
-
"src/pages/products/index.astro",
|
|
221
|
-
"src/pages/products/[slug].astro",
|
|
222
|
-
"src/components/ProductCard.astro",
|
|
223
|
-
"src/pages/cart.astro",
|
|
224
|
-
"src/pages/thank-you.astro"
|
|
225
|
-
]
|
|
226
|
-
}
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
### Scope: `services-pages`
|
|
230
|
-
|
|
231
|
-
All bookings-facing pages designed together for visual coherence. **Canonical templates exist** at `<SKILL_ROOT>/references/astro/templates/bookings/` — adapt them (copy, headings, styling); do not re-author the SDK/booking-flow wiring (`references/astro/bookings/SERVICES_PAGES.md` is the wiring spec).
|
|
232
|
-
|
|
233
|
-
**Files:** `src/pages/services/index.astro`, `src/pages/services/[slug].astro`, `src/pages/booking-confirmation.astro`
|
|
234
|
-
|
|
235
|
-
**Services listing (`/services`):**
|
|
236
|
-
- Page heading + optional brand tagline
|
|
237
|
-
- Service grid using the `service-grid` class, one `ServiceCard` per service (`service-card` class — image/placeholder, name, tagline, duration + price row)
|
|
238
|
-
- Bind the live `services.queryServices` query (per `references/astro/bookings/SERVICES_PAGES.md`); brand-contextual empty state if it returns nothing
|
|
239
|
-
|
|
240
|
-
**Service detail (`/services/[slug]`):**
|
|
241
|
-
- `container-reading` width (never a bare `max-w-<size>`); optional banner image **only when the service has media** (image-less is the common seed case — no fixed-ratio placeholder)
|
|
242
|
-
- Title, tagline, duration + price row, description
|
|
243
|
-
- "Book this service" section mounting the `ServiceBookingFlow` island (`client:only="react"`, threads `serviceType`) — the week calendar uses the `availability-*` classes (week strip + `availability-day`), slots use `time-slot` classes (`--available`/`--selected`), and the form uses the `booking-*` family
|
|
244
|
-
|
|
245
|
-
**Booking confirmation (`/booking-confirmation`):**
|
|
246
|
-
- `max-w-prose`, centered; "Thank you for booking" headline + the service name and time (read from the `service`/`startDate` query params) + a link back to `/services`. No re-fetch, no cancel UI (manage/cancel is out of scope).
|
|
247
|
-
|
|
248
|
-
### Scope: `blog-pages`
|
|
249
|
-
|
|
250
|
-
Blog feed listing and post detail designed together.
|
|
251
|
-
|
|
252
|
-
**Files:** `src/pages/blog/index.astro`, `src/pages/blog/[slug].astro`
|
|
253
|
-
|
|
254
|
-
**Blog listing (`/blog`):**
|
|
255
|
-
- Page heading
|
|
256
|
-
- Post grid/list using `blog-feed` class
|
|
257
|
-
- 3 placeholder post cards using `blog-post-card` class (title, date, excerpt, cover image placeholder)
|
|
258
|
-
|
|
259
|
-
**Blog post detail (`/blog/[slug]`):**
|
|
260
|
-
- Post header with title, date, author, cover image placeholder
|
|
261
|
-
- Body area with `blog-post` and `blog-post-body` classes
|
|
262
|
-
- Meta section with `blog-post-meta` class (tags, share links)
|
|
263
|
-
- Good reading typography (max-width prose container, comfortable line height)
|
|
264
|
-
|
|
265
|
-
**Return:**
|
|
266
|
-
```json
|
|
267
|
-
{
|
|
268
|
-
"status": "complete",
|
|
269
|
-
"phase": "designer-blog-pages",
|
|
270
|
-
"scope": "blog-pages",
|
|
271
|
-
"data": {
|
|
272
|
-
"pagesDesigned": ["blog/index.astro", "blog/[slug].astro"],
|
|
273
|
-
"contractClassesHonored": ["blog-feed", "blog-post-card", "blog-post", "blog-post-body", "blog-post-meta"]
|
|
274
|
-
},
|
|
275
|
-
"files": ["src/pages/blog/index.astro", "src/pages/blog/[slug].astro"]
|
|
276
|
-
}
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
### Scope: `contact-page`
|
|
280
|
-
|
|
281
|
-
Contact page with form placeholder.
|
|
282
|
-
|
|
283
|
-
**Files:** `src/pages/contact.astro`
|
|
284
|
-
|
|
285
|
-
**Contact page:**
|
|
286
|
-
- Page heading and descriptive text
|
|
287
|
-
- Contact CTA section using `contact-cta` class (if on home, this mirrors the home CTA's visual language)
|
|
288
|
-
- Form area — mount the `ContactForm.tsx` island (written by Phase 3 Components) styled to the brand, per `references/astro/forms/CONTACT_FORM.md`. Style a complete form layout (name, email, message fields, submit button) so the page reads as finished even before submissions wire up.
|
|
289
|
-
- Optional: map embed placeholder, business hours, address (if brand context suggests it)
|
|
290
|
-
|
|
291
|
-
**Return:**
|
|
292
|
-
```json
|
|
293
|
-
{
|
|
294
|
-
"status": "complete",
|
|
295
|
-
"phase": "designer-contact-page",
|
|
296
|
-
"scope": "contact-page",
|
|
297
|
-
"data": {
|
|
298
|
-
"pagesDesigned": ["contact.astro"],
|
|
299
|
-
"contractClassesHonored": ["contact-cta"]
|
|
300
|
-
},
|
|
301
|
-
"files": ["src/pages/contact.astro"]
|
|
302
|
-
}
|
|
303
|
-
```
|
|
304
|
-
|
|
305
|
-
---
|
|
306
|
-
|
|
307
|
-
## Return Contract
|
|
308
|
-
|
|
309
|
-
At the end of your work, emit a structured JSON block per `../../shared/RETURN_CONTRACT.md`. Do **not** write sidecar files to `.wix/logs/*`.
|
|
310
|
-
|
|
311
|
-
The JSON block MUST be the **last** content in your message — the parent parses it as the last fenced JSON. No trailing prose after the closing ` ``` `.
|
|
312
|
-
|
|
313
|
-
## Anti-Patterns (apply to all page scopes)
|
|
314
|
-
|
|
315
|
-
| WRONG | CORRECT |
|
|
316
|
-
|-------|---------|
|
|
317
|
-
| Author a `.tsx` React island in a page scope | Phase 3 Components writes the islands; the route only **mounts** them (`client:load`) |
|
|
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
|
-
| 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-24">`); see `../../shared/STYLING.md` |
|
|
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
|
-
| HTML `<!-- comment -->` in `.astro` frontmatter | Use `//` or `/* */` — frontmatter is TypeScript |
|
|
323
|
-
| Use external placeholder image services (picsum, unsplash) | Use colored `<div>` placeholders with `data-decorative-slot` — the orchestrator injects Image Phase 1 URLs later |
|
|
324
|
-
| Write `components-<pack>.css` | Phase 3 Components creates that file — page scopes must not write it |
|
|
325
|
-
| Leave a section empty when a query returns nothing | Render a brand-contextual fallback / empty state so the page is always reviewable |
|
|
326
|
-
| Use default Tailwind colors (`bg-blue-500`, `text-gray-200`) | Use brand `@theme` tokens (`bg-bark`, `text-cream`) — defaults expose that it's AI-generated |
|
|
327
|
-
| Generic unstyled HTML | Brand-first design — every element reflects the aesthetic direction |
|
|
328
|
-
| Fixed-width layouts | Responsive: mobile-first, breakpoints at 320/768/1024px |
|
|
329
|
-
| `ls src/`, `Glob src/**` to discover files | Your prompt lists every file and class contract. Write directly. |
|
|
330
|
-
| Read a shared file to get brand or verticals | Every field is in your prompt |
|
|
331
|
-
| Hardcode an external `<img src="https://...">` for product/content images | Resolve entity images from the live record (`media.getScaledToFillImageUrl(...)`) in this same scope; **decorative** images use the `data-decorative-slot` mechanism |
|
|
332
|
-
| Omit `data-decorative-slot` on hero/about/background placeholders | Every decorative image placeholder MUST carry a slot attribute — the orchestrator's injection pass depends on it (common rule #7) |
|
|
333
|
-
| Add a hero CTA / footer link to a disabled-pack route | Disabled packs (gift-cards) are dormant — no entry points to their routes |
|
|
334
|
-
| ProductCard with flat props (`name`, `price`, `slug` as separate props) | Single `product` object prop: `{ product }` — Phase 4 passes the full Wix product object |
|
|
335
|
-
| Wrap CartBadge in `<a>` or add cart SVG icons in `nav-actions` | Leave `nav-actions` empty — CartBadge renders its own `<a>` link; nesting `<a>` tags produces duplicate icons |
|
|
336
|
-
|
|
337
|
-
## Coordination with other agents
|
|
338
|
-
|
|
339
|
-
| Agent | Relationship | Rule |
|
|
340
|
-
|-------|-------------|------|
|
|
341
|
-
| Composer (design-system) | Wrote `global.css`, `Layout.astro`, `Navigation.astro`, `Footer.astro`, the `@theme` tokens | You consume the token contract and wrap pages in its `Layout`; you never rewrite those files |
|
|
342
|
-
| Phase 3 Components (stores/bookings/blog/forms) | Writes React islands referencing contract classes + `components-<pack>.css` | They own islands + scoped CSS; the route references contract classes in markup and mounts the islands, no overlap |
|
|
343
|
-
| Per-vertical reference (`references/astro/<vertical>/`) | Supplies the exact SDK queries + wiring the merged route binds | Apply this design spec **and** that vertical's queries together in one write — there is no second pass |
|
|
344
|
-
| Image agent (Image Phase 1) | Returns decorative URLs in `data.slots` | Emit `data-decorative-slot="<key>"` placeholders; the orchestrator injects the `<img>` once Image Phase 1 returns |
|
|
345
|
-
| Image agent (Image Phase 2) | PATCHes entity images onto products/posts via REST | No direct interaction — images flow through product/post records that Phase 4 queries |
|
|
346
|
-
|
|
347
|
-
## File ownership
|
|
348
|
-
|
|
349
|
-
The merged Phase 4 `pages` scope owns each route file **end to end** — visual structure **and** data wiring, written in a single pass. There is no separate page-designer agent that writes a file for a later scope to rewrite; this doc is the visual-design spec the merged author applies alongside its vertical's SDK queries (`references/astro/<vertical>/`). Each route file therefore has exactly **one** writer (its `pages` scope), which removes the cross-phase double-write the older placeholder-then-rewrite model carried.
|
|
350
|
-
|
|
351
|
-
The shared shells the route composes into — `Layout.astro`, `global.css` (Composer), and the marker-patched `Navigation.astro` / `index.astro` / `components-<pack>.css` (pre-copied or patched by the serialized shell-patcher agents) — are NOT owned by a private-file route scope (see "Coordination" above and BUILD-astro.md § "Step 4.5", the serialized shell chain).
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
# Phase 4 Cart Pages — Ecom
|
|
2
|
-
|
|
3
|
-
Scope: `cart-checkout` (the ecom `pages` scope) — the **pages** portion of the ecom **merged build agent** (the build wave), written *after* its `components`. Mounts `CartView` island on the cart page, wires the thank-you page, and mounts `CartBadge` in `Navigation.astro` (at the `<!-- nav:actions -->` marker). **Because it patches the shared `Navigation.astro` shell, the ecom build agent runs in the build wave's serialized shell chain** — never concurrent with the other Navigation/index patchers (stores `pages-home-and-nav`, gift-cards, blog), so concurrent marker edits can't collide (`BUILD-astro.md` § "Step 4.5").
|
|
4
|
-
|
|
5
|
-
## Scope
|
|
6
|
-
|
|
7
|
-
Files this agent OWNS (each written once — designer visual spec + live wiring together):
|
|
8
|
-
|
|
9
|
-
- `src/pages/cart.astro` — mount `CartView.tsx` (client-only, no server-side cart fetch)
|
|
10
|
-
- `src/pages/thank-you.astro` — read `orderId` from URL, fire `Purchase` event
|
|
11
|
-
|
|
12
|
-
Files this agent PATCHES (does NOT rewrite) — only at its own marker:
|
|
13
|
-
|
|
14
|
-
- `src/components/Navigation.astro` — mount `CartBadge` in the `nav-actions` area (`<!-- nav:actions -->`). Stores `pages-home-and-nav` patches the same file at `<!-- nav:links -->`; the serialized shell chain keeps these from colliding.
|
|
15
|
-
|
|
16
|
-
Files this agent MUST NOT touch:
|
|
17
|
-
- `src/components/CartView.tsx`, `src/components/CartBadge.tsx` — the ecom islands; written earlier in this same merged agent (the `components` scope)
|
|
18
|
-
- Any product page, home page, or stores-specific component
|
|
19
|
-
- `global.css`, any designed component
|
|
20
|
-
|
|
21
|
-
## Critical rules
|
|
22
|
-
|
|
23
|
-
1. **No server-side cart fetch** — cart is per-visitor and must not break SSR caching. `CartView` fetches its own data on mount.
|
|
24
|
-
2. **Mount `CartView` with `client:load`** — no props needed, the island is self-contained.
|
|
25
|
-
3. **Fire `Purchase` event in `thank-you.astro`** only when `?orderId=` is present.
|
|
26
|
-
4. **Mount `CartBadge` in `Navigation.astro`** (not Layout.astro, not a page-specific header).
|
|
27
|
-
5. **No HTML comments in `.astro` frontmatter** — frontmatter is TypeScript.
|
|
28
|
-
6. **Preserve designer layout and classes.** Only mount islands and wire data; do not restructure markup.
|
|
29
|
-
7. **Do NOT add static HTML alongside `<CartView>`** — the island handles empty/loading/cart states internally.
|
|
30
|
-
|
|
31
|
-
## Implementation
|
|
32
|
-
|
|
33
|
-
### 1. `src/pages/cart.astro`
|
|
34
|
-
|
|
35
|
-
Use template `templates/cart.astro`.
|
|
36
|
-
|
|
37
|
-
Mounts `CartView` as a client-only island. **No server-side cart fetch** — cart data is per-visitor and would break SSR caching. CartView fetches the cart client-side on mount. Key requirements:
|
|
38
|
-
|
|
39
|
-
- **No `currentCart` import in frontmatter** — do not fetch cart data server-side
|
|
40
|
-
- Mount `<CartView client:load />` — no props needed, the island fetches its own data
|
|
41
|
-
- Preserve whatever the designer wrote around the mount (headings, breadcrumbs, section wrappers)
|
|
42
|
-
- Do NOT add static HTML alongside `<CartView>` — the island handles empty/loading/cart states internally
|
|
43
|
-
|
|
44
|
-
### 2. `src/pages/thank-you.astro`
|
|
45
|
-
|
|
46
|
-
Use template `templates/thank-you.astro`.
|
|
47
|
-
|
|
48
|
-
Wix redirects here after successful checkout with `?orderId=<id>`. Fires `Purchase` analytics event when orderId is present. Preserve whatever the designer wrote around the order confirmation content (headings, layout wrappers). The key requirements:
|
|
49
|
-
|
|
50
|
-
- Read `orderId` from URL search params
|
|
51
|
-
- Display order confirmation with the orderId
|
|
52
|
-
- Fire `Purchase` event via the analytics helper (client-side script)
|
|
53
|
-
- Only fire when `orderId` is present — refreshing without it should not re-fire
|
|
54
|
-
|
|
55
|
-
### 3. Mount CartBadge in `Navigation.astro`
|
|
56
|
-
|
|
57
|
-
Mount `CartBadge` inside the `nav-actions` area. The designer creates this with a `<slot name="actions" />` or similar placeholder. Because Navigation is in the shared Layout, the badge appears on every page.
|
|
58
|
-
|
|
59
|
-
```astro
|
|
60
|
-
---
|
|
61
|
-
// Add to Navigation.astro frontmatter:
|
|
62
|
-
import CartBadge from "./CartBadge.tsx";
|
|
63
|
-
---
|
|
64
|
-
|
|
65
|
-
<!-- Replace the nav-actions slot with the CartBadge island: -->
|
|
66
|
-
<div class="nav-actions">
|
|
67
|
-
<CartBadge client:only="react" />
|
|
68
|
-
</div>
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
Use `client:only="react"` — never SSR the badge. SSR would render `count: 0` (sessionStorage is a browser-only API), then hydration would read the cached count and flip to the real number, causing a visible blink on every page navigation. Skipping SSR means the badge renders once on the client with the cached count already populated. No flash.
|
|
72
|
-
|
|
73
|
-
## Checkout flow summary
|
|
74
|
-
|
|
75
|
-
CartView's `handleCheckout` runs:
|
|
76
|
-
|
|
77
|
-
```
|
|
78
|
-
Cart page → "Proceed to Checkout"
|
|
79
|
-
→ currentCart.createCheckoutFromCurrentCart({ channelType: WEB })
|
|
80
|
-
→ redirects.createRedirectSession({ ecomCheckout: { checkoutId }, callbacks: { thankYouPageUrl, cartPageUrl } })
|
|
81
|
-
→ window.location.href = redirectSession.fullUrl
|
|
82
|
-
→ User completes payment on Wix-hosted checkout
|
|
83
|
-
→ Redirect back to /thank-you?orderId=<id>
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
**Going-live note** (emitted by the skill, not this agent):
|
|
87
|
-
> Checkout is hosted by Wix and will show "we aren't accepting payments" until: (1) upgrade to premium eCommerce plan, (2) connect a payment provider.
|
|
88
|
-
|
|
89
|
-
## Analytics fired from this scope
|
|
90
|
-
|
|
91
|
-
| Event | Fires from | When | Payload |
|
|
92
|
-
|-------|------------|------|---------|
|
|
93
|
-
| `Purchase` | `thank-you.astro` | On mount when `?orderId=` is present | `{ id: orderId, origin: "Thank You Page" }` |
|
|
94
|
-
|
|
95
|
-
`RemoveFromCart` and `InitiateCheckout` fire from `CartView.tsx` (owned by `ecom-shared`).
|
|
96
|
-
|
|
97
|
-
## Return format
|
|
98
|
-
|
|
99
|
-
```json
|
|
100
|
-
{
|
|
101
|
-
"status": "complete",
|
|
102
|
-
"phase": "cart-checkout",
|
|
103
|
-
"scope": "cart-checkout",
|
|
104
|
-
"summary": "Mounted CartView (client-only fetch); wired Purchase event; mounted CartBadge in Navigation",
|
|
105
|
-
"data": {
|
|
106
|
-
"pagesWired": 2,
|
|
107
|
-
"cartViewMounted": true,
|
|
108
|
-
"purchaseEventWired": true,
|
|
109
|
-
"cartBadgeMounted": true,
|
|
110
|
-
"analyticsEvents": ["Purchase"]
|
|
111
|
-
},
|
|
112
|
-
"files": [
|
|
113
|
-
"src/pages/cart.astro",
|
|
114
|
-
"src/pages/thank-you.astro",
|
|
115
|
-
"src/components/Navigation.astro"
|
|
116
|
-
],
|
|
117
|
-
"errors": []
|
|
118
|
-
}
|
|
119
|
-
```
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
# Phase 3 Components — Ecom (TSX)
|
|
2
|
-
|
|
3
|
-
This is the **components** portion of the ecom **merged build agent** (the build wave — `BUILD-astro.md` § "Step 4.5"). Your agent writes these islands **first**, then the ecom pages (`cart.astro`, `thank-you.astro`) that mount them. The code here depends on the **design tokens** (read from `.wix/design-tokens.css` on disk) but NOT on page markup.
|
|
4
|
-
|
|
5
|
-
> **CSS is pre-copied, not authored.** `src/styles/components-ecom.css` ships from the skill template, copied by the orchestrator in the build-wave pre-batch (see `./COMPONENTS_CSS.md`). This scope does NOT write the CSS file. Reference its contract class names from the design tokens here; the pre-copied stylesheet defines the rules.
|
|
6
|
-
|
|
7
|
-
## Scope
|
|
8
|
-
|
|
9
|
-
Files this agent OWNS (creates fresh):
|
|
10
|
-
|
|
11
|
-
- `src/components/CartView.tsx` — React island; full cart display + checkout redirect
|
|
12
|
-
- `src/components/CartBadge.tsx` — React island; nav-wide cart count badge
|
|
13
|
-
|
|
14
|
-
Files this agent MUST NOT touch:
|
|
15
|
-
- `src/styles/components-ecom.css` — owned by the **`components-css`** sibling scope (see `./COMPONENTS_CSS.md`). Reference its class names; do not write the file.
|
|
16
|
-
- Any `.astro` page — designed and later rewritten by other scopes
|
|
17
|
-
- `src/styles/global.css` — owned by designer foundation
|
|
18
|
-
- `src/layouts/Layout.astro` — owned by designer foundation
|
|
19
|
-
- Any stores-specific component (AddToCartButton, ProductPurchase, etc.)
|
|
20
|
-
|
|
21
|
-
## Coordination: design tokens
|
|
22
|
-
|
|
23
|
-
Read the design tokens from `.wix/design-tokens.css` (on disk, gate-verified present before the wave).
|
|
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-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
|
-
|
|
27
|
-
## Template files
|
|
28
|
-
|
|
29
|
-
This scope uses **template files** instead of inline code. For each file below:
|
|
30
|
-
|
|
31
|
-
1. Read the template from `<Agent location>/templates/<filename>`
|
|
32
|
-
2. Write it to the project at the target path
|
|
33
|
-
3. Adapt CSS class names if the design tokens maps them differently than the defaults
|
|
34
|
-
|
|
35
|
-
Do NOT modify logic, imports, or component structure.
|
|
36
|
-
|
|
37
|
-
## Implementation
|
|
38
|
-
|
|
39
|
-
### 1. `src/components/CartView.tsx`
|
|
40
|
-
|
|
41
|
-
Use template `templates/CartView.tsx`.
|
|
42
|
-
|
|
43
|
-
Full cart display with two-column layout, quantity editing, remove, unavailable item detection, and checkout redirect. **No server-side props** — cart is per-visitor and fetched client-side on mount to keep pages SSR-cache-friendly. Key behaviors:
|
|
44
|
-
|
|
45
|
-
- **Always use `currentCart` APIs** — never the `cart` namespace that requires a cart ID
|
|
46
|
-
- **Image resolution** — `resolveCartImage()` handles `wix:image://` strings (SDK returns image as a string, not an object)
|
|
47
|
-
- **Description lines** — `formatDescriptionLine()` handles both `plainText` and `colorInfo` types
|
|
48
|
-
- **Per-line price display** — `fullPrice` and `price` are per-unit (shown side by side; `fullPrice` is struck through when an automatic discount is applied to that line); `lineItemPrice` is total (shown below only when qty > 1)
|
|
49
|
-
- **Clickable product link** — the image and product name link back to the product detail page. `item.url` shape varies by caller: the `@wix/ecom` SDK returns it as an absolute URL **string** (e.g. `https://<site>.wixsite.com/<name>/product-page/<slug>`), while REST returns an object `{ relativePath, url }`. `resolveProductHref` accepts both, extracts the slug after `/product-page/`, and rewrites to the headless `/products/<slug>` route. Link is suppressed on unavailable lines (nothing to navigate to for NOT_FOUND/NOT_AVAILABLE items).
|
|
50
|
-
- **Cart-level totals + discount surfaces (API-sourced)** — `extractSummary()` reads `cart.priceSummary.{subtotal, discount, total}` and `cart.appliedDiscounts[].discountName` in one pass. Three distinct surfaces, each sourced directly from the API (no client-side amount math):
|
|
51
|
-
1. `cart-discount` row — amount + optional name — rendered when `priceSummary.discount` is populated (coupons, cart-level promos).
|
|
52
|
-
2. `cart-applied-discounts` row — name-only — rendered when `priceSummary.discount` is empty but `appliedDiscounts[].discountName` is populated. This is the common case for **line-item automatic discounts**, where Wix bakes the discount into each line's `price` (with `fullPrice` preserved for the strikethrough). The per-line savings amount already shows inline via the `cart-item-full-price`/`cart-item-unit-price` strikethrough; the summary row just names the promotion.
|
|
53
|
-
3. `cart-total` row — rendered when `priceSummary.total` differs from `priceSummary.subtotal`.
|
|
54
|
-
If `priceSummary.subtotal` is missing (some early-stage carts return an empty summary before checkout creation), the subtotal is computed client-side from `lineItemPrice.amount` — do not leave the slot blank. Do NOT aggregate line-item savings into a summary row; shoppers see the strikethrough inline and that is the API's canonical visualization.
|
|
55
|
-
- **Availability** — `isItemUnavailable()` checks for `NOT_AVAILABLE` and `NOT_FOUND` status; hides qty selector, blocks checkout
|
|
56
|
-
- **Optimistic UI** — quantity changes and item removal update local state immediately before the API responds. Quantity changes are debounced (300ms) so rapid clicks coalesce into a single request. On API error, the cart reconciles from the server via `loadCart()`
|
|
57
|
-
- **Instant re-render via sessionStorage snapshot** — every successful cart fetch/update writes `{ lineItems, summary }` to `sessionStorage[CART_CACHE_KEY]`. On mount, CartView reads the snapshot synchronously and renders it before the authoritative fetch completes. Eliminates the empty/loading flash when re-navigating to `/cart`. Per-tab scope (sessionStorage not localStorage) so logout / shared-device scenarios can't leak stale carts to a different identity.
|
|
58
|
-
- **Dispatches `cart-updated`** events so CartBadge updates instantly
|
|
59
|
-
- **LineItem type** — local structural type mirroring the fields the component consumes. `_id` is declared `string | null | undefined` to match `@wix/ecom`'s `currentCart` return so `cart.lineItems as LineItem[]` type-checks cleanly. If you add new fields, mirror the SDK nullability or narrow at the use site.
|
|
60
|
-
|
|
61
|
-
Class names used (template provides them — do not invent):
|
|
62
|
-
- **Global semantic classes** (in `global.css`, designer-owned): `cart-summary`, `cart-total`, `checkout-btn`, `cart-empty` — compound patterns + interactive states
|
|
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-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
|
-
|
|
66
|
-
### 2. `src/components/CartBadge.tsx`
|
|
67
|
-
|
|
68
|
-
Use template `templates/CartBadge.tsx`.
|
|
69
|
-
|
|
70
|
-
Mounted once in `Navigation.astro` (by the `cart-checkout` scope). Shows cart item count; listens for `cart-updated` custom event.
|
|
71
|
-
|
|
72
|
-
**No `initialCount` prop.** Cart is per-visitor — server-rendering the count breaks SSR caching. On mount, CartBadge reads the sessionStorage snapshot that CartView maintains (same `CART_CACHE_KEY`) to seed the initial count without a visible zero-flash between page navigations, then fetches fresh from the SDK and reconciles. If no snapshot exists (first-ever page load), count starts at 0 like before.
|
|
73
|
-
|
|
74
|
-
**Mount with `client:only="react"`, never `client:load`.** sessionStorage is browser-only, so SSR would render `count: 0`, then hydration would read the cache and flip to the real number — a visible blink on every page navigation. `client:only` skips SSR entirely; the badge renders once on the client with the cached count already populated.
|
|
75
|
-
|
|
76
|
-
Contract keys: `cartBadge`, `cartBadgeCount`
|
|
77
|
-
|
|
78
|
-
### 3. `src/utils/analytics.ts` — not owned by this scope
|
|
79
|
-
|
|
80
|
-
> `analytics.ts` is a shared utility (canonical source `shared-utilities/analytics.ts`, seeded to `src/utils/analytics.ts`). Import from it (`import { trackEvent } from "../utils/analytics"`) but do not write it.
|
|
81
|
-
|
|
82
|
-
### 4. `src/styles/components-ecom.css` — not owned by this scope
|
|
83
|
-
|
|
84
|
-
> Owned by the **`components-css`** sibling scope. See `./COMPONENTS_CSS.md`. Reference the contract class names from the design tokens in your TSX files; the CSS sibling defines the rules.
|
|
85
|
-
|
|
86
|
-
## Return format
|
|
87
|
-
|
|
88
|
-
```json
|
|
89
|
-
{
|
|
90
|
-
"status": "complete",
|
|
91
|
-
"phase": "ecom-components",
|
|
92
|
-
"scope": "components",
|
|
93
|
-
"summary": "Wrote CartView and CartBadge from templates (CSS handled by components-css sibling)",
|
|
94
|
-
"data": {
|
|
95
|
-
"islands": ["CartView.tsx", "CartBadge.tsx"]
|
|
96
|
-
},
|
|
97
|
-
"files": [
|
|
98
|
-
"src/components/CartView.tsx",
|
|
99
|
-
"src/components/CartBadge.tsx"
|
|
100
|
-
],
|
|
101
|
-
"errors": []
|
|
102
|
-
}
|
|
103
|
-
```
|