@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.
- package/README.md +61 -0
- package/package.json +2 -2
- package/ts-dist/mocks/init-theme/.claude/CLAUDE.md +6 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-section-from-design.20260528/SKILL.md +242 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-section-from-design.20260528/inputs/figma.md +81 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-section-from-design.20260528/inputs/screenshot.md +54 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-section-from-design.20260528/inputs/url.md +88 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-section-from-design.20260528/spec-table.md +102 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-section-from-design.20260528/verification/accessibility.md +110 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-section-from-design.20260528/verification/performance.md +127 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-section-from-design.20260528/verification/tokens.md +87 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-section-from-design.20260528/verification/visual-diff.md +123 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-theme-builder.20260528/SKILL.md +605 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-theme-builder.20260528/design-tokens.md +105 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-theme-builder.20260528/page-json-contract.md +58 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-theme-builder.20260528/qa-accessibility.md +35 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-theme-builder.20260528/reference-lookup.md +94 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-theme-builder.20260528/section-anatomy.md +109 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/SKILL.md +313 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/agent-hierarchy.md +142 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/ask-developer.md +113 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/bootstrap.md +260 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/build-metrics.md +89 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/code-quality.md +186 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/common-pages-agent.md +97 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/dev-server-and-urls.md +127 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/exemplars.md +79 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/figma-discovery.md +138 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/figma-extraction.md +132 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/image-sources.md +84 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/inputs/guidelines-frame.md +178 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/page-builder.md +322 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/page-orchestrator.md +199 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/parallel-fanout.md +152 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/scripts/a11y.mjs +129 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/scripts/lint-section.mjs +502 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/scripts/perf.mjs +134 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/scripts/pixel-diff.mjs +206 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/scripts/record-build-metrics.mjs +118 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/section-builder.md +131 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/subagent-escalation.md +75 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/transcription-rules.md +98 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/verification.md +227 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/visual-verify-loop.md +117 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/_index.md +4 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/assets.md +105 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/best-practices.md +212 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/custom-scripts.md +294 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/i18n.md +155 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/introduction.md +91 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/layouts.md +158 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/pages.md +156 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/reference/_index.md +4 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/reference/filters.md +419 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/reference/global-objects.md +415 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/reference/schema-types.md +926 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/reference/tags.md +259 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/sections.md +203 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/setup-guide.md +424 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/snippets.md +70 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/theme-structure.md +252 -0
- package/ts-dist/mocks/init-theme/.cursor/PLAYBOOK.md +144 -0
- package/ts-dist/mocks/init-theme/.cursor/README.md +6 -0
- package/ts-dist/mocks/init-theme/.cursor/agents/figma-desktop-mobile-parallel.md +48 -0
- package/ts-dist/mocks/init-theme/.cursor/agents/visual-compare.md +221 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/add-field.md +83 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/add-theme-setting.md +200 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/assemble-page.md +72 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/audit-page.md +57 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/build-page-sections.md +110 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/build-section.md +418 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/build-theme.md +307 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/compare-section.md +358 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/create-theme.md +77 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/extract-tokens.md +43 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/fix-section.md +92 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/impact.md +50 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/qa-a11y.md +66 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/qa-i18n.md +110 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/qa-layout.md +127 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/qa-performance.md +72 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/qa-section.md +84 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/qa-sections.md +48 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/qa-theme.md +85 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/redesign-section.md +177 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/refactor-section.md +185 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/sync-theme-settings.md +132 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/validate-page.md +60 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/validate-section-group.md +88 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/validate-theme-settings.md +119 -0
- package/ts-dist/mocks/init-theme/.cursor/examples/design-instructions-template.md +151 -0
- package/ts-dist/mocks/init-theme/.cursor/mcp.json +18 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/README.md +160 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/accessibility.mdc +24 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/add-field.mdc +222 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/add-theme-setting.mdc +39 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/assemble-page.mdc +130 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/audit-page.mdc +92 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/build-section.mdc +178 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/build-theme.mdc +47 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/compare-section.mdc +94 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/create-theme.mdc +78 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/css.mdc +137 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/design-spec-extraction.mdc +255 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/extract-tokens.mdc +43 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/figma-mcp-resolution.mdc +40 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/fix-section.mdc +154 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/general.mdc +30 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/i18n.mdc +85 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/javascript.mdc +85 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/liquid-no-hardcoded-strings.mdc +42 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/liquid.mdc +171 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/mobile-desktop-setting-meta.mdc +34 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/naming-convention.mdc +64 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/pages.mdc +120 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/performance.mdc +51 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/qa-section.mdc +134 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/redesign-section.mdc +147 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/schema-sync.mdc +110 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/schema.mdc +360 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/share-urls.mdc +68 -0
- package/ts-dist/mocks/init-theme/.cursor/skills/browser-verify.md +128 -0
- package/ts-dist/mocks/init-theme/.cursor/skills/design-tokens.md +105 -0
- package/ts-dist/mocks/init-theme/.cursor/skills/page-json-contract.md +87 -0
- package/ts-dist/mocks/init-theme/.cursor/skills/qa-accessibility.md +35 -0
- package/ts-dist/mocks/init-theme/.cursor/skills/reference-lookup.md +88 -0
- package/ts-dist/mocks/init-theme/.cursor/skills/section-anatomy.md +173 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
---
|
|
2
|
+
|
|
3
|
+
description: Audit a built section for schema correctness, token compliance, and empty states
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
# /qa-section
|
|
9
|
+
|
|
10
|
+
Audit a completed section file against all rules.
|
|
11
|
+
Run this after /build-section before moving to the next section.
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
```
|
|
15
|
+
/qa-section <theme_name> <section_name>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
## Pre-flight — Files to Read Automatically
|
|
22
|
+
|
|
23
|
+
Before running any checks, read ALL of these without being asked:
|
|
24
|
+
|
|
25
|
+
1. `sections/<section_name>.liquid` — the section file
|
|
26
|
+
2. Every snippet referenced via `{% render 'snippet-name' %}` inside the section
|
|
27
|
+
- Read `snippets/<snippet-name>.liquid` for each one
|
|
28
|
+
- Repeat recursively — if a snippet renders another snippet, read that too
|
|
29
|
+
3. `figma-variables.json` — to verify token usage and resolve Figma MCP variables when applicable
|
|
30
|
+
|
|
31
|
+
Never ask the developer to paste file contents — read them directly from the workspace.
|
|
32
|
+
Apply all checks below to the section file AND every snippet found.
|
|
33
|
+
When reporting issues, always prefix with the filename:
|
|
34
|
+
`[hero-banner.liquid line 23]` or `[product-card.liquid line 8]`
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
## Checks
|
|
40
|
+
|
|
41
|
+
### Schema Checks
|
|
42
|
+
- [ ] Every `section.settings.X` referenced in Liquid has a matching field in `{% schema %}`
|
|
43
|
+
- [ ] Every schema field uses correct custom syntax (not standard Shopify)
|
|
44
|
+
- url → `{ "display_name": "t:...", "handle": "..." }` not `"/path"`
|
|
45
|
+
- image_picker → `{ "url": "...", "enable_customisation": true }` not `"/image.jpg"`
|
|
46
|
+
- media_picker (video) → `{ "url": "video.mp4", "is_video": true }`
|
|
47
|
+
- select default → `{ "display_name": "t:...", "value": "..." }` not `"value"`
|
|
48
|
+
- menu → `{ "display_name": "t:...", "handle": "..." }`
|
|
49
|
+
- [ ] All labels use `t:` translation keys — no hardcoded English strings
|
|
50
|
+
- [ ] All defaults use `t:` translation keys where applicable
|
|
51
|
+
- [ ] Schema has `padding_top` and `padding_bottom` range settings
|
|
52
|
+
- [ ] Schema has at least one entry in `"presets": []`
|
|
53
|
+
- [ ] If blocks are used: `"block_order"` exists and matches block keys
|
|
54
|
+
- [ ] Local blocks: `type` is bare name; settings schema inline in section `{% schema %}`
|
|
55
|
+
- [ ] Theme blocks: `type` is `zc_theme__<name>`; section schema opts in via `@theme` or specific entry; `blocks/<name>.liquid` exists with `"presets"`
|
|
56
|
+
- [ ] Theme-block sections render with `{% render_blocks %}` or mixed sections delegate via `{% render block %}`
|
|
57
|
+
- [ ] Heading/title fields and heading blocks use `text` — not `richtext`
|
|
58
|
+
- [ ] Body/description fields use `richtext` where multi-line formatting is needed; rendered with `| raw`
|
|
59
|
+
|
|
60
|
+
### Liquid Checks
|
|
61
|
+
- [ ] All loops have empty state `{% else %}` or `{% if size > 0 %}` guard
|
|
62
|
+
- [ ] All user output is escaped: `{{ value | escape }}`
|
|
63
|
+
- [ ] Uses `{% render %}` not `{% include %}`
|
|
64
|
+
- [ ] Dynamic values are assigned via `{% liquid assign %}` block at top
|
|
65
|
+
- [ ] Section is wrapped with `id="section-{{ section.id }}"`
|
|
66
|
+
|
|
67
|
+
### CSS / Token Checks
|
|
68
|
+
- [ ] No raw hex color values in inline styles → must use `var(--color-*)`
|
|
69
|
+
- [ ] No raw px font-size in inline styles → must use Tailwind text classes
|
|
70
|
+
- [ ] Spacing uses Tailwind classes not inline px (except via `{% style %}` block)
|
|
71
|
+
- [ ] `{% style %}` block scopes rules to `#section-{{ section.id }}`
|
|
72
|
+
- [ ] **Tailwind vs style block:** Static values in `{% style %}` (fixed px, gap, font-size, border-radius, padding, margin, line-height) should be implemented as Tailwind classes on the elements. Use `{% style %}` only for: (1) **dynamic** values from section/block settings (e.g. `{{ section.settings.padding_top }}px`, `{{ section_settings.gap }}px`), (2) CSS custom properties / theme variables, (3) **state or complex selectors** that require `#section-{{ section.id }}` (e.g. `.open`, `[aria-pressed="true"]`, `.productimage.active`). If the section has many static rules in the style block, report **TAILWIND / STYLE ⚠️ REVIEW** and add to "Remaining issues": *"Static styles in {% style %} — consider refactoring to Tailwind (run /refactor-section <theme_name> <section_name> or move rules to Tailwind classes; keep in style block only dynamic schema values and state selectors)."*
|
|
73
|
+
|
|
74
|
+
### Image Checks
|
|
75
|
+
- [ ] All `<img>` tags have: `src`, `alt`, `width`, `height`, `loading` attributes
|
|
76
|
+
- [ ] Above-the-fold images use `loading="eager"`, all others `loading="lazy"`
|
|
77
|
+
- [ ] Image src uses `{{ section.settings.field.url }}` not `| img_url`
|
|
78
|
+
|
|
79
|
+
### Accessibility Checks
|
|
80
|
+
- [ ] All `<img>` have non-empty, meaningful `alt`
|
|
81
|
+
- [ ] Heading order: no skipped levels (e.g. h1 → h3)
|
|
82
|
+
- [ ] Form controls: `<label>` or `aria-label` / `aria-labelledby`; groups use `fieldset`/`legend` or `role="group"` + `aria-labelledby`
|
|
83
|
+
- [ ] No `outline: none` without visible focus style on interactive elements
|
|
84
|
+
- [ ] Icon-only buttons/links have descriptive `aria-label`
|
|
85
|
+
|
|
86
|
+
### Performance Checks
|
|
87
|
+
- [ ] Above-the-fold images: `loading="eager"`, width/height to avoid layout shift
|
|
88
|
+
- [ ] Other images: `loading="lazy"`, width/height; flag very large dimensions vs display size
|
|
89
|
+
|
|
90
|
+
### HTML Validity Checks
|
|
91
|
+
- [ ] No nested `<form>` elements — if a section wraps content in a `<form>`, verify that no rendered snippets (e.g. product-card, add-to-cart) also output `<form>` tags inside it. Browsers silently drop inner `<form>` tags, breaking JS that queries by form class/ID. Fix: close the outer `<form>` before the region that renders inner forms, or convert inner forms to `<div>` with JS-only submission.
|
|
92
|
+
- [ ] No `<a>` nested inside `<a>` — interactive elements must not be nested
|
|
93
|
+
- [ ] No block elements (`<div>`, `<p>`, `<form>`) inside inline elements (`<span>`, `<a>` in inline context)
|
|
94
|
+
- [ ] All opened tags are closed; verify structural balance of conditional blocks (`{% if %}...{% endif %}`) that emit opening/closing tags
|
|
95
|
+
|
|
96
|
+
### JS Checks
|
|
97
|
+
- [ ] If a JS component is used, script tag exists with `defer`
|
|
98
|
+
- [ ] Script uses `{{ 'filename.js' | asset_url }}`
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
## Output Format
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
QA REPORT — <section_name>.liquid
|
|
107
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
108
|
+
|
|
109
|
+
SCHEMA ✅ PASS / ❌ FAIL
|
|
110
|
+
LIQUID ✅ PASS / ❌ FAIL
|
|
111
|
+
CSS TOKENS ✅ PASS / ❌ FAIL
|
|
112
|
+
TAILWIND / STYLE ✅ PASS / ⚠️ REVIEW
|
|
113
|
+
IMAGES ✅ PASS / ❌ FAIL
|
|
114
|
+
ACCESSIBILITY ✅ PASS / ⚠️ REVIEW / ❌ FAIL
|
|
115
|
+
PERFORMANCE ✅ PASS / ⚠️ REVIEW / N/A
|
|
116
|
+
HTML VALIDITY ✅ PASS / ❌ FAIL
|
|
117
|
+
JS ✅ PASS / N/A
|
|
118
|
+
|
|
119
|
+
ISSUES FOUND:
|
|
120
|
+
❌ [line X] section.settings.cta_url rendered as .handle but schema uses type "text" — should be type "url"
|
|
121
|
+
❌ [line X] Hardcoded color #1a1a1a found — replace with var(--color-heading)
|
|
122
|
+
⚠️ [line X] Loop has no empty state fallback
|
|
123
|
+
|
|
124
|
+
AUTO-FIXING issues that are unambiguous...
|
|
125
|
+
[list of fixes applied]
|
|
126
|
+
|
|
127
|
+
Remaining issues require manual review:
|
|
128
|
+
[list of issues that need human decision]
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
**TAILWIND / STYLE:** Mark **✅ PASS** when most styling is in Tailwind and `{% style %}` contains only dynamic schema values and state/selector rules. Mark **⚠️ REVIEW** when `{% style %}` contains many static rules (fixed px, gap, font-size, border-radius, padding, margin, line-height) that could be Tailwind classes; then add to "Remaining issues" the recommendation to refactor (run `/refactor-section <theme_name> <section_name>` with instruction "use Tailwind classes for static styles", or move static rules to Tailwind; keep in style block only dynamic values and state selectors).
|
|
132
|
+
|
|
133
|
+
Auto-fix unambiguous issues directly in the file.
|
|
134
|
+
Flag anything that requires a judgment call for the developer to resolve.
|
|
@@ -0,0 +1,147 @@
|
|
|
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
|
+
Provide the updated Figma frame via MCP or screenshot.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
## Pre-flight
|
|
24
|
+
1. Open `sections/<section_name>.liquid`
|
|
25
|
+
2. Open all related snippets referenced via `{% render %}` in this section
|
|
26
|
+
3. Confirm Figma frame is available
|
|
27
|
+
4. Check `figma-variables.json` exists
|
|
28
|
+
- If missing → STOP, tell user to run `/extract-tokens` or add the designer-exported file first
|
|
29
|
+
5. **When using Figma MCP:** resolve every `var(--name, fallback)` via `figma-variables.json` first (path by `/`; use `$value` if present, else fallback). See `.cursor/rules/figma-mcp-resolution.mdc`.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
## Stage 1 — Snapshot What Must NOT Change
|
|
35
|
+
Before touching anything, extract and list:
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
LOCKED (do not modify):
|
|
39
|
+
- Schema: all field IDs, types, defaults, labels
|
|
40
|
+
- {% liquid %} assign block: all variable names
|
|
41
|
+
- All {% if %} / {% unless %} / {% case %} logic
|
|
42
|
+
- All {% for %} loops and their variable names
|
|
43
|
+
- All {% render 'snippet-name' %} calls
|
|
44
|
+
- All JS web component tag names (e.g. <app-header>)
|
|
45
|
+
- {% style %} block dynamic values
|
|
46
|
+
- Script tags and asset references
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Print this list before proceeding. This is your protection layer.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
## Stage 2 — Read Figma Frame
|
|
55
|
+
Extract ONLY visual/layout information. **Resolve all var() from Figma MCP using figma-variables.json first** (see figma-mcp-resolution.mdc): look up variable name path in `figma-variables.json`; use `$value` if present, else MCP fallback.
|
|
56
|
+
|
|
57
|
+
### Use
|
|
58
|
+
- Layout direction (row / column / grid)
|
|
59
|
+
- Number of columns, grid gaps
|
|
60
|
+
- Element hierarchy and nesting
|
|
61
|
+
- Typography → resolve from JSON then map via figma-variables.json / Tailwind
|
|
62
|
+
- Colors → resolve from JSON then map to CSS variables
|
|
63
|
+
- Spacing → resolve from JSON then map to Tailwind classes
|
|
64
|
+
- Border radius, shadows → resolve from JSON then map via figma-variables.json
|
|
65
|
+
- New visual elements that didn't exist before → flag as ADDITIONS
|
|
66
|
+
|
|
67
|
+
### Ignore
|
|
68
|
+
- Hidden layers
|
|
69
|
+
- Hover/focus/active states
|
|
70
|
+
- Absolute positions from auto-layout
|
|
71
|
+
- Placeholder text
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
## Stage 3 — Identify What Changes
|
|
77
|
+
Produce a change plan before editing:
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
REDESIGN CHANGE PLAN — <section_name>
|
|
81
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
82
|
+
REMOVING:
|
|
83
|
+
- Old 2-column grid layout → replacing with 3-column
|
|
84
|
+
- Old heading class text-2xl → replacing with text-4xl font-bold
|
|
85
|
+
- Old card padding p-4 → replacing with p-6
|
|
86
|
+
|
|
87
|
+
KEEPING (unchanged):
|
|
88
|
+
- {% for product in products %} loop
|
|
89
|
+
- {% render 'product-card' %} call
|
|
90
|
+
- All schema fields
|
|
91
|
+
- {% style %} padding block
|
|
92
|
+
|
|
93
|
+
ADDING (new visual elements from Figma):
|
|
94
|
+
- Badge element above heading (new HTML only, no new schema field)
|
|
95
|
+
- Decorative divider between heading and grid
|
|
96
|
+
|
|
97
|
+
SCHEMA CHANGES: none
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Show this plan and ask: "Proceed with redesign?" before editing.
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
## Stage 4 — Apply Changes
|
|
106
|
+
Edit the file, replacing ONLY HTML wrapper elements and Tailwind classes.
|
|
107
|
+
|
|
108
|
+
Rules:
|
|
109
|
+
- Keep every Liquid tag exactly as-is — only wrap or restructure HTML around them
|
|
110
|
+
- Replace Tailwind classes using token map — never raw px or hex
|
|
111
|
+
- Colors → always `var(--color-*)`
|
|
112
|
+
- If a new visual element needs dynamic content → note it as:
|
|
113
|
+
`⚠️ New element found in Figma: needs schema field — run /add-field after redesign`
|
|
114
|
+
- Do NOT add schema fields during a redesign — keep scope clean
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
## Stage 5 — Self-QA
|
|
120
|
+
After editing, verify the locked list from Stage 1:
|
|
121
|
+
- [ ] All schema field IDs still present and unchanged
|
|
122
|
+
- [ ] All assign variable names unchanged
|
|
123
|
+
- [ ] All loops intact with empty state handling
|
|
124
|
+
- [ ] All {% render %} calls unchanged
|
|
125
|
+
- [ ] No raw hex or px values introduced
|
|
126
|
+
- [ ] No inline styles added except via var(--color-*)
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
## Output
|
|
132
|
+
```
|
|
133
|
+
✅ Redesign complete: sections/<section_name>.liquid
|
|
134
|
+
|
|
135
|
+
CHANGED:
|
|
136
|
+
- [list of HTML/class changes]
|
|
137
|
+
|
|
138
|
+
UNCHANGED (verified):
|
|
139
|
+
- Schema: ✅
|
|
140
|
+
- Liquid logic: ✅
|
|
141
|
+
- Snippet calls: ✅
|
|
142
|
+
|
|
143
|
+
⚠️ NEW ELEMENTS FOUND IN FIGMA (need schema fields):
|
|
144
|
+
- Badge text above heading → run /add-field <theme_name> <section_name> after review
|
|
145
|
+
|
|
146
|
+
NEXT: Run /qa-section <theme_name> <section_name> to verify output
|
|
147
|
+
```
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Every schema setting (section, block, or theme) must be reflected as a default value in the corresponding JSON file.
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Schema Sync — Settings Must Match JSON Defaults
|
|
7
|
+
|
|
8
|
+
Any time a setting is added or changed in a schema, the corresponding JSON file **must** be updated in the same step. There are three layers, each with its own target file.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## 1. Section settings → `pages/*.json`
|
|
13
|
+
|
|
14
|
+
Settings defined directly on a section must appear under `"settings"` for that section entry in the page JSON.
|
|
15
|
+
|
|
16
|
+
```json
|
|
17
|
+
// ✅ pages/blog.json
|
|
18
|
+
"blog_page": {
|
|
19
|
+
"type": "blog-page",
|
|
20
|
+
"settings": {
|
|
21
|
+
"title_font_size_mobile": { "display_name": "Medium", "value": "md" },
|
|
22
|
+
"title_font_size_desktop": { "display_name": "Medium", "value": "md" }
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 2. Block settings → `pages/*.json` (under the block)
|
|
30
|
+
|
|
31
|
+
Block settings in page JSON appear under `"blocks"` → the block key → `"settings"`. The schema source depends on the block model:
|
|
32
|
+
|
|
33
|
+
| Block model | Schema lives in | Page JSON `type` |
|
|
34
|
+
|-------------|----------------|------------------|
|
|
35
|
+
| **Local** | Section `{% schema %}` | bare name, e.g. `"product-title"` |
|
|
36
|
+
| **Theme** | `blocks/<name>.liquid` | `zc_theme__<name>`, e.g. `"zc_theme__text"` |
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
// ✅ Local block — pages/product.json
|
|
40
|
+
"main": {
|
|
41
|
+
"type": "product-details",
|
|
42
|
+
"blocks": {
|
|
43
|
+
"product-title": {
|
|
44
|
+
"type": "product-title",
|
|
45
|
+
"settings": {
|
|
46
|
+
"title_font_size_mobile": { "display_name": "Medium", "value": "md" },
|
|
47
|
+
"title_font_size_desktop": { "display_name": "Medium", "value": "md" }
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"block_order": ["product-title"]
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
```json
|
|
56
|
+
// ✅ Theme block — pages/index.json
|
|
57
|
+
"hero": {
|
|
58
|
+
"type": "shop-now-banner",
|
|
59
|
+
"blocks": {
|
|
60
|
+
"hero-heading": {
|
|
61
|
+
"type": "zc_theme__text",
|
|
62
|
+
"settings": {
|
|
63
|
+
"text": "<p>Welcome</p>",
|
|
64
|
+
"desktop_text_size": { "display_name": "Large", "value": "text-4xl" }
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"block_order": ["hero-heading"]
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Nested theme blocks: child block settings sync under the parent block instance's `"blocks"` → child key → `"settings"`, matching the parent block file's `{% schema %}`.
|
|
73
|
+
|
|
74
|
+
When adding a setting to a **theme block**, update `blocks/<name>.liquid` schema **and** any page JSON / section preset that instantiates that block type.
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## 3. Theme settings → `settings/theme.json`
|
|
79
|
+
|
|
80
|
+
Settings defined in `settings/schema.json` (global theme settings) must have a matching key inside `presets.Default` in `settings/theme.json`.
|
|
81
|
+
|
|
82
|
+
- `select` → `{ "value": "...", "display_name": "..." }`
|
|
83
|
+
- `color` → hex string e.g. `"#FFFFFF"`
|
|
84
|
+
- `range` → number e.g. `0`
|
|
85
|
+
|
|
86
|
+
```json
|
|
87
|
+
// ✅ settings/theme.json
|
|
88
|
+
{
|
|
89
|
+
"presets": {
|
|
90
|
+
"Default": {
|
|
91
|
+
"primary_font_family": { "value": "Poppins", "display_name": "Poppins" },
|
|
92
|
+
"background_color": "#FFFFFF",
|
|
93
|
+
"page_width": 1496
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Value format reference
|
|
102
|
+
|
|
103
|
+
| Setting type | Format in JSON |
|
|
104
|
+
|---|---|
|
|
105
|
+
| `select` | `{ "display_name": "Label", "value": "raw-value" }` |
|
|
106
|
+
| `color` | `"#RRGGBB"` |
|
|
107
|
+
| `range` | number |
|
|
108
|
+
| `text` / `richtext` | plain string |
|
|
109
|
+
| `checkbox` | `true` / `false` |
|
|
110
|
+
| `blog` / `url` | `{ "display_name": "", "handle": "" }` |
|