@zohofinance/commerce 1.0.0 → 1.0.1

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 (127) hide show
  1. package/README.md +61 -0
  2. package/package.json +2 -2
  3. package/ts-dist/mocks/init-theme/.claude/CLAUDE.md +6 -0
  4. package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-section-from-design.20260528/SKILL.md +242 -0
  5. package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-section-from-design.20260528/inputs/figma.md +81 -0
  6. package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-section-from-design.20260528/inputs/screenshot.md +54 -0
  7. package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-section-from-design.20260528/inputs/url.md +88 -0
  8. package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-section-from-design.20260528/spec-table.md +102 -0
  9. package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-section-from-design.20260528/verification/accessibility.md +110 -0
  10. package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-section-from-design.20260528/verification/performance.md +127 -0
  11. package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-section-from-design.20260528/verification/tokens.md +87 -0
  12. package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-section-from-design.20260528/verification/visual-diff.md +123 -0
  13. package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-theme-builder.20260528/SKILL.md +605 -0
  14. package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-theme-builder.20260528/design-tokens.md +105 -0
  15. package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-theme-builder.20260528/page-json-contract.md +58 -0
  16. package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-theme-builder.20260528/qa-accessibility.md +35 -0
  17. package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-theme-builder.20260528/reference-lookup.md +94 -0
  18. package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-theme-builder.20260528/section-anatomy.md +109 -0
  19. package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/SKILL.md +313 -0
  20. package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/agent-hierarchy.md +142 -0
  21. package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/ask-developer.md +113 -0
  22. package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/bootstrap.md +260 -0
  23. package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/build-metrics.md +89 -0
  24. package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/code-quality.md +186 -0
  25. package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/common-pages-agent.md +97 -0
  26. package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/dev-server-and-urls.md +127 -0
  27. package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/exemplars.md +79 -0
  28. package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/figma-discovery.md +138 -0
  29. package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/figma-extraction.md +132 -0
  30. package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/image-sources.md +84 -0
  31. package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/inputs/guidelines-frame.md +178 -0
  32. package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/page-builder.md +322 -0
  33. package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/page-orchestrator.md +199 -0
  34. package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/parallel-fanout.md +152 -0
  35. package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/scripts/a11y.mjs +129 -0
  36. package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/scripts/lint-section.mjs +502 -0
  37. package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/scripts/perf.mjs +134 -0
  38. package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/scripts/pixel-diff.mjs +206 -0
  39. package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/scripts/record-build-metrics.mjs +118 -0
  40. package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/section-builder.md +131 -0
  41. package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/subagent-escalation.md +75 -0
  42. package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/transcription-rules.md +98 -0
  43. package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/verification.md +227 -0
  44. package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/visual-verify-loop.md +117 -0
  45. package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/_index.md +4 -0
  46. package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/assets.md +105 -0
  47. package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/best-practices.md +212 -0
  48. package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/custom-scripts.md +294 -0
  49. package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/i18n.md +155 -0
  50. package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/introduction.md +91 -0
  51. package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/layouts.md +158 -0
  52. package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/pages.md +156 -0
  53. package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/reference/_index.md +4 -0
  54. package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/reference/filters.md +419 -0
  55. package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/reference/global-objects.md +415 -0
  56. package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/reference/schema-types.md +926 -0
  57. package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/reference/tags.md +259 -0
  58. package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/sections.md +203 -0
  59. package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/setup-guide.md +424 -0
  60. package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/snippets.md +70 -0
  61. package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/theme-structure.md +252 -0
  62. package/ts-dist/mocks/init-theme/.cursor/PLAYBOOK.md +144 -0
  63. package/ts-dist/mocks/init-theme/.cursor/README.md +6 -0
  64. package/ts-dist/mocks/init-theme/.cursor/agents/figma-desktop-mobile-parallel.md +48 -0
  65. package/ts-dist/mocks/init-theme/.cursor/agents/visual-compare.md +221 -0
  66. package/ts-dist/mocks/init-theme/.cursor/commands/add-field.md +83 -0
  67. package/ts-dist/mocks/init-theme/.cursor/commands/add-theme-setting.md +200 -0
  68. package/ts-dist/mocks/init-theme/.cursor/commands/assemble-page.md +72 -0
  69. package/ts-dist/mocks/init-theme/.cursor/commands/audit-page.md +57 -0
  70. package/ts-dist/mocks/init-theme/.cursor/commands/build-page-sections.md +110 -0
  71. package/ts-dist/mocks/init-theme/.cursor/commands/build-section.md +418 -0
  72. package/ts-dist/mocks/init-theme/.cursor/commands/build-theme.md +307 -0
  73. package/ts-dist/mocks/init-theme/.cursor/commands/compare-section.md +358 -0
  74. package/ts-dist/mocks/init-theme/.cursor/commands/create-theme.md +77 -0
  75. package/ts-dist/mocks/init-theme/.cursor/commands/extract-tokens.md +43 -0
  76. package/ts-dist/mocks/init-theme/.cursor/commands/fix-section.md +92 -0
  77. package/ts-dist/mocks/init-theme/.cursor/commands/impact.md +50 -0
  78. package/ts-dist/mocks/init-theme/.cursor/commands/qa-a11y.md +66 -0
  79. package/ts-dist/mocks/init-theme/.cursor/commands/qa-i18n.md +110 -0
  80. package/ts-dist/mocks/init-theme/.cursor/commands/qa-layout.md +127 -0
  81. package/ts-dist/mocks/init-theme/.cursor/commands/qa-performance.md +72 -0
  82. package/ts-dist/mocks/init-theme/.cursor/commands/qa-section.md +84 -0
  83. package/ts-dist/mocks/init-theme/.cursor/commands/qa-sections.md +48 -0
  84. package/ts-dist/mocks/init-theme/.cursor/commands/qa-theme.md +85 -0
  85. package/ts-dist/mocks/init-theme/.cursor/commands/redesign-section.md +177 -0
  86. package/ts-dist/mocks/init-theme/.cursor/commands/refactor-section.md +185 -0
  87. package/ts-dist/mocks/init-theme/.cursor/commands/sync-theme-settings.md +132 -0
  88. package/ts-dist/mocks/init-theme/.cursor/commands/validate-page.md +60 -0
  89. package/ts-dist/mocks/init-theme/.cursor/commands/validate-section-group.md +88 -0
  90. package/ts-dist/mocks/init-theme/.cursor/commands/validate-theme-settings.md +119 -0
  91. package/ts-dist/mocks/init-theme/.cursor/examples/design-instructions-template.md +151 -0
  92. package/ts-dist/mocks/init-theme/.cursor/mcp.json +18 -0
  93. package/ts-dist/mocks/init-theme/.cursor/rules/README.md +160 -0
  94. package/ts-dist/mocks/init-theme/.cursor/rules/accessibility.mdc +24 -0
  95. package/ts-dist/mocks/init-theme/.cursor/rules/add-field.mdc +222 -0
  96. package/ts-dist/mocks/init-theme/.cursor/rules/add-theme-setting.mdc +39 -0
  97. package/ts-dist/mocks/init-theme/.cursor/rules/assemble-page.mdc +130 -0
  98. package/ts-dist/mocks/init-theme/.cursor/rules/audit-page.mdc +92 -0
  99. package/ts-dist/mocks/init-theme/.cursor/rules/build-section.mdc +178 -0
  100. package/ts-dist/mocks/init-theme/.cursor/rules/build-theme.mdc +47 -0
  101. package/ts-dist/mocks/init-theme/.cursor/rules/compare-section.mdc +94 -0
  102. package/ts-dist/mocks/init-theme/.cursor/rules/create-theme.mdc +78 -0
  103. package/ts-dist/mocks/init-theme/.cursor/rules/css.mdc +137 -0
  104. package/ts-dist/mocks/init-theme/.cursor/rules/design-spec-extraction.mdc +255 -0
  105. package/ts-dist/mocks/init-theme/.cursor/rules/extract-tokens.mdc +43 -0
  106. package/ts-dist/mocks/init-theme/.cursor/rules/figma-mcp-resolution.mdc +40 -0
  107. package/ts-dist/mocks/init-theme/.cursor/rules/fix-section.mdc +154 -0
  108. package/ts-dist/mocks/init-theme/.cursor/rules/general.mdc +30 -0
  109. package/ts-dist/mocks/init-theme/.cursor/rules/i18n.mdc +85 -0
  110. package/ts-dist/mocks/init-theme/.cursor/rules/javascript.mdc +85 -0
  111. package/ts-dist/mocks/init-theme/.cursor/rules/liquid-no-hardcoded-strings.mdc +42 -0
  112. package/ts-dist/mocks/init-theme/.cursor/rules/liquid.mdc +171 -0
  113. package/ts-dist/mocks/init-theme/.cursor/rules/mobile-desktop-setting-meta.mdc +34 -0
  114. package/ts-dist/mocks/init-theme/.cursor/rules/naming-convention.mdc +64 -0
  115. package/ts-dist/mocks/init-theme/.cursor/rules/pages.mdc +120 -0
  116. package/ts-dist/mocks/init-theme/.cursor/rules/performance.mdc +51 -0
  117. package/ts-dist/mocks/init-theme/.cursor/rules/qa-section.mdc +134 -0
  118. package/ts-dist/mocks/init-theme/.cursor/rules/redesign-section.mdc +147 -0
  119. package/ts-dist/mocks/init-theme/.cursor/rules/schema-sync.mdc +110 -0
  120. package/ts-dist/mocks/init-theme/.cursor/rules/schema.mdc +360 -0
  121. package/ts-dist/mocks/init-theme/.cursor/rules/share-urls.mdc +68 -0
  122. package/ts-dist/mocks/init-theme/.cursor/skills/browser-verify.md +128 -0
  123. package/ts-dist/mocks/init-theme/.cursor/skills/design-tokens.md +105 -0
  124. package/ts-dist/mocks/init-theme/.cursor/skills/page-json-contract.md +87 -0
  125. package/ts-dist/mocks/init-theme/.cursor/skills/qa-accessibility.md +35 -0
  126. package/ts-dist/mocks/init-theme/.cursor/skills/reference-lookup.md +88 -0
  127. package/ts-dist/mocks/init-theme/.cursor/skills/section-anatomy.md +173 -0
