@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,255 @@
1
+ ---
2
+ description: Reusable design spec extraction protocol — extracts exact values from Figma MCP for any command
3
+ globs: ["sections/*.liquid", "snippets/*.liquid"]
4
+ ---
5
+
6
+ # Design Spec Extraction Protocol
7
+
8
+ This rule defines a **reusable, rigorous extraction process** for reading Figma MCP data.
9
+ It is used by `/build-section`, `/compare-section`, `/redesign-section`, and `/build-theme`.
10
+
11
+ The goal: extract EVERY visual property as an exact, resolved value — never vague descriptions.
12
+ Additionally, extract the COMPLETE element hierarchy so the agent knows exactly what elements exist, how they're nested, and what children each container has.
13
+
14
+ ---
15
+
16
+ ## Step 0 — Extract Element Hierarchy (Structure Tree)
17
+
18
+ Before extracting visual properties, first map out the COMPLETE structure of the Figma frame as a tree.
19
+ This is critical — without it, the agent will invent its own structure.
20
+
21
+ ### Read the Figma MCP response top-to-bottom. Produce a tree like this:
22
+
23
+ ```
24
+ ELEMENT HIERARCHY — <section_name>
25
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
26
+ Section wrapper (column)
27
+ ├── Header row (row, justify-between)
28
+ │ ├── Title block (column)
29
+ │ │ ├── Heading H2 "Action Toys"
30
+ │ │ └── Description paragraph
31
+ │ └── Sort block (row)
32
+ │ ├── "Sort By:" label
33
+ │ └── Dropdown (row, border, bg)
34
+ │ ├── Selected text "New Arrivals"
35
+ │ └── Chevron icon
36
+ ├── Divider (border-top)
37
+ └── Content area (row)
38
+ ├── Filter sidebar (column, w-300px)
39
+ │ ├── "Filter By" heading
40
+ │ ├── Filter group: Categories (column, border-bottom)
41
+ │ │ ├── Group header (row: search icon + title + chevron)
42
+ │ │ ├── Checkbox item: "Anime toys" (pl-36px)
43
+ │ │ ├── Checkbox item: "Soft toys"
44
+ │ │ ├── Checkbox item: "Wooden toys"
45
+ │ │ ├── Checkbox item: "Outdoor toys"
46
+ │ │ └── "42+ More" link (purple)
47
+ │ ├── Filter group: Age group (same structure)
48
+ │ ├── Filter group: Price (radio buttons instead of checkboxes)
49
+ │ └── Filter group: Brand (radio buttons)
50
+ └── Product grid area (column, flex-1)
51
+ ├── Product grid (grid, 3 cols, gap-x-12 gap-y-28)
52
+ │ ├── Product card (column)
53
+ │ │ ├── Image container (h-408px, bg-neutral)
54
+ │ │ │ └── Product image
55
+ │ │ └── Card info (column, pt-20px)
56
+ │ │ ├── Product name (Lato Bold 24px)
57
+ │ │ ├── Category tags row (Lato Medium 16px, gap-8px)
58
+ │ │ └── Price + rating row (justify-between)
59
+ │ │ ├── Price block (column)
60
+ │ │ │ ├── Current price (₹ symbol 28px + amount 36px Oswald Bold)
61
+ │ │ │ └── Original price (16px, line-through, purple)
62
+ │ │ └── Rating block (row: "4/5" text + star icon)
63
+ │ ├── Product card (same) — with "Add to Bag" button
64
+ │ ├── Product card (same) × 7 more
65
+ │ └── ...
66
+ └── Pagination (row, justify-center, pt-60px, gap-24px)
67
+ ├── Prev arrow (48px)
68
+ ├── Page numbers (40px each, active=purple bg)
69
+ └── Next arrow (48px)
70
+ ```
71
+
72
+ ### Rules for hierarchy extraction:
73
+ - List EVERY element, not just major sections
74
+ - Note the layout type of each container (row/column/grid)
75
+ - Note the number of children (especially for grids and repeating patterns)
76
+ - Note key structural properties: width constraints, alignment, justify
77
+ - For repeating elements (cards, filter items), describe one fully and note "× N more"
78
+ - If an element has a special variant (e.g. one card has an "Add to Bag" button), note it
79
+
80
+ This tree is the STRUCTURAL CONTRACT. The generated HTML must reproduce this exact nesting.
81
+ Cross-reference it with the reference section — if the reference has a different structure, the Figma tree wins for HTML, but preserve the reference's Liquid logic.
82
+
83
+ ---
84
+
85
+ ## Step 1 — Resolve ALL var() Values First
86
+
87
+ Figma MCP returns values like `var(--font/size/9xl, 56px)` or `var(--radius/xl, 25px)`.
88
+
89
+ For EVERY `var()` in the MCP response:
90
+ 1. Strip `--` prefix, normalize slashes: `--radius\/xl` → `radius/xl`
91
+ 2. Look up in `figma-variables.json` by traversing the path
92
+ 3. If node has `$value` → use that (theme-mode specific, e.g. B2BIZMART)
93
+ 4. If not found → use the fallback from the MCP response
94
+ 5. If no fallback AND not in JSON → flag as `⚠️ UNRESOLVED` and STOP for that value
95
+
96
+ **Never skip this step. Never use the variable name as a value.**
97
+
98
+ ---
99
+
100
+ ## Step 2 — Extract Per-Element Design Spec
101
+
102
+ For EVERY visible element in the Figma frame, extract these properties into a structured list.
103
+ Do NOT describe elements vaguely ("large heading", "tight spacing"). Use exact values.
104
+
105
+ ### For each TEXT element:
106
+ ```
107
+ Element: [description, e.g. "Section heading H2"]
108
+ - Font size: [resolved px] → [Tailwind class, e.g. text-5xl]
109
+ - Font weight: [resolved number] → [Tailwind class, e.g. font-bold]
110
+ - Line height: [resolved px or ratio] → [Tailwind class if applicable]
111
+ - Letter spacing: [resolved px] → [Tailwind class if applicable]
112
+ - Text color: [resolved hex] → [CSS variable, e.g. var(--color-heading)]
113
+ - Text alignment: [left/center/right]
114
+ - Max width: [if constrained]
115
+ ```
116
+
117
+ ### For each CONTAINER / LAYOUT element:
118
+ ```
119
+ Element: [description, e.g. "Card grid wrapper"]
120
+ - Layout: [flex-row / flex-col / grid]
121
+ - Columns: [count] at [breakpoint]
122
+ - Gap: [resolved px] → [Tailwind class, e.g. gap-6]
123
+ - Padding: [top] [right] [bottom] [left] in px → [Tailwind classes]
124
+ - Margin: [if any] → [Tailwind classes]
125
+ - Max width: [if constrained]
126
+ - Alignment: [items-start / items-center / justify-between, etc.]
127
+ - Background: [resolved hex] → [CSS variable]
128
+ ```
129
+
130
+ ### For each IMAGE element:
131
+ ```
132
+ Element: [description, e.g. "Hero background image"]
133
+ - Width: [px or %]
134
+ - Height: [px or %]
135
+ - Aspect ratio: [e.g. 16/9, 4/3, 1/1]
136
+ - Object fit: [cover / contain / fill]
137
+ - Border radius: [resolved px] → [Tailwind class]
138
+ - Position: [inline / background / overlapping]
139
+ ```
140
+
141
+ ### For each BUTTON / CTA element:
142
+ ```
143
+ Element: [description, e.g. "Primary CTA button"]
144
+ - Padding: [vertical]px [horizontal]px → [Tailwind classes]
145
+ - Font size: [resolved px] → [Tailwind class]
146
+ - Font weight: [resolved number] → [Tailwind class]
147
+ - Background: [resolved hex] → [CSS variable]
148
+ - Text color: [resolved hex] → [CSS variable]
149
+ - Border: [width]px [color] → [Tailwind/CSS]
150
+ - Border radius: [resolved px] → [Tailwind class]
151
+ - Min height: [px if specified]
152
+ ```
153
+
154
+ ### For each CARD element:
155
+ ```
156
+ Element: [description, e.g. "Product card"]
157
+ - Padding: [inner padding px] → [Tailwind]
158
+ - Background: [hex] → [CSS variable]
159
+ - Border: [width] [color] → [Tailwind/CSS]
160
+ - Border radius: [px] → [Tailwind]
161
+ - Shadow: [if any] → [Tailwind shadow class]
162
+ - Internal layout: [flex direction, gap between children]
163
+ - Children: [list each child element with its own spec]
164
+ ```
165
+
166
+ ### For SECTION-LEVEL properties:
167
+ ```
168
+ Section: [name]
169
+ - Total padding top: [px]
170
+ - Total padding bottom: [px]
171
+ - Background: [hex] → [CSS variable]
172
+ - Max width: [constrained or full-bleed]
173
+ - Horizontal padding: [px] → var(--section-padding-x) or Tailwind
174
+ ```
175
+
176
+ ---
177
+
178
+ ## Step 3 — Extract Responsive Differences (Mobile Frame)
179
+
180
+ If a mobile Figma frame is available, extract ONLY what DIFFERS from desktop:
181
+
182
+ ```
183
+ MOBILE OVERRIDES (vs desktop):
184
+ - Grid: [desktop columns] → [mobile columns]
185
+ - Heading font size: [desktop class] → [mobile class]
186
+ - Subheading font size: [desktop class] → [mobile class]
187
+ - Gap: [desktop gap] → [mobile gap]
188
+ - Padding: [desktop padding] → [mobile padding]
189
+ - Element visibility: [hidden on mobile / shown on mobile]
190
+ - Stack direction: [row on desktop] → [column on mobile]
191
+ - Element order: [reordered on mobile?]
192
+ ```
193
+
194
+ ---
195
+
196
+ ## Step 4 — Produce the Design Spec Table
197
+
198
+ Compile all extracted values into a single reference table that the build stage will use.
199
+ Format:
200
+
201
+ ```
202
+ DESIGN SPEC — <section_name>
203
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
204
+
205
+ SECTION-LEVEL
206
+ Padding top: 48px | Padding bottom: 48px
207
+ Background: var(--color-background) | Full width: yes
208
+ Container max-width: max-w-container-theme
209
+
210
+ ELEMENT MAP (top to bottom, left to right)
211
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
212
+ # | Element | Property | Desktop Value | Mobile Override | Tailwind/CSS
213
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
214
+ 1 | Section heading | font-size | 48px | 30px | text-5xl / md:text-3xl
215
+ 1 | Section heading | font-weight | 700 | — | font-bold
216
+ 1 | Section heading | color | #1a1a1a | — | var(--color-heading)
217
+ 1 | Section heading | text-align | center | center | text-center
218
+ 1 | Section heading | margin-bottom | 16px | 12px | mb-4 / md:mb-3
219
+ 2 | Subheading | font-size | 18px | 16px | text-lg / md:text-base
220
+ 2 | Subheading | color | #666666 | — | var(--color-body)
221
+ 3 | Card grid | layout | grid | grid | grid
222
+ 3 | Card grid | columns | 4 | 2 | grid-cols-2 md:grid-cols-4
223
+ 3 | Card grid | gap | 24px | 16px | gap-4 md:gap-6
224
+ 4 | Card | padding | 16px | 12px | p-3 md:p-4
225
+ 4 | Card | border-radius | 12px | 12px | rounded-xl
226
+ 4 | Card | border | 1px #e5e5e5 | — | border border-[var(--color-border)]
227
+ 4 | Card | shadow | 0 1px 3px rgba() | — | shadow-sm
228
+ 5 | Card image | aspect-ratio | 1/1 | 1/1 | aspect-square
229
+ 5 | Card image | border-radius | 8px | 8px | rounded-lg
230
+ 5 | Card image | object-fit | cover | cover | object-cover
231
+ 6 | Card title | font-size | 16px | 14px | text-base / md:text-sm
232
+ 6 | Card title | font-weight | 600 | — | font-semibold
233
+ 7 | CTA button | padding | 12px 24px | 10px 20px | py-3 px-6 / md:py-2.5 md:px-5
234
+ 7 | CTA button | font-size | 16px | 14px | text-base / md:text-sm
235
+ 7 | CTA button | bg | #2563eb | — | var(--color-primary)
236
+ 7 | CTA button | text | #ffffff | — | var(--color-on-primary)
237
+ 7 | CTA button | border-radius | 8px | — | rounded-lg
238
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
239
+
240
+ UNRESOLVED VALUES: [list any that could not be determined]
241
+ ```
242
+
243
+ This table is the CONTRACT. Every value in this table MUST appear in the generated code.
244
+ During self-QA, check every row against the written HTML/CSS.
245
+
246
+ ---
247
+
248
+ ## Rules
249
+
250
+ - NEVER describe values qualitatively ("large", "tight", "prominent"). Always use exact px/hex.
251
+ - NEVER skip elements. If an element is in the Figma frame, it must be in the spec.
252
+ - NEVER guess values. If a value cannot be determined, flag it as unresolved and ask.
253
+ - ALWAYS resolve var() before adding to the spec table.
254
+ - ALWAYS include both desktop and mobile values when a mobile frame is available.
255
+ - The spec table is an ordered list (top-to-bottom, left-to-right in the visual layout).
@@ -0,0 +1,43 @@
1
+ ---
2
+ description: Validate the Figma variables JSON exists for a theme
3
+ alwaysApply: false
4
+ ---
5
+
6
+ # /extract-tokens
7
+
8
+ Verify the designer-exported `figma-variables.json` is in place.
9
+ This is the only setup step needed before building sections.
10
+
11
+ ## Usage
12
+ ```
13
+ /extract-tokens <theme_name>
14
+ ```
15
+
16
+ ---
17
+
18
+ ## Step 1 — Check JSON Exists
19
+
20
+ Look for `figma-variables.json`.
21
+
22
+ If missing, STOP and tell the developer:
23
+ ```
24
+ ❌ Missing: figma-variables.json
25
+
26
+ Ask your designer to:
27
+ Figma → Variables panel → ··· menu → Export variables → JSON
28
+ Place the file at: figma-variables.json
29
+
30
+ Re-run /extract-tokens once the file is in place.
31
+ ```
32
+
33
+ ## Step 2 — Confirm
34
+
35
+ If the file exists, confirm:
36
+ ```
37
+ ✅ figma-variables.json found at figma-variables.json
38
+ → All build/compare/qa commands will read this file directly for token values.
39
+ → When designer updates tokens: re-export JSON, replace the file, done.
40
+ → Next step: run /audit-page <theme_name> <page_name>
41
+ ```
42
+
43
+ No conversion needed. Commands read the JSON directly.
@@ -0,0 +1,40 @@
1
+ ---
2
+ description: Resolve Figma MCP variable names using theme figma-variables.json (e.g. B2BIZMART mode)
3
+ globs: ["sections/*.liquid", "snippets/*.liquid"]
4
+ ---
5
+
6
+ # Figma MCP Variable Resolution
7
+
8
+ When using **Figma MCP** (e.g. `get_design_context`) for any command or fix:
9
+
10
+ ## Rule
11
+
12
+ Figma MCP returns values like `var(--variable-name, fallback)` (e.g. `var(--radius/xl, 25px)`, `var(--color/background-1/background-1, white)`). The fallback is from whatever mode is active in Figma (e.g. TWICE). The theme may use a different mode (e.g. B2BIZMART) whose values are in `figma-variables.json`.
13
+
14
+ **Always resolve variable names from the theme’s `figma-variables.json` first; use the MCP fallback only if the variable is not present.**
15
+
16
+ ## Steps
17
+
18
+ 1. **Read** `figma-variables.json`.
19
+ 2. **For each** `var(--name, fallback)` in the Figma MCP output:
20
+ - Normalize the variable name: strip the leading `--` and unescape slashes (e.g. `--radius\/xl` → `radius/xl`).
21
+ - **Look up** in the JSON by path: split the name on `/` and traverse (e.g. `radius/xl` → `json["radius"]["xl"]`).
22
+ - If the path exists and the node has a **`$value`** property, **use that value** (theme/mode-specific).
23
+ - If the path is missing or has no `$value`, **use the fallback** from the MCP response.
24
+ 3. **Use the resolved value** (from JSON or fallback) when mapping to Tailwind classes, CSS variables, or inline styles. Never use the raw variable name for comparison or output.
25
+
26
+ ## Example
27
+
28
+ - MCP returns: `rounded-[var(--radius\/xl, 25px)]`
29
+ - Variable name: `radius/xl`
30
+ - Look up: `figma-variables.json` → `radius.xl.$value` → e.g. `24`
31
+ - **Use 24** (from JSON) for border-radius, not 25 (fallback). Map to Tailwind or `24px` as needed.
32
+
33
+ ## Commands that use this
34
+
35
+ - `/compare-section` — when extracting Figma values from MCP data
36
+ - `/fix-section` — when applying design from Figma MCP selection
37
+ - `/build-section` — when reading Figma frame and mapping tokens
38
+ - `/redesign-section` — when reading Figma frame for layout/typography/colors
39
+
40
+ Reference this rule whenever Figma MCP output is used so the theme’s mode (e.g. B2BIZMART) is respected.
@@ -0,0 +1,154 @@
1
+ ---
2
+
3
+ description: Fix a bug in an existing section with minimal blast radius
4
+ alwaysApply: false
5
+ ---
6
+
7
+
8
+ # /fix-section
9
+
10
+ Fix a specific bug in an existing section.
11
+ Minimal blast radius — only touch what is broken, nothing else.
12
+
13
+ ## Usage
14
+ ```
15
+ /fix-section <theme_name> <section_name>
16
+ ```
17
+ Describe the bug clearly: what you see vs what you expect.
18
+
19
+ **Visual bugs (spacing, alignment, colour, typography, borders, CTA size, selected state):** Prefer running `/compare-section <theme_name> <section_name>` with desktop and mobile Figma URLs first; use the mismatch report to apply fixes, then `/qa-section`. Use fix-section for logic/schema issues or when Figma is not available.
20
+
21
+ ---
22
+
23
+
24
+ ## Pre-flight
25
+ 1. Read `sections/<section_name>.liquid` directly — do not ask for it
26
+ 2. Read ALL snippets referenced via `{% render %}` in the section automatically
27
+ - Read `snippets/<snippet-name>.liquid` for each
28
+ - Repeat recursively for nested snippets
29
+ 3. **When using Figma MCP** (e.g. get_design_context): resolve every `var(--name, fallback)` by looking up the variable name (path split by `/`) in `figma-variables.json`; if present use `$value`, else use fallback. See `.cursor/rules/figma-mcp-resolution.mdc`.
30
+ 4. Ask the user if they haven't already described:
31
+ - What is the current broken behaviour?
32
+ - What is the expected behaviour?
33
+ - Does it happen always or only in certain conditions (e.g. empty data, mobile, specific setting value)?
34
+
35
+ ---
36
+
37
+
38
+ ## Stage 1 — Diagnose Before Fixing
39
+ Read the full section file and identify:
40
+
41
+ ### Common Bug Categories — check each
42
+
43
+ **Schema / Settings mismatch**
44
+ - Is a `section.settings.X` referenced in Liquid but missing from schema?
45
+ - Is a field type wrong? (e.g. rendered as `.value` but schema type is `text` not `select`)
46
+ - Is a `url` field rendered as `{{ field }}` instead of `{{ field.handle }}`?
47
+ - Is a `select` field rendered as `{{ field }}` instead of `{{ field.value }}`?
48
+ - Is an `image` field rendered as `{{ field }}` instead of `{{ field.url }}`?
49
+
50
+ **Liquid Logic**
51
+ - Is a loop missing an empty state guard (`{% if items.size > 0 %}`)?
52
+ - Is a condition using wrong operator (`==` vs `!=`, `and` vs `or`)?
53
+ - Is a variable assigned after it's used?
54
+ - Is `{% render %}` passing the wrong variable name?
55
+
56
+ **HTML / CSS**
57
+ - Is a Tailwind class missing a responsive prefix (`md:`, `lg:`)?
58
+ - Is a flex/grid container missing `items-center` or `justify-between`?
59
+ - Is a `hidden` class conflicting with a display class?
60
+ - Is a `z-index` missing on an overlay or dropdown?
61
+
62
+ **Page JSON**
63
+ - Is the section type in the page JSON mismatched with the actual filename?
64
+ - Is a setting value in the wrong format? (e.g. `"value"` instead of `{ "display_name": "...", "value": "..." }`)
65
+ - Is a block missing from `block_order`?
66
+ - Theme block not rendering? Check section schema opts in (`@theme` or `zc_theme__<name>`), page JSON `type` uses `zc_theme__` prefix, and `blocks/<name>.liquid` exists
67
+ - Theme block missing from picker? Check `blocks/<name>.liquid` has `"presets"`
68
+
69
+ ---
70
+
71
+
72
+ ## Stage 2 — State the Diagnosis
73
+ Before making any edit, clearly state:
74
+
75
+ ```
76
+ BUG DIAGNOSIS — <section_name>
77
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
78
+ ROOT CAUSE:
79
+ section.settings.cta_url is rendered as {{ cta_url.handle }} but
80
+ schema defines it as type "text", not type "url" — so .handle doesn't exist.
81
+
82
+ LOCATION:
83
+ Line 34: <a href="{{ cta_url.handle }}">
84
+
85
+ FIX:
86
+ Option A: Change schema field type from "text" to "url" (if it should be a URL)
87
+ Option B: Change render to {{ cta_url }} (if it should stay as text)
88
+
89
+ RECOMMENDED: Option A — the field is clearly meant to be a URL based on usage.
90
+
91
+ BLAST RADIUS:
92
+ - 1 schema field change
93
+ - 1 line Liquid change
94
+ - page JSON default value may need updating
95
+
96
+ UNRELATED ISSUES NOTICED (not fixing now):
97
+ - Line 67: loop has no empty state — recommend /fix-section pass 2
98
+ ```
99
+
100
+ Ask: "Proceed with recommended fix?" before editing.
101
+
102
+ ---
103
+
104
+
105
+ ## Stage 3 — Apply Fix
106
+ - Change ONLY what is identified in the diagnosis
107
+ - Do not refactor surrounding code
108
+ - Do not improve unrelated areas
109
+ - Do not change Tailwind classes unless they are the bug
110
+ - Add a comment near the fixed line using standard Liquid comments:
111
+ `{% comment %} fixed: changed type text → url, was rendering .handle incorrectly {% endcomment %}`
112
+ - Never use `{{-- ... --}}` comment syntax — it may break rendering in this codebase.
113
+
114
+ ---
115
+
116
+
117
+ ## Stage 4 — Check Blast Radius
118
+ After the fix, check all affected areas:
119
+
120
+ **If schema field type changed:**
121
+ - [ ] All Liquid references to this field updated to match new type syntax
122
+ - [ ] Page JSON default value format matches new type
123
+ - url → `{ "display_name": "...", "handle": "/path" }`
124
+ - select → `{ "display_name": "...", "value": "..." }`
125
+
126
+ **If Liquid logic changed:**
127
+ - [ ] Check all branches of the condition are still valid
128
+ - [ ] Check loop still has empty state
129
+
130
+ **If HTML changed:**
131
+ - [ ] Check responsive behaviour still intact
132
+ - [ ] Check no other elements were accidentally shifted
133
+
134
+ ---
135
+
136
+
137
+ ## Output
138
+ ```
139
+ ✅ Fix applied: sections/<section_name>.liquid
140
+
141
+ ROOT CAUSE: [one line summary]
142
+
143
+ CHANGED:
144
+ - Line 34: schema field type text → url
145
+ - Line 34: render changed from {{ cta_url }} to {{ cta_url.handle }}
146
+ - pages/<page>.json: default updated to { "display_name": "...", "handle": "/" }
147
+
148
+ UNTOUCHED: everything else
149
+
150
+ ⚠️ OTHER ISSUES NOTICED (not fixed — separate passes recommended):
151
+ - Line 67: loop missing empty state → run /fix-section again describing this
152
+
153
+ NEXT: Run /qa-section <theme_name> <section_name> to verify
154
+ ```
@@ -0,0 +1,30 @@
1
+ ---
2
+ description: General project rules for this theme
3
+ globs: ["**/*"]
4
+ ---
5
+
6
+ # Project Overview
7
+ This is a custom Liquid-based theme system (NOT standard Shopify).
8
+ This is a single theme folder. The structure below describes the current theme:
9
+
10
+ ## Every Theme Follows This Folder Structure
11
+ ```
12
+
13
+ assets/ → JS, CSS, images, fonts
14
+ i18n/ → en.json, en.schema.json (translation keys)
15
+ layouts/ → theme.liquid, accounts.liquid, sitemap.liquid
16
+ sections/ → .liquid section files with embedded {% schema %}
17
+ snippets/ → reusable .liquid partials (rendered via {% render %})
18
+ pages/ → JSON page templates (index.json, product.json, etc.)
19
+ settings/ → schema.json, theme.json
20
+ ```
21
+
22
+ ## General Rules
23
+ - NEVER reference Shopify-standard folder names like `templates/`, `config/`, `locales/`
24
+ - Use `{% render 'snippet-name' %}` — NEVER use `{% include %}`
25
+ - All user-facing strings must use translation keys: `"label": "t:sections.section_name.settings.field.label"`
26
+ - CSS approach: Tailwind utility classes + CSS custom properties (e.g. `var(--color-primary)`)
27
+ - JS: Vanilla JS only, class-based Web Components extending HTMLElement
28
+ - Always use `loading="lazy"` on images except above-the-fold (use `loading="eager"` for hero/header)
29
+ - Always escape user output: `{{ value | escape }}`
30
+ - Assets referenced via: `{{ 'filename.js' | asset_url }}`
@@ -0,0 +1,85 @@
1
+ ---
2
+ description: i18n translation key rules — applies to all themes
3
+ globs: ["i18n/*.json", "sections/*.liquid"]
4
+ ---
5
+
6
+ # i18n / Translation Rules — b2bizmart Theme
7
+
8
+ ## Translation Files
9
+ ```
10
+ i18n/en.json → actual translated string values
11
+ i18n/en.schema.json → schema label/option translations
12
+ ```
13
+
14
+ ---
15
+
16
+ ## Key Naming Convention
17
+ All translation keys follow this dot-notation pattern:
18
+
19
+ ### For section settings
20
+ ```
21
+ t:sections.{section_name}.settings.{setting_id}.label
22
+ t:sections.{section_name}.settings.{setting_id}.default
23
+ t:sections.{section_name}.settings.{setting_id}.info
24
+ ```
25
+
26
+ ### For select options
27
+ ```
28
+ t:sections.{section_name}.settings.{setting_id}.option__{n}.label
29
+ ```
30
+
31
+ ### For section name
32
+ ```
33
+ t:sections.{section_name}.name
34
+ ```
35
+
36
+ ### For block names
37
+ ```
38
+ t:sections.{section_name}.blocks.{block_type}.name
39
+ t:sections.{section_name}.blocks.{block_type}.settings.{setting_id}.label
40
+ t:sections.{section_name}.blocks.{block_type}.settings.{setting_id}.default
41
+ ```
42
+
43
+ ### For headers (UI dividers)
44
+ ```
45
+ t:sections.{section_name}.settings.{header_id}.content
46
+ ```
47
+
48
+ ### For presets
49
+ ```
50
+ t:sections.{section_name}.presets.default.name
51
+ ```
52
+
53
+ ---
54
+
55
+ ## Usage in Schema
56
+ ```jsonc
57
+ // label
58
+ "label": "t:sections.header.settings.logo_width.label"
59
+
60
+ // default for text
61
+ "default": "t:sections.header.settings.explore_text.default"
62
+
63
+ // default for url
64
+ "default": { "display_name": "t:sections.header.settings.explore_url.default", "handle": "/home" }
65
+
66
+ // default for select
67
+ "default": { "display_name": "t:sections.header.settings.layout_type.default", "value": "left-alignment" }
68
+
69
+ // default for menu
70
+ "default": { "display_name": "t:sections.footer.blocks.footer_menu.settings.footer_menu.default", "handle": "" }
71
+
72
+ // default for media_picker (video)
73
+ "default": { "url": "video.mp4", "is_video": true }
74
+
75
+ // content for header type
76
+ "content": "t:sections.header.settings.header_links.content"
77
+ ```
78
+
79
+ ---
80
+
81
+ ## Rules
82
+ - ❌ NEVER hardcode English strings in schema `label`, `default`, `content`, or `name` fields
83
+ - ✅ ALWAYS use `t:` prefixed keys for all user-facing schema strings
84
+ - When generating a new section, always create matching `t:` keys for every label, default, and option
85
+ - `display_name` in url/select/menu defaults must ALWAYS be a `t:` key, never a plain string