create-abcart-theme 0.10.1 → 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.
Files changed (251) hide show
  1. package/CHANGELOG.md +133 -127
  2. package/LICENSE +202 -202
  3. package/NOTICE +2 -2
  4. package/README.md +65 -65
  5. package/bin/create-abcart-theme.mjs +4 -4
  6. package/package.json +49 -49
  7. package/src/args.mjs +113 -113
  8. package/src/banner.mjs +21 -21
  9. package/src/cli.mjs +119 -119
  10. package/src/create.mjs +85 -82
  11. package/src/package-manager.mjs +32 -32
  12. package/src/style.mjs +17 -17
  13. package/templates/default/.agents/skills/{wocart-docs → abcart-docs}/SKILL.md +146 -146
  14. package/templates/default/.agents/skills/{wocart-theme-from-design → abcart-theme-from-design}/SKILL.md +58 -58
  15. package/templates/default/.agents/skills/{wocart-theme-from-design → abcart-theme-from-design}/references/inputs-and-rights.md +47 -47
  16. package/templates/default/.agents/skills/{wocart-theme-from-design → abcart-theme-from-design}/references/layout-rtl-and-phone.md +36 -36
  17. package/templates/default/.agents/skills/{wocart-theme-from-design → abcart-theme-from-design}/references/measure-the-design.md +60 -60
  18. package/templates/default/.agents/skills/{wocart-theme-from-design → abcart-theme-from-design}/references/tokens-sections-content.md +103 -103
  19. package/templates/default/.agents/skills/{wocart-theme-from-design → abcart-theme-from-design}/references/verify-and-report.md +102 -102
  20. package/templates/default/.agents/skills/{wocart-theme-from-design → abcart-theme-from-design}/scripts/compare-design.cjs +230 -230
  21. package/templates/default/.agents/skills/{wocart-theme-from-design → abcart-theme-from-design}/scripts/qa-pages.cjs +219 -219
  22. package/templates/default/.agents/skills/shopify-theme-asset-collector/SKILL.md +125 -125
  23. package/templates/default/.agents/skills/shopify-theme-asset-collector/scripts/collect_public_assets.py +370 -370
  24. package/templates/default/.dev.vars.example +12 -12
  25. package/templates/default/AGENTS.md +240 -240
  26. package/templates/default/README.md +184 -184
  27. package/templates/default/_gitignore +11 -11
  28. package/templates/default/astro.config.mjs +85 -85
  29. package/templates/default/package.json +36 -36
  30. package/templates/default/public/fonts/OFL.txt +96 -96
  31. package/templates/default/src/actions/index.ts +22 -22
  32. package/templates/default/src/components/cart/AddToCartButton.astro +45 -45
  33. package/templates/default/src/components/cart/CartDrawer.astro +47 -47
  34. package/templates/default/src/components/cart/CartSummary.astro +11 -11
  35. package/templates/default/src/components/cart/FreeShipping.astro +7 -7
  36. package/templates/default/src/components/checkout/CheckoutMain.astro +29 -29
  37. package/templates/default/src/components/checkout/OrderForm.astro +280 -280
  38. package/templates/default/src/components/checkout/ThankYouMain.astro +68 -68
  39. package/templates/default/src/components/landing/LandingImages.astro +51 -51
  40. package/templates/default/src/components/landing/LandingOrder.astro +46 -46
  41. package/templates/default/src/components/landing/LandingProduct.astro +41 -41
  42. package/templates/default/src/components/listing/ListingMain.astro +93 -93
  43. package/templates/default/src/components/listing/PageMain.astro +52 -52
  44. package/templates/default/src/components/listing/Pagination.astro +31 -31
  45. package/templates/default/src/components/listing/SortControl.astro +35 -35
  46. package/templates/default/src/components/product/BuyBox.astro +96 -96
  47. package/templates/default/src/components/product/Description.astro +24 -24
  48. package/templates/default/src/components/product/Gallery.astro +66 -66
  49. package/templates/default/src/components/product/MobileBuyBar.astro +29 -29
  50. package/templates/default/src/components/product/OfferChoice.astro +66 -66
  51. package/templates/default/src/components/product/ProductMain.astro +40 -40
  52. package/templates/default/src/components/product/ProductReviews.astro +72 -72
  53. package/templates/default/src/components/product/RelatedProducts.astro +30 -30
  54. package/templates/default/src/components/product/blocks/BenefitsBlock.astro +13 -13
  55. package/templates/default/src/components/product/blocks/CollapsibleBlock.astro +20 -20
  56. package/templates/default/src/components/product/blocks/DescriptionBlock.astro +19 -19
  57. package/templates/default/src/components/product/blocks/DetailsBlock.astro +33 -33
  58. package/templates/default/src/components/product/blocks/GalleryBlock.astro +12 -12
  59. package/templates/default/src/components/product/blocks/OrderBlock.astro +30 -30
  60. package/templates/default/src/components/product/blocks/PriceBlock.astro +23 -23
  61. package/templates/default/src/components/product/blocks/RatingBlock.astro +16 -16
  62. package/templates/default/src/components/product/blocks/StockBlock.astro +22 -22
  63. package/templates/default/src/components/product/blocks/TextBlock.astro +11 -11
  64. package/templates/default/src/components/product/blocks/TitleBlock.astro +20 -20
  65. package/templates/default/src/components/reviews/ReviewCard.astro +46 -46
  66. package/templates/default/src/components/reviews/ReviewForm.astro +113 -113
  67. package/templates/default/src/components/reviews/VoiceNote.astro +60 -60
  68. package/templates/default/src/components/sections/CollectionCards.astro +65 -65
  69. package/templates/default/src/components/sections/Countdown.astro +57 -57
  70. package/templates/default/src/components/sections/Faq.astro +44 -44
  71. package/templates/default/src/components/sections/FeaturedProduct.astro +71 -71
  72. package/templates/default/src/components/sections/Hero.astro +99 -99
  73. package/templates/default/src/components/sections/ImageBanner.astro +46 -46
  74. package/templates/default/src/components/sections/ProductGrid.astro +47 -47
  75. package/templates/default/src/components/sections/RichText.astro +35 -35
  76. package/templates/default/src/components/sections/Steps.astro +46 -46
  77. package/templates/default/src/components/sections/Testimonials.astro +57 -57
  78. package/templates/default/src/components/shell/Footer.astro +80 -80
  79. package/templates/default/src/components/shell/Header.astro +89 -89
  80. package/templates/default/src/components/shell/LanguageMenu.astro +33 -33
  81. package/templates/default/src/components/shell/MobileMenu.astro +65 -65
  82. package/templates/default/src/components/shell/SearchDialog.astro +19 -19
  83. package/templates/default/src/components/shell/TopBar.astro +54 -54
  84. package/templates/default/src/components/shell/WhatsAppWidget.astro +111 -111
  85. package/templates/default/src/components/store/ContactMain.astro +79 -79
  86. package/templates/default/src/components/store/SearchMain.astro +56 -56
  87. package/templates/default/src/components/store/TrackOrderMain.astro +161 -161
  88. package/templates/default/src/components/surface/Area.astro +20 -20
  89. package/templates/default/src/components/surface/PreviewBridge.astro +24 -24
  90. package/templates/default/src/components/surface/Sections.astro +35 -35
  91. package/templates/default/src/components/ui/Breadcrumbs.astro +36 -36
  92. package/templates/default/src/components/ui/Button.astro +45 -45
  93. package/templates/default/src/components/ui/EditorPlaceholder.astro +24 -24
  94. package/templates/default/src/components/ui/Icon.astro +93 -93
  95. package/templates/default/src/components/ui/Logo.astro +36 -36
  96. package/templates/default/src/components/ui/Photo.astro +46 -46
  97. package/templates/default/src/components/ui/Price.astro +24 -24
  98. package/templates/default/src/components/ui/ProductCard.astro +41 -41
  99. package/templates/default/src/components/ui/Rating.astro +22 -22
  100. package/templates/default/src/components/ui/Section.astro +34 -34
  101. package/templates/default/src/components/ui/SectionHeading.astro +19 -19
  102. package/templates/default/src/env.d.ts +23 -23
  103. package/templates/default/src/layouts/StoreLayout.astro +145 -145
  104. package/templates/default/src/lib/browser-copy.ts +37 -37
  105. package/templates/default/src/lib/context.ts +89 -89
  106. package/templates/default/src/lib/coupon-notice.ts +47 -47
  107. package/templates/default/src/lib/i18n.ts +32 -32
  108. package/templates/default/src/lib/images.ts +38 -38
  109. package/templates/default/src/lib/listing-query.ts +41 -41
  110. package/templates/default/src/lib/money.ts +16 -16
  111. package/templates/default/src/lib/motion.ts +16 -16
  112. package/templates/default/src/lib/nav.ts +26 -26
  113. package/templates/default/src/lib/offer-tiles.ts +105 -105
  114. package/templates/default/src/lib/order-outcome.ts +66 -66
  115. package/templates/default/src/lib/otp-message.ts +21 -21
  116. package/templates/default/src/lib/products.ts +38 -38
  117. package/templates/default/src/lib/review-refusals.ts +31 -31
  118. package/templates/default/src/lib/store.ts +31 -31
  119. package/templates/default/src/lib/whatsapp.ts +29 -29
  120. package/templates/default/src/middleware.ts +23 -23
  121. package/templates/default/src/pages/404.astro +22 -22
  122. package/templates/default/src/pages/{wocart-preview.astro → abcart-preview.astro} +43 -43
  123. package/templates/default/src/pages/{wocart-revalidate.ts → abcart-revalidate.ts} +10 -10
  124. package/templates/default/src/pages/{wocart-styles.css.ts → abcart-styles.css.ts} +5 -5
  125. package/templates/default/src/pages/{wocart-theme.json.ts → abcart-theme.json.ts} +5 -5
  126. package/templates/default/src/pages/api/abandoned/convert.ts +4 -4
  127. package/templates/default/src/pages/api/abandoned/upsert.ts +4 -4
  128. package/templates/default/src/pages/api/cart/validate.ts +4 -4
  129. package/templates/default/src/pages/api/communes/[wilayaId].ts +4 -4
  130. package/templates/default/src/pages/api/otp/send.ts +4 -4
  131. package/templates/default/src/pages/api/otp/verify.ts +4 -4
  132. package/templates/default/src/pages/api/reviews/[productId].ts +3 -3
  133. package/templates/default/src/pages/api/reviews/eligibility.ts +3 -3
  134. package/templates/default/src/pages/api/reviews/submit.ts +3 -3
  135. package/templates/default/src/pages/api/reviews/upload.ts +3 -3
  136. package/templates/default/src/pages/category/[slug].astro +20 -20
  137. package/templates/default/src/pages/checkout.astro +25 -25
  138. package/templates/default/src/pages/collections/[handle].astro +20 -20
  139. package/templates/default/src/pages/contact.astro +17 -17
  140. package/templates/default/src/pages/index.astro +9 -9
  141. package/templates/default/src/pages/lp/[slug].astro +47 -47
  142. package/templates/default/src/pages/pages/[slug].astro +16 -16
  143. package/templates/default/src/pages/products/[handle].astro +37 -37
  144. package/templates/default/src/pages/products/index.astro +15 -15
  145. package/templates/default/src/pages/robots.txt.ts +9 -9
  146. package/templates/default/src/pages/search.astro +19 -19
  147. package/templates/default/src/pages/sitemap.xml.ts +12 -12
  148. package/templates/default/src/pages/thank-you.astro +33 -33
  149. package/templates/default/src/pages/track-order.astro +17 -17
  150. package/templates/default/src/scripts/cart.ts +371 -371
  151. package/templates/default/src/scripts/checkout/coupon.ts +96 -96
  152. package/templates/default/src/scripts/checkout/delivery.ts +86 -86
  153. package/templates/default/src/scripts/checkout/form.ts +54 -54
  154. package/templates/default/src/scripts/checkout/otp.ts +106 -106
  155. package/templates/default/src/scripts/checkout/picker.ts +169 -169
  156. package/templates/default/src/scripts/checkout/quote.ts +169 -169
  157. package/templates/default/src/scripts/checkout/submit.ts +113 -113
  158. package/templates/default/src/scripts/checkout/tracking.ts +74 -74
  159. package/templates/default/src/scripts/countdown.ts +29 -29
  160. package/templates/default/src/scripts/events.ts +4 -4
  161. package/templates/default/src/scripts/hero.ts +49 -49
  162. package/templates/default/src/scripts/listing.ts +13 -13
  163. package/templates/default/src/scripts/order-form.ts +100 -100
  164. package/templates/default/src/scripts/product.ts +306 -306
  165. package/templates/default/src/scripts/public-config.ts +79 -79
  166. package/templates/default/src/scripts/reviews.ts +358 -358
  167. package/templates/default/src/scripts/site.ts +131 -131
  168. package/templates/default/src/scripts/thank-you.ts +11 -11
  169. package/templates/default/src/scripts/voice-note.ts +94 -94
  170. package/templates/default/src/styles/base.css +1030 -1030
  171. package/templates/default/src/styles/checkout.css +1111 -1111
  172. package/templates/default/src/styles/global.css +12 -12
  173. package/templates/default/src/styles/product.css +871 -871
  174. package/templates/default/src/styles/reviews.css +533 -533
  175. package/templates/default/src/styles/sections.css +931 -931
  176. package/templates/default/src/styles/shell.css +970 -970
  177. package/templates/default/src/styles/tokens.css +583 -583
  178. package/templates/default/src/theme/api-routes.ts +10 -10
  179. package/templates/default/src/theme/content/catalog.ts +117 -117
  180. package/templates/default/src/theme/content/checkout.ts +168 -168
  181. package/templates/default/src/theme/content/editor.ts +21 -21
  182. package/templates/default/src/theme/content/index.ts +45 -45
  183. package/templates/default/src/theme/content/reviews.ts +76 -76
  184. package/templates/default/src/theme/content/shell.ts +59 -59
  185. package/templates/default/src/theme/content/types.ts +12 -12
  186. package/templates/default/src/theme/documents/catalog.json +11 -11
  187. package/templates/default/src/theme/documents/category.json +11 -11
  188. package/templates/default/src/theme/documents/checkout.json +11 -11
  189. package/templates/default/src/theme/documents/collection.json +11 -11
  190. package/templates/default/src/theme/documents/contact.json +11 -11
  191. package/templates/default/src/theme/documents/footer.area.json +11 -11
  192. package/templates/default/src/theme/documents/header.area.json +16 -16
  193. package/templates/default/src/theme/documents/home.json +313 -313
  194. package/templates/default/src/theme/documents/landing.json +8 -8
  195. package/templates/default/src/theme/documents/page.json +11 -11
  196. package/templates/default/src/theme/documents/product.json +125 -125
  197. package/templates/default/src/theme/documents/search.json +11 -11
  198. package/templates/default/src/theme/documents/thank-you.json +11 -11
  199. package/templates/default/src/theme/documents/track-order.json +11 -11
  200. package/templates/default/src/theme/fields.ts +61 -61
  201. package/templates/default/src/theme/key.ts +11 -11
  202. package/templates/default/src/theme/labels.ts +231 -231
  203. package/templates/default/src/theme/locales.ts +11 -11
  204. package/templates/default/src/theme/palette.ts +14 -14
  205. package/templates/default/src/theme/sections/collection-cards.ts +65 -65
  206. package/templates/default/src/theme/sections/faq.ts +74 -74
  207. package/templates/default/src/theme/sections/featured-product.ts +42 -42
  208. package/templates/default/src/theme/sections/hero.ts +47 -47
  209. package/templates/default/src/theme/sections/image-banner.ts +25 -25
  210. package/templates/default/src/theme/sections/index.ts +40 -40
  211. package/templates/default/src/theme/sections/landing.ts +150 -150
  212. package/templates/default/src/theme/sections/listing.ts +84 -84
  213. package/templates/default/src/theme/sections/product-grid.ts +42 -42
  214. package/templates/default/src/theme/sections/product.ts +297 -297
  215. package/templates/default/src/theme/sections/rich-text.ts +39 -39
  216. package/templates/default/src/theme/sections/shared.ts +54 -54
  217. package/templates/default/src/theme/sections/shell.ts +85 -85
  218. package/templates/default/src/theme/sections/store-pages.ts +101 -101
  219. package/templates/default/src/theme/sections/testimonials.ts +61 -61
  220. package/templates/default/src/theme/sections/thank-you.ts +35 -35
  221. package/templates/default/src/theme/settings.ts +124 -124
  222. package/templates/default/src/theme/theme.ts +65 -65
  223. package/templates/default/tests/fixtures/canvas-tote.json +62 -62
  224. package/templates/default/tests/fixtures/linen-shirt.json +128 -128
  225. package/templates/default/tests/unit/checkout.test.ts +241 -241
  226. package/templates/default/tests/unit/contract.test.ts +170 -169
  227. package/templates/default/tests/unit/contrast.test.ts +68 -68
  228. package/templates/default/tests/unit/copy.test.ts +101 -101
  229. package/templates/default/tests/unit/design-values.test.ts +95 -95
  230. package/templates/default/tests/unit/editability.test.ts +180 -180
  231. package/templates/default/tests/unit/fixtures.ts +91 -91
  232. package/templates/default/tests/unit/footer.test.ts +54 -54
  233. package/templates/default/tests/unit/guards.test.ts +340 -340
  234. package/templates/default/tests/unit/images.test.ts +26 -26
  235. package/templates/default/tests/unit/landing.test.ts +151 -151
  236. package/templates/default/tests/unit/languages.test.ts +42 -42
  237. package/templates/default/tests/unit/middleware.test.ts +53 -53
  238. package/templates/default/tests/unit/offer-tiles.test.ts +75 -75
  239. package/templates/default/tests/unit/render.ts +38 -38
  240. package/templates/default/tests/unit/reviews.test.ts +25 -25
  241. package/templates/default/tests/unit/rules.test.ts +59 -59
  242. package/templates/default/tests/unit/source.ts +75 -75
  243. package/templates/default/tests/unit/store-pages.test.ts +147 -147
  244. package/templates/default/tests/unit/studio.test.ts +202 -202
  245. package/templates/default/tests/unit/testimonials.test.ts +52 -52
  246. package/templates/default/tests/unit/thank-you.test.ts +52 -52
  247. package/templates/default/tests/unit/tracking.test.ts +29 -29
  248. package/templates/default/tests/unit/voice-note.test.ts +42 -42
  249. package/templates/default/tsconfig.json +13 -13
  250. package/templates/default/vitest.config.ts +15 -15
  251. package/templates/default/wrangler.jsonc +16 -16
