@wix/agent-skills 1.0.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/LICENSE +21 -0
- package/README.md +111 -0
- package/package.json +29 -0
- package/skills/wix-app/SKILL.md +344 -0
- package/skills/wix-app/references/APP_IDENTIFIERS.md +35 -0
- package/skills/wix-app/references/APP_MARKET_REVIEW.md +311 -0
- package/skills/wix-app/references/APP_VALIDATION.md +171 -0
- package/skills/wix-app/references/BACKEND_API.md +233 -0
- package/skills/wix-app/references/BACKEND_EVENT.md +116 -0
- package/skills/wix-app/references/CODE_QUALITY.md +33 -0
- package/skills/wix-app/references/CUSTOM_ELEMENT_WIDGET.md +587 -0
- package/skills/wix-app/references/DASHBOARD_MENU_PLUGIN.md +157 -0
- package/skills/wix-app/references/DASHBOARD_MODAL.md +283 -0
- package/skills/wix-app/references/DASHBOARD_PAGE.md +403 -0
- package/skills/wix-app/references/DASHBOARD_PLUGIN.md +205 -0
- package/skills/wix-app/references/DATA_COLLECTION.md +451 -0
- package/skills/wix-app/references/DOCUMENTATION.md +42 -0
- package/skills/wix-app/references/EDITOR_REACT_COMPONENT.md +65 -0
- package/skills/wix-app/references/EMBEDDED_SCRIPT.md +468 -0
- package/skills/wix-app/references/EXTENSION_REGISTRATION.md +96 -0
- package/skills/wix-app/references/SERVICE_PLUGIN.md +235 -0
- package/skills/wix-app/references/SITE_PLUGIN.md +436 -0
- package/skills/wix-app/references/STORES_VERSIONING.md +334 -0
- package/skills/wix-app/references/backend-event/COMMON-EVENTS.md +84 -0
- package/skills/wix-app/references/custom-element-widget/SETTINGS_PANEL.md +345 -0
- package/skills/wix-app/references/dashboard-menu-plugin/blog-slots.md +71 -0
- package/skills/wix-app/references/dashboard-menu-plugin/bookings-slots.md +58 -0
- package/skills/wix-app/references/dashboard-menu-plugin/crm-slots.md +8 -0
- package/skills/wix-app/references/dashboard-menu-plugin/ecommerce-slots.md +17 -0
- package/skills/wix-app/references/dashboard-menu-plugin/events-slots.md +29 -0
- package/skills/wix-app/references/dashboard-menu-plugin/restaurants-slots.md +27 -0
- package/skills/wix-app/references/dashboard-menu-plugin/stores-slots.md +35 -0
- package/skills/wix-app/references/dashboard-page/API_SPEC.md +138 -0
- package/skills/wix-app/references/dashboard-page/DASHBOARD_API.md +573 -0
- package/skills/wix-app/references/dashboard-page/DYNAMIC_PARAMETERS.md +269 -0
- package/skills/wix-app/references/dashboard-page/ECOM_NAVIGATION.md +164 -0
- package/skills/wix-app/references/dashboard-plugin/SLOTS.md +294 -0
- package/skills/wix-app/references/data-collection/WIX_DATA.md +270 -0
- package/skills/wix-app/references/data-collection/extension-template.ts +107 -0
- package/skills/wix-app/references/editor-react-component/ACCESSIBILITY.md +138 -0
- package/skills/wix-app/references/editor-react-component/COMPONENT-API.md +454 -0
- package/skills/wix-app/references/editor-react-component/COMPONENT-CONFIGURATION.md +165 -0
- package/skills/wix-app/references/editor-react-component/CSS-GUIDELINES.md +576 -0
- package/skills/wix-app/references/editor-react-component/DIRECTIONALITY.md +170 -0
- package/skills/wix-app/references/editor-react-component/EDIT-FLOW.md +6 -0
- package/skills/wix-app/references/editor-react-component/PARTS.md +25 -0
- package/skills/wix-app/references/editor-react-component/PROPS-VS-CSS.md +203 -0
- package/skills/wix-app/references/editor-react-component/REACT-GUIDELINES.md +167 -0
- package/skills/wix-app/references/editor-react-component/REACT-PATTERNS.md +137 -0
- package/skills/wix-app/references/service-plugin/ADDITIONAL-FEES.md +112 -0
- package/skills/wix-app/references/service-plugin/BOOKINGS-STAFF-SORTING.md +118 -0
- package/skills/wix-app/references/service-plugin/DISCOUNT-TRIGGERS.md +87 -0
- package/skills/wix-app/references/service-plugin/GIFT-CARDS.md +86 -0
- package/skills/wix-app/references/service-plugin/PAYMENT-SETTINGS.md +135 -0
- package/skills/wix-app/references/service-plugin/SHIPPING-RATES.md +79 -0
- package/skills/wix-app/references/service-plugin/VALIDATIONS.md +68 -0
- package/skills/wix-app/references/site-plugin/EXAMPLES.md +311 -0
- package/skills/wix-app/references/site-plugin/SLOTS.md +263 -0
- package/skills/wix-design-system/SKILL.md +129 -0
- package/skills/wix-design-system/references/file-structure.md +56 -0
- package/skills/wix-design-system/scripts/wds.cjs +531 -0
- package/skills/wix-headless/SKILL.md +418 -0
- package/skills/wix-headless/references/DISCOVERY.md +332 -0
- package/skills/wix-headless/references/ORCHESTRATION.md +269 -0
- package/skills/wix-headless/references/SETUP.md +154 -0
- package/skills/wix-headless/references/blog/BLOG_CONTENT.md +152 -0
- package/skills/wix-headless/references/blog/BLOG_PAGES.md +299 -0
- package/skills/wix-headless/references/blog/BLOG_SETUP.md +218 -0
- package/skills/wix-headless/references/blog/INSTRUCTIONS.md +32 -0
- package/skills/wix-headless/references/cms/CMS_FOUNDATIONS.md +373 -0
- package/skills/wix-headless/references/cms/FAQ_KNOWLEDGE_BASE.md +229 -0
- package/skills/wix-headless/references/cms/INSTRUCTIONS.md +40 -0
- package/skills/wix-headless/references/cms/PORTFOLIO.md +454 -0
- package/skills/wix-headless/references/cms/RESOURCE_LIBRARY.md +356 -0
- package/skills/wix-headless/references/cms/TEAM_DIRECTORY.md +299 -0
- package/skills/wix-headless/references/commands/install-app.md +42 -0
- package/skills/wix-headless/references/commands/known-apps.json +5 -0
- package/skills/wix-headless/references/commands/mcp-bootstrap.md +28 -0
- package/skills/wix-headless/references/designer/INSTRUCTIONS.md +828 -0
- package/skills/wix-headless/references/ecom/CART_PAGES.md +120 -0
- package/skills/wix-headless/references/ecom/CART_WIRING.md +103 -0
- package/skills/wix-headless/references/ecom/COMPONENTS_CSS.md +132 -0
- package/skills/wix-headless/references/ecom/INSTRUCTIONS.md +59 -0
- package/skills/wix-headless/references/forms/CONTACT_FORM.md +477 -0
- package/skills/wix-headless/references/forms/INSTRUCTIONS.md +43 -0
- package/skills/wix-headless/references/gift-cards/COMPONENTS.md +119 -0
- package/skills/wix-headless/references/gift-cards/INSTRUCTIONS.md +51 -0
- package/skills/wix-headless/references/gift-cards/PAGES.md +129 -0
- package/skills/wix-headless/references/images/INSTRUCTIONS.md +359 -0
- package/skills/wix-headless/references/shared/BUILD_NOISE.md +8 -0
- package/skills/wix-headless/references/shared/IMAGE_GENERATION.md +185 -0
- package/skills/wix-headless/references/shared/IMPLEMENTER.md +155 -0
- package/skills/wix-headless/references/shared/MCP_PREFIX.md +105 -0
- package/skills/wix-headless/references/shared/PRODUCTION_SHARP_EDGES.md +97 -0
- package/skills/wix-headless/references/shared/RETURN_CONTRACT.md +423 -0
- package/skills/wix-headless/references/shared/STYLING.md +117 -0
- package/skills/wix-headless/references/stores/BACK_IN_STOCK.md +178 -0
- package/skills/wix-headless/references/stores/CATEGORY_PAGES.md +86 -0
- package/skills/wix-headless/references/stores/COMPONENTS_CSS.md +129 -0
- package/skills/wix-headless/references/stores/HOME_AND_NAV.md +227 -0
- package/skills/wix-headless/references/stores/INSTRUCTIONS.md +96 -0
- package/skills/wix-headless/references/stores/PRODUCT_CATALOG_DATA.md +249 -0
- package/skills/wix-headless/references/stores/PRODUCT_PAGES.md +213 -0
- package/skills/wix-headless/references/stores/SHARED_WIRING.md +164 -0
- package/skills/wix-headless/references/verticals/_schema.json +160 -0
- package/skills/wix-headless/references/verticals/_schema.md +185 -0
- package/skills/wix-headless/references/verticals/blog.md +125 -0
- package/skills/wix-headless/references/verticals/cms.md +121 -0
- package/skills/wix-headless/references/verticals/ecom.md +96 -0
- package/skills/wix-headless/references/verticals/forms.md +106 -0
- package/skills/wix-headless/references/verticals/gift-cards.md +121 -0
- package/skills/wix-headless/references/verticals/stores.md +167 -0
- package/skills/wix-headless/scripts/check-manifest.mjs +198 -0
- package/skills/wix-headless/scripts/copy-utility-templates.mjs +153 -0
- package/skills/wix-headless/scripts/emit-design-tokens.mjs +77 -0
- package/skills/wix-headless/scripts/finalize-run-json.mjs +141 -0
- package/skills/wix-headless/scripts/init-site-json.mjs +63 -0
- package/skills/wix-headless/scripts/patch-decorative-slots.mjs +124 -0
- package/skills/wix-headless/scripts/plan-entity-image-waves.mjs +190 -0
- package/skills/wix-headless/scripts/preview.sh +45 -0
- package/skills/wix-headless/scripts/release.sh +73 -0
- package/skills/wix-headless/scripts/scaffold.sh +53 -0
- package/skills/wix-headless/scripts/seed-utilities.sh +55 -0
- package/skills/wix-headless/shared-utilities/analytics.ts +40 -0
- package/skills/wix-headless/shared-utilities/ricos.ts +179 -0
- package/skills/wix-headless/shared-utilities/wix-image.ts +72 -0
- package/skills/wix-headless/templates/ecom/CartBadge.tsx +84 -0
- package/skills/wix-headless/templates/ecom/CartView.tsx +543 -0
- package/skills/wix-headless/templates/ecom/cart.astro +13 -0
- package/skills/wix-headless/templates/ecom/components-ecom.css +215 -0
- package/skills/wix-headless/templates/ecom/discounts.ts +71 -0
- package/skills/wix-headless/templates/ecom/thank-you.astro +24 -0
- package/skills/wix-headless/templates/gift-cards/GiftCardPurchase.tsx +172 -0
- package/skills/wix-headless/templates/gift-cards/_home-teaser-snippet.astro +42 -0
- package/skills/wix-headless/templates/gift-cards/_nav-snippet.astro +11 -0
- package/skills/wix-headless/templates/gift-cards/components-gift-cards.css +219 -0
- package/skills/wix-headless/templates/gift-cards/gift-cards.astro +51 -0
- package/skills/wix-headless/templates/gift-cards/gift-cards.ts +75 -0
- package/skills/wix-headless/templates/stores/AddToCartButton.tsx +77 -0
- package/skills/wix-headless/templates/stores/BackInStockForm.tsx +176 -0
- package/skills/wix-headless/templates/stores/CategoryRail.astro +69 -0
- package/skills/wix-headless/templates/stores/ProductCard.astro +79 -0
- package/skills/wix-headless/templates/stores/ProductPurchase.tsx +397 -0
- package/skills/wix-headless/templates/stores/SeoTags.astro +21 -0
- package/skills/wix-headless/templates/stores/back-in-stock.ts +67 -0
- package/skills/wix-headless/templates/stores/categories.ts +155 -0
- package/skills/wix-headless/templates/stores/category/[slug].astro +130 -0
- package/skills/wix-headless/templates/stores/components-stores.css +295 -0
- package/skills/wix-headless/templates/stores/products/[slug].astro +128 -0
- package/skills/wix-headless/templates/stores/products/index.astro +101 -0
- package/skills/wix-manage/SKILL.md +280 -0
- package/skills/wix-manage/references/app-installation/install-wix-apps.md +155 -0
- package/skills/wix-manage/references/app-installation/list-installed-apps.md +124 -0
- package/skills/wix-manage/references/blog/how-to-create-blog-posts.md +226 -0
- package/skills/wix-manage/references/bookings/booking-service-policy-setup.md +95 -0
- package/skills/wix-manage/references/bookings/booking-system-integration-gaps.md +416 -0
- package/skills/wix-manage/references/bookings/bookings-staff-setup.md +255 -0
- package/skills/wix-manage/references/bookings/create-and-update-booking-services.md +462 -0
- package/skills/wix-manage/references/bookings/end-to-end-booking-flow.md +278 -0
- package/skills/wix-manage/references/bookings/external-calendar-integration.md +258 -0
- package/skills/wix-manage/references/bookings/multi-resource-service-creation.md +231 -0
- package/skills/wix-manage/references/calendar/configure-default-business-hours.md +226 -0
- package/skills/wix-manage/references/cms/cms-data-items-crud.md +422 -0
- package/skills/wix-manage/references/cms/cms-data-operations-extended.md +263 -0
- package/skills/wix-manage/references/cms/cms-ecommerce-catalog-integration.md +136 -0
- package/skills/wix-manage/references/cms/cms-references-and-relationships.md +160 -0
- package/skills/wix-manage/references/cms/cms-schema-management.md +143 -0
- package/skills/wix-manage/references/contacts/bulk-delete-contacts.md +73 -0
- package/skills/wix-manage/references/contacts/bulk-label-and-unlabel-contacts.md +67 -0
- package/skills/wix-manage/references/domains/domain-search-and-purchase.md +434 -0
- package/skills/wix-manage/references/ecommerce/api-recommendation-tracking.md +420 -0
- package/skills/wix-manage/references/ecommerce/flow-add-free-shipping.md +267 -0
- package/skills/wix-manage/references/ecommerce/flow-bundle-and-save.md +290 -0
- package/skills/wix-manage/references/ecommerce/flow-fix-coverage-gaps.md +300 -0
- package/skills/wix-manage/references/ecommerce/flow-optimize-shipping-rates.md +364 -0
- package/skills/wix-manage/references/ecommerce/flow-seasonal-promotion.md +315 -0
- package/skills/wix-manage/references/ecommerce/flow-stock-mover.md +308 -0
- package/skills/wix-manage/references/ecommerce/flow-upsell-boost.md +271 -0
- package/skills/wix-manage/references/ecommerce/goal-clear-inventory.md +118 -0
- package/skills/wix-manage/references/ecommerce/goal-drive-cross-sells.md +122 -0
- package/skills/wix-manage/references/ecommerce/goal-increase-aov.md +132 -0
- package/skills/wix-manage/references/ecommerce/goal-reduce-cart-abandonment.md +148 -0
- package/skills/wix-manage/references/ecommerce/goal-seasonal-revenue.md +146 -0
- package/skills/wix-manage/references/ecommerce/guardrail-discount-conflicts.md +118 -0
- package/skills/wix-manage/references/ecommerce/guardrail-margin-protection.md +88 -0
- package/skills/wix-manage/references/ecommerce/guardrail-rate-pricing-sanity.md +108 -0
- package/skills/wix-manage/references/ecommerce/guardrail-shipping-health.md +124 -0
- package/skills/wix-manage/references/ecommerce/recipe-apply-shipping-recommendations.md +299 -0
- package/skills/wix-manage/references/ecommerce/recommend-ecommerce-strategy.md +582 -0
- package/skills/wix-manage/references/ecommerce/setup-coupons.md +338 -0
- package/skills/wix-manage/references/ecommerce/setup-discount-rules.md +444 -0
- package/skills/wix-manage/references/ecommerce/setup-shipping-rates.md +86 -0
- package/skills/wix-manage/references/ecommerce/setup-shipping-regions.md +56 -0
- package/skills/wix-manage/references/ecommerce/setup-store-pickup-location.md +209 -0
- package/skills/wix-manage/references/ecommerce/skill-graph.md +139 -0
- package/skills/wix-manage/references/ecommerce/troubleshoot-checkout-delivery-dropoff.md +124 -0
- package/skills/wix-manage/references/ecommerce/troubleshoot-discount-not-applying.md +95 -0
- package/skills/wix-manage/references/events/list-events.md +203 -0
- package/skills/wix-manage/references/forms/create-form.md +260 -0
- package/skills/wix-manage/references/get-paid/create-payment-links.md +212 -0
- package/skills/wix-manage/references/get-paid/how-to-setup-wix-payments.md +57 -0
- package/skills/wix-manage/references/get-paid/payment-links-for-bookings.md +101 -0
- package/skills/wix-manage/references/media/upload-media-to-wix.md +216 -0
- package/skills/wix-manage/references/pricing-plans/create-and-update-pricing-plans.md +77 -0
- package/skills/wix-manage/references/pricing-plans/pricing-plans-bookings-integration.md +166 -0
- package/skills/wix-manage/references/restaurants/wix-restaurants-setup.md +336 -0
- package/skills/wix-manage/references/rich-content/ricos-converter-service.md +295 -0
- package/skills/wix-manage/references/site-properties/change-payment-currency-site-properties.md +59 -0
- package/skills/wix-manage/references/sites/create-site-from-template.md +183 -0
- package/skills/wix-manage/references/sites/query-sites.md +125 -0
- package/skills/wix-manage/references/stores/add-store-pages-to-site.md +57 -0
- package/skills/wix-manage/references/stores/bulk-create-products-with-options.md +1041 -0
- package/skills/wix-manage/references/stores/create-product-catalog-v1.md +125 -0
- package/skills/wix-manage/references/stores/create-product-from-image.md +824 -0
- package/skills/wix-manage/references/stores/create-product-with-options-catalog-v3.md +566 -0
- package/skills/wix-manage/references/stores/find-products-query-and-search-catalog-v3.md +194 -0
- package/skills/wix-manage/references/stores/query-products-catalog-v1.md +80 -0
- package/skills/wix-manage/references/stores/setup-online-store-catalog-v3.md +99 -0
- package/skills/wix-manage/references/stores/update-product-pre-order.md +213 -0
- package/skills/wix-manage/references/stores/update-product-with-options.md +318 -0
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
# Phase 3 Components — Stores (TSX/Astro)
|
|
2
|
+
|
|
3
|
+
Launched in **Step 4.5** (after Phase 2 Design System completes, parallel to any running designer page scopes). Writes code that depends on the **design tokens** but NOT on Phase 4 page markup. Finishes before the Phase 4 Pages scopes run in Step 7.
|
|
4
|
+
|
|
5
|
+
> **CSS lives in a sibling scope.** `src/styles/components-stores.css` is owned by the `components-css` scope (see `./COMPONENTS_CSS.md`), which runs concurrently with this one in the same Step 4.5 batch. This scope does NOT write the CSS file. Reference contract class names from the design tokens here; the CSS sibling defines the rules.
|
|
6
|
+
|
|
7
|
+
## Scope
|
|
8
|
+
|
|
9
|
+
Files this agent OWNS (creates fresh, no designer output to read):
|
|
10
|
+
|
|
11
|
+
- `src/components/SeoTags.astro` — Renders `product.seoData.tags` into `<head>`
|
|
12
|
+
- `src/components/AddToCartButton.tsx` — React island; optimistic add-to-cart
|
|
13
|
+
- `src/components/ProductPurchase.tsx` — React island; option selectors + variant resolution + wraps AddToCartButton
|
|
14
|
+
- `src/components/BackInStockForm.tsx` — React island; back-in-stock subscription form
|
|
15
|
+
|
|
16
|
+
Files this agent MUST NOT touch:
|
|
17
|
+
- `src/styles/components-stores.css` — owned by the **`components-css`** sibling scope (see `./COMPONENTS_CSS.md`). Reference its class names; do not write the file.
|
|
18
|
+
- `src/utils/wix-image.ts` — **shared utility shipped by the build skill.** Import `resolveWixImageUrl` from `../utils/wix-image`; do NOT write your own copy (would shadow the shared util and drop other verticals' callers). The canonical source lives at `<SKILL_ROOT>/shared-utilities/wix-image.ts`; it's copied into projects by `seed-utilities.sh` during Setup.
|
|
19
|
+
- `src/components/CartView.tsx`, `src/components/CartBadge.tsx`, `src/utils/analytics.ts`, `src/styles/components-ecom.css` — owned by ecom
|
|
20
|
+
- Any `.astro` page — those are designed and later rewritten by other scopes
|
|
21
|
+
- `src/styles/global.css` — owned by designer foundation
|
|
22
|
+
- `src/layouts/Layout.astro` — owned by designer foundation (including the `components-stores.css` import line)
|
|
23
|
+
- Any designed component (`ProductCard.astro`, `Navigation.astro`, etc.) — owned by designers
|
|
24
|
+
|
|
25
|
+
## Coordination: design tokens
|
|
26
|
+
|
|
27
|
+
Your parent prompt includes the design tokens inline. Use it directly — do **not** read `.wix/design-tokens.css` + `.wix/site.d.ts` from disk and do not poll for it. The parent skill serializes your launch behind designer foundation specifically so the contract is already available in your prompt when you start.
|
|
28
|
+
|
|
29
|
+
Reference the ACTUAL class names from the contract in React components (e.g. `className="add-to-cart-btn"`, not `className="addToCartButton"` or an invented name). See `references/shared/IMPLEMENTER.md` § "Contract class-name adaptation" for the full rule.
|
|
30
|
+
|
|
31
|
+
## Critical rules
|
|
32
|
+
|
|
33
|
+
1. **Import `productsV3`, never `products`** — V1 silently returns 0 results on V3 catalogs (used in `ProductPurchase.tsx` type definitions).
|
|
34
|
+
2. **Always include `variantId` in `catalogReference.options`** — even single-variant products have one. Without it, `addToCurrentCart` returns 200 OK but silently adds nothing.
|
|
35
|
+
3. **No HTML comments in `.astro` frontmatter** — frontmatter is TypeScript; use `//` or `/* */`. Build-fails with "Legacy HTML single-line comments are not allowed".
|
|
36
|
+
4. **Use brand-token Tailwind utilities on React islands** (e.g., `bg-bark`, `text-cream`), never default Tailwind colors (`bg-green-50`, `text-red-600`). See IMPLEMENTER.md § "Contract class-name adaptation" for the class-name rule itself.
|
|
37
|
+
5. **Analytics is fire-and-forget** — see `references/shared/IMPLEMENTER.md` § "Fire-and-forget analytics".
|
|
38
|
+
|
|
39
|
+
## Template files
|
|
40
|
+
|
|
41
|
+
This scope uses **template files** instead of inline code. For each file below:
|
|
42
|
+
|
|
43
|
+
1. Read the template from `<Agent location>/templates/<filename>`
|
|
44
|
+
2. Write it to the project at the target path
|
|
45
|
+
3. Adapt CSS class names if the design tokens maps them differently than the defaults
|
|
46
|
+
|
|
47
|
+
Do NOT modify logic, imports, or component structure.
|
|
48
|
+
|
|
49
|
+
## Implementation
|
|
50
|
+
|
|
51
|
+
### 1. `src/styles/components-stores.css` — not owned by this scope
|
|
52
|
+
|
|
53
|
+
> Owned by the **`components-css`** sibling scope. See `./COMPONENTS_CSS.md`. Reference the contract class names from the design tokens in your TSX/Astro files; the CSS sibling defines the rules.
|
|
54
|
+
|
|
55
|
+
### 2. `src/utils/analytics.ts` — not owned by this scope
|
|
56
|
+
|
|
57
|
+
> Import from it (`import { trackEvent } from "../utils/analytics"`) but do not write it. Shipped by the build skill as a seeded shared utility.
|
|
58
|
+
|
|
59
|
+
### 3. `src/utils/wix-image.ts` — not owned by this scope
|
|
60
|
+
|
|
61
|
+
> Import `resolveWixImageUrl` from `../utils/wix-image` but do not write it. Shipped by the build skill as a seeded shared utility that already exposes `resolveWixImageUrl(image, width?, height?)`. Writing your own copy shadows and breaks callers in other verticals (blog, cms).
|
|
62
|
+
|
|
63
|
+
### 4. `src/components/SeoTags.astro`
|
|
64
|
+
|
|
65
|
+
Use template `templates/SeoTags.astro`.
|
|
66
|
+
|
|
67
|
+
Renders merchant-edited SEO from the Wix dashboard into `<head>`. Mounted on the product detail page (by `product-pages` scope) via `Layout`'s `head` slot.
|
|
68
|
+
|
|
69
|
+
`product.seoData` is returned by default from `getProductBySlug` — no `fields` flag needed.
|
|
70
|
+
|
|
71
|
+
### 5. `src/components/AddToCartButton.tsx`
|
|
72
|
+
|
|
73
|
+
Use template `templates/AddToCartButton.tsx`.
|
|
74
|
+
|
|
75
|
+
Optimistic add-to-cart button. Shows "Added ✓" immediately; fires API in background; reverts on failure. Dispatches `cart-updated` events so CartBadge can update badge count instantly.
|
|
76
|
+
|
|
77
|
+
Uses `@wix/ecom` `currentCart.addToCurrentCart`. `WIX_STORES_APP_ID` is the Stores appDefId constant (`215238eb-22a5-4c36-9e7b-e7c08025e04e`) used in `catalogReference.appId`.
|
|
78
|
+
|
|
79
|
+
**Modifier support** — accepts pre-flattened `modifierChoices` and `customTextFields` from ProductPurchase and merges them into `catalogReference.options` per the Wix Stores Catalog V3 contract. ProductPurchase owns the flattening; this component just passes them through.
|
|
80
|
+
|
|
81
|
+
Class from contract: `addToCartButton` → `"add-to-cart-btn"`.
|
|
82
|
+
|
|
83
|
+
### 6. `src/components/CartBadge.tsx` — not owned by this scope
|
|
84
|
+
|
|
85
|
+
> Do not write this file. AddToCartButton dispatches `cart-updated` CustomEvents that CartBadge (owned by ecom) listens for.
|
|
86
|
+
|
|
87
|
+
### 7. `src/components/ProductPurchase.tsx`
|
|
88
|
+
|
|
89
|
+
Use template `templates/ProductPurchase.tsx`.
|
|
90
|
+
|
|
91
|
+
Handles variant selection, quantity selector, stock awareness, and wraps `AddToCartButton`. Mounted on product detail pages (by `product-pages` scope) as:
|
|
92
|
+
|
|
93
|
+
```tsx
|
|
94
|
+
<ProductPurchase client:load product={product} inventoryByVariant={inventoryByVariant} />
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**Prop contract — single `product` object.** The template accepts the full productsV3 product and destructures internally. This mirrors `ProductCard.astro`'s `{ product }` contract so both stores components take the same shape (prevents the regression observed in an earlier run where a fallback-written `[slug].astro` passed `product` as a whole when the component expected flat props).
|
|
98
|
+
|
|
99
|
+
Key behaviors:
|
|
100
|
+
- `hasMeaningfulOptions` — a product has meaningful options only when at least one option has >1 choice. Dummy single-choice options (e.g., "Type: Standard") are treated as no options.
|
|
101
|
+
- Out of stock → renders just the message, no button.
|
|
102
|
+
- No meaningful options → renders quantity + AddToCartButton with default variant ID.
|
|
103
|
+
- Has options → renders pill selectors + quantity + AddToCartButton with resolved variant ID.
|
|
104
|
+
- **Modifiers** — customization choices that do NOT create separate variants. Pills for `modifierRenderType === "TEXT_CHOICES"` / `"SWATCH_CHOICES"`, textarea for `"FREE_TEXT"`. Mandatory modifiers must have a value before add-to-cart is enabled. Selections flatten into `{ options: { [modifier.key]: choice.key }, customTextFields: { [modifier.freeTextSettings.key]: text } }` before being handed to AddToCartButton.
|
|
105
|
+
- **OOS gating** — source of truth is `inventoryByVariant` (from `inventoryItemsV3`). `variantsInfo[].inventoryStatus.inStock` is a stale cached flag and is only used when the live map is empty. See PRODUCT_PAGES.md for the detail-page query that populates `inventoryByVariant`.
|
|
106
|
+
|
|
107
|
+
Classes from contract (stores pack):
|
|
108
|
+
|
|
109
|
+
- **Global** (CSS in foundation's `global.css`):
|
|
110
|
+
- `productPurchase` → `"product-purchase"` (outer wrapper — use on the root `<div>`)
|
|
111
|
+
- **Scoped** (CSS in `components-stores.css`, owned by the `components-css` sibling scope — see `./COMPONENTS_CSS.md`):
|
|
112
|
+
- `optionGroup` → `"option-group"`
|
|
113
|
+
- `optionLabel` → `"option-label"`
|
|
114
|
+
- `optionChoices` → `"option-choices"`
|
|
115
|
+
- `optionPill` → `"option-pill"` (state modifier `.selected` for active choice)
|
|
116
|
+
- `quantitySelector` → `"quantity-selector"`
|
|
117
|
+
- `quantityBtn` → `"quantity-btn"`
|
|
118
|
+
- `quantityValue` → `"quantity-value"`
|
|
119
|
+
- `stockStatus` → `"stock-status"`
|
|
120
|
+
|
|
121
|
+
**Do not invent new class names** — if a new interactive control needs a class, add it to the pack's `contractKeys.scoped` first.
|
|
122
|
+
|
|
123
|
+
### 8. `src/components/CartView.tsx` — not owned by this scope
|
|
124
|
+
|
|
125
|
+
> Do not write this file.
|
|
126
|
+
|
|
127
|
+
## Return format
|
|
128
|
+
|
|
129
|
+
```json
|
|
130
|
+
{
|
|
131
|
+
"status": "complete",
|
|
132
|
+
"phase": "stores-components",
|
|
133
|
+
"scope": "components",
|
|
134
|
+
"summary": "Wrote React islands and Astro components from templates (CSS handled by components-css sibling)",
|
|
135
|
+
"data": {
|
|
136
|
+
"islands": ["ProductPurchase.tsx", "AddToCartButton.tsx", "BackInStockForm.tsx"],
|
|
137
|
+
"astroComponents": ["SeoTags.astro"],
|
|
138
|
+
"globalContractClassesReferenced": ["addToCartButton", "productPurchase"],
|
|
139
|
+
"scopedContractClassesReferenced": ["optionGroup", "optionLabel", "optionChoices", "optionPill", "stockStatus", "quantitySelector", "quantityBtn", "quantityValue"]
|
|
140
|
+
},
|
|
141
|
+
"files": [
|
|
142
|
+
"src/components/SeoTags.astro",
|
|
143
|
+
"src/components/AddToCartButton.tsx",
|
|
144
|
+
"src/components/ProductPurchase.tsx",
|
|
145
|
+
"src/components/BackInStockForm.tsx"
|
|
146
|
+
],
|
|
147
|
+
"errors": []
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## Anti-patterns
|
|
152
|
+
|
|
153
|
+
| WRONG | CORRECT |
|
|
154
|
+
|-------|---------|
|
|
155
|
+
| Read designer `.astro` files | Not needed — this scope doesn't touch pages |
|
|
156
|
+
| Import `products` from `@wix/stores` | Use `productsV3` |
|
|
157
|
+
| Write `src/utils/wix-image.ts` | Import from it — shared util already exposes `resolveWixImageUrl` |
|
|
158
|
+
| Hardcode `className="btn-primary"` | Use contract class `className="add-to-cart-btn"` |
|
|
159
|
+
| Default Tailwind color utilities on React islands (`bg-green-50`, `bg-blue-500`) | Brand `@theme` utilities (`bg-bark`, `text-cream`) or contract class names |
|
|
160
|
+
| `<!--` HTML comments in `.astro` frontmatter | `//` or `/* */` — frontmatter is TypeScript |
|
|
161
|
+
| Omit `WIX_STORES_APP_ID` constant | Hardcoded `215238eb-22a5-4c36-9e7b-e7c08025e04e` in AddToCartButton for `catalogReference.appId` |
|
|
162
|
+
| Introspect `node_modules/@wix/*` | All symbols are documented here; if missing, call `<prefix>SearchWixSDKDocumentation` |
|
|
163
|
+
| Write `CartView.tsx`, `CartBadge.tsx`, or `analytics.ts` | Not owned by this scope — do not write |
|
|
164
|
+
| Pass flat props to `ProductPurchase` (`productId`, `options`, `variantsInfo`, …) | Pass the whole product: `<ProductPurchase product={product} inventoryByVariant={inventoryByVariant} />` |
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "Wix Headless Vertical Frontmatter",
|
|
4
|
+
"description": "Validates verticals/<name>.md frontmatter. Runs at session start; malformed vertical aborts the skill.",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": ["name", "description", "packages"],
|
|
7
|
+
"additionalProperties": true,
|
|
8
|
+
"properties": {
|
|
9
|
+
"name": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"pattern": "^[a-z][a-z0-9-]*$",
|
|
12
|
+
"description": "Must match filename stem (e.g., stores.md → 'stores')"
|
|
13
|
+
},
|
|
14
|
+
"triggers": {
|
|
15
|
+
"type": "array",
|
|
16
|
+
"items": { "type": "string" }
|
|
17
|
+
},
|
|
18
|
+
"description": { "type": "string" },
|
|
19
|
+
"requires": {
|
|
20
|
+
"type": "array",
|
|
21
|
+
"items": { "type": "string" }
|
|
22
|
+
},
|
|
23
|
+
"features": {
|
|
24
|
+
"type": "array",
|
|
25
|
+
"items": {
|
|
26
|
+
"type": "object",
|
|
27
|
+
"required": ["name", "description"],
|
|
28
|
+
"properties": {
|
|
29
|
+
"name": { "type": "string" },
|
|
30
|
+
"description": { "type": "string" }
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"apps": {
|
|
35
|
+
"type": "array",
|
|
36
|
+
"items": {
|
|
37
|
+
"oneOf": [
|
|
38
|
+
{ "type": "string", "description": "App name (resolved via known-apps.json)" },
|
|
39
|
+
{
|
|
40
|
+
"type": "object",
|
|
41
|
+
"required": ["name"],
|
|
42
|
+
"properties": {
|
|
43
|
+
"name": { "type": "string" },
|
|
44
|
+
"appDefId": { "type": "string" }
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"packages": {
|
|
51
|
+
"type": "array",
|
|
52
|
+
"minItems": 1,
|
|
53
|
+
"items": { "type": "string" }
|
|
54
|
+
},
|
|
55
|
+
"routes": {
|
|
56
|
+
"type": "array",
|
|
57
|
+
"items": {
|
|
58
|
+
"type": "object",
|
|
59
|
+
"required": ["route"],
|
|
60
|
+
"properties": {
|
|
61
|
+
"route": { "type": "string", "description": "URL path (e.g. /cart) OR the literal 'Hosted by Wix' for Wix-hosted endpoints like checkout." },
|
|
62
|
+
"name": { "type": "string", "description": "Optional user-facing page name override for DISCOVERY.md's Section C table. When omitted, the orchestrator derives the name from the path (/ → Home; /thank-you → Thank You). Set this only when path-derivation produces a poor name (e.g. /products/[slug] → 'Product Detail') or when the route has no path (e.g. ecom's Wix-hosted Checkout)." }
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"cmsCollections": { "type": "array" },
|
|
67
|
+
"seed": {
|
|
68
|
+
"oneOf": [
|
|
69
|
+
{ "type": "null" },
|
|
70
|
+
{
|
|
71
|
+
"type": "object",
|
|
72
|
+
"required": ["agentLocation", "scope", "references"],
|
|
73
|
+
"properties": {
|
|
74
|
+
"agentLocation": { "type": "string" },
|
|
75
|
+
"scope": { "type": "string", "const": "seed" },
|
|
76
|
+
"description": { "type": "string" },
|
|
77
|
+
"references": { "type": "array", "items": { "type": "string" } }
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
},
|
|
82
|
+
"components": {
|
|
83
|
+
"oneOf": [
|
|
84
|
+
{ "type": "null" },
|
|
85
|
+
{
|
|
86
|
+
"type": "object",
|
|
87
|
+
"required": ["agentLocation", "scope", "references"],
|
|
88
|
+
"properties": {
|
|
89
|
+
"agentLocation": { "type": "string" },
|
|
90
|
+
"scope": { "type": "string", "const": "components" },
|
|
91
|
+
"description": { "type": "string" },
|
|
92
|
+
"references": { "type": "array", "items": { "type": "string" } },
|
|
93
|
+
"files": { "type": "array", "items": { "type": "string" } }
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
},
|
|
98
|
+
"componentsCss": {
|
|
99
|
+
"oneOf": [
|
|
100
|
+
{ "type": "null" },
|
|
101
|
+
{
|
|
102
|
+
"type": "object",
|
|
103
|
+
"required": ["agentLocation", "scope", "references"],
|
|
104
|
+
"description": "Optional sibling of `components`. When present, the orchestrator dispatches a second concurrent Phase 3 subagent that owns the pack's scoped CSS file only — independent of TSX/Astro work in the `components` scope. Used by packs whose `components` agent dominated phase wall time (today: stores). Backward compatible — packs without this field keep the single-agent shape.",
|
|
105
|
+
"properties": {
|
|
106
|
+
"agentLocation": { "type": "string" },
|
|
107
|
+
"scope": { "type": "string", "const": "components-css" },
|
|
108
|
+
"description": { "type": "string" },
|
|
109
|
+
"references": { "type": "array", "items": { "type": "string" } },
|
|
110
|
+
"files": { "type": "array", "items": { "type": "string" } }
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
]
|
|
114
|
+
},
|
|
115
|
+
"pages": {
|
|
116
|
+
"type": "array",
|
|
117
|
+
"items": {
|
|
118
|
+
"type": "object",
|
|
119
|
+
"required": ["agentLocation", "scope", "references"],
|
|
120
|
+
"properties": {
|
|
121
|
+
"name": { "type": "string" },
|
|
122
|
+
"agentLocation": { "type": "string" },
|
|
123
|
+
"scope": {
|
|
124
|
+
"type": "string",
|
|
125
|
+
"pattern": "^pages(-[a-z][a-z0-9-]*)?$",
|
|
126
|
+
"description": "Must be 'pages' or 'pages-<subscope>'"
|
|
127
|
+
},
|
|
128
|
+
"description": { "type": "string" },
|
|
129
|
+
"references": { "type": "array", "items": { "type": "string" } },
|
|
130
|
+
"files": { "type": "array", "items": { "type": "string" } }
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
"creates": {
|
|
135
|
+
"type": "array",
|
|
136
|
+
"items": {
|
|
137
|
+
"type": "object",
|
|
138
|
+
"required": ["file", "phase"],
|
|
139
|
+
"properties": {
|
|
140
|
+
"file": { "type": "string" },
|
|
141
|
+
"phase": { "type": "string", "enum": ["seed", "components", "pages"] }
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
"contributes": {
|
|
146
|
+
"type": "array",
|
|
147
|
+
"items": {
|
|
148
|
+
"type": "object",
|
|
149
|
+
"required": ["file", "marker"],
|
|
150
|
+
"properties": {
|
|
151
|
+
"file": { "type": "string" },
|
|
152
|
+
"marker": { "type": "string", "pattern": "^<!--\\s.*\\s-->$" },
|
|
153
|
+
"description": { "type": "string" }
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
"include": { "type": "boolean", "description": "Pack-level loading flag. If true, the pack is loaded in every site regardless of triggers/requires (today: only the cms pack uses include:true). Default false — the pack loads only when triggers match the user's prompt or another pack pulls it in via requires." },
|
|
158
|
+
"disabled": { "type": "boolean", "description": "Pack-level activation flag, ORTHOGONAL to `include`. If true, the pack's surfaces (pages, nav links, home blocks) are disabled by default — they ship as code but do not appear without a separate user action (today: enabling the matching Wix app from the dashboard, which the pack's runtime probe detects). Files still ship via creates: / contributes: so activation is instant once the user opts in. DISCOVERY.md plan composition (Sections B + C) skips features and routes from disabled packs so the plan never promises a surface the user did not ask for. Today only the gift-cards pack uses disabled:true." }
|
|
159
|
+
}
|
|
160
|
+
}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
# Vertical Schema
|
|
2
|
+
|
|
3
|
+
Each file in `references/verticals/` declares one vertical's contribution to the build flow. The skill reads the user's prompt, loads matching verticals, and assembles the phase-based flow from them.
|
|
4
|
+
|
|
5
|
+
## File format
|
|
6
|
+
|
|
7
|
+
Markdown with YAML frontmatter. The frontmatter is the machine-readable config. The markdown body is human-readable docs (what the vertical does, gotchas, examples).
|
|
8
|
+
|
|
9
|
+
## Frontmatter fields
|
|
10
|
+
|
|
11
|
+
```yaml
|
|
12
|
+
---
|
|
13
|
+
# --- Identity ---
|
|
14
|
+
name: stores # unique vertical name, matches the filename stem
|
|
15
|
+
triggers: # prompt patterns that route the user to this vertical
|
|
16
|
+
- "sell"
|
|
17
|
+
- "ecommerce"
|
|
18
|
+
- "store"
|
|
19
|
+
- "shop"
|
|
20
|
+
description: "Full ecommerce: products, cart, checkout, thank-you"
|
|
21
|
+
|
|
22
|
+
# --- Dependencies ---
|
|
23
|
+
requires: [] # optional list of vertical names that must be co-loaded
|
|
24
|
+
# e.g. stores requires ["ecom"] for cart/checkout
|
|
25
|
+
|
|
26
|
+
# --- Plan contribution ---
|
|
27
|
+
features: # human-readable feature blurbs for the plan
|
|
28
|
+
- name: "Product catalog"
|
|
29
|
+
description: "Browse products with images, prices, and variants."
|
|
30
|
+
- name: "Cart & checkout"
|
|
31
|
+
description: "Add to cart, review, check out via Wix's hosted checkout."
|
|
32
|
+
|
|
33
|
+
# --- Infrastructure ---
|
|
34
|
+
apps: # MCP app installs (0 or more per pack)
|
|
35
|
+
- name: "Wix Stores"
|
|
36
|
+
appDefId: "215238eb-22a5-4c36-9e7b-e7c08025e04e"
|
|
37
|
+
packages: # npm packages to install
|
|
38
|
+
- "@wix/stores"
|
|
39
|
+
- "@wix/ecom"
|
|
40
|
+
- "@wix/redirects"
|
|
41
|
+
- "@wix/site"
|
|
42
|
+
|
|
43
|
+
# --- Routes this vertical contributes (for plan assembly) ---
|
|
44
|
+
# Agent dispatch for rewriting page files lives under the 'pages:' phase entry further down.
|
|
45
|
+
routes:
|
|
46
|
+
- route: "/products"
|
|
47
|
+
- route: "/products/[slug]"
|
|
48
|
+
name: "Product Detail" # OPTIONAL: user-facing name override for DISCOVERY's Section C table. When omitted, the orchestrator derives the name from the path (/ → "Home"; /thank-you → "Thank You"). Override only when path-derivation produces a poor name (e.g. /products/[slug] would derive to "Products [slug]") OR when the route has no path (ecom's Wix-hosted Checkout uses route: "Hosted by Wix" + name: "Checkout").
|
|
49
|
+
|
|
50
|
+
# --- CMS collections this vertical declares (if any) ---
|
|
51
|
+
cmsCollections: [] # stores adds none; the cms vertical adds About + FAQ
|
|
52
|
+
|
|
53
|
+
# --- Seed phase: data seeding (MCP-only, no design-token dependency) ---
|
|
54
|
+
seed:
|
|
55
|
+
agentLocation: "references/stores/"
|
|
56
|
+
scope: "seed"
|
|
57
|
+
description: "Delete default sample products, create on-brand products"
|
|
58
|
+
references: ["references/stores/PRODUCT_CATALOG_DATA.md"]
|
|
59
|
+
|
|
60
|
+
# --- Components phase: shared React/Astro components (runs after Design System, parallel with other verticals' components) ---
|
|
61
|
+
components:
|
|
62
|
+
agentLocation: "references/stores/"
|
|
63
|
+
scope: "components"
|
|
64
|
+
description: "SDK-wiring code and reusable islands (reads design tokens + site.d.ts)"
|
|
65
|
+
references: ["references/stores/SHARED_WIRING.md"]
|
|
66
|
+
files:
|
|
67
|
+
- "src/utils/wix-image.ts"
|
|
68
|
+
- "src/utils/analytics.ts"
|
|
69
|
+
- "src/components/SeoTags.astro"
|
|
70
|
+
- "src/components/AddToCartButton.tsx"
|
|
71
|
+
- "src/components/CartBadge.tsx"
|
|
72
|
+
- "src/components/ProductPurchase.tsx"
|
|
73
|
+
- "src/components/CartView.tsx"
|
|
74
|
+
|
|
75
|
+
# --- Pages phase: route files (written ONCE with both visual design and data queries) ---
|
|
76
|
+
pages:
|
|
77
|
+
- name: "product-pages"
|
|
78
|
+
agentLocation: "references/stores/"
|
|
79
|
+
scope: "pages-products"
|
|
80
|
+
references: ["references/stores/PRODUCT_PAGES.md"]
|
|
81
|
+
files:
|
|
82
|
+
- "src/pages/products/index.astro"
|
|
83
|
+
- "src/pages/products/[slug].astro"
|
|
84
|
+
- "src/components/ProductCard.astro"
|
|
85
|
+
- name: "cart-checkout"
|
|
86
|
+
agentLocation: "references/stores/"
|
|
87
|
+
scope: "pages-cart-checkout"
|
|
88
|
+
references: ["references/ecom/CART_PAGES.md"]
|
|
89
|
+
files:
|
|
90
|
+
- "src/pages/cart.astro"
|
|
91
|
+
- "src/pages/thank-you.astro"
|
|
92
|
+
- name: "home-and-nav"
|
|
93
|
+
agentLocation: "references/stores/"
|
|
94
|
+
scope: "pages-home-and-nav"
|
|
95
|
+
references: ["references/stores/HOME_AND_NAV.md"]
|
|
96
|
+
files:
|
|
97
|
+
- "src/pages/index.astro (patch)"
|
|
98
|
+
- "src/components/Navigation.astro (patch)"
|
|
99
|
+
|
|
100
|
+
# --- File ownership declarations ---
|
|
101
|
+
# `creates:` lists files this vertical is the sole author of. Schema validator
|
|
102
|
+
# enforces single-owner (two verticals claiming the same file → fail at session start)
|
|
103
|
+
# and unresolved-import check (if ANY loaded reference imports ../utils/X, some
|
|
104
|
+
# vertical must declare it in `creates:` OR it must be a plugin shared utility).
|
|
105
|
+
# `contributes:` lists files this vertical co-edits via named markers. The Design
|
|
106
|
+
# System phase scaffolds shell files (Navigation.astro, index.astro) with markers;
|
|
107
|
+
# each vertical inserts at its marker. Replaces the old `homeSection:` concept —
|
|
108
|
+
# contributes[].description is surfaced in the plan shown to the user.
|
|
109
|
+
# Skill-level shared utilities (wix-image.ts, analytics.ts, ricos.ts) are NEVER listed here —
|
|
110
|
+
# they ship via <SKILL_ROOT>/shared-utilities/ and are copied into projects by
|
|
111
|
+
# <SKILL_ROOT>/scripts/seed-utilities.sh during Setup.
|
|
112
|
+
creates:
|
|
113
|
+
- { file: src/components/AddToCartButton.tsx, phase: components }
|
|
114
|
+
- { file: src/pages/products/index.astro, phase: pages }
|
|
115
|
+
|
|
116
|
+
contributes:
|
|
117
|
+
- file: src/pages/index.astro
|
|
118
|
+
marker: "<!-- home:stores -->"
|
|
119
|
+
description: "Featured products grid (3–6 items from productsV3.queryProducts)"
|
|
120
|
+
- file: src/components/Navigation.astro
|
|
121
|
+
marker: "<!-- nav:links -->"
|
|
122
|
+
description: "Shop menu link → /products"
|
|
123
|
+
|
|
124
|
+
# --- Loading + activation (orthogonal pack-level flags) ---
|
|
125
|
+
include: false # if true, the pack loads in every site regardless of triggers/requires (today: only `cms` sets include:true). Default false → loads on trigger match or via another pack's requires.
|
|
126
|
+
disabled: false # if true, the pack ships its code but its surfaces (pages, nav, home blocks) are inactive by default — they light up only when the user takes a separate action (today: enabling the matching Wix app from the dashboard, detected by a runtime probe). DISCOVERY.md plan composition (Sections B + C) skips features and routes from disabled packs so the plan never promises a surface the user did not ask for. Today only `gift-cards` sets disabled:true. Default false.
|
|
127
|
+
---
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Field reference
|
|
131
|
+
|
|
132
|
+
| Field | Type | Required | Notes |
|
|
133
|
+
|-------|------|----------|-------|
|
|
134
|
+
| `name` | string | yes | Matches filename stem (e.g., `stores.md` → `name: stores`) |
|
|
135
|
+
| `triggers` | string[] | yes unless `include: true` | Case-insensitive substrings matched against user prompt |
|
|
136
|
+
| `description` | string | yes | Short label for the plan |
|
|
137
|
+
| `features` | object[] | yes | Feature blurbs for the plan's "Features" section |
|
|
138
|
+
| `apps` | object[] | no | MCP app installs; `{name, appDefId}` pairs |
|
|
139
|
+
| `packages` | string[] | yes | npm packages |
|
|
140
|
+
| `routes` | object[] | no | `{route, name?}` — routes the pack ships. Optional `name` overrides the path-derived page name in DISCOVERY's Section C. |
|
|
141
|
+
| `cmsCollections` | object[] | no | Collections this vertical adds |
|
|
142
|
+
| `seed` | object | no | Seed-phase agent config; omit if the vertical has no seeding |
|
|
143
|
+
| `components` | object | no | Components-phase agent config; omit if none |
|
|
144
|
+
| `pages` | object[] | no | Pages-phase agent dispatch (one entry per page-rewrite sub-scope) |
|
|
145
|
+
| `creates` | object[] | no | `{file, phase}` — files this vertical is sole author of. Schema validator enforces single-owner + unresolved-import check. |
|
|
146
|
+
| `contributes` | object[] | no | `{file, marker, description}` — files this vertical co-edits via named markers. |
|
|
147
|
+
| `include` | bool | no | If true, the pack loads in every site regardless of triggers/requires (today: only `cms`). Controls **loading**. |
|
|
148
|
+
| `disabled` | bool | no | If true, the pack ships its code but its surfaces are inactive by default — they light up only via a separate user action (today: enabling the matching Wix app from the dashboard; the pack's runtime probe detects it). DISCOVERY plan composition skips disabled packs from Sections B + C. Today only `gift-cards`. Controls **activation**. |
|
|
149
|
+
|
|
150
|
+
### `include` vs `disabled` — orthogonal axes
|
|
151
|
+
|
|
152
|
+
The two flags answer different questions. Don't conflate them:
|
|
153
|
+
|
|
154
|
+
- **`include`** — *Is this pack in the loaded set?* Default: load when triggers match or another pack pulls it in via `requires:`. `include: true` overrides that and forces the pack to load in every site. Used by `cms` (every site needs About/FAQ).
|
|
155
|
+
- **`disabled`** — *Do this pack's surfaces appear without further user action?* Default: yes — the moment the pack is loaded, its routes and contributions are live. `disabled: true` says no — the code ships, but a separate runtime check (today: a dashboard-app probe) decides whether to render. Used by `gift-cards` (the surface only appears once the user enables the Wix Gift Card app from the dashboard).
|
|
156
|
+
|
|
157
|
+
A pack can be `include: true, disabled: true` (always loaded but never auto-active) or any other combination — they don't conflict.
|
|
158
|
+
|
|
159
|
+
## How the skill uses the vertical
|
|
160
|
+
|
|
161
|
+
1. **Discovery step**: scan loaded verticals for `features`, `routes`, `cmsCollections` → assemble plan markdown.
|
|
162
|
+
2. **Setup phase**: collect `apps`, `packages` → one MCP call per app, one `npm install` with merged package list.
|
|
163
|
+
3. **Seed phase**: for each vertical with a `seed` block, dispatch `seed.agent + scope`.
|
|
164
|
+
4. **Design System phase**: Design System agent writes global styling — `@theme` token contract + a small set of always-required global semantic classes (compound patterns, interactive states, JS targets). Layout/spacing/typography flows through tokens-as-utilities at call sites; see `references/shared/STYLING.md`.
|
|
165
|
+
5. **Components phase**: for each vertical with a `components` block, dispatch `components.agent + scope` (parallel).
|
|
166
|
+
6. **Pages phase**: for each vertical, launch one agent per `pages[*]` entry (parallel).
|
|
167
|
+
|
|
168
|
+
## Adding a new vertical
|
|
169
|
+
|
|
170
|
+
1. Create `<name>.md` in this directory with frontmatter per the schema above.
|
|
171
|
+
2. Create `references/<name>/` with `INSTRUCTIONS.md` and `references/`.
|
|
172
|
+
3. No changes needed to `SKILL.md` or other verticals.
|
|
173
|
+
|
|
174
|
+
The skill discovers verticals by listing this directory. No registration step.
|
|
175
|
+
|
|
176
|
+
## Validation (informal)
|
|
177
|
+
|
|
178
|
+
The skill should sanity-check vertical frontmatter at load time:
|
|
179
|
+
- `name` matches filename stem
|
|
180
|
+
- `packages` non-empty (empty would mean nothing to install)
|
|
181
|
+
- If `seed` is declared, `seed.agentLocation` exists on disk
|
|
182
|
+
- If `components` or `pages` declared, their agent locations exist on disk
|
|
183
|
+
- All declared `apps`, `routes`, `creates`, `contributes` paths are valid and don't collide with another loaded vertical's owned paths
|
|
184
|
+
|
|
185
|
+
If validation fails, fail loud — surface the error to the user. A malformed vertical breaking the whole flow is better than silently dropping it.
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: blog
|
|
3
|
+
triggers: ["blog", "publish articles", "write posts", "content site", "editorial", "journal", "newsletter"]
|
|
4
|
+
description: "Blog — post listing, post detail with rich content, RSS feed, sitemap"
|
|
5
|
+
|
|
6
|
+
features:
|
|
7
|
+
- name: "Blog"
|
|
8
|
+
description: "Publish posts with a listing page, individual post pages with rich content rendering, and an RSS feed."
|
|
9
|
+
- name: "RSS and sitemap"
|
|
10
|
+
description: "Auto-generated RSS feed and XML sitemap for search engine discovery."
|
|
11
|
+
|
|
12
|
+
apps:
|
|
13
|
+
- name: "Wix Blog"
|
|
14
|
+
appDefId: "14bcded7-0066-7c35-14d7-466cb3f09103"
|
|
15
|
+
|
|
16
|
+
packages:
|
|
17
|
+
- "@wix/blog"
|
|
18
|
+
- "@wix/ricos"
|
|
19
|
+
- "@astrojs/rss"
|
|
20
|
+
- "@astrojs/sitemap"
|
|
21
|
+
|
|
22
|
+
routes:
|
|
23
|
+
- route: "/blog"
|
|
24
|
+
- route: "/blog/[slug]"
|
|
25
|
+
name: "Blog Post" # path-derivation would produce "Blog [slug]" — override with the user-facing label
|
|
26
|
+
- route: "/rss.xml"
|
|
27
|
+
|
|
28
|
+
cmsCollections: []
|
|
29
|
+
|
|
30
|
+
seed:
|
|
31
|
+
agentLocation: "references/blog/"
|
|
32
|
+
scope: "seed"
|
|
33
|
+
description: "Ensure Blog app is installed, seed 3 on-brand blog posts via MCP with rich Ricos content"
|
|
34
|
+
references: ["references/blog/BLOG_CONTENT.md"]
|
|
35
|
+
|
|
36
|
+
components:
|
|
37
|
+
agentLocation: "references/blog/"
|
|
38
|
+
scope: "components"
|
|
39
|
+
description: "Blog service module (queryBlogPosts, getPostBySlug), RicosViewer React wrapper, site constants, astro.config sitemap integration"
|
|
40
|
+
references: ["references/blog/BLOG_SETUP.md"]
|
|
41
|
+
files:
|
|
42
|
+
- "src/lib/blog.ts"
|
|
43
|
+
- "src/components/RicosViewer.tsx"
|
|
44
|
+
- "src/consts.ts"
|
|
45
|
+
- "astro.config.mjs (patch — add site property and sitemap integration)"
|
|
46
|
+
|
|
47
|
+
pages:
|
|
48
|
+
- name: "blog-pages"
|
|
49
|
+
agentLocation: "references/blog/"
|
|
50
|
+
scope: "pages"
|
|
51
|
+
description: "Wire blog listing + post detail pages to @wix/blog SDK, add RSS feed endpoint, BlogPost layout, SEO head, date formatting, patch home page latest-posts section"
|
|
52
|
+
references: ["references/blog/BLOG_PAGES.md"]
|
|
53
|
+
files:
|
|
54
|
+
- "src/pages/blog/index.astro"
|
|
55
|
+
- "src/pages/blog/[...slug].astro"
|
|
56
|
+
- "src/pages/rss.xml.js"
|
|
57
|
+
- "src/layouts/BlogPost.astro"
|
|
58
|
+
- "src/components/BaseHead.astro"
|
|
59
|
+
- "src/components/FormattedDate.astro"
|
|
60
|
+
- "src/pages/index.astro (patch — latest-posts section only)"
|
|
61
|
+
|
|
62
|
+
creates:
|
|
63
|
+
- { file: src/lib/blog.ts, phase: components }
|
|
64
|
+
- { file: src/components/RicosViewer.tsx, phase: components }
|
|
65
|
+
- { file: src/consts.ts, phase: components }
|
|
66
|
+
- { file: src/pages/blog/index.astro, phase: pages }
|
|
67
|
+
- { file: src/pages/blog/[...slug].astro, phase: pages }
|
|
68
|
+
- { file: src/pages/rss.xml.js, phase: pages }
|
|
69
|
+
- { file: src/layouts/BlogPost.astro, phase: pages }
|
|
70
|
+
- { file: src/components/BaseHead.astro, phase: pages }
|
|
71
|
+
- { file: src/components/FormattedDate.astro, phase: pages }
|
|
72
|
+
|
|
73
|
+
contributes:
|
|
74
|
+
- file: astro.config.mjs
|
|
75
|
+
marker: "<!-- config:sitemap -->"
|
|
76
|
+
description: "site property + @astrojs/sitemap integration"
|
|
77
|
+
- file: src/pages/index.astro
|
|
78
|
+
marker: "<!-- home:blog -->"
|
|
79
|
+
description: "Latest 3 posts grid (cover images, titles, dates, excerpts) from queryBlogPosts(3)"
|
|
80
|
+
- file: src/components/Navigation.astro
|
|
81
|
+
marker: "<!-- nav:links -->"
|
|
82
|
+
description: "Blog menu link → /blog"
|
|
83
|
+
|
|
84
|
+
include: false
|
|
85
|
+
disabled: false
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
# Blog Pack
|
|
89
|
+
|
|
90
|
+
Blog vertical for content-driven sites. Loaded when the user's prompt mentions blogging, publishing, or editorial content.
|
|
91
|
+
|
|
92
|
+
## Phase decomposition
|
|
93
|
+
|
|
94
|
+
| Scope | Phase | Files | Depends on |
|
|
95
|
+
|-------|-------|-------|------------|
|
|
96
|
+
| `seed` | Phase 1 — Step 3 (bg) | None (MCP only) | MCP connection |
|
|
97
|
+
| `components` | Phase 3 — Step 4.5 (bg) | blog.ts, RicosViewer.tsx, consts.ts, astro.config.mjs | Styling contract |
|
|
98
|
+
| `blog-pages` | Phase 4 — Step 7 (bg) | blog/index.astro, blog/[...slug].astro, rss.xml.js, BlogPost.astro, BaseHead.astro, FormattedDate.astro, index.astro (patch) | Phase 2 Design System + Phase 1 Seed post data |
|
|
99
|
+
|
|
100
|
+
Phase 3 Components runs in the background from Step 4.5 through Phase 4. Phase 4 blog-pages dispatches in Step 7 after Phase 3 + Phase 1 Seed complete — it needs the React islands written by Phase 3 and the seeded post slugs from Phase 1.
|
|
101
|
+
|
|
102
|
+
RSS feed generation (`rss.xml.js`) is included in the blog-pages scope rather than a separate scope — it's ~15 lines, has no design dependency, and doesn't justify its own agent dispatch.
|
|
103
|
+
|
|
104
|
+
## Known failure modes (propagate to agent prompts)
|
|
105
|
+
|
|
106
|
+
| Wrong | Right |
|
|
107
|
+
|-------|-------|
|
|
108
|
+
| `import { items } from "@wix/data"` for blog queries | `import { posts } from "@wix/blog"` — use the Blog SDK |
|
|
109
|
+
| `<article set:html={post.content} />` | `<RicosViewer client:only="react" content={post.richContent} />` — content is Ricos format |
|
|
110
|
+
| Skip `wixMetadata` export on `[...slug].astro` | Required for Wix page routing and SEO |
|
|
111
|
+
| `media.wixMedia.image` as raw URL | `media.getImageUrl(item.media.wixMedia.image).url` — must resolve |
|
|
112
|
+
| Query posts without `RICH_CONTENT` fieldset | Always request `RICH_CONTENT` or `post.richContent` is undefined |
|
|
113
|
+
| `const { tag } = await tags.getTag(id)` | `const tag = await tags.getTag(id)` — returns directly (unlike `getCategory()`) |
|
|
114
|
+
| Scoped `<style>` for RicosViewer overrides | `<style is:global>` — React islands don't inherit scoped Astro styles |
|
|
115
|
+
| Skip `.ricos-content` color overrides | Ricos CSS hardcodes `color: rgb(0, 0, 0)` — invisible on dark themes without overrides |
|
|
116
|
+
|
|
117
|
+
## Images
|
|
118
|
+
|
|
119
|
+
Cover images for blog posts are generated by the shared image agent (`image-phase-2-entity` scope), not by blog agents. The image agent PATCHes cover images onto post records after Phase 1 Seed creates them. Phase 4 agents query posts and render `post.media` — the image URL flows through the post record.
|
|
120
|
+
|
|
121
|
+
## References
|
|
122
|
+
|
|
123
|
+
- `references/blog/BLOG_CONTENT.md` — Phase 1: MCP post seeding
|
|
124
|
+
- `references/blog/BLOG_SETUP.md` — Phase 3 Components: service module, RicosViewer, config
|
|
125
|
+
- `references/blog/BLOG_PAGES.md` — Phase 2 blog-pages: listing, detail, RSS, layout, SEO
|