@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,423 @@
|
|
|
1
|
+
# Agent Return Contract
|
|
2
|
+
|
|
3
|
+
Replaces the sidecar-file coordination model (`.wix/logs/*.md`) with **in-memory structured returns**. Every agent returns a JSON block at the end of its completion message; the skill parses these returns directly from session context.
|
|
4
|
+
|
|
5
|
+
At end of run, the skill writes ONE file (`.wix/run.json`) aggregating every return. This is the only observability artifact on the project side.
|
|
6
|
+
|
|
7
|
+
## Why this replaces sidecars
|
|
8
|
+
|
|
9
|
+
Sidecar files were designed assuming agents are independent processes without shared memory. But subagents run as child model calls under the parent skill's context — they can return structured data directly. Writing/reading markdown files between them adds:
|
|
10
|
+
|
|
11
|
+
- ~10s per sidecar write (file I/O + narration)
|
|
12
|
+
- ~5s per sidecar read from the parent (another tool call)
|
|
13
|
+
- Coordination complexity (timing, status-line parsing, retry logic)
|
|
14
|
+
|
|
15
|
+
Prior runs spent **~1–2 minutes total** on sidecar ceremony. Eliminating that buys back meaningful critical-path time.
|
|
16
|
+
|
|
17
|
+
## The contract
|
|
18
|
+
|
|
19
|
+
Every subagent's final message ends with a fenced JSON block (language tag: `json` or `jsonc`). Format:
|
|
20
|
+
|
|
21
|
+
~~~markdown
|
|
22
|
+
... agent's human-readable summary ...
|
|
23
|
+
|
|
24
|
+
```json
|
|
25
|
+
{
|
|
26
|
+
"status": "complete" | "partial" | "failed",
|
|
27
|
+
"phase": "<phase identifier — pack.seed / pack.components / pack.pages[*].name / design-system / image-phase-1-decorative / image-phase-2-entity>",
|
|
28
|
+
"scope": "<scope string from the agent's prompt>",
|
|
29
|
+
"summary": "<one-line description of what was done>",
|
|
30
|
+
"data": { ... phase-specific structured data ... },
|
|
31
|
+
"files": ["list", "of", "files", "written", "or", "modified"],
|
|
32
|
+
"errors": [],
|
|
33
|
+
"notes": "<optional — anything the parent skill should know>"
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
~~~
|
|
37
|
+
|
|
38
|
+
The JSON block MUST be the **last** content in the message. The parent skill parses the last fenced JSON block as the return.
|
|
39
|
+
|
|
40
|
+
### Timing is NOT the agent's responsibility
|
|
41
|
+
|
|
42
|
+
Prior versions of this contract asked agents to include `started` / `ended` ISO-8601 timestamps. **Remove those fields.** Agents fabricate placeholder timestamps (`T00:00:00Z` / `T00:05:00Z`) roughly 60% of the time, which makes `run.json` useless for perf comparison.
|
|
43
|
+
|
|
44
|
+
**Authoritative timing source is the runtime `duration_ms`** captured by the parent skill from task-notifications when the subagent completes. The orchestrator MUST prefer `duration_ms` over any agent-reported timing. If an older agent still emits `started`/`ended`, the orchestrator ignores them.
|
|
45
|
+
|
|
46
|
+
For Bash calls made by the skill itself (scaffold, env-pull, npm-install, app-install), wrap in `date -u` captures:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
STARTED_AT=$(date -u +%Y-%m-%dT%H:%M:%SZ)
|
|
50
|
+
# ... run the command ...
|
|
51
|
+
ENDED_AT=$(date -u +%Y-%m-%dT%H:%M:%SZ)
|
|
52
|
+
# compute seconds and append to run.json
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
No LLM-generated timestamps anywhere in the observability pipeline.
|
|
56
|
+
|
|
57
|
+
### Observed failure mode — narrative ending instead of fenced JSON
|
|
58
|
+
|
|
59
|
+
Agents sometimes end with prose like:
|
|
60
|
+
|
|
61
|
+
> *"All three files are correctly written. Let me verify the key requirements… Everything looks good."*
|
|
62
|
+
|
|
63
|
+
…with no fenced JSON block at the end. The parent skill then has to reconstruct `data.products` etc. from narrative text — fragile, and when Phase 4 relies on pre-seeded data from Phase 1 Seed returns (see `SKILL.md` Step 7), a missing JSON block means Phase 4 agents don't get their pre-seeded data inline and fall back to re-querying MCP, costing 5–15s each.
|
|
64
|
+
|
|
65
|
+
**Correct pattern — end with the fenced block, no trailing prose:**
|
|
66
|
+
|
|
67
|
+
~~~markdown
|
|
68
|
+
✅ CORRECT
|
|
69
|
+
|
|
70
|
+
All files written. Contract classes referenced: productCard, productGrid, optionPill, quantityBtn.
|
|
71
|
+
|
|
72
|
+
```json
|
|
73
|
+
{
|
|
74
|
+
"status": "complete",
|
|
75
|
+
"phase": "stores-components",
|
|
76
|
+
"scope": "components",
|
|
77
|
+
"summary": "Wrote React islands + utils; contract classes referenced: 11",
|
|
78
|
+
"data": { ... },
|
|
79
|
+
"files": [ ... ],
|
|
80
|
+
"errors": []
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
~~~
|
|
84
|
+
|
|
85
|
+
~~~markdown
|
|
86
|
+
❌ WRONG — trailing prose after the block
|
|
87
|
+
|
|
88
|
+
```json
|
|
89
|
+
{ "status": "complete", ... }
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
All three files are correctly written. Let me verify the key requirements are met before returning.
|
|
93
|
+
~~~
|
|
94
|
+
|
|
95
|
+
~~~markdown
|
|
96
|
+
❌ WRONG — no JSON block at all
|
|
97
|
+
|
|
98
|
+
All three files are correctly written. The ProductPurchase island uses contract classes
|
|
99
|
+
throughout, AddToCartButton wires to @wix/ecom, and CartView handles the two-step
|
|
100
|
+
checkout redirect. Build should pass.
|
|
101
|
+
~~~
|
|
102
|
+
|
|
103
|
+
The parent skill looks for the **last** fenced JSON block in the message. A trailing sentence means it's no longer the last content; scanning falls back to heuristics. Just stop writing after the closing ` ``` `.
|
|
104
|
+
|
|
105
|
+
## Status semantics
|
|
106
|
+
|
|
107
|
+
| Status | Meaning | Parent action |
|
|
108
|
+
|--------|---------|---------------|
|
|
109
|
+
| `complete` | All work done successfully | Proceed to next phase |
|
|
110
|
+
| `partial` | Some work done, some failed — `errors` explains | Decide per-case: retry, work around, or fail the run |
|
|
111
|
+
| `failed` | Nothing usable produced — `errors` explains | Retry with corrective prompt or fail the run |
|
|
112
|
+
|
|
113
|
+
## Phase-specific `data` shapes
|
|
114
|
+
|
|
115
|
+
The skill uses `data` to carry information forward to later phases. Each phase has a known shape.
|
|
116
|
+
|
|
117
|
+
### Phase 1: stores seed
|
|
118
|
+
|
|
119
|
+
```json
|
|
120
|
+
{
|
|
121
|
+
"status": "complete",
|
|
122
|
+
"phase": "stores-seed",
|
|
123
|
+
"scope": "seed",
|
|
124
|
+
"summary": "Deleted 12 default products; created 3 on-brand products with variants",
|
|
125
|
+
"data": {
|
|
126
|
+
"products": [
|
|
127
|
+
{
|
|
128
|
+
"id": "2d1bce83-...",
|
|
129
|
+
"name": "Tero Dining Table",
|
|
130
|
+
"slug": "tero-dining-table",
|
|
131
|
+
"variantId": "ffc1caa2-...",
|
|
132
|
+
"price": 2890,
|
|
133
|
+
"inventory": 12,
|
|
134
|
+
"sku": "TAB-TERO-OAK"
|
|
135
|
+
}
|
|
136
|
+
],
|
|
137
|
+
"deletedCount": 12,
|
|
138
|
+
"createdCount": 3
|
|
139
|
+
},
|
|
140
|
+
"files": [],
|
|
141
|
+
"errors": []
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Phase 4 agents consume `data.products[*].slug` and `data.products[*].variantId` to wire live SDK queries.
|
|
146
|
+
|
|
147
|
+
### Phase 1: CMS seed
|
|
148
|
+
|
|
149
|
+
```json
|
|
150
|
+
{
|
|
151
|
+
"status": "complete",
|
|
152
|
+
"phase": "cms-seed",
|
|
153
|
+
"scope": "seed",
|
|
154
|
+
"data": {
|
|
155
|
+
"collections": [
|
|
156
|
+
{
|
|
157
|
+
"name": "about-content",
|
|
158
|
+
"itemIds": ["665f3363-..."],
|
|
159
|
+
"fields": ["heading", "body", "image"]
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"name": "faq",
|
|
163
|
+
"itemIds": ["abc", "def", "ghi", "jkl", "mno", "pqr"],
|
|
164
|
+
"fields": ["question", "answer", "sortOrder"]
|
|
165
|
+
}
|
|
166
|
+
]
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Phase 4 CMS page agents reference these collection names; the image agent attaches entity images to CMS items by ID.
|
|
172
|
+
|
|
173
|
+
### Phase 2: shared wiring
|
|
174
|
+
|
|
175
|
+
```json
|
|
176
|
+
{
|
|
177
|
+
"status": "complete",
|
|
178
|
+
"phase": "stores-components",
|
|
179
|
+
"scope": "components",
|
|
180
|
+
"summary": "Wrote React islands + utils; wired analytics; contract classes referenced: 7",
|
|
181
|
+
"data": {
|
|
182
|
+
"islands": ["ProductPurchase.tsx", "CartView.tsx", "AddToCartButton.tsx", "CartBadge.tsx"],
|
|
183
|
+
"utils": ["wix-image.ts", "analytics.ts"],
|
|
184
|
+
"astroComponents": ["SeoTags.astro"]
|
|
185
|
+
},
|
|
186
|
+
"files": [
|
|
187
|
+
"src/utils/wix-image.ts",
|
|
188
|
+
"src/utils/analytics.ts",
|
|
189
|
+
"src/components/SeoTags.astro",
|
|
190
|
+
"src/components/AddToCartButton.tsx",
|
|
191
|
+
"src/components/CartBadge.tsx",
|
|
192
|
+
"src/components/ProductPurchase.tsx",
|
|
193
|
+
"src/components/CartView.tsx"
|
|
194
|
+
]
|
|
195
|
+
}
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### Phase 2: page rewrites
|
|
199
|
+
|
|
200
|
+
```json
|
|
201
|
+
{
|
|
202
|
+
"status": "complete",
|
|
203
|
+
"phase": "stores-pages-products",
|
|
204
|
+
"scope": "pages-products",
|
|
205
|
+
"data": {
|
|
206
|
+
"pagesWired": 2,
|
|
207
|
+
"wixMetadataExported": true,
|
|
208
|
+
"seoTagsMounted": true,
|
|
209
|
+
"analyticsEvents": ["AddProductImpression", "ClickProduct", "ViewContent"]
|
|
210
|
+
},
|
|
211
|
+
"files": [
|
|
212
|
+
"src/pages/products/index.astro",
|
|
213
|
+
"src/pages/products/[slug].astro",
|
|
214
|
+
"src/components/ProductCard.astro"
|
|
215
|
+
]
|
|
216
|
+
}
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### Designer foundation
|
|
220
|
+
|
|
221
|
+
```json
|
|
222
|
+
{
|
|
223
|
+
"status": "complete",
|
|
224
|
+
"phase": "design-system",
|
|
225
|
+
"data": {
|
|
226
|
+
"contractKeys": 19,
|
|
227
|
+
"cssLines": 247,
|
|
228
|
+
"fonts": ["Cormorant Garamond", "DM Sans"],
|
|
229
|
+
"palette": {"cream": "#FFF8F0", "charcoal": "#1A1A1A", "roseGold": "#B76E79"}
|
|
230
|
+
},
|
|
231
|
+
"files": [
|
|
232
|
+
"src/styles/global.css",
|
|
233
|
+
"src/layouts/Layout.astro",
|
|
234
|
+
"src/components/Navigation.astro",
|
|
235
|
+
"src/components/Footer.astro",
|
|
236
|
+
".wix/design-tokens.css"
|
|
237
|
+
]
|
|
238
|
+
}
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### Designer page groups
|
|
242
|
+
|
|
243
|
+
```json
|
|
244
|
+
{
|
|
245
|
+
"status": "complete",
|
|
246
|
+
"phase": "designer-store-pages",
|
|
247
|
+
"data": {
|
|
248
|
+
"pagesDesigned": ["/products", "/products/[slug]", "/cart", "/thank-you"],
|
|
249
|
+
"placeholderDataUsed": true,
|
|
250
|
+
"contractClassesHonored": 11
|
|
251
|
+
},
|
|
252
|
+
"files": [
|
|
253
|
+
"src/pages/products/index.astro",
|
|
254
|
+
"src/pages/products/[slug].astro",
|
|
255
|
+
"src/pages/cart.astro",
|
|
256
|
+
"src/pages/thank-you.astro",
|
|
257
|
+
"src/components/ProductCard.astro",
|
|
258
|
+
"src/components/ProductPurchase.astro",
|
|
259
|
+
"src/components/CartView.astro"
|
|
260
|
+
]
|
|
261
|
+
}
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
### Images (split into two image phases, dispatched separately)
|
|
265
|
+
|
|
266
|
+
The image agent runs in two scopes dispatched by the parent in different steps. Each emits its own return block.
|
|
267
|
+
|
|
268
|
+
**`image-phase-1-decorative` — dispatched in Step 3 (no dependencies):**
|
|
269
|
+
|
|
270
|
+
```json
|
|
271
|
+
{
|
|
272
|
+
"status": "complete",
|
|
273
|
+
"phase": "image-phase-1-decorative",
|
|
274
|
+
"scope": "image-phase-1-decorative",
|
|
275
|
+
"summary": "Generated 3 decorative images; uploaded to Wix Media; wrote .wix/image-urls.md",
|
|
276
|
+
"data": {
|
|
277
|
+
"decorativeCount": 3,
|
|
278
|
+
"purposes": ["hero", "about", "background"],
|
|
279
|
+
"model": "google:4@2",
|
|
280
|
+
"totalCredits": 0.297
|
|
281
|
+
},
|
|
282
|
+
"files": [".wix/image-urls.md"],
|
|
283
|
+
"errors": []
|
|
284
|
+
}
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
**`image-phase-2-entity` — dispatched in Step 7 (Phase 1 Seed return data inline in prompt):**
|
|
288
|
+
|
|
289
|
+
```json
|
|
290
|
+
{
|
|
291
|
+
"status": "complete",
|
|
292
|
+
"phase": "image-phase-2-entity",
|
|
293
|
+
"scope": "image-phase-2-entity",
|
|
294
|
+
"summary": "Generated + attached images for 6 products and 1 CMS item",
|
|
295
|
+
"data": {
|
|
296
|
+
"entityCount": { "products": 6, "cmsAboutContent": 1, "blogPosts": 0 },
|
|
297
|
+
"model": "google:4@2",
|
|
298
|
+
"totalCredits": 0.693
|
|
299
|
+
},
|
|
300
|
+
"files": [],
|
|
301
|
+
"errors": []
|
|
302
|
+
}
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
(Image agent writes to Wix Media via MCP, not to project files — Image Phase 2 `files` is empty.)
|
|
306
|
+
|
|
307
|
+
## Failure returns
|
|
308
|
+
|
|
309
|
+
On `failed` or `partial`, `errors` is populated and `data` may still contain partial results:
|
|
310
|
+
|
|
311
|
+
```json
|
|
312
|
+
{
|
|
313
|
+
"status": "partial",
|
|
314
|
+
"phase": "stores-pages-products",
|
|
315
|
+
"errors": [
|
|
316
|
+
{
|
|
317
|
+
"file": "src/pages/products/[slug].astro",
|
|
318
|
+
"code": "MISSING_SEO_DATA",
|
|
319
|
+
"message": "product.seoData was null; fell back to product.name for <title>",
|
|
320
|
+
"severity": "warning"
|
|
321
|
+
}
|
|
322
|
+
],
|
|
323
|
+
"data": {...}
|
|
324
|
+
}
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
Severity levels: `warning` (keep running), `error` (parent should retry), `fatal` (parent must stop).
|
|
328
|
+
|
|
329
|
+
## Final `.wix/run.json` (written once by the skill at end of run)
|
|
330
|
+
|
|
331
|
+
The skill aggregates every agent return into one file.
|
|
332
|
+
|
|
333
|
+
**Timing is required** — the `run` object MUST include `started`, `ended`, and `totalSeconds`, and every entry in `phases` MUST include `seconds`. All timing values are captured by the parent skill (from runtime `duration_ms` for subagents, from `date -u` wraps for its own Bash calls) — agents do not self-report. If timing is missing for any phase, record `seconds: null` + `errors: [{code: "MISSING_TIMING"}]` and investigate what broke capture. See `skills/wix-headless/SKILL.md` § "Timing — required in run.json" for the capture protocol.
|
|
334
|
+
|
|
335
|
+
Example:
|
|
336
|
+
|
|
337
|
+
```json
|
|
338
|
+
{
|
|
339
|
+
"version": "1.0",
|
|
340
|
+
"run": {
|
|
341
|
+
"started": "2026-01-15T09:16:14Z",
|
|
342
|
+
"ended": "2026-01-15T09:28:03Z",
|
|
343
|
+
"totalSeconds": 709,
|
|
344
|
+
"brand": "Acme Coffee",
|
|
345
|
+
"prompt": "I want to sell tables online",
|
|
346
|
+
"verticals": ["stores", "cms"],
|
|
347
|
+
"packs": ["stores", "cms"]
|
|
348
|
+
},
|
|
349
|
+
"outcome": {
|
|
350
|
+
"build": "success",
|
|
351
|
+
"previewUrl": "https://goj5lj-tabula-...-alexp775.wix-host.com",
|
|
352
|
+
"dashboardUrl": "https://manage.wix.com/dashboard/<siteId>"
|
|
353
|
+
},
|
|
354
|
+
"phases": [
|
|
355
|
+
{ "phase": "scaffold", "status": "complete", "seconds": 45 },
|
|
356
|
+
{ "phase": "app-install-stores", "status": "complete", "seconds": 6 },
|
|
357
|
+
{ "phase": "env-pull", "status": "complete", "seconds": 4 },
|
|
358
|
+
{ "phase": "npm-install", "status": "complete", "seconds": 42, "packageCount": 725 },
|
|
359
|
+
{ "phase": "stores-seed", "status": "complete", "seconds": 112, "data": { ... } },
|
|
360
|
+
{ "phase": "cms-seed", "status": "complete", "seconds": 98, "data": { ... } },
|
|
361
|
+
{ "phase": "stores-components", "status": "complete", "seconds": 134, "data": { ... } },
|
|
362
|
+
{ "phase": "design-system", "status": "complete", "seconds": 165, "data": { ... } },
|
|
363
|
+
{ "phase": "designer-home", "status": "complete", "seconds": 287, "data": { ... } },
|
|
364
|
+
{ "phase": "designer-static", "status": "complete", "seconds": 265, "data": { ... } },
|
|
365
|
+
{ "phase": "designer-store-pages", "status": "complete", "seconds": 298, "data": { ... } },
|
|
366
|
+
{ "phase": "stores-pages-products", "status": "complete", "seconds": 89, "data": { ... } },
|
|
367
|
+
{ "phase": "stores-pages-cart-checkout", "status": "complete", "seconds": 67, "data": { ... } },
|
|
368
|
+
{ "phase": "stores-pages-home-and-nav", "status": "complete", "seconds": 54, "data": { ... } },
|
|
369
|
+
{ "phase": "pages", "status": "complete", "seconds": 78, "data": { ... } },
|
|
370
|
+
{ "phase": "image-phase-1-decorative", "status": "complete", "seconds": 112, "data": { "decorativeCount": 3, ... } },
|
|
371
|
+
{ "phase": "image-phase-2-entity", "status": "complete", "seconds": 287, "data": { "entityCount": { "products": 6, "cmsAboutContent": 1 }, ... } },
|
|
372
|
+
{ "phase": "build", "status": "complete", "seconds": 9 },
|
|
373
|
+
{ "phase": "preview", "status": "complete", "seconds": 21 }
|
|
374
|
+
],
|
|
375
|
+
"notes": []
|
|
376
|
+
}
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
Observations post-run (including this doc's example):
|
|
380
|
+
- Total serial wall time ≈ max parallel paths, not sum of seconds
|
|
381
|
+
- `data` blocks preserve what each agent returned — recoverable without re-reading agent transcripts
|
|
382
|
+
- `files` lists omitted from aggregate; query individual phase `data` if needed
|
|
383
|
+
|
|
384
|
+
## Common failure modes
|
|
385
|
+
|
|
386
|
+
Agents should check their output for these before returning `complete`:
|
|
387
|
+
|
|
388
|
+
### Astro/React
|
|
389
|
+
|
|
390
|
+
| Failure | How to detect | Fix |
|
|
391
|
+
|---------|---------------|-----|
|
|
392
|
+
| HTML-style comments in `.astro` frontmatter | `grep '<!--' *.astro frontmatter` | Use `//` or `/* */` — frontmatter is TypeScript |
|
|
393
|
+
| Missing `wixMetadata` on `/products/[slug]` | Check exports | Add the metadata export — required for Wix platform indexing |
|
|
394
|
+
| `import { products }` instead of `productsV3` | `grep 'from "@wix/stores"' -- import line` | V1 silently returns 0 on V3 catalogs |
|
|
395
|
+
| Missing `variantId` in cart operations | Check `catalogReference.options` | Always include — single-variant products have one |
|
|
396
|
+
| React island using default Tailwind color class | `grep 'bg-blue-\|bg-green-\|text-red-\|bg-gray-' *.tsx` | Use brand `@theme` utilities (`bg-bark`, `text-cream`) or contract class names |
|
|
397
|
+
|
|
398
|
+
### MCP
|
|
399
|
+
|
|
400
|
+
| Failure | How to detect | Fix |
|
|
401
|
+
|---------|---------------|-----|
|
|
402
|
+
| `UNSUPPORTED_FORM_NAMESPACE` after app install | Error on first MCP call post-install | Wait 10s, retry up to 3x (namespace propagation) |
|
|
403
|
+
| `CallWixSiteAPI` with stringified `body` | Tool rejects the call shape | Load the tool schema via your runtime's tool-discovery primitive, then pass `body` as a real object |
|
|
404
|
+
| Tool-not-found on Wix MCP call | Tool name without the session's prefix | Use `<prefix>ToolName`; see `MCP_PREFIX.md` recovery |
|
|
405
|
+
|
|
406
|
+
### Build
|
|
407
|
+
|
|
408
|
+
| Failure | How to detect | Fix |
|
|
409
|
+
|---------|---------------|-----|
|
|
410
|
+
| `Legacy HTML single-line comments` | `npx @wix/cli build` stderr | See Astro/React row 1 above — Phase 2 agent emitted HTML comments |
|
|
411
|
+
| `Missing environment variable WIX_CLIENT_ID` | Build stderr | Run `npx @wix/cli env pull` then retry |
|
|
412
|
+
| `Cannot find module '@wix/…'` | Build stderr | npm install didn't include that package; check pack's `packages` list |
|
|
413
|
+
|
|
414
|
+
## Notes for agent authors
|
|
415
|
+
|
|
416
|
+
When writing a new agent, include a **Returns** section in its `INSTRUCTIONS.md` that lists:
|
|
417
|
+
|
|
418
|
+
1. The `phase` identifier this agent emits
|
|
419
|
+
2. The exact `data` shape for successful returns
|
|
420
|
+
3. Known `error.code` values
|
|
421
|
+
4. Required `files` entries
|
|
422
|
+
|
|
423
|
+
Agents should produce the JSON return block deterministically — don't let creative prose overrun the fenced block. Parent skill parsing assumes the JSON is well-formed and complete.
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# Styling — Three Categories, One Default
|
|
2
|
+
|
|
3
|
+
Every visual decision in a generated site falls into one of three categories. Each has a single owner and a single home. This file is the canonical reference; designer `INSTRUCTIONS.md` and `IMPLEMENTER.md` link here.
|
|
4
|
+
|
|
5
|
+
## The three categories
|
|
6
|
+
|
|
7
|
+
| Category | Lives in | Owned by | Use for |
|
|
8
|
+
|---|---|---|---|
|
|
9
|
+
| **Tokens (composed as utilities)** | `@theme` block in `src/styles/global.css`, mirrored to `.wix/site.json.designTokens`, `.wix/design-tokens.css`, `.wix/site.d.ts` | Designer (Phase 2) | All color, spacing, typography scale, radii, aspect ratios, shadows, transitions. Pages compose tokens at call sites as Tailwind utilities — `class="py-4xl bg-sand aspect-[16/5]"`. |
|
|
10
|
+
| **Global semantic classes** | `src/styles/global.css` (outside `@theme`) and `src/styles/components-<pack>.css` | Designer + Phase 3 component agents | Compound multi-element patterns, interactive states (`:hover`, `:focus`, `:disabled`), and JS/React DOM query targets. |
|
|
11
|
+
| **Co-located styles** | `<style>` block at the bottom of the same `.astro` file (or component CSS module for islands) | Page or component author | One-off page decoration: hero stamps, custom dividers, ornamental overlays that won't be reused elsewhere. |
|
|
12
|
+
|
|
13
|
+
## Default direction
|
|
14
|
+
|
|
15
|
+
**Tokens-as-utilities is the default.** When you're about to write a class for layout, spacing, typography, alignment, simple background/text color, or aspect ratio, write Tailwind utilities derived from `@theme` instead. The site's design tokens give you `py-4xl`, `gap-sm`, `bg-paper-warm`, `text-ink`, `font-display`, `aspect-[16/5]` etc. Compose them in markup; do not invent semantic classes for these concerns.
|
|
16
|
+
|
|
17
|
+
The token namespace is the contract. Read `.wix/site.json.designTokens` (or its typed mirror at `.wix/site.d.ts`) at the start of any pages or components scope to know which tokens this run published. If a token you need isn't there, that's a designer-side gap — flag it in your return JSON, don't paper over it with a custom class.
|
|
18
|
+
|
|
19
|
+
## Decision tree
|
|
20
|
+
|
|
21
|
+
When you find yourself reaching for a `class="..."` value, ask:
|
|
22
|
+
|
|
23
|
+
1. **Can this be expressed as 2–4 Tailwind utilities derived from `@theme`?** → Use utilities. Don't create a class.
|
|
24
|
+
2. **Is it a compound multi-element pattern** (e.g., a bordered card with header + body + foot rules), an **interactive state** (`:hover`/`:focus`/`:disabled`/`:hover .child`), or a **JS query target** the DOM is inspected for? → Global semantic class in `global.css` (designer-owned) or `components-<pack>.css` (Phase 3 components agent-owned).
|
|
25
|
+
3. **Is it a one-off page decoration** that won't be reused on any other route? → Co-located `<style>` block at the bottom of the same `.astro` file. Reference tokens via `var(--color-foo)` from `:root` (auto-loaded by `design-tokens.css`).
|
|
26
|
+
|
|
27
|
+
If none fit, you're probably trying to do something the tokens don't support yet — talk to the designer (for new runs, return a `MISSING_TOKEN` error; for existing projects, add the token to `@theme` and propagate to `.wix/site.json.designTokens`).
|
|
28
|
+
|
|
29
|
+
## What does NOT belong as a global semantic class
|
|
30
|
+
|
|
31
|
+
These are layout/spacing/typography concerns that should always be utilities, never standalone classes:
|
|
32
|
+
|
|
33
|
+
- Section padding / margins (`py-4xl`, `mt-3xl`, `mb-2xl`)
|
|
34
|
+
- Flex / grid layouts (`flex flex-col gap-md`, `grid grid-cols-3 gap-lg`)
|
|
35
|
+
- Aspect ratios (`aspect-[4/5]`, `aspect-square`)
|
|
36
|
+
- Plain typography choices (`text-display-lg font-display`, `text-mute uppercase tracking-wide`)
|
|
37
|
+
- Background / foreground color application without state (`bg-paper`, `text-ink-soft`)
|
|
38
|
+
- Container widths derived from tokens (`max-w-prose`, `w-full`)
|
|
39
|
+
|
|
40
|
+
If a designer's `global.css` contains rules like `.featured-section { padding-block: var(--spacing-4xl); }` or `.product-card-body { display: flex; flex-direction: column; gap: var(--spacing-xs); }`, those are misplaced — they belong in markup as utilities. Inventing such classes ships broken layouts: every consumer needs the designer to have pre-declared the class, and Tailwind v4 silently drops the references when the rule is missing.
|
|
41
|
+
|
|
42
|
+
## What DOES belong in `global.css` (designer-owned)
|
|
43
|
+
|
|
44
|
+
The designer's `global.css` is small — tokens plus a short list of truly cross-cutting patterns. Anything specific to a single vertical's component (a product card, a cart row, a discount callout) does NOT belong here. Those live with the component, in `components-<pack>.css` (Phase 3 components agent-owned) or in a co-located `<style>` block inside the component's `.astro` file.
|
|
45
|
+
|
|
46
|
+
The retained set:
|
|
47
|
+
|
|
48
|
+
- **Button family** — `btn`, `btn-primary`, `btn-secondary`, `btn-ghost`. Compound + `:hover`/`:disabled`. Used on every page across every vertical.
|
|
49
|
+
- **`[data-decorative-slot]`** — cross-cutting decorative pattern; the orchestrator injects images here regardless of vertical.
|
|
50
|
+
- **`editorial-rule`** — cross-cutting decorative pattern (gold-rule / accent dividers used by hero/section dividers across verticals).
|
|
51
|
+
- **Site shell shells** — `.site-nav`, `.site-footer`, `.nav-progress`. Sticky header, footer scaffold, top progress bar — universal site chrome with markers that verticals contribute into via `<!-- nav:links -->` etc.
|
|
52
|
+
|
|
53
|
+
That's it. The full list of always-required classes for a site lives in designer `INSTRUCTIONS.md`; this file states the principle.
|
|
54
|
+
|
|
55
|
+
## Component-specific CSS is owned by the component, not the designer
|
|
56
|
+
|
|
57
|
+
The boundary that previously caused leaks: the designer published partial rules for `.product-card`, `.product-grid`, `.product-card-media`, `.offer-callout`, `.cart-summary`, etc. — all classes used by exactly one vertical's component. The designer doesn't know how those components should be laid out for a particular brand, so the rules ship as stubs and templates quietly add the missing layout in scoped CSS. Result: the same class behaves differently on different pages (e.g. `/products` rendering with `.product-grid { transition: opacity }` and no `display: grid`, while `/category/<slug>` defines a separate scoped `.product-grid` with the actual grid).
|
|
58
|
+
|
|
59
|
+
The fix is structural: move component-specific CSS out of `global.css` entirely.
|
|
60
|
+
|
|
61
|
+
| What | Where it lives | Owner |
|
|
62
|
+
|---|---|---|
|
|
63
|
+
| `.product-card`, `.product-card-media`, `.product-card-ribbon`, `.product-card-index`, `.product-grid` | `src/styles/components-stores.css` | Stores Phase 3 components agent (or scoped `<style>` in the component's `.astro`) |
|
|
64
|
+
| `.offer-callout` family (`-item`, `-badge`, `-name`, `-detail`, `-foot`) | `src/styles/components-stores.css` | Stores Phase 3 components agent |
|
|
65
|
+
| `.cart-summary`, `.cart-total`, `.cart-empty`, `.checkout-btn` | `src/styles/components-ecom.css` | Ecom Phase 3 components agent |
|
|
66
|
+
| Anything used by exactly one component | Co-located `<style>` block in the component's `.astro` or the matching `components-<pack>.css` | The pack that owns the component |
|
|
67
|
+
|
|
68
|
+
The Phase 3 components agents already write to `components-<pack>.css` (the file is imported by the designer's `Layout.astro` from the start). This change just makes it the *only* place those classes live — no parallel partial rule in `global.css`.
|
|
69
|
+
|
|
70
|
+
### Why this is structural
|
|
71
|
+
|
|
72
|
+
Tokens + truly cross-cutting patterns (buttons, decorative slots, site shell) are stable across verticals and brands — fine for the designer to own. Component-specific layout and spacing evolves with the component. Putting it next to the component means:
|
|
73
|
+
|
|
74
|
+
- One author per class. No drift.
|
|
75
|
+
- Verticals can ship new component variants without round-tripping the designer.
|
|
76
|
+
- `overflow: hidden` + `border-radius` traps are caught by the same person who set the radius — no second author who has to *know* the radius value.
|
|
77
|
+
|
|
78
|
+
### Pre-return checklist for the designer
|
|
79
|
+
|
|
80
|
+
Before returning the design-system scope, the designer agent runs:
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
grep -r --include="*.astro" --include="*.tsx" -lE "class(\\Name)?=.*(\\.|\\b)(product-card|product-grid|product-card-media|product-card-ribbon|product-card-index|offer-callout|cart-summary|cart-total|cart-empty|checkout-btn)\\b" $SKILL_ROOT/templates/*/
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
For every class name listed above that the designer's `global.css` declares: if any template references it, the class is component-specific and must NOT be in `global.css`. Move the rule to the appropriate `components-<pack>.css` template (or to a scoped `<style>` block in the component template). Do NOT ship a partial rule in `global.css` that the template "completes" — that's the leak this file is preventing.
|
|
87
|
+
|
|
88
|
+
The check is mechanical and bounded — it scans templates, not the live project.
|
|
89
|
+
|
|
90
|
+
## Co-located styles — the locality default for one-offs
|
|
91
|
+
|
|
92
|
+
Astro's `<style>` blocks scope automatically to the `.astro` file by default — no class-name collision risk across routes. When a page needs decoration that doesn't fit utilities and isn't reusable, the rule lives next to its only caller:
|
|
93
|
+
|
|
94
|
+
```astro
|
|
95
|
+
<section class="relative py-4xl">
|
|
96
|
+
<div class="hero-stamp">Made in small batches</div>
|
|
97
|
+
</section>
|
|
98
|
+
|
|
99
|
+
<style>
|
|
100
|
+
.hero-stamp {
|
|
101
|
+
position: absolute;
|
|
102
|
+
bottom: var(--spacing-lg);
|
|
103
|
+
right: var(--spacing-lg);
|
|
104
|
+
background: rgba(27, 26, 23, 0.75);
|
|
105
|
+
color: var(--color-paper);
|
|
106
|
+
padding: 0.5rem 0.875rem;
|
|
107
|
+
font-family: var(--font-display);
|
|
108
|
+
font-style: italic;
|
|
109
|
+
}
|
|
110
|
+
</style>
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
No coordination with the designer needed; no entry to forget on the always-required list. If this stamp later becomes a pattern used on three routes, *then* promote it to a global semantic class.
|
|
114
|
+
|
|
115
|
+
## Why this protocol
|
|
116
|
+
|
|
117
|
+
The bug class this prevents: markup writers (designer's shells, vertical pages agents, committed templates) and the CSS writer (designer's `global.css`) operate in different phases with no handshake. When the markup writer types a class string the CSS writer didn't pre-declare, Tailwind v4 silently drops it and ships a site with broken styling. Tokens-as-utilities collapses that handshake — there's no class to forget, only utilities derived from a token list everyone reads.
|