@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,160 @@
1
+ # .cursor/rules — Theme Development Rules
2
+
3
+ ## Overview
4
+ These rules apply automatically to this theme.
5
+ When you add files under the standard theme folders, path-scoped rules activate
6
+ immediately with zero changes needed.
7
+
8
+ - **Ordered workflows:** `.cursor/PLAYBOOK.md` (new theme, redesign, bug fix, theme settings).
9
+ - **Slash commands:** `.cursor/commands/*.md` (16 commands — source of truth for invocation text).
10
+ - **Parallel Figma (desktop + mobile):** `.cursor/agents/figma-desktop-mobile-parallel.md` — use when the user gives two Figma selection URLs.
11
+
12
+ ---
13
+
14
+ ## File Map
15
+
16
+ ### Path-scoped rules (auto by glob)
17
+
18
+ | File | Activates on | Purpose |
19
+ |------|----------------|---------|
20
+ | `general.mdc` | `**/*` | Folder structure, global conventions |
21
+ | `schema.mdc` | `sections/*.liquid`, `pages/*.json` | Custom schema syntax for all field types |
22
+ | `liquid.mdc` | `**/*.liquid` | Liquid patterns, global objects, rendering |
23
+ | `pages.mdc` | `pages/*.json` | Page JSON structure and inline setting values |
24
+ | `javascript.mdc` | `assets/*.js` | Web Components, fetch, event patterns |
25
+ | `i18n.mdc` | `i18n/*.json`, `sections/*.liquid` | Translation key naming conventions |
26
+ | `css.mdc` | `assets/*.css`, `sections/*.liquid` | Tailwind + CSS variable usage |
27
+ | `reference-themes.mdc` | `sections/*.liquid`, `snippets/*.liquid` | Logic from existing sections in this theme, design from Figma |
28
+ | `figma-mcp-resolution.mdc` | `sections/*.liquid`, `snippets/*.liquid` | Resolve Figma MCP `var()` from `figma-variables.json` first |
29
+ | `design-spec-extraction.mdc` | `sections/*.liquid`, `snippets/*.liquid` | Reusable protocol for extracting exact values from Figma MCP — used by build-section, compare-section, redesign-section |
30
+ | `add-theme-setting.mdc` | `settings/schema.json`, `theme.json`, `i18n/en.schema.json` | Theme-level settings (wire to Liquid unless schema-only) |
31
+
32
+ ### Command-paired rules (no globs — use with matching slash command)
33
+
34
+ These mirror `.cursor/commands/*.md`. Invoke the command (or `@`-mention the rule) so the agent loads the right checklist.
35
+
36
+ | File | Command | Purpose |
37
+ |------|---------|---------|
38
+ | `create-theme.mdc` | `/create-theme` | Scaffold a new theme |
39
+ | `extract-tokens.mdc` | `/extract-tokens` | Validate `figma-variables.json` exists |
40
+ | `audit-page.mdc` | `/audit-page` | Page plan before code |
41
+ | `build-section.mdc` | `/build-section` | Build section from Figma + reference |
42
+ | `assemble-page.mdc` | `/assemble-page` | Generate page JSON from sections |
43
+ | `add-field.mdc` | `/add-field` | New section setting + page JSON + snippets |
44
+ | `qa-section.mdc` | `/qa-section` | Schema, Liquid, tokens, images, **a11y**, **performance**, **Tailwind vs `{% style %}`** |
45
+ | `compare-section.mdc` | `/compare-section` | Built section vs Figma — mismatch report |
46
+ | `fix-section.mdc` | `/fix-section` | Minimal blast-radius bug fixes |
47
+ | `redesign-section.mdc` | `/redesign-section` | New Figma — preserve logic, replace HTML/CSS |
48
+
49
+ ### Commands without a dedicated `.mdc`
50
+
51
+ | Command | Notes |
52
+ |---------|--------|
53
+ | `/refactor-section` | Planned refactors (e.g. move static CSS to Tailwind) — see `.cursor/commands/refactor-section.md` |
54
+ | `/sync-theme-settings` | Sync token map into `settings/theme.json` presets |
55
+ | `/qa-sections` | QA every section in a theme |
56
+ | `/validate-page` | Page JSON references real sections/blocks |
57
+ | `/impact` | Snippet → list of dependent sections |
58
+
59
+ ---
60
+
61
+ ## Commands
62
+
63
+ ### New Theme Pipeline (run in order)
64
+ | Command | When to use |
65
+ |---------|-------------|
66
+ | `/create-theme <n>` | Start a new theme — scaffolds folders, copies snippets |
67
+ | `/extract-tokens <n>` | Run once after create — validates `figma-variables.json` exists |
68
+ | `/sync-theme-settings <n>` | Copy mapped token values into `settings/theme.json` presets |
69
+ | `/audit-page <n> <page>` | Plan a page — produces section inventory, no code yet |
70
+ | `/build-section <n> <section>` | Build one section at a time from Figma + reference |
71
+ | `/qa-section <n> <section>` | Audit: schema, Liquid, tokens, images, a11y, performance, Tailwind vs `{% style %}` |
72
+ | `/compare-section <n> <section>` | Compare built section vs Figma — report mismatches by severity |
73
+ | `/assemble-page <n> <page>` | Generate page JSON after all sections are built and QA'd |
74
+
75
+ ### Editing Existing Sections
76
+ | Command | When to use |
77
+ |---------|-------------|
78
+ | `/redesign-section <n> <section>` | New Figma design — keep all logic, replace HTML/CSS only |
79
+ | `/fix-section <n> <section>` | Bug fix — diagnoses root cause before touching anything |
80
+ | `/refactor-section <n> <section>` | Structural / style refactors (often with a short plan first) |
81
+ | `/add-field <n> <section>` | Add a **section** setting — section, page JSON, snippets |
82
+ | `/add-theme-setting <n>` | Add **theme** setting — schema, presets, i18n |
83
+ | `/compare-section <n> <section>` | Check rebuilt/redesigned section against updated Figma |
84
+
85
+ ### Per-Section Quality Gate
86
+ Run these three commands on every section before assembling the page:
87
+ ```
88
+ /qa-section → code correctness (schema, Liquid, tokens, images, a11y, performance)
89
+ /compare-section → design accuracy (spacing, typography, layout, colour)
90
+ /fix-section → fix approved issues from either report
91
+ ```
92
+
93
+ Both `/qa-section` and `/compare-section` read the section file and all
94
+ nested snippets automatically — no manual pasting required.
95
+
96
+ ### Batch / theme-level
97
+ | Command | When to use |
98
+ |---------|-------------|
99
+ | `/qa-sections <theme_name>` | QA every section in the theme (e.g. before release) |
100
+ | `/validate-page <theme_name> <page_name>` | After assemble-page: verify page JSON references real sections/blocks |
101
+ | `/impact <theme_name> <snippet_name>` | List sections that use a snippet before changing it |
102
+
103
+ See `.cursor/PLAYBOOK.md` for full flows (new theme, redesign, bug fix, theme settings).
104
+
105
+ ---
106
+
107
+ ## Agents (subagents)
108
+
109
+ | Doc | When to use |
110
+ |-----|-------------|
111
+ | `.cursor/agents/figma-desktop-mobile-parallel.md` | User provides **two** Figma selection URLs (desktop + mobile). Runs build/compare/fix/redesign with both viewports in parallel. |
112
+ | `.cursor/agents/visual-compare.md` | `/compare-section --visual` — launches dev server, screenshots rendered section in browser (desktop + mobile via Claude in Chrome), fetches Figma screenshot, produces visual diff report. |
113
+
114
+ ---
115
+
116
+ ## Skills
117
+ Skills live in `.cursor/skills/` and are referenced in chat with `@skill-name`.
118
+ They are part of the project — version controlled alongside your rules and commands.
119
+
120
+ | File | Reference in chat | Purpose |
121
+ |------|------------------|---------|
122
+ | `design-tokens.md` | `@design-tokens` | Figma px/hex → Tailwind/CSS variable map |
123
+ | `section-anatomy.md` | `@section-anatomy` | Complete section file skeleton |
124
+ | `reference-lookup.md` | `@reference-lookup` | How to extract logic from existing sections in this theme |
125
+ | `qa-accessibility.md` | `@qa-accessibility` | Accessibility checklist for QA |
126
+ | `page-json-contract.md` | `@page-json-contract` | Page JSON shape and validation for assemble/validate |
127
+
128
+ ---
129
+
130
+ ## Adding files to this theme
131
+ 1. Keep work inside this theme folder
132
+ 2. Follow the standard folder structure (assets, i18n, layouts, sections, snippets, pages, settings)
133
+ 3. Path-scoped rules apply automatically — no rule changes needed
134
+
135
+ ## Theme-specific override
136
+ Only add an override if this theme genuinely differs from shared syntax.
137
+ Create `theme-{name}.mdc` with ONLY the differences — never repeat shared rules.
138
+
139
+ ```
140
+ .cursor/rules/
141
+ schema.mdc ← shared syntax
142
+ theme-{name}.mdc ← only what differs for this theme
143
+ ```
144
+
145
+ ---
146
+
147
+ ## Custom Schema Syntax Quick Reference
148
+
149
+ | Field Type | Default Format |
150
+ |------------|---------------|
151
+ | `url` | `{ "display_name": "t:...", "handle": "/path" }` |
152
+ | `image_picker` | `{ "url": "file.webp", "enable_customisation": true }` |
153
+ | `select` | `{ "display_name": "t:...", "value": "option-value" }` |
154
+ | `menu` | `{ "display_name": "t:...", "handle": "" }` |
155
+ | `text` | `"t:sections.name.settings.id.default"` |
156
+ | `range` | plain number e.g. `40` |
157
+ | `checkbox` | plain boolean `true` / `false` |
158
+ | `color` | hex string `"#000000"` |
159
+
160
+ All labels, defaults, and content strings must use `t:` translation keys — never hardcoded English.
@@ -0,0 +1,24 @@
1
+ ---
2
+ description: Accessibility standards for theme sections, templates, and components
3
+ globs: **
4
+ alwaysApply: false
5
+ ---
6
+
7
+ # Accessibility (A11y) Guidelines
8
+
9
+ - Prefer semantic HTML (`<button>`, `<nav>`, `<main>`, `<header>`, `<footer>`, `<section>`, `<h1>`–`<h6>`) over generic `<div>`/`<span>`
10
+ - Each page must have exactly one visible `<h1>` and maintain a logical heading order (no skipping levels)
11
+ - All interactive elements must be real controls (`<button>`, `<a href>`, form elements) — never clickable `<div>`s
12
+ - Clickable elements must be keyboard-focusable and operable with Enter/Space
13
+ - Do not remove the focus outline; customize with clearly visible `outline` or `box-shadow` instead
14
+ - All images must have meaningful `alt` text or `alt=""` when decorative, never omit `alt`
15
+ - Icon-only buttons and links must have accessible names via text, `aria-label`, or `aria-labelledby`
16
+ - Labels must be programmatically associated with form fields (`<label for>` or wrapping the input)
17
+ - Avoid `aria-*` when native HTML semantics are sufficient; when used, keep roles, states, and properties in sync with DOM
18
+ - Ensure color contrast meets WCAG AA (4.5:1 for normal text, 3:1 for large text and UI elements)
19
+ - Do not rely on color alone to convey meaning (add text, icons, or patterns)
20
+ - Provide clear error messages tied to fields via `aria-describedby` or inline descriptions
21
+ - Announce dynamic content changes for screen readers when they are critical (e.g. `aria-live="polite"` or `"assertive"` on small regions)
22
+ - Avoid auto-playing animations; if persistent animation exists, keep motion subtle and provide a way to pause or reduce motion
23
+ - Do not trap keyboard focus in modals, drawers, or menus; when used, move focus inside and restore it on close
24
+ - Ensure tab order matches visual order; avoid positive `tabindex`, use `tabindex="-1"` only for programmatic focus targets
@@ -0,0 +1,222 @@
1
+ ---
2
+
3
+ description: Add a new setting/field to an existing section — updates section, snippets, and page JSON
4
+ alwaysApply: false
5
+ ---
6
+
7
+
8
+ # /add-field
9
+
10
+ Add a new setting or block field to an existing section.
11
+ Updates all affected files: section Liquid, schema, and page JSON defaults.
12
+
13
+ ## Usage
14
+ ```
15
+ /add-field <theme_name> <section_name>
16
+ ```
17
+ Describe the field: what it controls, what type it should be, where it appears visually.
18
+
19
+ ---
20
+
21
+
22
+ ## Pre-flight
23
+ 1. Open `sections/<section_name>.liquid`
24
+ 2. Open `pages/*.json` — find the page JSON that uses this section
25
+ 3. Open related snippets if the field affects a snippet render
26
+ 4. If field is from Figma → confirm Figma frame is available for reference
27
+
28
+ ---
29
+
30
+
31
+ ## Stage 1 — Determine Field Spec
32
+ From the user's description (and Figma if provided), determine:
33
+
34
+ | Property | Decision |
35
+ |----------|----------|
36
+ | Field type | text / richtext / url / image_picker / media_picker / select / checkbox / range / color / menu |
37
+ | Field ID | snake_case, descriptive (e.g. `badge_text`, `show_divider`, `card_image`) |
38
+ | Where used | section-level setting OR local block-level setting OR theme block (`blocks/<name>.liquid`) |
39
+ | Default value | sensible default matching the field type |
40
+ | Label key | `t:sections.<n>.settings.<id>.label` (section) / `t:sections.<n>.blocks.<type>.settings.<id>.label` (local block) / `t:blocks.<name>.settings.<id>.label` (theme block) |
41
+ | Placement in schema | after which existing field? |
42
+ | Placement in Liquid | where in the HTML does it render? |
43
+
44
+ **Choose `text` vs `richtext`:**
45
+ - Renders in `<h1>`–`<h6>` or as title/eyebrow/badge/button label → `text`
46
+ - Renders as paragraph, description, or multi-line body copy → `richtext`
47
+ - Heading blocks must never use `richtext`
48
+
49
+ State the spec before making any changes:
50
+ ```
51
+ FIELD SPEC
52
+ ━━━━━━━━━━━━━━━━━━━━━━
53
+ Type: select
54
+ ID: card_size
55
+ Level: block setting (inside "product-card" block)
56
+ Label key: t:sections.category-main.blocks.product-card.settings.card_size.label
57
+ Default: { "display_name": "t:...default", "value": "medium" }
58
+ Options: small / medium / large
59
+ Renders at: line 52, inside the card wrapper div as a CSS class
60
+ Schema after: "card_gap" field
61
+ ```
62
+
63
+ Ask: "Proceed with this spec?" before editing.
64
+
65
+ ---
66
+
67
+
68
+ ## Stage 2 — Update Schema
69
+ Add the new field in the correct file:
70
+
71
+ **Section-level setting** → section `{% schema %}` inside `"settings": []`
72
+ **Local block-level setting** → section `{% schema %}` inside the correct block in `"blocks": []`
73
+ **Theme block setting** → `blocks/<name>.liquid` `{% schema %}` inside `"settings": []` (not the section file)
74
+
75
+ Use correct custom syntax for the field type:
76
+
77
+ ```jsonc
78
+ // text (headings, titles, labels, button text)
79
+ { "type": "text", "id": "badge_text", "label": "t:...", "default": "t:..." }
80
+
81
+ // richtext (descriptions, body copy, FAQ answers)
82
+ { "type": "richtext", "id": "description", "label": "t:...", "default": "<p>t:...</p>" }
83
+
84
+ // url
85
+ { "type": "url", "id": "cta_url", "label": "t:...", "default": { "display_name": "t:...", "handle": "/" } }
86
+
87
+ // image_picker
88
+ { "type": "image_picker", "id": "card_image", "label": "t:...", "default": { "url": "placeholder.webp", "enable_customisation": true } }
89
+
90
+ // media_picker (video)
91
+ { "type": "media_picker", "id": "video_media", "label": "t:...", "default": { "url": "video.mp4", "is_video": true } }
92
+
93
+ // select
94
+ { "type": "select", "id": "card_size", "label": "t:...",
95
+ "options": [
96
+ { "label": "t:...option__1.label", "value": "small" },
97
+ { "label": "t:...option__2.label", "value": "medium" },
98
+ { "label": "t:...option__3.label", "value": "large" }
99
+ ],
100
+ "default": { "display_name": "t:...default", "value": "medium" }
101
+ }
102
+
103
+ // checkbox
104
+ { "type": "checkbox", "id": "show_badge", "label": "t:...", "default": false }
105
+
106
+ // range
107
+ { "type": "range", "id": "card_gap", "min": 4, "max": 48, "step": 4, "unit": "px", "default": 16, "label": "t:..." }
108
+
109
+ // color
110
+ { "type": "color", "id": "badge_color", "label": "t:...", "default": "#000000" }
111
+
112
+ // menu
113
+ { "type": "menu", "id": "section_menu", "label": "t:...", "default": { "display_name": "t:...", "handle": "" } }
114
+ ```
115
+
116
+ ---
117
+
118
+
119
+ ## Stage 3 — Add Liquid Assign
120
+ Add to the `{% liquid %}` assign block at the top of the section:
121
+
122
+ ```liquid
123
+ {% liquid
124
+ ...existing assigns...
125
+ assign card_size = section.settings.card_size.value
126
+ assign badge_text = section.settings.badge_text
127
+ %}
128
+ ```
129
+
130
+ Field type render syntax:
131
+ - `text` → `{{ field | escape }}`
132
+ - `richtext` → `{{ field | raw }}`
133
+ - `url` → `{{ field.handle }}`
134
+ - `select` → `{{ field.value }}`
135
+ - `image_picker` → `{{ field.url }}`
136
+ - `media_picker` → `{{ field.url }}` (and optional `{{ field.is_video }}`)
137
+ - `menu` → `{{ field.handle }}`
138
+ - `checkbox` → `{% if field %}...{% endif %}`
139
+ - `range` / `color` → `{{ field }}`
140
+
141
+ ---
142
+
143
+
144
+ ## Stage 4 — Add Render in HTML
145
+ Insert the field output at the correct location in the HTML.
146
+
147
+ Always wrap optional fields with a blank check:
148
+ ```liquid
149
+ {% if badge_text != blank %}
150
+ <span class="text-sm font-medium px-2 py-1 rounded" style="background-color: var(--color-primary); color: var(--color-on-primary);">
151
+ {{ badge_text | escape }}
152
+ </span>
153
+ {% endif %}
154
+ ```
155
+
156
+ For classes driven by a select field:
157
+ ```liquid
158
+ <div class="card-wrapper {% if card_size == 'large' %}p-8{% elsif card_size == 'small' %}p-2{% else %}p-4{% endif %}">
159
+ ```
160
+
161
+ ---
162
+
163
+
164
+ ## Stage 5 — Update Page JSON
165
+ Find the page JSON file that uses this section.
166
+ Add the new field to the correct section or block settings with proper inline syntax:
167
+
168
+ ```jsonc
169
+ // For section setting
170
+ "settings": {
171
+ ...existing settings...,
172
+ "badge_text": "New Arrivals",
173
+ "card_size": { "display_name": "Medium", "value": "medium" }
174
+ }
175
+
176
+ // For block setting
177
+ "blocks": {
178
+ "product-card": {
179
+ "type": "product-card",
180
+ "settings": {
181
+ ...existing...,
182
+ "card_size": { "display_name": "Medium", "value": "medium" }
183
+ }
184
+ }
185
+ }
186
+ ```
187
+
188
+ ---
189
+
190
+
191
+ ## Stage 6 — Update Related Snippets
192
+ If the field value is passed to a `{% render %}` snippet call:
193
+ ```liquid
194
+ {% render 'product-card', card_size: card_size, show_badge: show_badge %}
195
+ ```
196
+ Open the snippet and add the variable handling there too.
197
+
198
+ ---
199
+
200
+
201
+ ## Output
202
+ ```
203
+ ✅ Field added: <field_id> (<type>) → <section_name>
204
+
205
+ FILES CHANGED:
206
+ 1. sections/<section_name>.liquid
207
+ - Schema: added field at position X in settings/blocks
208
+ - Liquid: added assign on line X
209
+ - HTML: added render on line X
210
+
211
+ 2. pages/<page>.json
212
+ - Added default value for <field_id>
213
+
214
+ 3. snippets/<snippet>.liquid (if applicable)
215
+ - Added variable handling
216
+
217
+ ⚠️ REMEMBER: Add translation keys to i18n/en.schema.json:
218
+ "t:sections.<n>.settings.<id>.label": "Your Label Text"
219
+ "t:sections.<n>.settings.<id>.default": "Default Text"
220
+
221
+ NEXT: Run /qa-section <theme_name> <section_name> to verify
222
+ ```
@@ -0,0 +1,39 @@
1
+ ---
2
+
3
+ description: Add a new theme-level setting to schema.json, theme.json presets, and en.schema.json
4
+ globs:
5
+ - "settings/schema.json"
6
+ - "settings/theme.json"
7
+ - "i18n/en.schema.json"
8
+ alwaysApply: false
9
+ ---
10
+
11
+
12
+ # /add-theme-setting
13
+
14
+ When adding or editing **theme-level** settings (not section `{% schema %}`):
15
+
16
+ ## Files
17
+
18
+ 1. `settings/schema.json` — field definitions per group; each group may have `"meta": "global_settings"` or `"component_settings"`.
19
+ 2. `settings/theme.json` — add the new key to **every** preset under `presets`.
20
+ 3. `i18n/en.schema.json` — human-readable strings under `settings_schema.<group>.settings.<id>`.
21
+
22
+ ## Rules
23
+
24
+ - All schema `label`, `content`, `placeholder`, and select option labels use **`t:`** keys; English lives in `en.schema.json`.
25
+ - **Select** defaults in schema and theme.json use `{ "value", "label" }` with `label` as `t:...options__N.label` matching an option.
26
+ - **New group:** include `"name"` (t:), `"settings"` array, `"meta"`.
27
+ - **`component_settings`** — safe from blind overwrite by token sync for fields not in sync mapping.
28
+ - **`global_settings`** — candidate for `/sync-theme-settings`; document new mapped fields in `sync-theme-settings.md`.
29
+ - Setting **ids must be unique** across the merged flat preset object.
30
+
31
+ ## Wire-up is required
32
+
33
+ Unless the user says **schema only**, every new theme setting must be **consumed** in layout, `snippets/theme-settings.liquid`, or JS/CSS so toggles and values actually affect the storefront (including `accounts.liquid` when relevant).
34
+
35
+ ## Not in scope here
36
+
37
+ Section fields → `/add-field`.
38
+ Token file validation → `/extract-tokens`.
39
+ Populating mapped globals from Figma → `/sync-theme-settings`.
@@ -0,0 +1,130 @@
1
+ ---
2
+
3
+ description: Generate page JSON from completed sections
4
+ alwaysApply: false
5
+ ---
6
+
7
+
8
+ # /assemble-page
9
+
10
+ Generate the page JSON file from all completed sections for a page.
11
+ Run this after all sections for a page have been built and QA'd.
12
+
13
+ ## Usage
14
+ ```
15
+ /assemble-page <theme_name> <page_name>
16
+ ```
17
+
18
+ ---
19
+
20
+
21
+ ## Step 1 — Identify Sections
22
+ - Read the audit plan produced by `/audit-page` for this page
23
+ - Confirm which sections have been built in `sections/`
24
+ - If any sections from the plan are missing → warn the user and list them
25
+ - Ask: "Proceed with available sections or wait until all are built?"
26
+
27
+ ---
28
+
29
+
30
+ ## Step 2 — Read Section and Block Schemas
31
+ For each section to include:
32
+ - Open `sections/<section_name>.liquid`
33
+ - Read the `{% schema %}` to extract:
34
+ - All setting IDs and their types
35
+ - All block types allowed (local blocks with inline `settings`; theme blocks as `zc_theme__<name>` or `@theme`)
36
+ - Default values
37
+ - For each **theme block** referenced in the section schema, also read `blocks/<name>.liquid` to get that block's setting IDs and defaults (page JSON `type` is `zc_theme__<name>`)
38
+
39
+ ---
40
+
41
+
42
+ ## Step 3 — Generate Page JSON
43
+ Build the page JSON using correct inline value syntax for each field type:
44
+
45
+ ```jsonc
46
+ {
47
+ "layout": "theme",
48
+ "sections": {
49
+ "<section_key>": {
50
+ "type": "<section_filename_without_liquid>",
51
+ "settings": {
52
+ // text → plain string
53
+ "heading": "Section Heading",
54
+
55
+ // url → object
56
+ "cta_url": { "display_name": "Shop Now", "handle": "/collection" },
57
+
58
+ // image_picker → object
59
+ "banner_image": { "url": "banner.webp", "enable_customisation": true },
60
+
61
+ // media_picker (video) → object
62
+ "video_media": { "url": "video.mp4", "is_video": true },
63
+
64
+ // select → object
65
+ "layout_type": { "display_name": "Left Alignment", "value": "left-alignment" },
66
+
67
+ // menu → object
68
+ "nav_menu": { "display_name": "Main Menu", "handle": "main-menu" },
69
+
70
+ // checkbox → boolean
71
+ "show_heading": true,
72
+
73
+ // range/number → number
74
+ "padding_top": 40,
75
+ "padding_bottom": 40,
76
+
77
+ // color → hex string
78
+ "overlay_color": "#000000"
79
+ },
80
+ "blocks": {
81
+ "<block_key>": {
82
+ "type": "<block_type>", // local: bare name; theme: zc_theme__<name>
83
+ "settings": {
84
+ // same field type rules as above
85
+ }
86
+ }
87
+ },
88
+ "block_order": ["<block_key>"]
89
+ }
90
+ },
91
+ "order": ["<section_key_1>", "<section_key_2>"]
92
+ }
93
+ ```
94
+
95
+ Rules for page JSON:
96
+ - `"order"` array must match the visual top-to-bottom order from the Figma page
97
+ - `"block_order"` must list all block keys in intended render order
98
+ - Use descriptive section keys (e.g. `"hero-banner"` not `"section1"`)
99
+ - Default values should be reasonable placeholder content, not lorem ipsum
100
+ - All `display_name` values in url/select/menu can use plain English (not t: keys) in page JSON
101
+
102
+ ---
103
+
104
+
105
+ ## Step 4 — Save
106
+ Write to: `pages/<page_name>.json`
107
+
108
+ If the file already exists → show a diff of changes and ask for confirmation before overwriting.
109
+
110
+ ---
111
+
112
+
113
+ ## Step 5 — Confirm
114
+ ```
115
+ ✅ Page JSON written: pages/<page_name>.json
116
+
117
+ SECTIONS INCLUDED (in order):
118
+ 1. header
119
+ 2. hero-banner
120
+ 3. category-grid
121
+ 4. featured-products
122
+ 5. footer
123
+
124
+ ⚠️ SKIPPED (not yet built):
125
+ - promotional-strip → build with /build-section <theme_name> promotional-strip
126
+
127
+ NEXT:
128
+ - Preview the page and run /qa-section on any sections that need adjustment
129
+ - Or proceed to the next page with /audit-page <theme_name> <next_page>
130
+ ```
@@ -0,0 +1,92 @@
1
+ ---
2
+
3
+ description: Audit a Figma page and produce a section build plan before writing any code
4
+ alwaysApply: false
5
+ ---
6
+
7
+
8
+ # /audit-page
9
+
10
+ Analyse a Figma page and produce a structured section inventory.
11
+ NO CODE is written during this command — only a build plan is produced.
12
+ The user reviews and approves the plan before any section is built.
13
+
14
+ ## Usage
15
+ ```
16
+ /audit-page <theme_name> <page_name>
17
+ ```
18
+ Provide the Figma page frame via MCP or screenshot when running.
19
+
20
+ ---
21
+
22
+
23
+ ## Step 1 — Read the Figma Page
24
+ Scan the full page layout top to bottom. Identify every distinct visual section/block.
25
+
26
+ For each section found, determine:
27
+ - **Section name** — descriptive slug (e.g. `hero-banner`, `category-grid`, `featured-products`)
28
+ - **Type** — `section` (full layout block) or `snippet` (reusable UI element)
29
+ - **Figma frame name** — the exact frame name in Figma
30
+ - **Reference match** — find the closest existing section in this theme:
31
+ - Scan `sections/` for a filename that matches the purpose
32
+ - If found → mark as REUSE with path
33
+ - If not found → mark as NEW
34
+
35
+ ---
36
+
37
+
38
+ ## Step 2 — Output Build Plan
39
+
40
+ Present the plan as a table. Do NOT write any code yet.
41
+
42
+ ```
43
+ Page: <page_name> — <theme_name>
44
+ Source: <Figma frame name>
45
+
46
+ SECTION BUILD PLAN
47
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
48
+ # | Section Name | Type | Figma Frame | Reference | Status
49
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
50
+ 1 | header | snippet | — | snippets/header.liquid | SHARED (skip)
51
+ 2 | hero-banner | section | Home/Hero | sections/banner.liquid | REUSE + REDESIGN
52
+ 3 | category-grid | section | Home/Categories | sections/category-grid.liquid | REUSE + REDESIGN
53
+ 4 | featured-products | section | Home/Featured | none found | NEW
54
+ 5 | promotional-strip | section | Home/Promo | sections/marquee.liquid | REUSE + REDESIGN
55
+ 6 | footer | section | — | sections/footer.liquid | REUSE + REDESIGN
56
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
57
+
58
+ SUMMARY
59
+ - SHARED (skip): 1 → already exists in snippets, no rebuild needed
60
+ - REUSE + REDESIGN: 4 → copy logic from reference, apply new Figma design
61
+ - NEW: 1 → build from scratch using schema.mdc + liquid.mdc
62
+
63
+ SUGGESTED BUILD ORDER: 2 → 3 → 5 → 4 → 6
64
+ (header is shared infrastructure, build last if changes needed)
65
+ ```
66
+
67
+ ---
68
+
69
+
70
+ ## Step 3 — Ask for Approval
71
+ After presenting the plan, ask:
72
+
73
+ ```
74
+ Does this section plan look correct?
75
+ - Reply YES to proceed to building sections one by one
76
+ - Reply EDIT to adjust any row before building
77
+ - Reply /build-section <number> to jump straight to a specific section
78
+ ```
79
+
80
+ Do NOT proceed to code until the user confirms.
81
+
82
+ ---
83
+
84
+
85
+ ## Step 4 — On Approval
86
+ Remind the user of the build command:
87
+ ```
88
+ Run: /build-section <theme_name> <section_name>
89
+
90
+ Work through sections in the suggested build order.
91
+ Each section will be built, reviewed, and confirmed before moving to the next.
92
+ ```