@@ -1,58 +1,58 @@
1
- ---
2
- name: wocart-theme-from-design
3
- description: Build or restyle a Wocart theme from a design, and prove it matches. The design can be a screenshot or image, a live website URL, or a Shopify theme measured with shopify-theme-asset-collector. Use for any new theme that must look like a design, for one section or one look, or for a restyle. Covers the route from an empty folder to a home page on a real store, the design as named tokens, sections, content and claims, right-to-left and phone layouts, and measuring the match. Look SDK names up with wocart-docs.
4
- ---
5
-
6
- # Build a Wocart theme from a design
7
-
8
- This skill is the route for a theme that must match a design. Each step has a reference file with the detail; read it when you reach that step.
9
-
10
- | Step | Read | What it does |
11
- | --- | --- | --- |
12
- | 0 | `references/inputs-and-rights.md` | Ask for the inputs, and set the rights before any content is taken |
13
- | 1 | `references/measure-the-design.md` | Measure the design: a screenshot, a live URL, or a Shopify theme collected by `shopify-theme-asset-collector` |
14
- | 2 | `references/tokens-sections-content.md` | Name every design value as a token; map sections; write content and claims; fonts and motion |
15
- | 3 | `references/layout-rtl-and-phone.md` | Right to left, the layout patterns, and the phone layer |
16
- | 4 | `references/verify-and-report.md` | Start the project, add a store, check the page, measure the match, and report |
17
-
18
- For any SDK name, field, platform behaviour or failing check, look it up with `wocart-docs` before you use it. Never guess an export.
19
-
20
- Read `AGENTS.md` in the project first. Its rules are what `npm test` enforces.
21
-
22
- ## Be a designer, not a tracer
23
-
24
- A design is a direction. Capture its character: the rhythm of spacing, the weight of type, how photos meet text. Where the design is silent (hover, a phone layout, an empty state, right to left), design the answer it implies. Change markup and add sections freely. Your limits are the SDK contract, the starter's tests, and the store's own facts.
25
-
26
- ## Never drift
27
-
28
- These hold at every step. If one cannot be kept, stop and ask.
29
-
30
- 1. **The platform is the SDK's.** Import `@wocart/*` through its published entry points. Never copy or deep-import SDK code; a missing capability is reported, not rebuilt.
31
- 2. **No design value is a literal.** Sizes, weights, colours, radii, shadows, borders, motion and opacity are tokens in `src/styles/tokens.css`; colours are named once in `src/theme/palette.ts`. Layout geometry stays in the stylesheets.
32
- 3. **Layout is logical** (`inset-inline-start`, `margin-inline-end`), so Arabic mirrors without extra rules.
33
- 4. **Every word is copy, every photo is an `image` field**, and the theme states no fact about a store.
34
- 5. **Nothing a merchant saved breaks.** Never rename `THEME_KEY`, a section type, a field key or an instance id. Only add.
35
- 6. **A failing check is fixed at its cause.** Never weaken, skip or delete a test or a guard.
36
- 7. **Never copy another site's code, photos, fonts or words** except on the developer's word, and only into test data (`references/inputs-and-rights.md`).
37
- 8. **Build presentation only.** Translations, prices, media and settings come from the store. Do not invent a platform feature.
38
- 9. **Done is shown, not claimed.** Quote the commands' output, and list what you did not check.
39
-
40
- ## Gates
41
-
42
- Each step ends at a gate. The gates are in `references/verify-and-report.md`. The short form: the project passes its checks before you change it; every design value is a token; the home page lists the design's sections in order; the store shows products, collections, reviews and photos; the match is within its limit at the desktop width; and the four commands pass.
43
-
44
- ## Scripts
45
-
46
- Both run against a running page, with Playwright. Set `CHROME` to a Chromium binary and `PLAYWRIGHT` to where Playwright loads from if the defaults do not run.
47
-
48
- - `scripts/qa-pages.cjs`: every page the home page links to, at desktop and phone widths, in one language. It fails on overflow, broken images, leaked translation keys, console errors, and low contrast.
49
- - `scripts/compare-design.cjs`: how closely a page matches its design, pixel by pixel, with the worst regions and the section each one falls in.
50
-
51
- ## Hand-offs
52
-
53
- - Any SDK name, field, platform behaviour or failing check: `wocart-docs`.
54
- - A design taken from a Shopify theme: `shopify-theme-asset-collector` first, then step 1 of this skill.
55
-
56
- ## Unattended builds
57
-
58
- When the developer leaves the build to run on its own, stop only at a hard stop, commit after each gate, and finish with the report. The message that starts one is in `references/verify-and-report.md`.
1
+ ---
2
+ name: abcart-theme-from-design
3
+ description: Build or restyle an AbCart theme from a design, and prove it matches. The design can be a screenshot or image, a live website URL, or a Shopify theme measured with shopify-theme-asset-collector. Use for any new theme that must look like a design, for one section or one look, or for a restyle. Covers the route from an empty folder to a home page on a real store, the design as named tokens, sections, content and claims, right-to-left and phone layouts, and measuring the match. Look SDK names up with abcart-docs.
4
+ ---
5
+
6
+ # Build an AbCart theme from a design
7
+
8
+ This skill is the route for a theme that must match a design. Each step has a reference file with the detail; read it when you reach that step.
9
+
10
+ | Step | Read | What it does |
11
+ | --- | --- | --- |
12
+ | 0 | `references/inputs-and-rights.md` | Ask for the inputs, and set the rights before any content is taken |
13
+ | 1 | `references/measure-the-design.md` | Measure the design: a screenshot, a live URL, or a Shopify theme collected by `shopify-theme-asset-collector` |
14
+ | 2 | `references/tokens-sections-content.md` | Name every design value as a token; map sections; write content and claims; fonts and motion |
15
+ | 3 | `references/layout-rtl-and-phone.md` | Right to left, the layout patterns, and the phone layer |
16
+ | 4 | `references/verify-and-report.md` | Start the project, add a store, check the page, measure the match, and report |
17
+
18
+ For any SDK name, field, platform behaviour or failing check, look it up with `abcart-docs` before you use it. Never guess an export.
19
+
20
+ Read `AGENTS.md` in the project first. Its rules are what `npm test` enforces.
21
+
22
+ ## Be a designer, not a tracer
23
+
24
+ A design is a direction. Capture its character: the rhythm of spacing, the weight of type, how photos meet text. Where the design is silent (hover, a phone layout, an empty state, right to left), design the answer it implies. Change markup and add sections freely. Your limits are the SDK contract, the starter's tests, and the store's own facts.
25
+
26
+ ## Never drift
27
+
28
+ These hold at every step. If one cannot be kept, stop and ask.
29
+
30
+ 1. **The platform is the SDK's.** Import `@abcart/*` through its published entry points. Never copy or deep-import SDK code; a missing capability is reported, not rebuilt.
31
+ 2. **No design value is a literal.** Sizes, weights, colours, radii, shadows, borders, motion and opacity are tokens in `src/styles/tokens.css`; colours are named once in `src/theme/palette.ts`. Layout geometry stays in the stylesheets.
32
+ 3. **Layout is logical** (`inset-inline-start`, `margin-inline-end`), so Arabic mirrors without extra rules.
33
+ 4. **Every word is copy, every photo is an `image` field**, and the theme states no fact about a store.
34
+ 5. **Nothing a merchant saved breaks.** Never rename `THEME_KEY`, a section type, a field key or an instance id. Only add.
35
+ 6. **A failing check is fixed at its cause.** Never weaken, skip or delete a test or a guard.
36
+ 7. **Never copy another site's code, photos, fonts or words** except on the developer's word, and only into test data (`references/inputs-and-rights.md`).
37
+ 8. **Build presentation only.** Translations, prices, media and settings come from the store. Do not invent a platform feature.
38
+ 9. **Done is shown, not claimed.** Quote the commands' output, and list what you did not check.
39
+
40
+ ## Gates
41
+
42
+ Each step ends at a gate. The gates are in `references/verify-and-report.md`. The short form: the project passes its checks before you change it; every design value is a token; the home page lists the design's sections in order; the store shows products, collections, reviews and photos; the match is within its limit at the desktop width; and the four commands pass.
43
+
44
+ ## Scripts
45
+
46
+ Both run against a running page, with Playwright. Set `CHROME` to a Chromium binary and `PLAYWRIGHT` to where Playwright loads from if the defaults do not run.
47
+
48
+ - `scripts/qa-pages.cjs`: every page the home page links to, at desktop and phone widths, in one language. It fails on overflow, broken images, leaked translation keys, console errors, and low contrast.
49
+ - `scripts/compare-design.cjs`: how closely a page matches its design, pixel by pixel, with the worst regions and the section each one falls in.
50
+
51
+ ## Hand-offs
52
+
53
+ - Any SDK name, field, platform behaviour or failing check: `abcart-docs`.
54
+ - A design taken from a Shopify theme: `shopify-theme-asset-collector` first, then step 1 of this skill.
55
+
56
+ ## Unattended builds
57
+
58
+ When the developer leaves the build to run on its own, stop only at a hard stop, commit after each gate, and finish with the report. The message that starts one is in `references/verify-and-report.md`.
@@ -1,47 +1,47 @@
1
- # Inputs and rights
2
-
3
- Read this before you start, and again whenever a source changes.
4
-
5
- ## Ask once, at the start
6
-
7
- Without an answer, take the default and say so in the report.
8
-
9
- | Ask | Default |
10
- | --- | --- |
11
- | The design: a screenshot or image, a live website URL, or a Shopify theme to measure (see below) | None: there is no build without a design |
12
- | The theme's folder name and key | The brand's name, lowercase, with hyphens |
13
- | The store to run it on: API address and key, or a local store | A local store on its own state and port |
14
- | Whether the photos, logos and words belong to the developer | No: measure the design and take none of its content |
15
- | Brand colours and font files | Read from the design; open-licence fonts only |
16
- | The pages | The home page; other pages keep the starter's sections, restyled through tokens |
17
- | The store's primary language | French, with Arabic and English published |
18
-
19
- An image cannot give these, so ask for them when they matter:
20
-
21
- - **Exact colours.** Colours read from an image are estimates. Ask for hex values when precision matters.
22
- - **Font files and their licence.** A font named from a picture is a guess. Open-licence fonts can be downloaded from their publisher and self-hosted with their licence line.
23
- - **The logo.** It is the merchant's: uploaded in the store's settings. `src/components/ui/Logo.astro` shows it, or the store's name when there is none.
24
-
25
- ## Rights
26
-
27
- You may measure a site's design: its layout, colours, type, spacing and motion. You never copy its code. Its photos, logos and words are taken only on the developer's word, and only into test data.
28
-
29
- - A reference collected from a site (a live URL, or the output of `shopify-theme-asset-collector`) is for measuring. Do not ship its CSS, JavaScript, fonts, images or text in a theme. Write the theme's own code and tokens, and name the values you measured.
30
- - A font ships only under its own open licence, self-hosted, with its licence line in `public/fonts/OFL.txt`.
31
- - A catalogue that the site serves as data is read only within the developer's permission.
32
-
33
- If the developer has not said they own the photos and words, use neutral copy and placeholders, and say so in the report.
34
-
35
- ## Shopify references
36
-
37
- A Shopify theme is a design reference, collected with `shopify-theme-asset-collector`. Run that skill first. It writes a manifest of the homepage sections and their public resources, which you use to map sections (`measure-the-design.md`). Use its output to measure, not to copy.
38
-
39
- ## What an image cannot give you
40
-
41
- The developer supplies these. Ask, and do not invent them:
42
-
43
- - exact colours (hex values);
44
- - font files and their licences;
45
- - the logo;
46
- - photos and their rights;
47
- - contact details, menus, legal pages and translations.
1
+ # Inputs and rights
2
+
3
+ Read this before you start, and again whenever a source changes.
4
+
5
+ ## Ask once, at the start
6
+
7
+ Without an answer, take the default and say so in the report.
8
+
9
+ | Ask | Default |
10
+ | --- | --- |
11
+ | The design: a screenshot or image, a live website URL, or a Shopify theme to measure (see below) | None: there is no build without a design |
12
+ | The theme's folder name and key | The brand's name, lowercase, with hyphens |
13
+ | The store to run it on: API address and key, or a local store | A local store on its own state and port |
14
+ | Whether the photos, logos and words belong to the developer | No: measure the design and take none of its content |
15
+ | Brand colours and font files | Read from the design; open-licence fonts only |
16
+ | The pages | The home page; other pages keep the starter's sections, restyled through tokens |
17
+ | The store's primary language | French, with Arabic and English published |
18
+
19
+ An image cannot give these, so ask for them when they matter:
20
+
21
+ - **Exact colours.** Colours read from an image are estimates. Ask for hex values when precision matters.
22
+ - **Font files and their licence.** A font named from a picture is a guess. Open-licence fonts can be downloaded from their publisher and self-hosted with their licence line.
23
+ - **The logo.** It is the merchant's: uploaded in the store's settings. `src/components/ui/Logo.astro` shows it, or the store's name when there is none.
24
+
25
+ ## Rights
26
+
27
+ You may measure a site's design: its layout, colours, type, spacing and motion. You never copy its code. Its photos, logos and words are taken only on the developer's word, and only into test data.
28
+
29
+ - A reference collected from a site (a live URL, or the output of `shopify-theme-asset-collector`) is for measuring. Do not ship its CSS, JavaScript, fonts, images or text in a theme. Write the theme's own code and tokens, and name the values you measured.
30
+ - A font ships only under its own open licence, self-hosted, with its licence line in `public/fonts/OFL.txt`.
31
+ - A catalogue that the site serves as data is read only within the developer's permission.
32
+
33
+ If the developer has not said they own the photos and words, use neutral copy and placeholders, and say so in the report.
34
+
35
+ ## Shopify references
36
+
37
+ A Shopify theme is a design reference, collected with `shopify-theme-asset-collector`. Run that skill first. It writes a manifest of the homepage sections and their public resources, which you use to map sections (`measure-the-design.md`). Use its output to measure, not to copy.
38
+
39
+ ## What an image cannot give you
40
+
41
+ The developer supplies these. Ask, and do not invent them:
42
+
43
+ - exact colours (hex values);
44
+ - font files and their licences;
45
+ - the logo;
46
+ - photos and their rights;
47
+ - contact details, menus, legal pages and translations.
@@ -1,36 +1,36 @@
1
- # Layout, right to left and phones
2
-
3
- Arabic is the default language, so every section is checked right to left. Layout uses logical properties (`inset-inline-start`, `margin-inline-end`), so Arabic mirrors without extra rules. A physical left or right appears only in a rule that names one direction, or the WhatsApp widget's side.
4
-
5
- ## Patterns that came from real layouts that broke
6
-
7
- - **A split (photo beside text)** is a two-column grid with the photo first. The browser mirrors it. Never place a photo under text with absolute positioning: in one direction the text lands on the photo's busy part.
8
- - **Text on a photo** sits in its own panel with a background. Text never sits directly on a photo.
9
- - **Optional blocks in a grid.** A grid with a fixed count of tracks leaves an empty track at one edge when a block is missing. Lay out only the blocks that render, or let the tracks repeat to fit.
10
- - **A grid that replaces a flex row** must set its own `justify-content`. Flex's `space-between` pins a single grid track to the start edge.
11
- - **Decorative corners and quotes** use `inset-inline-end`, so they mirror.
12
- - **Names keep their own direction.** A Latin name in an Arabic card takes the card's direction, and its full stop jumps to the start (`.Nadia K`). Every name and free text carries `dir="auto"`. Run `npx vitest run tests/unit/rules.test.ts -t "own direction"`.
13
- - **Card rows fill their row.** A grid of cards uses `repeat(auto-fit, minmax(min(100%, 340px), 1fr))`, not a fixed count of columns. A fixed count leaves an empty column beside the last card. Six cards make two even rows of three.
14
- - **Text on a band is readable.** Every scheme keeps its text at WCAG AA (4.5:1) on its own band, and its button words on its button. A light band takes dark ink: white words on sand measured 2.3:1, and a page can pass its tests and still fail this. Run `npx vitest run tests/unit/contrast.test.ts`, which names each pair.
15
- - **A word on a soft band takes the accent's text colour**, not the accent itself: the accent is tuned for fills, and it can fall below 4.5:1 on a pale background. Use `--accent-text`.
16
- - **Overlays never stack.** An add-to-cart confirmation shows only when no drawer opens with it, or it covers the drawer's first line on a phone. Run `npx vitest run tests/unit/rules.test.ts -t "drawer"`.
17
- - **The brand stays on one line** in the phone header: `white-space: nowrap` and the `-narrow` brand size. Two lines push the icons out of their row.
18
- - **Quantity sits beside the order button** when a product has no offer tiers, inside the order form. A quantity above the form is a second control for the same value.
19
- - **Icons match.** Accordions either all carry an icon or none does. One lone icon reads as a missed setting.
20
- - **Directional icons** carry the `icon-directional` class.
21
- - **Numbers and phone numbers** stay left to right: wrap them in `dir="ltr"`.
22
- - **Arabic is never letter-spaced.** The `[dir="rtl"]` block resets tracking and sizes it on its own.
23
-
24
- ## The phone layer
25
-
26
- Write the phone layer last, in one `@media (max-width: 759px)` block:
27
-
28
- - **Hero:** nearly full height; the words at the foot over a fade of the band's colour; a full-width button.
29
- - **Swipe rows** for side-by-side content: one row that scrolls and snaps, bleeds to the screen's edge, and mirrors in Arabic.
30
- - **Product grids** stay two columns. **Icon rows** become 2 × 2. **Primary buttons** span the width. **Tap targets** are at least 40 px.
31
- - **Header:** the brand stays on one line (`white-space: nowrap`, the `-narrow` brand size); the icons keep their row.
32
- - **Overlays:** a confirmation or toast never covers an open drawer, a sticky purchase bar or a form field.
33
- - **Galleries:** a product's thumbnails stay on a phone, beside the photo or under it, as the merchant sets them. Only the arrows are hidden. Run `npx vitest run tests/unit/rules.test.ts -t "phone gallery"`.
34
- - **Pickers:** on a touch screen, a long list (the wilayas, for example) opens as a themed list, not the phone's own wheel. The native select stays in the form, hidden, and the script reads and changes it. Run `npx vitest run tests/unit/checkout.test.ts -t "themed list"`.
35
-
36
- Right to left, check every new section against these patterns.
1
+ # Layout, right to left and phones
2
+
3
+ Arabic is the default language, so every section is checked right to left. Layout uses logical properties (`inset-inline-start`, `margin-inline-end`), so Arabic mirrors without extra rules. A physical left or right appears only in a rule that names one direction, or the WhatsApp widget's side.
4
+
5
+ ## Patterns that came from real layouts that broke
6
+
7
+ - **A split (photo beside text)** is a two-column grid with the photo first. The browser mirrors it. Never place a photo under text with absolute positioning: in one direction the text lands on the photo's busy part.
8
+ - **Text on a photo** sits in its own panel with a background. Text never sits directly on a photo.
9
+ - **Optional blocks in a grid.** A grid with a fixed count of tracks leaves an empty track at one edge when a block is missing. Lay out only the blocks that render, or let the tracks repeat to fit.
10
+ - **A grid that replaces a flex row** must set its own `justify-content`. Flex's `space-between` pins a single grid track to the start edge.
11
+ - **Decorative corners and quotes** use `inset-inline-end`, so they mirror.
12
+ - **Names keep their own direction.** A Latin name in an Arabic card takes the card's direction, and its full stop jumps to the start (`.Nadia K`). Every name and free text carries `dir="auto"`. Run `npx vitest run tests/unit/rules.test.ts -t "own direction"`.
13
+ - **Card rows fill their row.** A grid of cards uses `repeat(auto-fit, minmax(min(100%, 340px), 1fr))`, not a fixed count of columns. A fixed count leaves an empty column beside the last card. Six cards make two even rows of three.
14
+ - **Text on a band is readable.** Every scheme keeps its text at WCAG AA (4.5:1) on its own band, and its button words on its button. A light band takes dark ink: white words on sand measured 2.3:1, and a page can pass its tests and still fail this. Run `npx vitest run tests/unit/contrast.test.ts`, which names each pair.
15
+ - **A word on a soft band takes the accent's text colour**, not the accent itself: the accent is tuned for fills, and it can fall below 4.5:1 on a pale background. Use `--accent-text`.
16
+ - **Overlays never stack.** An add-to-cart confirmation shows only when no drawer opens with it, or it covers the drawer's first line on a phone. Run `npx vitest run tests/unit/rules.test.ts -t "drawer"`.
17
+ - **The brand stays on one line** in the phone header: `white-space: nowrap` and the `-narrow` brand size. Two lines push the icons out of their row.
18
+ - **Quantity sits beside the order button** when a product has no offer tiers, inside the order form. A quantity above the form is a second control for the same value.
19
+ - **Icons match.** Accordions either all carry an icon or none does. One lone icon reads as a missed setting.
20
+ - **Directional icons** carry the `icon-directional` class.
21
+ - **Numbers and phone numbers** stay left to right: wrap them in `dir="ltr"`.
22
+ - **Arabic is never letter-spaced.** The `[dir="rtl"]` block resets tracking and sizes it on its own.
23
+
24
+ ## The phone layer
25
+
26
+ Write the phone layer last, in one `@media (max-width: 759px)` block:
27
+
28
+ - **Hero:** nearly full height; the words at the foot over a fade of the band's colour; a full-width button.
29
+ - **Swipe rows** for side-by-side content: one row that scrolls and snaps, bleeds to the screen's edge, and mirrors in Arabic.
30
+ - **Product grids** stay two columns. **Icon rows** become 2 × 2. **Primary buttons** span the width. **Tap targets** are at least 40 px.
31
+ - **Header:** the brand stays on one line (`white-space: nowrap`, the `-narrow` brand size); the icons keep their row.
32
+ - **Overlays:** a confirmation or toast never covers an open drawer, a sticky purchase bar or a form field.
33
+ - **Galleries:** a product's thumbnails stay on a phone, beside the photo or under it, as the merchant sets them. Only the arrows are hidden. Run `npx vitest run tests/unit/rules.test.ts -t "phone gallery"`.
34
+ - **Pickers:** on a touch screen, a long list (the wilayas, for example) opens as a themed list, not the phone's own wheel. The native select stays in the form, hidden, and the script reads and changes it. Run `npx vitest run tests/unit/checkout.test.ts -t "themed list"`.
35
+
36
+ Right to left, check every new section against these patterns.
@@ -1,60 +1,60 @@
1
- # Measure the design
2
-
3
- Measure before you change a file. The table you write here becomes tokens (`tokens-sections-content.md`), and it is the comparison at the end (`verify-and-report.md`).
4
-
5
- ## From a screenshot or an image
6
-
7
- Read the whole image once. Then list its sections from top to bottom, one row each:
8
-
9
- | # | Role | What it shows | Design, content or claim |
10
- | --- | --- | --- | --- |
11
-
12
- - **Design** is layout, colour, type, corners, shadows, spacing, motion and order. You copy it.
13
- - **Content** is words and photos. Words become copy; photos become `image` fields. You never copy the actual photos.
14
- - **Claims** are facts about a store: delivery reach or periods, guarantees, percentages, ratings, reviews, people's names, cities, prices, phone numbers, addresses, payment logos. You do not copy them (`content-and-claims` in `tokens-sections-content.md`).
15
-
16
- Colours and sizes read by eye are estimates. Say so in the report.
17
-
18
- ## From a live URL
19
-
20
- Open the page in a browser you can script, at the desktop width the design uses (1440 px). Read computed styles with small scripts, each returning a few short lines. For each section, record:
21
-
22
- - the body font, size, line height and letter-spacing; the content column's width; the gap between sections;
23
- - each heading's family, size, weight, line height and case; the small line above titles; the button's size, weight, height and padding;
24
- - each background band; the action colour; borders; the card proportions (the photo's rendered width and height, the padding under it, the title and price sizes, the gap between cards).
25
-
26
- You may measure a site's values. You never copy its code (`inputs-and-rights.md`).
27
-
28
- ## From a Shopify theme
29
-
30
- Run `shopify-theme-asset-collector` on the storefront's public pages:
31
-
32
- ```sh
33
- python3 .agents/skills/shopify-theme-asset-collector/scripts/collect_public_assets.py \
34
- https://store.myshopify.com/ --out ./reference-store --zip
35
- ```
36
-
37
- Its `manifest.json` lists the homepage sections in order, with each section's heading and the public resources it uses. Use that order and those headings to build your section table. Read the section's real values from the live page, as in the previous section. The collected files are for measuring only.
38
-
39
- ## Map each section
40
-
41
- Each row of the table becomes one of:
42
-
43
- - an existing section, restyled through tokens, or with a field or a `layout` option added (`tokens-sections-content.md`, step 3);
44
- - a new section, when nothing fits;
45
- - left out, when the platform has no feature for it (`inputs-and-rights.md`).
46
-
47
- ## Compare the built page with the design
48
-
49
- Once the page runs, measure how closely it matches:
50
-
51
- ```sh
52
- node .agents/skills/wocart-theme-from-design/scripts/compare-design.cjs \
53
- --reference ./design/home.png --page http://localhost:4321/ --width 1440 --max-diff 4 --out ./design-compare
54
- ```
55
-
56
- The reference is an image, or a live page's URL (which is captured at the same width). The script freezes animation, loads every photo, and compares the two pixel by pixel. It writes `report.json`, `reference.png`, `page.png` and `diff.png` (differences in red) to `--out`. It prints the share of pixels that differ, the worst regions, and the section each region falls in.
57
-
58
- Exit status 0 means within `--max-diff`; 1 means over it; 2 means the run itself failed. Start at 4%, and tighten it once the layout is right. A page with animated or loaded-late photos can differ a little from its own capture; a region that differs in the same place on every run is a real difference.
59
-
60
- Work in rounds: list the three largest differences, fix them, and measure again. Stop when the rest is image loading or animation timing.
1
+ # Measure the design
2
+
3
+ Measure before you change a file. The table you write here becomes tokens (`tokens-sections-content.md`), and it is the comparison at the end (`verify-and-report.md`).
4
+
5
+ ## From a screenshot or an image
6
+
7
+ Read the whole image once. Then list its sections from top to bottom, one row each:
8
+
9
+ | # | Role | What it shows | Design, content or claim |
10
+ | --- | --- | --- | --- |
11
+
12
+ - **Design** is layout, colour, type, corners, shadows, spacing, motion and order. You copy it.
13
+ - **Content** is words and photos. Words become copy; photos become `image` fields. You never copy the actual photos.
14
+ - **Claims** are facts about a store: delivery reach or periods, guarantees, percentages, ratings, reviews, people's names, cities, prices, phone numbers, addresses, payment logos. You do not copy them (`content-and-claims` in `tokens-sections-content.md`).
15
+
16
+ Colours and sizes read by eye are estimates. Say so in the report.
17
+
18
+ ## From a live URL
19
+
20
+ Open the page in a browser you can script, at the desktop width the design uses (1440 px). Read computed styles with small scripts, each returning a few short lines. For each section, record:
21
+
22
+ - the body font, size, line height and letter-spacing; the content column's width; the gap between sections;
23
+ - each heading's family, size, weight, line height and case; the small line above titles; the button's size, weight, height and padding;
24
+ - each background band; the action colour; borders; the card proportions (the photo's rendered width and height, the padding under it, the title and price sizes, the gap between cards).
25
+
26
+ You may measure a site's values. You never copy its code (`inputs-and-rights.md`).
27
+
28
+ ## From a Shopify theme
29
+
30
+ Run `shopify-theme-asset-collector` on the storefront's public pages:
31
+
32
+ ```sh
33
+ python3 .agents/skills/shopify-theme-asset-collector/scripts/collect_public_assets.py \
34
+ https://store.myshopify.com/ --out ./reference-store --zip
35
+ ```
36
+
37
+ Its `manifest.json` lists the homepage sections in order, with each section's heading and the public resources it uses. Use that order and those headings to build your section table. Read the section's real values from the live page, as in the previous section. The collected files are for measuring only.
38
+
39
+ ## Map each section
40
+
41
+ Each row of the table becomes one of:
42
+
43
+ - an existing section, restyled through tokens, or with a field or a `layout` option added (`tokens-sections-content.md`, step 3);
44
+ - a new section, when nothing fits;
45
+ - left out, when the platform has no feature for it (`inputs-and-rights.md`).
46
+
47
+ ## Compare the built page with the design
48
+
49
+ Once the page runs, measure how closely it matches:
50
+
51
+ ```sh
52
+ node .agents/skills/abcart-theme-from-design/scripts/compare-design.cjs \
53
+ --reference ./design/home.png --page http://localhost:4321/ --width 1440 --max-diff 4 --out ./design-compare
54
+ ```
55
+
56
+ The reference is an image, or a live page's URL (which is captured at the same width). The script freezes animation, loads every photo, and compares the two pixel by pixel. It writes `report.json`, `reference.png`, `page.png` and `diff.png` (differences in red) to `--out`. It prints the share of pixels that differ, the worst regions, and the section each region falls in.
57
+
58
+ Exit status 0 means within `--max-diff`; 1 means over it; 2 means the run itself failed. Start at 4%, and tighten it once the layout is right. A page with animated or loaded-late photos can differ a little from its own capture; a region that differs in the same place on every run is a real difference.
59
+
60
+ Work in rounds: list the three largest differences, fix them, and measure again. Stop when the rest is image loading or animation timing.