@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,132 @@
1
+ ---
2
+ description: Sync theme settings values from figma-variables.json into settings/theme.json
3
+ alwaysApply: false
4
+ ---
5
+
6
+ # /sync-theme-settings
7
+
8
+ Read `figma-variables.json` and populate `settings/theme.json` with correct
9
+ values for all token-driven fields. Non-token fields (social links, checkboxes,
10
+ text content) are left unchanged.
11
+
12
+ ## Usage
13
+ ```
14
+ /sync-theme-settings <theme_name>
15
+ ```
16
+
17
+ ---
18
+
19
+ ## Step 1 — Read Both Files
20
+
21
+ Read these two files before doing anything:
22
+ 1. `figma-variables.json` — token source of truth
23
+ 2. `settings/theme.json` — current values to update
24
+
25
+ ---
26
+
27
+ ## Step 2 — Understand the Field Categories
28
+
29
+ Settings have a `meta` field that determines how they are treated:
30
+
31
+ **`global_settings`** — theme-level, driven by Figma tokens
32
+ Update these automatically from `figma-variables.json`.
33
+
34
+ **`component_settings`** — component defaults, not token-driven
35
+ Leave these exactly as-is. Never overwrite component settings.
36
+
37
+ ---
38
+
39
+ ## Step 3 — Token Mapping Rules
40
+
41
+ For every field in the `global_settings` group, apply this mapping:
42
+
43
+ ### Colors
44
+ Read hex values from `figma-variables.json` using this map:
45
+
46
+ | Field ID | Token Path in JSON |
47
+ |---|---|
48
+ | `background_color` | `color > Background 1 > Background 1 > $value > hex` |
49
+ | `card_background` | `color > white > $value > hex` → `#FFFFFF` |
50
+ | `primary_color` | `color > Primary Color > Primary > $value > hex` |
51
+ | `accent_color` | `color > Secondary Color > Secondary > $value > hex` |
52
+ | `footer_background` | `color > black > $value > hex` → `#000000` |
53
+ | `sale_badge_color` | `color > Toast Message > Error > $value > hex` |
54
+
55
+ ### Spacing / Radius (range fields)
56
+ Read numeric values from `figma-variables.json`:
57
+
58
+ | Field ID | Token Path in JSON | Notes |
59
+ |---|---|---|
60
+ | `product_card_padding` | `Padding > P - 4 > $value` | Default card padding |
61
+ | `product_card_gap` | `Gap > G - 3 > $value` | Default card gap |
62
+ | `product_card_border_radius` | `radius > sm > $value` | Card radius |
63
+ | `product_card_border_width` | `border-width > 1 > $value` | Default border |
64
+ | `product_card_image_border_radius` | `radius > xs > $value` | Image radius |
65
+
66
+ ### Fields to Leave Unchanged
67
+ Never touch these — they are not token-driven:
68
+
69
+ - `product_grid_columns` — layout decision, not a token
70
+ - `show_sidebar_filters` — feature toggle
71
+ - `product_card_image_ratio` — layout decision
72
+ - `product_card_show_sku` — feature toggle
73
+ - `product_card_show_in_stock` — feature toggle
74
+ - All `social_*` fields — merchant data
75
+ - All `message_bar_*` fields — content, not design tokens
76
+ - `enable_message_bar` — feature toggle
77
+
78
+ ---
79
+
80
+ ## Step 4 — Write Updated theme.json
81
+
82
+ Update ONLY the `Default` preset in `settings/theme.json`.
83
+ Keep the exact same JSON structure — only change the values of token-driven fields.
84
+
85
+ After writing, print a summary:
86
+ ```
87
+ ✅ settings/theme.json updated for <theme_name>
88
+
89
+ TOKEN-DRIVEN FIELDS UPDATED:
90
+ background_color → #FAFAFA (from color/Background 1)
91
+ card_background → #FFFFFF
92
+ primary_color → #5E2BFF (from color/Primary Color)
93
+ accent_color → #C04CFD (from color/Secondary Color)
94
+ footer_background → #000000
95
+ sale_badge_color → #FF7979 (from color/Toast Message/Error)
96
+ product_card_padding → 16 (from Padding/P - 4)
97
+ product_card_gap → 12 (from Gap/G - 3)
98
+ product_card_border_radius → 8 (from radius/sm)
99
+ product_card_border_width → 1 (from border-width/1)
100
+ product_card_image_border_radius → 4 (from radius/xs)
101
+
102
+ UNCHANGED (non-token fields):
103
+ product_grid_columns, show_sidebar_filters, product_card_image_ratio,
104
+ product_card_show_sku, product_card_show_in_stock,
105
+ social_* fields, message_bar_* fields
106
+
107
+ ⚠️ MISMATCHES (if any):
108
+ footer_background — token value #000000 differs from current ""
109
+ sale_badge_color — token value #FF7979 differs from current ""
110
+ → Review these before committing
111
+ ```
112
+
113
+ ---
114
+
115
+ ## When to Re-run
116
+
117
+ Re-run `/sync-theme-settings <theme_name>` whenever:
118
+ - Designer updates and re-exports `figma-variables.json`
119
+ - A new color token is added that maps to a settings field
120
+ - You start a new theme and want defaults populated from tokens
121
+
122
+ ---
123
+
124
+ ## Adding a new token-mapped field
125
+
126
+ If you add a **new** `global_settings` field via `/add-theme-setting` that should be filled from Figma:
127
+
128
+ 1. Add the field to `settings/schema.json` and `theme.json` (via `/add-theme-setting`).
129
+ 2. **Extend this command’s mapping table** (Step 3): new row = field `id` → path in `figma-variables.json` (same pattern as existing colors/ranges).
130
+ 3. Re-run `/sync-theme-settings <theme_name>`.
131
+
132
+ Fields not listed in the mapping are never overwritten by sync.
@@ -0,0 +1,60 @@
1
+ ---
2
+ description: Verify page JSON references real sections and blocks
3
+ alwaysApply: false
4
+ ---
5
+
6
+ # /validate-page
7
+
8
+ After `/assemble-page`, verify that the page JSON is valid: every section type exists, every block type is allowed by the section schema, and `order`/`block_order` reference real keys.
9
+
10
+ ## Usage
11
+ ```
12
+ /validate-page <theme_name> <page_name>
13
+ ```
14
+
15
+ ---
16
+
17
+ ## Pre-flight
18
+
19
+ 1. Read `pages/<page_name>.json`.
20
+ 2. Read `sections/*.liquid` as needed to resolve section `type` and allowed block types.
21
+ 3. Read `blocks/*.liquid` as needed to resolve theme block schemas and nested children.
22
+
23
+ ---
24
+
25
+ ## Validation rules
26
+
27
+ Use the contract in `.cursor/skills/page-json-contract.md`. Check:
28
+
29
+ 1. **order:** Every entry in `order` exists as a key in `sections`. No extra keys in `sections` that are not in `order` (optional strict check).
30
+ 2. **Section type:** For each `sections.<key>.type`, the file `sections/<type>.liquid` exists (e.g. `product-details` → `product-details.liquid`).
31
+ 3. **Blocks:** For each section that has `blocks` and `block_order`:
32
+ - Every key in `block_order` exists in `blocks`.
33
+ - For each `blocks.<key>.type`:
34
+ - **Local block** (bare name): declared in that section's `{% schema %}` `blocks` array with inline `settings`.
35
+ - **Theme block** (`zc_theme__<name>`): `blocks/<name>.liquid` exists AND the section schema lists `{ "type": "@theme" }` or that specific `zc_theme__<name>` entry.
36
+ - Recursively validate nested `blocks` / `block_order` on theme block instances against the parent block file's schema.
37
+ 4. **Settings keys:** Optionally spot-check that top-level keys in `settings` and `blocks.<key>.settings` match the correct schema (section schema for local blocks; `blocks/<name>.liquid` schema for theme blocks). No strict validation of value format here — that's assemble-page's job.
38
+
39
+ ---
40
+
41
+ ## Output
42
+
43
+ ```
44
+ VALIDATE PAGE — <page_name>.json (<theme_name>)
45
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
46
+
47
+ ✅ order: all keys present in sections
48
+ ✅ section "hero": type "hero-and-banners" → sections/hero-and-banners.liquid exists
49
+ ✅ section "product": type "product-details" → sections/product-details.liquid exists
50
+ ❌ section "footer": type "footer" → sections/footer.liquid NOT FOUND
51
+ ✅ section "badges": block_order keys match blocks
52
+ ✅ section "badges": local type "badge" declared in section schema
53
+ ✅ section "badges": theme type "zc_theme__text" → blocks/text.liquid exists; allowed by section schema
54
+ ❌ section "hero": block "cta" type "zc_theme__button" → blocks/button.liquid NOT FOUND
55
+
56
+ SUMMARY: PASS / FAIL
57
+ Issues: [list any ❌]
58
+ ```
59
+
60
+ If FAIL, list the issues and suggest fixing the page JSON, adding the missing section/block file, or updating the section schema to opt into the theme block.
@@ -0,0 +1,88 @@
1
+ ---
2
+ description: Validate a section group JSON file (header-group, footer-group, etc.)
3
+ alwaysApply: false
4
+ ---
5
+
6
+ # /validate-section-group
7
+
8
+ Validate a `*-group.json` file to ensure it references real sections, has correct structure, and is wired into a layout.
9
+
10
+ ## Usage
11
+ ```
12
+ /validate-section-group <theme_name> <group_name>
13
+ ```
14
+
15
+ `group_name` is without the `.json` extension (e.g. `header-group`, `footer-group`).
16
+
17
+ ---
18
+
19
+ ## Pre-flight
20
+
21
+ 1. Read `sections/<group_name>.json`.
22
+ 2. Read all layout files in `layouts/` to find `{% sections '<group_name>' %}` references.
23
+
24
+ ---
25
+
26
+ ## Validation Rules
27
+
28
+ ### 1. Valid JSON Structure
29
+ - File parses as valid JSON.
30
+ - Required top-level keys: `name`, `type`, `sections`, `order`.
31
+ - `name` is a `t:` translation key (e.g. `t:sections.header.name`).
32
+ - `type` is a string (e.g. `"header"`, `"footer"`).
33
+ - `sections` is an object with at least one section entry.
34
+ - `order` is an array of strings.
35
+
36
+ ### 2. Order Array Integrity
37
+ - Every entry in `order` exists as a key in `sections`.
38
+ - Every key in `sections` appears in `order` (no orphan sections).
39
+ - No duplicate entries in `order`.
40
+
41
+ ### 3. Section Type Existence
42
+ - For each `sections.<key>.type`, verify `sections/<type>.liquid` exists.
43
+
44
+ ### 4. Settings Validation
45
+ - For each section entry that has `settings`:
46
+ - Read the corresponding section's `{% schema %}` to get its field definitions.
47
+ - Spot-check that setting keys in the group JSON match schema field `id` values.
48
+ - Verify value formats match the field type:
49
+ - select → `{ "display_name": "...", "value": "..." }`
50
+ - url → `{ "display_name": "...", "handle": "..." }`
51
+ - image_picker → `{ "url": "...", "enable_customisation": true }`
52
+ - menu → `{ "display_name": "...", "handle": "..." }`
53
+ - checkbox → boolean
54
+ - range/number → number
55
+ - color → hex string
56
+ - text → string
57
+
58
+ ### 5. Layout Wiring
59
+ - At least one layout file in `layouts/` contains `{% sections '<group_name>' %}`.
60
+ - If no layout references this group → flag as warning (the group file exists but is never rendered).
61
+
62
+ ### 6. Translation Keys
63
+ - `name` field uses a `t:` key.
64
+ - That `t:` key exists in `i18n/en.schema.json`.
65
+
66
+ ---
67
+
68
+ ## Output
69
+
70
+ ```
71
+ VALIDATE SECTION GROUP — <group_name>.json (<theme_name>)
72
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
73
+
74
+ STRUCTURE ✅ / ❌
75
+ ORDER INTEGRITY ✅ / ❌
76
+ SECTION TYPES ✅ / ❌
77
+ SETTINGS ✅ / ⚠️ / ❌
78
+ LAYOUT WIRING ✅ / ⚠️
79
+ TRANSLATION KEYS ✅ / ⚠️
80
+
81
+ ISSUES:
82
+ ❌ [rule] description
83
+ ⚠️ [rule] description
84
+
85
+ SUMMARY: PASS / FAIL
86
+ ```
87
+
88
+ If FAIL, list each issue with a suggested fix. If PASS with warnings, list the warnings for developer review.
@@ -0,0 +1,119 @@
1
+ ---
2
+ description: Cross-check settings/schema.json vs settings/theme.json vs i18n/en.schema.json vs Liquid consumers
3
+ alwaysApply: false
4
+ ---
5
+
6
+ # /validate-theme-settings
7
+
8
+ Audit consistency across the three theme settings files and their Liquid consumers.
9
+ Run after `/add-theme-setting`, `/sync-theme-settings`, or before release.
10
+
11
+ ## Usage
12
+ ```
13
+ /validate-theme-settings <theme_name>
14
+ ```
15
+
16
+ ---
17
+
18
+ ## Pre-flight
19
+
20
+ Read all four sources:
21
+
22
+ 1. `settings/schema.json` — field definitions grouped by category.
23
+ 2. `settings/theme.json` — preset values (check **every** preset under `presets`).
24
+ 3. `i18n/en.schema.json` — translation keys under `settings_schema`.
25
+ 4. `snippets/theme-settings.liquid` — where `settings.*` are consumed as CSS variables.
26
+
27
+ ---
28
+
29
+ ## Checks
30
+
31
+ ### 1. Schema ↔ Presets Sync
32
+ For every field `id` across all groups in `schema.json`:
33
+ - The same key exists in **every** preset in `theme.json`.
34
+ - If a key is in a preset but not in any schema group → flag as **orphan in preset**.
35
+ - If a key is in schema but missing from a preset → flag as **missing from preset**.
36
+
37
+ ### 2. Value Type Correctness
38
+ For each key in each preset, verify the value matches the schema field type:
39
+
40
+ | Schema type | Expected preset value |
41
+ |-------------|----------------------|
42
+ | `checkbox` | `true` or `false` (boolean) |
43
+ | `range` | number |
44
+ | `color` | hex string (e.g. `"#FFFFFF"`) |
45
+ | `text` | string |
46
+ | `richtext` | string |
47
+ | `image_picker` | string (URL or empty `""`) |
48
+ | `select` | object with `display_name` and `value` keys |
49
+
50
+ Flag mismatches (e.g. select with `label` instead of `display_name`, checkbox with string value).
51
+
52
+ ### 3. Select Convention
53
+ For every `select` field in `schema.json`:
54
+ - **Default** must be `{ "display_name": "...", "value": "..." }` — not `{ "label": "...", "value": "..." }`.
55
+ - **Options** array entries must use `{ "display_name": "...", "value": "..." }`.
56
+ - Corresponding preset value in `theme.json` must also use `{ "display_name": "...", "value": "..." }`.
57
+ - The preset's `value` must match one of the option values in schema.
58
+
59
+ ### 4. Translation Key Coverage
60
+ For every `t:settings_schema.*` reference in `schema.json` (labels, content, display_name, info, placeholder):
61
+ - Extract the key path (e.g. `t:settings_schema.theme.settings.primary_color.label` → `settings_schema.theme.settings.primary_color.label`).
62
+ - Verify that key exists in `en.schema.json`.
63
+ - Flag any `t:` key referenced in schema but missing from i18n.
64
+
65
+ ### 5. i18n Orphans (optional, warnings only)
66
+ For every key under `settings_schema` in `en.schema.json`:
67
+ - Check if it is referenced by any `t:` path in `schema.json`.
68
+ - Keys not referenced → flag as **orphan i18n key** (warning, not error).
69
+
70
+ ### 6. Liquid Consumer Check
71
+ Read `snippets/theme-settings.liquid` and any layout files that reference `settings.*`:
72
+ - For every `settings.<id>` or `settings.<id>.value` reference in Liquid:
73
+ - Verify `<id>` exists in `schema.json`.
74
+ - If the schema type is `select` and Liquid reads `settings.<id>.value`, that is correct.
75
+ - If the schema type is `select` and Liquid reads `settings.<id>` without `.value`, flag as potential bug (will get the whole object, not the string value).
76
+
77
+ ### 7. Meta Field Presence
78
+ Every group in `schema.json` should have a `meta` field set to either `"global_settings"` or `"component_settings"`.
79
+ - Missing `meta` → flag as warning.
80
+
81
+ ---
82
+
83
+ ## Output
84
+
85
+ ```
86
+ VALIDATE THEME SETTINGS — <theme_name>
87
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
88
+
89
+ SCHEMA ↔ PRESETS ✅ / ❌
90
+ VALUE TYPES ✅ / ❌
91
+ SELECT CONVENTION ✅ / ❌
92
+ TRANSLATION KEYS ✅ / ❌
93
+ I18N ORPHANS ✅ / ⚠️
94
+ LIQUID CONSUMERS ✅ / ⚠️
95
+ META FIELDS ✅ / ⚠️
96
+
97
+ ISSUES:
98
+ ❌ [check] <id>: description (file:line if applicable)
99
+ ⚠️ [check] <id>: description
100
+
101
+ SUMMARY
102
+ Schema fields: <n>
103
+ Preset keys (Default): <n>
104
+ i18n keys under settings_schema: <n>
105
+ Errors: <n> | Warnings: <n>
106
+
107
+ RESULT: PASS / FAIL
108
+ ```
109
+
110
+ Auto-fix unambiguous issues (e.g. `label` → `display_name` in a select) if safe.
111
+ Flag anything requiring judgment.
112
+
113
+ ---
114
+
115
+ ## Notes
116
+
117
+ - This command does NOT modify schema structure or add new fields — use `/add-theme-setting` for that.
118
+ - Run this after any manual edit to `schema.json` or `theme.json` to catch drift.
119
+ - Pair with `/qa-i18n` for deeper translation key analysis across sections too.
@@ -0,0 +1,151 @@
1
+ # Design Instructions Template
2
+
3
+ Use this file as an optional argument to `/build-theme` or `/build-section` to provide detailed build instructions that supplement or override the Figma extraction.
4
+
5
+ Pass it as the last argument:
6
+ ```
7
+ /build-theme <theme_name> <figma_file_key> design-instructions.md
8
+ /build-section <theme_name> <section_name> [figma_url] design-instructions.md
9
+ ```
10
+
11
+ ---
12
+
13
+ ## Frame Mapping
14
+
15
+ Maps Figma frames to section file names and their order in the page JSON.
16
+
17
+ | Figma Frame | Section File | Page | Order |
18
+ |-------------|-------------|------|-------|
19
+ | Hero Banner | `hero-banner` | index.json | 1 |
20
+ | Product Features | `product-features` | index.json | 2 |
21
+ | Testimonials | `testimonials-carousel` | index.json | 3 |
22
+ | FAQ Accordion | `faq-accordion` | index.json | 4 |
23
+ | Newsletter Signup | `newsletter-cta` | index.json | 5 |
24
+
25
+ ---
26
+
27
+ ## Image Placeholders
28
+
29
+ Maps Figma image layers to ZCommerce Liquid objects or schema settings.
30
+
31
+ | Figma Layer | Schema Type | Liquid Source | Fallback |
32
+ |-------------|-------------|--------------|----------|
33
+ | Hero Background | `image_picker` | `section.settings.hero_image` | Placeholder gradient via CSS |
34
+ | Product Photo | product object | `product.images[0].url` | `{{ 'placeholder.webp' | asset_url }}` |
35
+ | Testimonial Avatar | `image_picker` (block) | `block.settings.avatar` | Initials circle via CSS |
36
+
37
+ **Schema syntax reminder** — image_picker defaults use ZCommerce format:
38
+ ```json
39
+ { "url": "placeholder.webp", "enable_customisation": true }
40
+ ```
41
+
42
+ ---
43
+
44
+ ## Animations & Transitions
45
+
46
+ CSS animations and scroll-triggered effects.
47
+
48
+ | Element | Trigger | Animation | Duration | Easing |
49
+ |---------|---------|-----------|----------|--------|
50
+ | `.hero-banner__heading` | Page load | `fadeInUp` | `0.8s` | `ease-out` |
51
+ | `.product-features__card` | Scroll into view | `fadeInUp` | `0.6s` | `ease-out` |
52
+ | `.testimonials__item` | Scroll into view | `fadeIn` | `0.5s` | `ease` |
53
+
54
+ ```css
55
+ @keyframes fadeInUp {
56
+ from {
57
+ opacity: 0;
58
+ transform: translateY(20px);
59
+ }
60
+ to {
61
+ opacity: 1;
62
+ transform: translateY(0);
63
+ }
64
+ }
65
+
66
+ @keyframes fadeIn {
67
+ from { opacity: 0; }
68
+ to { opacity: 1; }
69
+ }
70
+ ```
71
+
72
+ **Implementation notes:**
73
+ - Use `IntersectionObserver` in a Web Component for scroll-triggered animations
74
+ - Always respect `prefers-reduced-motion: reduce`
75
+ - Use `<script defer>` — no external JS libraries
76
+
77
+ ---
78
+
79
+ ## Hover States
80
+
81
+ Interactive CSS transitions on hover.
82
+
83
+ | Element | Property | Default | Hover | Transition |
84
+ |---------|----------|---------|-------|------------|
85
+ | `.product-card` | `transform` | `none` | `translateY(-4px)` | `0.3s ease` |
86
+ | `.product-card` | `box-shadow` | `none` | `0 8px 24px rgba(0,0,0,0.1)` | `0.3s ease` |
87
+ | `.cta-button` | `background-color` | `var(--color-primary)` | Darken 10% | `0.2s ease` |
88
+ | `.testimonials__dot` | `opacity` | `0.5` | `1` | `0.2s ease` |
89
+
90
+ ---
91
+
92
+ ## Component Overrides
93
+
94
+ Override specific design decisions per section that differ from the Figma extraction or reference theme.
95
+
96
+ | Section | Setting | Override Value | Notes |
97
+ |---------|---------|---------------|-------|
98
+ | `hero-banner` | Container | Full-bleed (no `max-w-container-theme`) | Image behind text, edge-to-edge |
99
+ | `product-features` | Grid columns | 3 on desktop, 1 on mobile | Figma shows 4 but client prefers 3 |
100
+ | `faq-accordion` | Behavior | Single-open | Only one accordion item open at a time |
101
+
102
+ ---
103
+
104
+ ## Custom CSS Variables
105
+
106
+ Additional CSS custom properties beyond the standard theme tokens. Define these in the `{% style %}` block of the relevant section.
107
+
108
+ | Variable | Value | Used By |
109
+ |----------|-------|---------|
110
+ | `--hero-overlay-opacity` | `0.4` | hero-banner |
111
+ | `--card-hover-shadow` | `0 8px 24px rgba(0,0,0,0.1)` | product-features |
112
+ | `--accordion-border-color` | `var(--color-border)` | faq-accordion |
113
+
114
+ ---
115
+
116
+ ## Schema Field Overrides
117
+
118
+ Force specific schema field types or defaults that differ from what Figma extraction would produce.
119
+
120
+ | Section | Field ID | Type | Default | Notes |
121
+ |---------|---------|------|---------|-------|
122
+ | `hero-banner` | `overlay_opacity` | `range` | `40` (min:0, max:100, step:5) | Controls image overlay darkness |
123
+ | `product-features` | `columns_desktop` | `select` | `{ "display_name": "t:...", "value": "3" }` | Options: 2, 3, 4 |
124
+ | `newsletter-cta` | `bg_style` | `select` | `{ "display_name": "t:...", "value": "gradient" }` | Options: solid, gradient, image |
125
+
126
+ ---
127
+
128
+ ## Custom Instructions
129
+
130
+ Free-form build notes that the agent must follow. These take highest priority.
131
+
132
+ - The hero section should use a full-bleed layout with the image behind the text overlay
133
+ - Product feature cards should be in a 3-column grid on desktop, stacking vertically on mobile
134
+ - The FAQ accordion should only allow one item open at a time (use a Web Component with `data-single-open`)
135
+ - The newsletter section should have a subtle background pattern using a CSS gradient
136
+ - All section transitions should respect `prefers-reduced-motion`
137
+ - Use `{% render 'icon-chevron' %}` for accordion arrows — do NOT inline SVGs
138
+ - All prices must use the `| money` filter
139
+ - Product cards must match the existing `{% render 'product-card' %}` snippet interface — do NOT create a new card layout
140
+
141
+ ---
142
+
143
+ ## i18n Overrides
144
+
145
+ Force specific translation key values instead of auto-generated ones.
146
+
147
+ | Key | Value | Notes |
148
+ |-----|-------|-------|
149
+ | `t:sections.hero_banner.settings.heading.default` | `Discover Our Collection` | Marketing-approved copy |
150
+ | `t:sections.newsletter_cta.settings.heading.default` | `Stay in the Loop` | — |
151
+ | `t:sections.faq_accordion.settings.heading.default` | `Frequently Asked Questions` | — |
@@ -0,0 +1,18 @@
1
+ {
2
+ "mcpServers": {
3
+ "chrome-devtools": {
4
+ "command": "npx",
5
+ "args": [
6
+ "-y",
7
+ "chrome-devtools-mcp@latest",
8
+ "--viewport=1440x900",
9
+ "--isolated",
10
+ "--experimentalPageIdRouting",
11
+ "--no-usage-statistics"
12
+ ],
13
+ "env": {
14
+ "CHROME_DEVTOOLS_MCP_NO_USAGE_STATISTICS": "1"
15
+ }
16
+ }
17
+ }
18
+ }