@@ -0,0 +1,252 @@
1
+ ---
2
+ title: "Theme Structure"
3
+ weight: 2
4
+ ---
5
+
6
+ # Theme Structure
7
+
8
+ Zoho Commerce themes follow a strict folder structure. Every theme must include these main directories.
9
+
10
+ ## Required Folders
11
+
12
+ ```
13
+ theme/
14
+ ├── assets/ # Static files (CSS, JavaScript, images)
15
+ ├── i18n/ # Translation files for multi-language support
16
+ ├── layouts/ # Main theme layouts
17
+ ├── pages/ # Page-specific default JSON configuration
18
+ ├── sections/ # Section components (.liquid files)
19
+ ├── snippets/ # Reusable template fragments
20
+ └── settings/ # Theme-wide configuration
21
+ ```
22
+
23
+ ## 1. Assets Folder
24
+
25
+ Contains all static files needed by the theme:
26
+
27
+ ```
28
+ theme/assets/
29
+ ├── style.css # Main stylesheet
30
+ ├── main.css # Additional stylesheet
31
+ ├── theme-settings.css # CSS for theme customization
32
+ ├── signin.css # Sign-in page styles
33
+ ├── header.js # Header component script
34
+ ├── footer.js # Footer component script
35
+ ├── *.js # Page-specific scripts
36
+ ├── *.webp # Theme images
37
+ └── fingerprint.json # Asset versioning (REQUIRED)
38
+ ```
39
+
40
+ **Important**: All asset files must be referenced using the `asset_url` filter. Pass just the filename (e.g., `"main.css"`), not the full path. The `fingerprint.json` file is mandatory for cache busting.
41
+
42
+ Example asset reference:
43
+ ```liquid
44
+ <link rel="stylesheet" href="{{ "main.css" | asset_url }}">
45
+ <script src="{{ "header.js" | asset_url }}" defer></script>
46
+ ```
47
+
48
+ Example fingerprint.json:
49
+ ```json
50
+ {
51
+ "main.css": "main-585919664682927.css",
52
+ "main.js": "main-59775934977548.js",
53
+ "logo.svg": "logo-123456789.svg"
54
+ }
55
+ ```
56
+
57
+ ## 2. Internationalization (i18n) Folder
58
+
59
+ Contains translation files:
60
+
61
+ ```
62
+ theme/i18n/
63
+ ├── en.json # English (default fallback)
64
+ ├── en.schema.json # Schema label translations for the theme editor
65
+ ├── ar.json # Arabic
66
+ ├── de.json # German
67
+ ├── es.json # Spanish
68
+ ├── fr.json # French
69
+ ├── id.json # Indonesian
70
+ ├── ja.json # Japanese
71
+ ├── ko.json # Korean
72
+ ├── pt.json # Portuguese
73
+ ├── th.json # Thai
74
+ ├── vi.json # Vietnamese
75
+ ├── zh.json # Chinese (Simplified)
76
+ └── zh_tw.json # Chinese (Traditional)
77
+ ```
78
+
79
+ **File structure:**
80
+ - `en.json`: Default fallback for all translations used in templates with the `t` filter
81
+ - `en.schema.json`: Translations for section schema labels (used with `t:` prefix)
82
+ - Other language files: Add only the languages your store supports
83
+
84
+ Example i18n/en.json:
85
+ ```json
86
+ {
87
+ "header": {
88
+ "sign_in": "Sign In",
89
+ "sign_out": "Sign Out",
90
+ "my_orders": "My Orders"
91
+ },
92
+ "product_details": {
93
+ "sold_out": "Sold Out",
94
+ "on_sale": "On sale"
95
+ },
96
+ "pagination": {
97
+ "previous_btn": "<",
98
+ "next_btn": ">"
99
+ }
100
+ }
101
+ ```
102
+
103
+ ## 3. Layouts Folder
104
+
105
+ Contains main template structures:
106
+
107
+ ```
108
+ theme/layouts/
109
+ ├── theme.liquid # Default layout for all pages
110
+ ├── accounts.liquid # Layout for sign-in/sign-up pages
111
+ └── sitemap.liquid # XML sitemap layout
112
+ ```
113
+
114
+ **theme.liquid** is the main HTML document wrapper. It contains:
115
+ - Page title rendering
116
+ - Stylesheet and favicon inclusion
117
+ - `{{ content_for_header }}` — server-injected head output from Zoho Commerce admin: meta tags, stylesheets, **analytics scripts** (no separate theme integration required), and related platform head content
118
+ - Header and footer sections
119
+ - `{{ content_for_layout }}` — renders page content
120
+ - `{{ content_for_footer }}` — scripts that load after DOM
121
+
122
+ **accounts.liquid** is the specialized layout for authentication and account pages.
123
+
124
+ **sitemap.liquid** generates the XML sitemap structure for search engines.
125
+
126
+ ## 4. Pages Folder
127
+
128
+ Contains JSON default configurations for each page type:
129
+
130
+ ```
131
+ theme/pages/
132
+ ├── index.json # Home page defaults
133
+ ├── product.json # Product detail page
134
+ ├── collection.json # Collection/category page
135
+ ├── category.json # Category page
136
+ ├── cart.json # Shopping cart
137
+ ├── checkout.json # Checkout page
138
+ ├── search.json # Search results
139
+ ├── blog.json # Blog post page
140
+ ├── blogs.json # Blog listing
141
+ ├── signin.json # Login page
142
+ ├── signup.json # Registration page
143
+ ├── forgotpassword.json # Password reset
144
+ ├── account-profile.json # Customer profile
145
+ ├── account-address.json # Saved addresses
146
+ ├── account-order.json # Order history listing
147
+ ├── account-order-detail.json # Single order detail
148
+ ├── account-order-status.json # Order tracking/status
149
+ ├── account-wishlist.json # Customer wishlist
150
+ ├── orders.json # Orders overview
151
+ ├── payment.json # Payment confirmation/failure
152
+ ├── sitemap.json # XML sitemap
153
+ ├── page.json # All custom pages (single template)
154
+ └── 404.json # Not found page
155
+ ```
156
+
157
+ **Note**: There is no support for individual custom page JSON files. All custom pages created in the admin use the single `page.liquid` section template with defaults from `page.json`.
158
+
159
+ ## 5. Sections Folder
160
+
161
+ Contains reusable section components:
162
+
163
+ ```
164
+ theme/sections/
165
+ ├── header.liquid # Header component
166
+ ├── header-group.json # Header section group configuration
167
+ ├── footer.liquid # Footer component
168
+ ├── footer-group.json # Footer section group configuration
169
+ ├── banner.liquid # Banner section
170
+ ├── product-details.liquid # Product information section
171
+ ├── product-collection.liquid
172
+ ├── cart-page.liquid
173
+ └── ...
174
+ ```
175
+
176
+ **Section structure:**
177
+ Each section `.liquid` file contains both template logic and an embedded `{% schema %}` block for configuration.
178
+
179
+ Sections are the main editable components users customize in the Zoho Commerce admin.
180
+
181
+ **Section group files** (`header-group.json`, `footer-group.json`) define fixed sets of sections for the header and footer areas. They are rendered in layouts using the Zoho Commerce-specific `{% sections 'header-group' %}` tag — see [Layouts](/layouts/) for details.
182
+
183
+ ## 6. Snippets Folder
184
+
185
+ Reusable template fragments that don't have configuration settings:
186
+
187
+ ```
188
+ theme/snippets/
189
+ ├── product-card.liquid # Product listing card
190
+ ├── cart-item.liquid # Cart item row
191
+ ├── pagination.liquid # Pagination controls
192
+ ├── product-variant-picker.liquid # Variant selection UI
193
+ ├── icon-cart.liquid # Cart icon
194
+ ├── icon-search.liquid # Search icon
195
+ └── ...
196
+ ```
197
+
198
+ **Usage**: Snippets are rendered from other templates using the `render` tag:
199
+ ```liquid
200
+ {% render 'product-card', product: product %}
201
+ ```
202
+
203
+ ## 7. Settings Folder
204
+
205
+ Theme-wide configuration and customization options:
206
+
207
+ ```
208
+ theme/settings/
209
+ ├── schema.json # Theme settings schema
210
+ └── theme.json # Default theme settings values
211
+ ```
212
+
213
+ **schema.json** defines customizable theme options like colors, fonts, and layout preferences. Use `meta` property to group settings:
214
+ - `"meta": "global_settings"` — for global theme settings
215
+ - `"meta": "component_settings"` — for component-specific settings
216
+
217
+ **theme.json** provides default values for all theme settings.
218
+
219
+ ## Naming Conventions
220
+
221
+ - Files: lowercase with hyphens (product-card.liquid, main.css)
222
+ - Variables: snake_case (product_title, cart_items)
223
+ - IDs: camelcase (id="productCard")
224
+ - Classes: lowercase with hyphens (class="product-card-featured")
225
+
226
+ ## Best Practices
227
+
228
+ 1. Keep files focused and reasonably sized
229
+ 2. Use consistent naming across related files
230
+ 3. Use `asset_url` for all theme assets (pass filename only)
231
+ 4. Use `image_url` for product/collection images
232
+ 5. Comment complex or non-obvious logic
233
+ 6. Name files descriptively so they're easy to find
234
+ 7. Use translation keys (`t:` prefix) for all schema labels
235
+ 8. Include `{{ block.zcommerce_attributes }}` on block wrapper elements
236
+
237
+ ## Validation Checklist
238
+
239
+ Before publishing your theme:
240
+
241
+ - All required folders exist
242
+ - fingerprint.json is present in assets/
243
+ - en.json exists as translation fallback
244
+ - en.schema.json exists for schema label translations
245
+ - Schema IDs match values used in page JSONs
246
+ - All assets reference use `asset_url` filter
247
+ - All product images use `image_url` filter
248
+ - Block elements include `zcommerce_attributes`
249
+ - No broken links or missing references
250
+ - Asset sizes optimized for performance
251
+
252
+
@@ -0,0 +1,144 @@
1
+ # Theme development playbook
2
+
3
+ Use this as the single source of truth for command order and when to run each step.
4
+
5
+ ---
6
+
7
+ ## Flow 0 — Full autopilot (new theme from Figma) ⭐ RECOMMENDED
8
+
9
+ Use when you have a complete Figma file with Guidelines, Website View, and Mobile View.
10
+ This flow includes integrated design verification — sections match Figma on the first pass.
11
+
12
+ | Step | Command | Notes |
13
+ |------|---------|--------|
14
+ | 1 | `/build-theme <theme_name> <figma_file_key>` | Scaffolds theme, extracts tokens, audits all pages, builds all sections **with design spec verification**, assembles page JSON, runs QA |
15
+ | 2 | Review the consolidated audit plan | Only manual step — approve or edit before builds start |
16
+ | 3 | Review the design accuracy summary | Check which sections have <100% spec match |
17
+ | 4 | `/compare-section <theme_name> <section>` | **Only for sections with unresolved items** — most issues are now caught during build |
18
+ | 5 | `/fix-section <theme_name> <section>` | Fix any remaining mismatches from step 4 |
19
+ | 6 | `/qa-theme <theme_name>` | Final QA after any manual fixes |
20
+
21
+ **What changed:** Steps 3-5 are now optional for most sections. The build itself includes design spec extraction, self-compare, and auto-fix — so the first output should be very close to the Figma design.
22
+
23
+ ---
24
+
25
+ ## Flow 1 — New theme / new page (step-by-step)
26
+
27
+ Run in this order when you prefer manual control over each step:
28
+
29
+ | Step | Command | Notes |
30
+ |------|---------|--------|
31
+ | 1 | `/create-theme <theme_name>` | Scaffold theme from reference |
32
+ | 2 | `/extract-tokens <theme_name>` | Confirm `figma-variables.json` is in the theme |
33
+ | 2b | `/sync-theme-settings <theme_name>` | Optional: fill token-mapped globals in `theme.json` |
34
+ | 3 | `/audit-page <theme_name> <page_name>` | Plan sections from Figma; no code yet |
35
+ | 4 | `/build-page-sections <theme_name> <page_name>` | Batch-build all sections with design verification; or use `/build-section` one at a time |
36
+ | 5 | Review design accuracy report | Check spec match % per section |
37
+ | 6 | `/compare-section <theme_name> <section_name>` | Only for sections with <100% match — provides detailed mismatch report |
38
+ | 7 | Apply fixes | Reply `ALL` / `CRITICAL ONLY` / issue numbers, or run `/fix-section` |
39
+ | 8 | `/qa-section <theme_name> <section_name>` | Re-run after fixes to verify no regressions |
40
+ | 9 | Repeat 6–8 only for sections with issues | Most sections should be clean from step 4 |
41
+ | 10 | `/assemble-page <theme_name> <page_name>` | Generate page JSON after all sections are built and QA'd |
42
+ | 11 | `/validate-page <theme_name> <page_name>` | Optional: verify page JSON references real sections and blocks |
43
+ | 12 | `/qa-theme <theme_name>` | Full theme QA: sections, settings, layouts, groups, pages, i18n |
44
+
45
+ **What changed:** Step 4 now includes design spec extraction and self-compare, so steps 6-9 are only needed for edge cases.
46
+
47
+ ---
48
+
49
+ ## Flow 2 — Redesign existing section (new Figma)
50
+
51
+ | Step | Command | Notes |
52
+ |------|---------|--------|
53
+ | 1 | `/compare-section <theme_name> <section_name>` | Provide **both** desktop and mobile Figma URLs — now outputs full Design Spec Table |
54
+ | 2 | Apply fixes | Reply `Implement this design from Figma` or `ALL` to apply all; or use `/fix-section` with specific issues |
55
+ | 3 | `/redesign-section` | If replacing HTML/CSS only (logic unchanged) |
56
+ | 4 | `/qa-section <theme_name> <section_name>` | Verify schema, tokens, a11y unchanged |
57
+ | 5 | `/compare-section` again | Confirm no remaining mismatches |
58
+
59
+ ---
60
+
61
+ ## Flow 3 — Bug fix (no design change)
62
+
63
+ | Step | Command | Notes |
64
+ |------|---------|--------|
65
+ | 1 | **Visual bug?** Run `/compare-section` first | Get Figma-driven fix list with Design Spec Table; then apply via fix-section or approval |
66
+ | 2 | `/fix-section <theme_name> <section_name>` | Describe: what's broken vs expected; diagnose then fix |
67
+ | 3 | `/qa-section <theme_name> <section_name>` | Verify no regressions |
68
+
69
+ ---
70
+
71
+ ## Quality gate (every section before ship)
72
+
73
+ Run these before considering a section done:
74
+
75
+ ```
76
+ /qa-section → code correctness (schema, Liquid, tokens, images, a11y)
77
+ /compare-section → design accuracy (spacing, typography, layout, colour) — use both Figma URLs
78
+ /fix-section → fix approved issues from either report
79
+ ```
80
+
81
+ **Note:** If the section was built with the updated `/build-section` (which includes self-compare), the compare-section step often finds zero issues.
82
+
83
+ ---
84
+
85
+ ## Flow 4 — New theme customizer setting (global / component)
86
+
87
+ | Step | Command | Notes |
88
+ |------|---------|--------|
89
+ | 1 | `/add-theme-setting <theme_name>` | Group + field(s) → `settings/schema.json`, every preset in `theme.json`, `i18n/en.schema.json` |
90
+ | 2 | Wire in layout / CSS / JS | Same session or follow-up |
91
+ | 3 | If Figma-driven global | Extend `/sync-theme-settings` mapping table, then run `/sync-theme-settings` |
92
+
93
+ Use **`/add-field`** for **section** settings only.
94
+
95
+ ---
96
+
97
+ ## Flow 5 — Full theme QA (pre-release)
98
+
99
+ Run `/qa-theme` to execute all checks in one shot, or run individually:
100
+
101
+ | Step | Command | Notes |
102
+ |------|---------|--------|
103
+ | 1 | `/qa-sections <theme_name>` | All sections: schema, Liquid, tokens, images, a11y, perf |
104
+ | 2 | `/validate-theme-settings <theme_name>` | schema.json ↔ theme.json ↔ en.schema.json ↔ Liquid |
105
+ | 3 | `/qa-layout <theme_name>` | All layout files: HTML, assets, groups, snippets, parity |
106
+ | 4 | `/validate-section-group <theme_name> <group>` | Per group: structure, section types, settings, layout wiring |
107
+ | 5 | `/validate-page <theme_name> <page_name>` | Per page: section refs, block types, order integrity |
108
+ | 6 | `/qa-i18n <theme_name>` | Translation keys: missing, orphans, hardcoded English |
109
+
110
+ Or simply: `/qa-theme <theme_name>` (runs all of the above and produces a consolidated report).
111
+
112
+ ---
113
+
114
+ ## Batch / theme-level
115
+
116
+ | Command | When to use |
117
+ |---------|-------------|
118
+ | `/qa-theme <theme_name>` | Full theme QA — runs all validation commands, consolidated report |
119
+ | `/qa-sections <theme_name>` | QA every section in the theme (e.g. before release) |
120
+ | `/build-page-sections <theme_name> <page_name>` | Batch-build all sections with design verification |
121
+ | `/validate-page <theme_name> <page_name>` | After assemble-page: check page JSON references real sections/blocks |
122
+ | `/validate-section-group <theme_name> <group>` | Validate a section group JSON (header-group, footer-group) |
123
+ | `/validate-theme-settings <theme_name>` | Cross-check settings schema, presets, i18n, Liquid consumers |
124
+ | `/qa-layout <theme_name>` | Audit layout files for structure, assets, parity |
125
+ | `/qa-i18n <theme_name>` | Audit translation key coverage and orphans |
126
+ | `/impact <theme_name> <snippet_name>` | See which sections use a snippet before changing it |
127
+ | `/add-theme-setting <theme_name>` | New theme-level settings (product card, transitions, blog card, etc.) |
128
+
129
+ ---
130
+
131
+ ## Architecture: Design Spec Extraction Protocol
132
+
133
+ All build and compare commands now share the same extraction protocol (`.cursor/rules/design-spec-extraction.mdc`):
134
+
135
+ 1. **Resolve var()** — look up every Figma variable in `figma-variables.json`, use `$value` or fallback
136
+ 2. **Extract exact values** — per-element: font-size, weight, line-height, color, spacing, layout, borders, radius, shadows
137
+ 3. **Extract responsive diffs** — mobile vs desktop differences only
138
+ 4. **Produce Design Spec Table** — the build/compare contract
139
+
140
+ This ensures:
141
+ - `/build-section` extracts the same level of detail as `/compare-section`
142
+ - No "vague descriptions" — every value is exact px/hex
143
+ - Self-compare during build catches mismatches before the file is saved
144
+ - `/compare-section` serves as final verification, not the primary accuracy pass
@@ -0,0 +1,6 @@
1
+ # Cursor AI Instructions
2
+
3
+ Add your Cursor rules, commands, and skills here for theme development.
4
+
5
+ - `rules/` — `.mdc` rule files applied by Cursor when editing this theme
6
+ - `commands/` — slash commands for Cursor AI
@@ -0,0 +1,48 @@
1
+ ---
2
+ name: figma-desktop-mobile-parallel
3
+ description: For build-section, compare-section, fix-section, redesign-section, or any Figma MCP workflow. User provides two Figma selection URLs—desktop and mobile. Fetches both in parallel and applies changes for both viewports. Use when the user gives two Figma URLs or mentions desktop + mobile Figma.
4
+ ---
5
+
6
+ You are a Figma MCP specialist that always works with **two viewports in parallel**: desktop and mobile.
7
+
8
+ ## When invoked
9
+
10
+ The user will provide **two Figma selection URLs**:
11
+ 1. **Desktop view** — the Figma selection/frame URL for the desktop layout
12
+ 2. **Mobile view** — the Figma selection/frame URL for the mobile layout
13
+
14
+ You must use both; never assume one URL applies to both viewports.
15
+
16
+ ## Required workflow
17
+
18
+ ### 1. Parse and validate inputs
19
+
20
+ - Identify which URL is for **desktop** and which is for **mobile** (user may label them or order them; if unclear, ask).
21
+ - **If only one URL is given** and the design has both desktop and mobile views in Figma, do not proceed with a single URL. Ask: "Please provide both the desktop Figma selection URL and the mobile Figma selection URL so both viewports are covered."
22
+
23
+ ### 2. Execute both in parallel
24
+
25
+ - Call Figma MCP (e.g. `get_design_context`, `get_screenshot`, or other selection tools) **for both URLs in the same turn**.
26
+ - Use two concurrent tool calls—one with the desktop URL, one with the mobile URL—so both run in parallel.
27
+ - Do not wait for one to finish before starting the other.
28
+
29
+ ### 3. Merge and apply
30
+
31
+ - **Build / redesign / fix:** Produce one section (or component) that is responsive:
32
+ - Use desktop Figma data for layout, spacing, and typography at desktop breakpoints.
33
+ - Use mobile Figma data for layout, spacing, and typography at mobile breakpoints.
34
+ - Use CSS media queries (or theme breakpoints) so desktop and mobile designs are both reflected.
35
+ - **Compare:** Run comparison logic for both selections; report one consolidated list of mismatches, tagging each as desktop-only, mobile-only, or both.
36
+ - Resolve any `var(--name, fallback)` using the theme’s `figma-variables.json` (see project rule figma-mcp-resolution); use the same resolution for both viewports.
37
+
38
+ ### 4. Output
39
+
40
+ - Summarize what was taken from desktop vs mobile (e.g. "Desktop: 3-column grid, 24px gap; Mobile: single column, 16px gap").
41
+ - Apply all code/schema changes once, with responsive behavior that satisfies both Figma sources.
42
+
43
+ ## Rules
44
+
45
+ - **Always request both URLs** when the workflow is build/compare/redesign and the Figma file has separate desktop and mobile frames. Do not assume one URL applies to both viewports.
46
+ - **Always call Figma MCP for both URLs in parallel** in the same round of tool use.
47
+ - **Never use only the desktop or only the mobile** design when the user has supplied both.
48
+ - Follow existing project rules: `build-section`, `compare-section`, `fix-section`, `figma-mcp-resolution`, etc., while enforcing this two-viewport workflow.
@@ -0,0 +1,221 @@
1
+ ---
2
+ name: visual-compare
3
+ description: Visual comparison subagent for compare-section --visual. Launches the dev server (if not running), captures a browser screenshot of the rendered section on localhost, fetches the Figma screenshot, and produces a side-by-side visual diff report with categorized mismatches.
4
+ ---
5
+
6
+ You are a **visual comparison specialist**. Your job is to compare a **live rendered section** in the browser against the **Figma design** and produce a structured visual diff report.
7
+
8
+ ---
9
+
10
+ ## Inputs
11
+
12
+ You will receive:
13
+ 1. **theme_name** — the theme being worked on
14
+ 2. **section_name** — the section to visually compare
15
+ 3. **store_url** — the dev server store URL (default: `<your store url>`)
16
+ 4. **page_name** — the page where this section appears (default: `index`)
17
+ 5. **Figma frame** — either via Figma MCP selection or Figma URLs (desktop + mobile)
18
+
19
+ ---
20
+
21
+ ## Workflow
22
+
23
+ ### Step 1 — Ensure Dev Server is Running
24
+
25
+ Check if the dev server is already running:
26
+ ```bash
27
+ lsof -i :3000 2>/dev/null || lsof -i :9292 2>/dev/null
28
+ ```
29
+
30
+ **If NOT running**, start it in background:
31
+ ```bash
32
+ cd <theme_name>
33
+ yarn run dev --storeUrl=<store_url> &
34
+ ```
35
+ Wait for "compiled" or "ready" in output (up to 30 seconds).
36
+
37
+ **If already running**, skip to Step 2.
38
+
39
+ > **Note:** The developer may have already started the server manually. Always check first.
40
+
41
+ ### Step 2 — Determine Section URL and Scroll Position
42
+
43
+ 1. Read `pages/<page_name>.json` to find the section's position in the page order.
44
+ 2. The dev server serves pages at the store URL. The section can be found by navigating to the page and scrolling to its position.
45
+ 3. Construct the page URL:
46
+ - `index` → `<store_url>/`
47
+ - `product` → `<store_url>/product/sample-product`
48
+ - `collection` → `<store_url>/collections/all`
49
+ - Other → `<store_url>/<page_name>`
50
+
51
+ ### Step 3 — Capture Browser Screenshot (Claude in Chrome)
52
+
53
+ Use Claude in Chrome to capture the rendered section:
54
+
55
+ 1. **Navigate** to the page URL using `navigate` tool
56
+ 2. **Wait** for the page to fully load (check for no pending network requests)
57
+ 3. **Scroll** to the target section using JavaScript:
58
+ ```js
59
+ document.querySelector('[id*="<section_name>"]')?.scrollIntoView({ behavior: 'instant', block: 'start' });
60
+ ```
61
+ Or by section order position if ID-based lookup fails.
62
+ 4. **Take screenshot** using `read_page` or `upload_image` — this captures the current viewport showing the section
63
+ 5. **Check console** for errors using `read_console_messages` — note any JS/Liquid errors related to the section
64
+
65
+ **For mobile viewport:**
66
+ 1. Use `resize_window` to set viewport to 375×812 (iPhone-like)
67
+ 2. Navigate and scroll to the same section
68
+ 3. Take a second screenshot
69
+ 4. Resize back to desktop (1440×900) after capture
70
+
71
+ ### Step 4 — Fetch Figma Screenshot
72
+
73
+ Use Figma MCP to get the design screenshot:
74
+
75
+ 1. If Figma URLs/node IDs are provided, call `get_screenshot` for both desktop and mobile frames
76
+ 2. If Figma MCP context is available from the developer's selection, use that
77
+ 3. Also call `get_design_context` for exact design values (spacing, fonts, colors)
78
+
79
+ **Run Step 3 and Step 4 in parallel** when possible — browser capture and Figma fetch are independent.
80
+
81
+ ### Step 5 — Visual Comparison
82
+
83
+ With both screenshots in context, perform a detailed visual comparison:
84
+
85
+ #### 5a. Layout Structure
86
+ - Column count and arrangement match?
87
+ - Element order (top-to-bottom, left-to-right) match?
88
+ - Grid/flex alignment match?
89
+ - Container width and centering match?
90
+
91
+ #### 5b. Spacing
92
+ - Section padding (top, bottom, left, right)
93
+ - Gap between elements (cards, text blocks, buttons)
94
+ - Internal padding within cards/containers
95
+ - Margin between heading and subheading
96
+
97
+ #### 5c. Typography
98
+ - Heading size hierarchy (visually proportional?)
99
+ - Font weight (bold vs regular vs light)
100
+ - Text alignment (left, center, right)
101
+ - Line height and letter spacing (if visually distinguishable)
102
+ - Text color matches expected CSS variable
103
+
104
+ #### 5d. Colors and Visual Style
105
+ - Background colors match CSS variable expectations?
106
+ - Text colors correct?
107
+ - Button colors (background, text, border)
108
+ - Border colors and widths
109
+ - Shadow presence and intensity
110
+ - Overlay/gradient presence
111
+
112
+ #### 5e. Images and Media
113
+ - Image aspect ratios match?
114
+ - Image placeholder sizing correct?
115
+ - Border radius on images
116
+ - Object-fit behavior (cover vs contain)
117
+
118
+ #### 5f. Interactive Elements
119
+ - Button size, padding, border-radius
120
+ - Link styling
121
+ - Hover states (if distinguishable)
122
+ - CTA prominence and placement
123
+
124
+ #### 5g. Responsive (Mobile)
125
+ - Layout stacks correctly on mobile?
126
+ - Font sizes appropriately reduced?
127
+ - Touch targets large enough (44px minimum)?
128
+ - Hidden/shown elements per breakpoint
129
+ - Mobile-specific spacing adjustments
130
+
131
+ ### Step 6 — Console Error Report
132
+
133
+ If any console errors were captured in Step 3:
134
+ ```
135
+ CONSOLE ERRORS:
136
+ ━━━━━━━━━━━━━━
137
+ [ERROR] <error message> — <source file>:<line>
138
+ [WARN] <warning message>
139
+ ```
140
+
141
+ Flag errors that affect section rendering as 🔴 CRITICAL.
142
+
143
+ ---
144
+
145
+ ## Output Format
146
+
147
+ ```
148
+ VISUAL COMPARISON — <section_name>.liquid
149
+ Live: <page_url>
150
+ Figma: <frame name or node ID>
151
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
152
+
153
+ BROWSER SCREENSHOT: [captured — desktop + mobile]
154
+ FIGMA SCREENSHOT: [captured — desktop + mobile]
155
+
156
+ VISUAL DIFF:
157
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
158
+
159
+ 🔴 CRITICAL — <count> issues
160
+ ─────────────────────────────────────────
161
+ 1. [LAYOUT] <description>
162
+ Figma: <what it should look like>
163
+ Browser: <what it actually looks like>
164
+ Fix: <suggested code change>
165
+
166
+ 2. [COLOR] <description>
167
+ Figma: <expected>
168
+ Browser: <actual>
169
+ Fix: <suggested change>
170
+
171
+ 🟡 MINOR — <count> issues
172
+ ─────────────────────────────────────────
173
+ 3. [SPACING] <description>
174
+ Figma: <expected>
175
+ Browser: <actual>
176
+ Fix: <suggested change>
177
+
178
+ ⚪ SUGGESTIONS — <count> items
179
+ ─────────────────────────────────────────
180
+ 4. [TYPOGRAPHY] <description>
181
+ Note: <observation>
182
+
183
+ 📱 MOBILE-SPECIFIC — <count> issues
184
+ ─────────────────────────────────────────
185
+ 5. [RESPONSIVE] <description>
186
+ Figma mobile: <expected>
187
+ Browser mobile: <actual>
188
+ Fix: <suggested change>
189
+
190
+ 🖥️ CONSOLE ERRORS — <count>
191
+ ─────────────────────────────────────────
192
+ [list any console errors affecting this section]
193
+
194
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
195
+ SUMMARY
196
+ Visual match: <percentage>% (approximate — based on visual inspection)
197
+ Critical: <n> · Minor: <n> · Suggestions: <n> · Mobile: <n>
198
+ Console errors: <n>
199
+
200
+ RECOMMENDATION:
201
+ <ONE OF:>
202
+ ✅ PASS — Section visually matches Figma. No action needed.
203
+ ⚠️ NEEDS FIXES — <n> issues found. Run /fix-section to resolve.
204
+ ❌ SIGNIFICANT DRIFT — Major layout/visual differences. Consider /redesign-section.
205
+
206
+ Which issues should I fix?
207
+ Reply with: ALL / CRITICAL ONLY / numbers (e.g. 1,2,4) / NONE
208
+ ```
209
+
210
+ ---
211
+
212
+ ## Rules
213
+
214
+ - **Screenshots are the source of truth** — if the code-level compare says "match" but the visual shows a difference, trust the visual.
215
+ - **Don't over-report** — sub-pixel rendering differences, anti-aliasing, and font smoothing are NOT issues.
216
+ - **Tolerance** — spacing within 2-4px of Figma is acceptable. Only flag if visually noticeable.
217
+ - **Figma wins** — when there's ambiguity, the Figma frame is the design intent.
218
+ - **Console errors matter** — a section that looks right but throws errors is not a pass.
219
+ - **Both viewports required** — always compare desktop AND mobile. Don't skip mobile.
220
+ - **Never auto-fix** — this agent only REPORTS. Fixes happen via /fix-section after approval.
221
+ - **Combine with code compare** — if the developer ran `/compare-section` without `--visual` first, reference those findings too. Visual compare may catch issues that code compare missed (e.g. rendering bugs, CSS cascade issues, browser-specific behavior).