@zohofinance/commerce 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/README.md +59 -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 +136 -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,84 @@
1
+ ---
2
+ description: Audit a built section for schema correctness, token compliance, and empty states
3
+ alwaysApply: false
4
+ ---
5
+
6
+ # /qa-section
7
+
8
+ Audit a completed section. Run after every /build-section or /redesign-section.
9
+
10
+ ## Usage
11
+ ```
12
+ /qa-section <theme_name> <section_name>
13
+ ```
14
+
15
+ ---
16
+
17
+ ## Checks
18
+
19
+ ### Schema
20
+ - [ ] Every `section.settings.X` in Liquid has matching schema field
21
+ - [ ] url default → `{ "display_name": "t:...", "handle": "..." }` not `"/path"`
22
+ - [ ] image_picker default → `{ "url": "...", "enable_customisation": true }`
23
+ - [ ] select default → `{ "display_name": "t:...", "value": "..." }` not `"value"`
24
+ - [ ] menu default → `{ "display_name": "t:...", "handle": "..." }`
25
+ - [ ] All labels use `t:` keys — no hardcoded English
26
+ - [ ] padding_top and padding_bottom settings present
27
+ - [ ] At least one preset in `"presets": []`
28
+ - [ ] Heading/title fields and heading blocks use `text` — not `richtext`
29
+ - [ ] Body/description fields use `richtext` where needed; rendered with `| raw`
30
+
31
+ ### Liquid
32
+ - [ ] All loops have empty state `{% else %}` or `{% if size > 0 %}` guard
33
+ - [ ] All user output escaped: `{{ value | escape }}`
34
+ - [ ] Uses `{% render %}` not `{% include %}`
35
+ - [ ] Assigns in `{% liquid %}` block at top
36
+
37
+ ### CSS / Tokens
38
+ - [ ] No raw hex in inline styles → must use `var(--color-*)`
39
+ - [ ] No raw px font-size → must use Tailwind text classes
40
+ - [ ] `{% style %}` scoped to `#section-{{ section.id }}`
41
+ - [ ] **Tailwind vs style block:** Static values (fixed px, gap, font-size, border-radius, padding, margin) in `{% style %}` should be Tailwind classes on elements. Keep in `{% style %}` only: (1) dynamic schema values (e.g. `{{ section.settings.X }}px`), (2) CSS custom properties / theme variables, (3) state or selectors that need `#section-{{ section.id }}` (e.g. `.open`, `[aria-pressed="true"]`). If the section has many static rules in the style block, flag them and recommend refactoring (see action below).
42
+
43
+ ### Images
44
+ - [ ] All `<img>` have: src, alt, width, height, loading
45
+ - [ ] Above-fold: `loading="eager"`, all others: `loading="lazy"`
46
+ - [ ] src uses `{{ field.url }}` not `| img_url`
47
+
48
+ ### Accessibility
49
+ - [ ] All `<img>` have non-empty, meaningful `alt`
50
+ - [ ] Heading order: no skipped levels (e.g. h1 → h3)
51
+ - [ ] Form controls: associated `<label>` or `aria-label` / `aria-labelledby`; groups use `fieldset`/`legend` or `role="group"` + `aria-labelledby`
52
+ - [ ] No `outline: none` without a visible focus style on interactive elements
53
+ - [ ] Icon-only buttons/links have descriptive `aria-label`
54
+
55
+ ### Performance
56
+ - [ ] Above-the-fold images use `loading="eager"` and have width/height to avoid layout shift
57
+ - [ ] Other images use `loading="lazy"` and have width/height
58
+ - [ ] Flag very large image dimensions vs likely display size (suggest responsive/sizes if needed)
59
+
60
+ ---
61
+
62
+ ## Output Format
63
+ ```
64
+ QA REPORT — <section_name>.liquid
65
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
66
+ SCHEMA ✅ PASS / ❌ FAIL
67
+ LIQUID ✅ PASS / ❌ FAIL
68
+ CSS TOKENS ✅ PASS / ❌ FAIL
69
+ TAILWIND / STYLE ✅ PASS / ⚠️ REVIEW
70
+ IMAGES ✅ PASS / ❌ FAIL
71
+ ACCESSIBILITY ✅ PASS / ⚠️ REVIEW / ❌ FAIL
72
+ PERFORMANCE ✅ PASS / ⚠️ REVIEW / N/A
73
+
74
+ ISSUES:
75
+ ❌ [line X] description of issue → fix applied / needs your decision
76
+
77
+ AUTO-FIXED: [list]
78
+ NEEDS YOUR DECISION: [list]
79
+ ```
80
+
81
+ **TAILWIND / STYLE:** Pass when static styling is in Tailwind classes; Review when `{% style %}` contains many static rules (fixed px, gap, font-size, etc.) that could be Tailwind. In that case, add to NEEDS YOUR DECISION: *"Static styles in {% style %} — consider refactoring to Tailwind (run `/refactor-section <theme_name> <section_name>` with instruction 'use Tailwind classes for static styles', or move rules to Tailwind; keep in style block only dynamic schema values and state selectors)."*
82
+
83
+ Auto-fix unambiguous issues directly in the file.
84
+ Flag anything requiring a judgment call.
@@ -0,0 +1,48 @@
1
+ ---
2
+ description: QA every section in a theme (batch)
3
+ alwaysApply: false
4
+ ---
5
+
6
+ # /qa-sections
7
+
8
+ Run the same checks as `/qa-section` on **every section** in a theme. Use before release or after a large refactor.
9
+
10
+ ## Usage
11
+ ```
12
+ /qa-sections <theme_name>
13
+ ```
14
+
15
+ ---
16
+
17
+ ## Pre-flight
18
+
19
+ 1. List all `.liquid` files in `sections/` (exclude `.json` group files if present).
20
+ 2. For each section file (e.g. `product-details.liquid`), run the full qa-section logic: read section + all snippets it renders, then run Schema, Liquid, CSS/Token, Tailwind/Style, Images, Accessibility, Performance, JS checks.
21
+
22
+ ---
23
+
24
+ ## Output
25
+
26
+ Produce one report per section, then a **summary**:
27
+
28
+ ```
29
+ QA BATCH — <theme_name>
30
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
31
+
32
+ <section_1>.liquid SCHEMA ✅ LIQUID ✅ CSS ✅ TAILWIND ⚠️ IMAGES ✅ A11Y ✅ PERF ✅
33
+ <section_2>.liquid SCHEMA ✅ LIQUID ❌ CSS ✅ TAILWIND ✅ IMAGES ✅ A11Y ✅ PERF N/A
34
+ ...
35
+
36
+ SUMMARY
37
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
38
+ Sections: <n>
39
+ PASS (all rows ✅): <m>
40
+ REVIEW (at least one ⚠️): <k>
41
+ FAIL (at least one ❌): <j>
42
+
43
+ ISSUES BY SECTION:
44
+ <section_2>.liquid: [list of failures]
45
+ ...
46
+ ```
47
+
48
+ Optionally list only sections with at least one ❌ or ⚠️ to keep the report scannable. Suggest running `/qa-section <theme_name> <section_name>` on any failed or review sections for full detail.
@@ -0,0 +1,85 @@
1
+ ---
2
+ description: Run all QA and validation commands for an entire theme in one shot
3
+ alwaysApply: false
4
+ ---
5
+
6
+ # /qa-theme
7
+
8
+ Orchestrator command that runs every QA and validation check available for a theme. Use before release, after a large refactor, or when onboarding a new theme.
9
+
10
+ ## Usage
11
+ ```
12
+ /qa-theme <theme_name>
13
+ ```
14
+
15
+ ---
16
+
17
+ ## Execution Order
18
+
19
+ Run these checks in sequence. Each produces its own report; this command collates them into a single consolidated summary.
20
+
21
+ ### 1. Sections — `/qa-sections <theme_name>`
22
+ QA every `.liquid` section file: schema, Liquid, CSS/tokens, Tailwind, images, accessibility, performance.
23
+
24
+ ### 2. Theme Settings — `/validate-theme-settings <theme_name>`
25
+ Cross-check `settings/schema.json` vs `settings/theme.json` vs `i18n/en.schema.json` vs Liquid consumers.
26
+
27
+ ### 3. Layouts — `/qa-layout <theme_name>`
28
+ Audit all layout files: HTML structure, asset loading, section group refs, snippet refs, layout parity.
29
+
30
+ ### 4. Section Groups
31
+ List all `*-group.json` files in `sections/`.
32
+ For each, run `/validate-section-group <theme_name> <group_name>`.
33
+
34
+ ### 5. Pages
35
+ List all `.json` files in `pages/`.
36
+ For each, run `/validate-page <theme_name> <page_name>`.
37
+
38
+ ### 6. Translation Keys — `/qa-i18n <theme_name>`
39
+ Audit `t:` key coverage: missing keys, orphans, hardcoded English.
40
+
41
+ ---
42
+
43
+ ## Consolidated Report
44
+
45
+ ```
46
+ QA THEME — <theme_name>
47
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
48
+
49
+ MODULE STATUS ERRORS WARNINGS
50
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
51
+ Sections (<n> files) PASS/FAIL <n> <n>
52
+ Theme Settings PASS/FAIL <n> <n>
53
+ Layouts (<n> files) PASS/FAIL <n> <n>
54
+ Section Groups (<n>) PASS/FAIL <n> <n>
55
+ Pages (<n> files) PASS/FAIL <n> <n>
56
+ Translation Keys PASS/FAIL <n> <n>
57
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
58
+
59
+ OVERALL: PASS / FAIL
60
+
61
+ TOTAL ERRORS: <n>
62
+ TOTAL WARNINGS: <n>
63
+
64
+ TOP ISSUES (errors first, then warnings):
65
+ 1. ❌ [module] description
66
+ 2. ❌ [module] description
67
+ 3. ⚠️ [module] description
68
+ ...
69
+
70
+ RECOMMENDED NEXT STEPS:
71
+ - Fix ❌ errors before shipping
72
+ - Review ⚠️ warnings — fix or document as intentional
73
+ - For section issues: /fix-section <theme_name> <section_name>
74
+ - For settings issues: /add-theme-setting or manual edit
75
+ - For i18n issues: edit en.schema.json directly
76
+ ```
77
+
78
+ ---
79
+
80
+ ## Notes
81
+
82
+ - This command is read-only — it reports issues but does not auto-fix anything. Individual sub-commands (like `/qa-section`) may auto-fix within their own scope.
83
+ - For large themes (40+ sections), this may take several minutes. Each sub-command's progress is logged as it completes.
84
+ - If any sub-command fails to run (e.g. missing file), log the failure and continue with the remaining checks.
85
+ - After fixing issues, re-run `/qa-theme` to verify everything passes.
@@ -0,0 +1,177 @@
1
+ ---
2
+
3
+ description: Redesign an existing section from new Figma — preserve all logic, replace only HTML/CSS
4
+ alwaysApply: false
5
+ ---
6
+
7
+
8
+ # /redesign-section
9
+
10
+ Redesign an existing section using a new Figma frame.
11
+ ONLY HTML structure and CSS classes change.
12
+ Schema, Liquid logic, assigns, loops, and snippet calls are NEVER touched.
13
+
14
+ ## Usage
15
+ ```
16
+ /redesign-section <theme_name> <section_name>
17
+ ```
18
+
19
+ ---
20
+
21
+
22
+ ## Pre-flight
23
+ 1. Open `sections/<section_name>.liquid`
24
+ 2. Open all related snippets referenced via `{% render %}` in this section
25
+ 3. Open `figma-variables.json` — token values for this theme
26
+ 4. Read Figma frame from active Cursor MCP selection — see below
27
+
28
+ ## Figma Frame — via Cursor Figma MCP
29
+
30
+ Cursor reads the Figma frame from whatever is currently selected in the Figma app
31
+ via the Figma Dev Mode MCP plugin. The developer selects the redesigned frame in
32
+ Figma first, then runs this command in Cursor.
33
+
34
+
35
+ If no Figma MCP context is present in the conversation:
36
+ ```
37
+ ⚠️ No Figma frame data found.
38
+ Please:
39
+ 1. Open your Figma file in the browser
40
+ 2. Click on the new <section_name> frame
41
+ 3. Re-run this command in Cursor
42
+ ```
43
+
44
+ ---
45
+
46
+
47
+ ## Stage 1 — Snapshot What Must NOT Change
48
+ Before touching anything, extract and list:
49
+
50
+ ```
51
+ LOCKED (do not modify):
52
+ - Schema: all field IDs, types, defaults, labels
53
+ - {% liquid %} assign block: all variable names
54
+ - All {% if %} / {% unless %} / {% case %} logic
55
+ - All {% for %} loops and their variable names
56
+ - All {% render 'snippet-name' %} calls
57
+ - All JS web component tag names (e.g. <app-header>)
58
+ - {% style %} block dynamic values
59
+ - Script tags and asset references
60
+ ```
61
+
62
+ Print this list before proceeding. This is your protection layer.
63
+
64
+ ---
65
+
66
+
67
+ ## Stage 2 — Extract Detailed Design Spec from Figma
68
+
69
+ **Follow the Design Spec Extraction Protocol** in `.cursor/rules/design-spec-extraction.mdc`.
70
+
71
+ ### 2a. Resolve ALL var() values first
72
+ For every `var(--name, fallback)` in the Figma MCP data:
73
+ - Look up in `figma-variables.json` by path → use `$value` if present, fallback otherwise
74
+ - If neither → STOP and flag as unresolved
75
+
76
+ ### 2b. Extract EXACT values for EVERY visible element
77
+ Per TEXT: font-size (px → Tailwind), font-weight, line-height, letter-spacing, color (hex → CSS var), text-align
78
+ Per CONTAINER: layout, columns, gap (px → Tailwind), padding, margin, alignment, background (hex → CSS var)
79
+ Per IMAGE: width, height, aspect-ratio, object-fit, border-radius (px → Tailwind)
80
+ Per BUTTON: padding, font-size, font-weight, background, text-color, border, border-radius
81
+ Per CARD: padding, background, border, border-radius, shadow, internal layout, children
82
+
83
+ ### 2c. Extract responsive differences (if mobile frame available)
84
+
85
+ ### 2d. Produce the Design Spec Table
86
+ Every row = one element+property with exact Tailwind/CSS value.
87
+ Flag any NEW visual elements that don't exist in the current section as ADDITIONS.
88
+
89
+ ### Ignore
90
+ - Hidden layers
91
+ - Hover/focus/active states
92
+ - Absolute positions from auto-layout
93
+ - Placeholder text
94
+
95
+ ---
96
+
97
+
98
+ ## Stage 3 — Identify What Changes
99
+ Produce a change plan before editing:
100
+
101
+ ```
102
+ REDESIGN CHANGE PLAN — <section_name>
103
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
104
+ REMOVING:
105
+ - Old 2-column grid layout → replacing with 3-column
106
+ - Old heading class text-2xl → replacing with text-4xl font-bold
107
+ - Old card padding p-4 → replacing with p-6
108
+
109
+ KEEPING (unchanged):
110
+ - {% for product in products %} loop
111
+ - {% render 'product-card' %} call
112
+ - All schema fields
113
+ - {% style %} padding block
114
+
115
+ ADDING (new visual elements from Figma):
116
+ - Badge element above heading (new HTML only, no new schema field)
117
+ - Decorative divider between heading and grid
118
+
119
+ SCHEMA CHANGES: none
120
+ ```
121
+
122
+ Show this plan and ask: "Proceed with redesign?" before editing.
123
+
124
+ ---
125
+
126
+
127
+ ## Stage 4 — Apply Changes
128
+ Edit the file, replacing ONLY HTML wrapper elements and Tailwind classes.
129
+
130
+ Rules:
131
+ - Keep every Liquid tag exactly as-is — only wrap or restructure HTML around them
132
+ - Replace Tailwind classes using token map — never raw px or hex
133
+ - Colors → always `var(--color-*)`
134
+ - If a new visual element needs dynamic content → note it as:
135
+ `⚠️ New element found in Figma: needs schema field — run /add-field after redesign`
136
+ - Do NOT add schema fields during a redesign — keep scope clean
137
+
138
+ ---
139
+
140
+
141
+ ## Stage 5 — Self-Compare Against Design Spec + QA
142
+
143
+ ### 5a. Self-compare against the Design Spec Table from Stage 2d
144
+ For EVERY row in the spec table:
145
+ 1. Find the corresponding HTML element in the edited code
146
+ 2. Verify the Tailwind class / CSS variable matches EXACTLY
147
+ 3. If mismatch → fix immediately
148
+
149
+ ### 5b. Verify the locked list from Stage 1:
150
+ - [ ] All schema field IDs still present and unchanged
151
+ - [ ] All assign variable names unchanged
152
+ - [ ] All loops intact with empty state handling
153
+ - [ ] All {% render %} calls unchanged
154
+ - [ ] No raw hex or px values introduced
155
+ - [ ] No inline styles added except via var(--color-*)
156
+ - [ ] Responsive classes present for all mobile overrides in spec
157
+
158
+ ---
159
+
160
+
161
+ ## Output
162
+ ```
163
+ ✅ Redesign complete: sections/<section_name>.liquid
164
+
165
+ CHANGED:
166
+ - [list of HTML/class changes]
167
+
168
+ UNCHANGED (verified):
169
+ - Schema: ✅
170
+ - Liquid logic: ✅
171
+ - Snippet calls: ✅
172
+
173
+ ⚠️ NEW ELEMENTS FOUND IN FIGMA (need schema fields):
174
+ - Badge text above heading → run /add-field <theme_name> <section_name> after review
175
+
176
+ NEXT: Run /qa-section <theme_name> <section_name> to verify output
177
+ ```
@@ -0,0 +1,185 @@
1
+ ---
2
+ description: Refactor an existing section — structural HTML changes, schema updates, Tailwind classes, all in one pass
3
+ alwaysApply: false
4
+ ---
5
+
6
+ # /refactor-section
7
+
8
+ Full refactor of an existing section. Handles structural HTML changes, schema
9
+ additions/removals/renames/type changes, and Tailwind class updates in one pass.
10
+ Liquid logic and assigns are preserved unless a field rename directly requires updating them.
11
+
12
+ ## Usage
13
+ ```
14
+ /refactor-section <theme_name> <section_name>
15
+ ```
16
+
17
+ Provide instructions as plain text, a Figma frame via MCP, or both.
18
+
19
+ ---
20
+
21
+ ## Pre-flight — Read Everything First
22
+
23
+ Before making any changes, read ALL of these:
24
+
25
+ 1. `sections/<section_name>.liquid`
26
+ 2. Every snippet referenced via `{% render %}` — recursively
27
+ 3. `pages/*.json` — find any page JSON that references this section
28
+ 4. `figma-variables.json` — token values
29
+ 5. Figma MCP frame if available — read from active Cursor selection
30
+
31
+ ---
32
+
33
+ ## Stage 1 — Build Change List
34
+
35
+ From the developer's instructions and/or Figma frame, build a precise change list
36
+ before touching anything. Categorise every change:
37
+
38
+ ```
39
+ REFACTOR PLAN — <section_name>
40
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
41
+
42
+ SCHEMA CHANGES:
43
+ ADD:
44
+ - id: "subtitle", type: text, default: ""
45
+ - id: "show_divider", type: checkbox, default: false
46
+ REMOVE:
47
+ - id: "description" (currently used in HTML at line 24 — will be removed)
48
+ RENAME:
49
+ - id: "btn_text" → "cta_text" (update all Liquid references)
50
+ TYPE CHANGE:
51
+ - id: "body_text": text → richtext (update output filter: {{ }} → {{ | raw }})
52
+
53
+ HTML CHANGES:
54
+ - Wrap heading + subtitle in new <div class="flex flex-col gap-2">
55
+ - Replace 2-column grid with 3-column grid (grid-cols-2 → grid-cols-3)
56
+ - Add new divider element below heading (conditional on show_divider)
57
+ - Remove description block entirely
58
+
59
+ TAILWIND CHANGES:
60
+ - Section padding: px-4 → px-6 (from Figma / instruction)
61
+ - Heading: text-3xl → text-4xl font-bold
62
+
63
+ SNIPPETS AFFECTED:
64
+ - snippets/hero-card.liquid — uses renamed field "btn_text", needs update
65
+
66
+ PAGE JSON AFFECTED:
67
+ - pages/index.json — section "hero-banner" has "btn_text" key, needs rename
68
+
69
+ LIQUID LOGIC PRESERVED:
70
+ - {% for %} loop unchanged
71
+ - {% if section.settings.show_cta %} unchanged
72
+ - All {% render %} calls unchanged
73
+ ```
74
+
75
+ Print this plan, then proceed immediately without waiting for approval.
76
+
77
+ ---
78
+
79
+ ## Stage 2 — Apply Schema Changes
80
+
81
+ Edit the `{% schema %}` block:
82
+
83
+ ### Adding fields
84
+ Use your platform's custom schema syntax:
85
+ - `text` default → `"t:sections.<section>.settings.<id>.default"`
86
+ - `url` → `{ "display_name": "t:...", "handle": "/path" }`
87
+ - `image_picker` → `{ "url": "file.webp", "enable_customisation": true }`
88
+ - `select` default → `{ "display_name": "t:...", "value": "option-value" }`
89
+ - `range` default → plain number
90
+ - `checkbox` default → plain boolean
91
+ - `color` default → hex string
92
+
93
+ ### Removing fields
94
+ Remove the field object from schema.
95
+ Remove all `{{ section.settings.<id> }}` references from HTML.
96
+ Remove any `assign` statements that reference it.
97
+ Remove from page JSON default values.
98
+
99
+ ### Renaming field IDs
100
+ Update the schema `id` value.
101
+ Find and replace ALL Liquid references:
102
+ - `section.settings.old_id` → `section.settings.new_id`
103
+ - `assign var = section.settings.old_id` → updated
104
+ - Any snippet that receives this as a parameter → updated
105
+
106
+ ### Type changes
107
+ Update schema type.
108
+ Update output syntax if needed:
109
+ - `text` → `richtext`: only for body/description fields — change `{{ val | escape }}` to `{{ val | raw }}`
110
+ - `richtext` → `text`: only for heading/title fields — change `{{ val | raw }}` to `{{ val | escape }}`
111
+ - Do not use `richtext` for heading blocks or fields rendered in `<h1>`–`<h6>`
112
+ - `image_picker` → update src reference: `val.url` stays the same
113
+
114
+ ---
115
+
116
+ ## Stage 3 — Apply HTML + Tailwind Changes
117
+
118
+ Restructure HTML as instructed or per Figma frame.
119
+
120
+ Rules:
121
+ - Keep all Liquid tags exactly in place — only move or rewrap HTML around them
122
+ - All spacing/typography values → Tailwind classes from figma-variables.json
123
+ - Colors → always `var(--color-*)`, never raw hex
124
+ - New conditional elements → wrap in `{% if section.settings.<id> %}` using the new field
125
+
126
+ ---
127
+
128
+ ## Stage 4 — Update Affected Files
129
+
130
+ ### Snippets
131
+ For any snippet that uses a renamed or removed field:
132
+ - Update the parameter name passed via `{% render 'snippet', param: value %}`
133
+ - Update the internal reference inside the snippet file
134
+
135
+ ### Page JSON
136
+ For any page JSON that references this section:
137
+ - Rename keys that match renamed field IDs
138
+ - Remove keys for removed fields
139
+ - Add keys with default values for new fields
140
+
141
+ ---
142
+
143
+ ## Stage 5 — Self-QA
144
+
145
+ Before reporting done, verify:
146
+ - [ ] All new schema fields have correct custom syntax
147
+ - [ ] All removed fields have no remaining Liquid references
148
+ - [ ] All renamed fields updated everywhere — section, snippets, page JSON
149
+ - [ ] No raw hex or px values introduced
150
+ - [ ] No inline styles added
151
+ - [ ] All new conditional elements have matching schema fields
152
+ - [ ] i18n keys added for any new field labels (flag if not added)
153
+
154
+ ---
155
+
156
+ ## Output
157
+
158
+ ```
159
+ ✅ Refactor complete: <section_name>.liquid
160
+
161
+ SCHEMA:
162
+ Added: subtitle, show_divider
163
+ Removed: description
164
+ Renamed: btn_text → cta_text
165
+ Type changed: body_text text → richtext
166
+
167
+ HTML/CSS:
168
+ - 2-col grid → 3-col grid
169
+ - New subtitle element added
170
+ - Divider added (conditional on show_divider)
171
+ - Description block removed
172
+ - Heading: text-3xl → text-4xl font-bold
173
+
174
+ FILES CHANGED:
175
+ - sections/<section_name>.liquid
176
+ - snippets/hero-card.liquid
177
+ - pages/index.json
178
+
179
+ ⚠️ NEEDS ATTENTION:
180
+ - i18n keys needed for new fields: subtitle, show_divider
181
+ Run /add-field won't help here — add manually to i18n/en.json and en.schema.json
182
+ - Designer should confirm 3-col layout on mobile
183
+
184
+ NEXT: Run /qa-section <theme_name> <section_name>
185
+ ```