@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,83 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Add a new setting/field to an existing section — updates section, page JSON, and snippets
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /add-field
|
|
7
|
+
|
|
8
|
+
Add a new setting to an existing section. Updates all affected files.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
```
|
|
12
|
+
/add-field <theme_name> <section_name>
|
|
13
|
+
```
|
|
14
|
+
Describe: what the field controls, type, where it appears visually.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Pre-flight
|
|
19
|
+
Open: section file, page JSON that uses it, related snippets.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Stage 1 — Determine Field Spec
|
|
24
|
+
State before editing:
|
|
25
|
+
```
|
|
26
|
+
FIELD SPEC
|
|
27
|
+
━━━━━━━━━━━━━━━━━━━━━━
|
|
28
|
+
Type: [text/richtext/url/image_picker/select/checkbox/range/color/menu]
|
|
29
|
+
ID: [snake_case_id]
|
|
30
|
+
Level: [section setting / block setting — which block type]
|
|
31
|
+
Label key: t:sections.<n>.settings.<id>.label
|
|
32
|
+
Default: [correct format for type]
|
|
33
|
+
Renders at: [line / location in HTML]
|
|
34
|
+
Schema after: [existing field it goes after]
|
|
35
|
+
```
|
|
36
|
+
Ask: "Proceed?" before editing.
|
|
37
|
+
|
|
38
|
+
**Choose `text` vs `richtext`:**
|
|
39
|
+
- Renders in `<h1>`–`<h6>` or as title/eyebrow/badge/button label → `text`
|
|
40
|
+
- Renders as paragraph, description, or multi-line body copy → `richtext`
|
|
41
|
+
- Heading blocks must never use `richtext`
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Stage 2 — Update Schema
|
|
46
|
+
Add field using correct custom syntax:
|
|
47
|
+
|
|
48
|
+
- text: `{ "type": "text", "id": "x", "label": "t:...", "default": "t:..." }` — headings, titles, labels
|
|
49
|
+
- richtext: `{ "type": "richtext", "id": "x", "label": "t:...", "default": "<p>t:...</p>" }` — descriptions, body copy
|
|
50
|
+
- url: `{ "type": "url", "id": "x", "label": "t:...", "default": { "display_name": "t:...", "handle": "/" } }`
|
|
51
|
+
- image_picker: `{ "type": "image_picker", "id": "x", "label": "t:...", "default": { "url": "placeholder.webp", "enable_customisation": true } }`
|
|
52
|
+
- select: `{ "type": "select", "id": "x", "label": "t:...", "options": [...], "default": { "display_name": "t:...", "value": "option" } }`
|
|
53
|
+
- checkbox: `{ "type": "checkbox", "id": "x", "label": "t:...", "default": false }`
|
|
54
|
+
- range: `{ "type": "range", "id": "x", "min": 0, "max": 100, "step": 4, "unit": "px", "default": 40, "label": "t:..." }`
|
|
55
|
+
- color: `{ "type": "color", "id": "x", "label": "t:...", "default": "#000000" }`
|
|
56
|
+
- menu: `{ "type": "menu", "id": "x", "label": "t:...", "default": { "display_name": "t:...", "handle": "" } }`
|
|
57
|
+
|
|
58
|
+
## Stage 3 — Add Liquid Assign
|
|
59
|
+
Add to `{% liquid %}` block:
|
|
60
|
+
- text/range/color/checkbox → `assign x = section.settings.x`
|
|
61
|
+
- url/menu → `assign x = section.settings.x` (render as `{{ x.handle }}`)
|
|
62
|
+
- select → `assign x = section.settings.x` (render as `{{ x.value }}`)
|
|
63
|
+
- image → `assign x = section.settings.x` (render as `{{ x.url }}`)
|
|
64
|
+
|
|
65
|
+
Wrap optional fields: `{% if x != blank %}...{% endif %}`
|
|
66
|
+
|
|
67
|
+
## Stage 4 — Update Page JSON
|
|
68
|
+
Add field with correct inline value format to the relevant section in page JSON.
|
|
69
|
+
|
|
70
|
+
## Stage 5 — Update Snippets
|
|
71
|
+
If field value is passed to a `{% render %}` call → update the snippet too.
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Output
|
|
76
|
+
List all files changed, lines modified.
|
|
77
|
+
Always remind:
|
|
78
|
+
```
|
|
79
|
+
⚠️ Add translation keys to i18n/en.schema.json:
|
|
80
|
+
"t:sections.<n>.settings.<id>.label": "Your Label"
|
|
81
|
+
"t:sections.<n>.settings.<id>.default": "Default Text"
|
|
82
|
+
```
|
|
83
|
+
→ NEXT: `/qa-section <theme_name> <section_name>`
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Add a new global or component setting to theme schema + theme.json + i18n
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /add-theme-setting
|
|
7
|
+
|
|
8
|
+
Add one or more fields to **theme-level** settings (`settings/schema.json`), defaults in **`settings/theme.json`**, and translation keys in **`i18n/en.schema.json`**.
|
|
9
|
+
|
|
10
|
+
Use this for product card options, view transitions, blog card defaults, navigation behaviour, etc.
|
|
11
|
+
**Not** for section `{% schema %}` — use `/add-field` for sections.
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
```
|
|
15
|
+
/add-theme-setting <theme_name>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Describe in chat:
|
|
19
|
+
|
|
20
|
+
- **Group:** which settings block to extend, e.g. `theme` (main theme + product card block), `social_media`, `message_bar`, or **new group** name slug (e.g. `view_transitions`).
|
|
21
|
+
- **Meta (for new group only):** `global_settings` (token-sync candidate) or `component_settings` (merchant/feature toggles, not overwritten by `/sync-theme-settings`).
|
|
22
|
+
- **Field(s):** type, id (`snake_case`), label meaning, default, min/max/step for range, options for select.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Pre-flight
|
|
27
|
+
|
|
28
|
+
1. Read `settings/schema.json` — list top-level groups (`name`, `meta`, `settings` length).
|
|
29
|
+
2. Read `settings/theme.json` — note every key under `presets` (update **all** presets with the new key so nothing breaks).
|
|
30
|
+
3. Read `i18n/en.schema.json` — find matching `settings_schema.<group_slug>` for label paths.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Stage 1 — Theme field spec (before editing)
|
|
35
|
+
|
|
36
|
+
Print and confirm:
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
THEME FIELD SPEC
|
|
40
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
41
|
+
Theme: <theme_name>
|
|
42
|
+
Group: <existing group slug OR new: view_transitions>
|
|
43
|
+
Meta: <component_settings | global_settings> (new groups only)
|
|
44
|
+
Fields:
|
|
45
|
+
1. id: enable_view_transitions | type: checkbox | default: false
|
|
46
|
+
2. id: page_transition_style | type: select | options: none, fade, slide
|
|
47
|
+
Label keys: t:settings_schema.<group>.settings.<id>.label
|
|
48
|
+
(+ options__N for select)
|
|
49
|
+
theme.json: Add key + default to EVERY preset under presets.{}
|
|
50
|
+
Proceed? [y]
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**Id rules:** unique across **all** presets’ keys in `theme.json` (flat merge of settings from every group).
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Stage 2 — Update `settings/schema.json`
|
|
58
|
+
|
|
59
|
+
### Existing group
|
|
60
|
+
|
|
61
|
+
Insert the new field object into that group’s `settings` array (after a related field or before closing). Use correct types:
|
|
62
|
+
|
|
63
|
+
| Type | Schema shape |
|
|
64
|
+
|------|----------------|
|
|
65
|
+
| `text` | `id`, `label` (t:), optional `placeholder` (t:) |
|
|
66
|
+
| `checkbox` | `id`, `label` (t:), `default` boolean in schema |
|
|
67
|
+
| `range` | `id`, `label` (t:), `min`, `max`, `step`, `unit`, `default` number |
|
|
68
|
+
| `color` | `id`, `label` (t:), `default` hex |
|
|
69
|
+
| `select` | `id`, `label` (t:), `options` array `{ "value", "label": "t:..." }`, `default` `{ "value", "label": "t:...options__N..." }` matching first option’s label key |
|
|
70
|
+
| `header` | `type: "header"`, `content`: "t:..." (section divider in UI) |
|
|
71
|
+
|
|
72
|
+
Match existing theme patterns (see `settings/schema.json`).
|
|
73
|
+
|
|
74
|
+
### New group
|
|
75
|
+
|
|
76
|
+
Append a new object to the root array:
|
|
77
|
+
|
|
78
|
+
```json
|
|
79
|
+
{
|
|
80
|
+
"name": "t:settings_schema.<group_slug>.name",
|
|
81
|
+
"settings": [
|
|
82
|
+
{ "type": "header", "content": "t:settings_schema.<group_slug>.settings.section_header.content" },
|
|
83
|
+
{ ...fields... }
|
|
84
|
+
],
|
|
85
|
+
"meta": "component_settings"
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
- **`global_settings`** — only if the field should be updated from Figma via `/sync-theme-settings` (then add mapping in that command’s doc).
|
|
90
|
+
- **`component_settings`** — default for feature toggles, transitions, card layout options not driven by token export.
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Stage 3 — Update `settings/theme.json`
|
|
95
|
+
|
|
96
|
+
For **each** key in `presets` (e.g. `Default` and any others):
|
|
97
|
+
|
|
98
|
+
- Add the new setting id with the correct inline value:
|
|
99
|
+
- checkbox → `true` / `false`
|
|
100
|
+
- range/number → number
|
|
101
|
+
- color → `"#RRGGBB"`
|
|
102
|
+
- select → `{ "value": "none", "label": "t:settings_schema.<group>.settings.<id>.options__1.label" }` (same shape as existing selects)
|
|
103
|
+
- text → `""` or default string
|
|
104
|
+
|
|
105
|
+
Never remove or rename unrelated keys.
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Stage 4 — Update `i18n/en.schema.json`
|
|
110
|
+
|
|
111
|
+
Under `settings_schema`, ensure the group exists:
|
|
112
|
+
|
|
113
|
+
**Existing group** (e.g. `theme`): add under `settings.<id>`:
|
|
114
|
+
|
|
115
|
+
```json
|
|
116
|
+
"<id>": {
|
|
117
|
+
"label": "Human-readable label"
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
For **select**, add `options__1`, `options__2`, … under that id.
|
|
122
|
+
|
|
123
|
+
**New group** `<group_slug>`:
|
|
124
|
+
|
|
125
|
+
```json
|
|
126
|
+
"<group_slug>": {
|
|
127
|
+
"name": "View transitions",
|
|
128
|
+
"settings": {
|
|
129
|
+
"section_header": { "content": "Animations" },
|
|
130
|
+
"enable_view_transitions": { "label": "Enable view transitions" },
|
|
131
|
+
"page_transition_style": {
|
|
132
|
+
"label": "Page transition",
|
|
133
|
+
"options__1": { "label": "None" },
|
|
134
|
+
"options__2": { "label": "Fade" },
|
|
135
|
+
"options__3": { "label": "Slide" }
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
All schema `label` / `content` / `placeholder` fields must still use **`t:`** keys pointing to these paths (e.g. `t:settings_schema.view_transitions.settings.enable_view_transitions.label`).
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## Stage 5 — Wire-up (**required** unless user says **schema only**)
|
|
146
|
+
|
|
147
|
+
A theme setting is **not done** until it changes storefront behaviour (or is intentionally “schema only” for a later PR).
|
|
148
|
+
|
|
149
|
+
| Setting intent | Typical wire-up |
|
|
150
|
+
|----------------|-----------------|
|
|
151
|
+
| Toggle (feature on/off) | `layouts/theme.liquid` / `accounts.liquid`: conditional script, `data-*` on `<html>`, or `{% if settings.x %}…{% endif %}` |
|
|
152
|
+
| Color / range / spacing | `snippets/theme-settings.liquid` → `:root { --token: {{ settings.id }} }` |
|
|
153
|
+
| Select (behaviour) | JS reads `settings` via inline assign in layout or CSS custom property |
|
|
154
|
+
| URL / text | Liquid where consumed (header, footer, snippet) |
|
|
155
|
+
|
|
156
|
+
**Checklist before marking complete:**
|
|
157
|
+
|
|
158
|
+
1. [ ] **Read path:** Document how Liquid/JS/CSS reads `settings.<id>` (same id as schema).
|
|
159
|
+
2. [ ] **Layouts:** Main storefront layout(s) load any new asset or conditional block.
|
|
160
|
+
3. [ ] **Accounts layout:** If the setting affects global chrome, mirror in `accounts.liquid` when applicable.
|
|
161
|
+
4. [ ] **Opt-out:** Only skip wire-up if the user explicitly requests **schema only**.
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Stage 6 — Figma-driven globals (optional)
|
|
166
|
+
|
|
167
|
+
If the new field should be filled by **`/sync-theme-settings`**:
|
|
168
|
+
|
|
169
|
+
1. Add a row to the mapping table in `.cursor/commands/sync-theme-settings.md` (field id → `figma-variables.json` path).
|
|
170
|
+
2. Re-run `/sync-theme-settings <theme_name>` after designer exports tokens.
|
|
171
|
+
|
|
172
|
+
Fields that are **not** in the sync mapping stay as whatever you put in `theme.json`.
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Output
|
|
177
|
+
|
|
178
|
+
```
|
|
179
|
+
✅ THEME SETTING(S) ADDED + WIRED
|
|
180
|
+
|
|
181
|
+
Files changed:
|
|
182
|
+
- settings/schema.json
|
|
183
|
+
- settings/theme.json
|
|
184
|
+
- i18n/en.schema.json
|
|
185
|
+
- layouts / snippets / assets (wire-up — list each)
|
|
186
|
+
|
|
187
|
+
IDs added: <list>
|
|
188
|
+
Runtime: [how settings.<id> is consumed]
|
|
189
|
+
|
|
190
|
+
NEXT:
|
|
191
|
+
- If token-mapped: extend /sync-theme-settings mapping + re-run sync
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
## Notes
|
|
197
|
+
|
|
198
|
+
- **`/add-field`** = section schema only. **`/add-theme-setting`** = theme customizer schema.
|
|
199
|
+
- **`/sync-theme-settings`** overwrites only fields listed in its mapping for **global_settings** groups; it does not add new keys automatically.
|
|
200
|
+
- Keep **snake_case** ids consistent between schema, theme.json, and Liquid/CSS/JS references.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Generate page JSON from completed sections
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /assemble-page
|
|
7
|
+
|
|
8
|
+
Generate the page JSON from all completed sections. Run after all sections are built and QA'd.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
```
|
|
12
|
+
/assemble-page <theme_name> <page_name>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Step 1 — Check Built Sections
|
|
18
|
+
- Read audit plan for this page
|
|
19
|
+
- List which sections exist in `sections/`
|
|
20
|
+
- Warn about any missing sections, ask: "Proceed with available or wait?"
|
|
21
|
+
|
|
22
|
+
## Step 2 — Read Section Schemas
|
|
23
|
+
For each section: read `{% schema %}` to extract all setting IDs and types.
|
|
24
|
+
|
|
25
|
+
## Step 3 — Generate Page JSON
|
|
26
|
+
|
|
27
|
+
```jsonc
|
|
28
|
+
{
|
|
29
|
+
"layout": "theme",
|
|
30
|
+
"sections": {
|
|
31
|
+
"<section_key>": {
|
|
32
|
+
"type": "<section_filename>",
|
|
33
|
+
"settings": {
|
|
34
|
+
"heading": "Section Heading",
|
|
35
|
+
"cta_url": { "display_name": "Shop Now", "handle": "/collection" },
|
|
36
|
+
"banner_image": { "url": "banner.webp", "enable_customisation": true },
|
|
37
|
+
"layout_type": { "display_name": "Left", "value": "left-alignment" },
|
|
38
|
+
"nav_menu": { "display_name": "Main Menu", "handle": "main-menu" },
|
|
39
|
+
"show_heading": true,
|
|
40
|
+
"padding_top": 40,
|
|
41
|
+
"padding_bottom": 40,
|
|
42
|
+
"overlay_color": "#000000"
|
|
43
|
+
},
|
|
44
|
+
"blocks": {
|
|
45
|
+
"<block_key>": {
|
|
46
|
+
"type": "<block_type>",
|
|
47
|
+
"settings": {}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"block_order": ["<block_key>"]
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"order": ["<section_key_1>", "<section_key_2>"]
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Inline value rules:
|
|
58
|
+
- text → plain string
|
|
59
|
+
- url → `{ "display_name": "Label", "handle": "/path" }`
|
|
60
|
+
- image_picker → `{ "url": "file.webp", "enable_customisation": true }`
|
|
61
|
+
- select → `{ "display_name": "Label", "value": "option-value" }`
|
|
62
|
+
- menu → `{ "display_name": "Label", "handle": "handle-name" }`
|
|
63
|
+
- checkbox → boolean
|
|
64
|
+
- range/number → number
|
|
65
|
+
- color → hex string
|
|
66
|
+
|
|
67
|
+
## Step 4 — Save
|
|
68
|
+
Write to `pages/<page_name>.json`
|
|
69
|
+
If file exists → show diff, ask for confirmation before overwriting.
|
|
70
|
+
|
|
71
|
+
## Step 5 — Confirm
|
|
72
|
+
List sections included, skipped, and next steps.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Audit a Figma page and produce a section build plan before writing any code
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /audit-page
|
|
7
|
+
|
|
8
|
+
Analyse a Figma page and produce a structured section inventory.
|
|
9
|
+
NO CODE is written — only a build plan. User approves before any section is built.
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
```
|
|
13
|
+
/audit-page <theme_name> <page_name>
|
|
14
|
+
```
|
|
15
|
+
Provide the Figma page frame via MCP or screenshot.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Step 1 — Read the Figma Page
|
|
20
|
+
Scan top to bottom. For each section identify:
|
|
21
|
+
- Section name (descriptive slug e.g. `hero-banner`, `category-grid`)
|
|
22
|
+
- Type: `section` (full layout block) or `snippet` (reusable UI element)
|
|
23
|
+
- Figma frame name (exact name in Figma)
|
|
24
|
+
- Reference match: scan `sections/` for closest existing file
|
|
25
|
+
- Found → REUSE + REDESIGN with path
|
|
26
|
+
- Not found → NEW
|
|
27
|
+
|
|
28
|
+
## Step 2 — Output Build Plan
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
Page: <page_name> — <theme_name>
|
|
32
|
+
|
|
33
|
+
SECTION BUILD PLAN
|
|
34
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
35
|
+
# | Section Name | Figma Frame | Reference | Status
|
|
36
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
37
|
+
1 | header | — | snippets/header.liquid | SHARED (skip)
|
|
38
|
+
2 | hero-banner | Homepage/Hero | sections/banner.liquid | REUSE + REDESIGN
|
|
39
|
+
3 | category-grid | Homepage/Category | sections/cat-grid.liquid| REUSE + REDESIGN
|
|
40
|
+
4 | featured-products | Homepage/Featured | none | NEW
|
|
41
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
42
|
+
|
|
43
|
+
SUMMARY
|
|
44
|
+
SHARED (skip): 1 | REUSE + REDESIGN: 2 | NEW: 1
|
|
45
|
+
|
|
46
|
+
SUGGESTED BUILD ORDER: 2 → 3 → 4
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Step 3 — Ask for Approval
|
|
50
|
+
```
|
|
51
|
+
Does this plan look correct?
|
|
52
|
+
YES → proceed | EDIT → adjust a row | /build-section <n> → jump to a section
|
|
53
|
+
```
|
|
54
|
+
Do NOT write any code until user confirms.
|
|
55
|
+
|
|
56
|
+
## Step 4 — On Approval
|
|
57
|
+
Remind: `Run /build-section <theme_name> <section_name> — one section at a time.`
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Batch-build all sections from an approved audit plan — with integrated design verification
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /build-page-sections
|
|
7
|
+
|
|
8
|
+
Build **every section** listed in an approved `/audit-page` plan in one run.
|
|
9
|
+
Each section follows the full build process including design spec extraction and self-compare verification.
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
```
|
|
13
|
+
/build-page-sections <theme_name> <page_name>
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Provide desktop and mobile Figma URLs (or node IDs) when prompted.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Pre-flight
|
|
21
|
+
|
|
22
|
+
1. Confirm `figma-variables.json` exists. If missing → STOP.
|
|
23
|
+
2. Look for the approved audit plan for `<page_name>` in the conversation history.
|
|
24
|
+
- If no plan exists → STOP: run `/audit-page <theme_name> <page_name>` first.
|
|
25
|
+
3. List sections to build from the plan. Skip rows marked **SHARED (skip)**.
|
|
26
|
+
4. For REUSE + REDESIGN rows, note the reference section path.
|
|
27
|
+
5. For NEW rows, note there is no reference — build from Figma only.
|
|
28
|
+
6. Read `.cursor/rules/design-spec-extraction.mdc` — the extraction protocol to follow for every section.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Build Loop
|
|
33
|
+
|
|
34
|
+
For each section in the plan's **SUGGESTED BUILD ORDER**:
|
|
35
|
+
|
|
36
|
+
### Step 1 — Fetch Figma Frames (BOTH desktop AND mobile)
|
|
37
|
+
- Use the Figma MCP `get_design_context` tool with the section's node ID.
|
|
38
|
+
- **Always fetch both desktop and mobile frames.** If the plan includes separate desktop and mobile node IDs, fetch both.
|
|
39
|
+
- If no node ID is available for a section, ask the developer to select the frame in Figma and provide the URL.
|
|
40
|
+
|
|
41
|
+
### Step 2 — Build the Section (Full /build-section with Design Verification)
|
|
42
|
+
Run the complete `/build-section` logic (Stages 1–8):
|
|
43
|
+
|
|
44
|
+
1. **Read reference section** (if REUSE/REDESIGN) — extract schema, logic, loops, renders, JS.
|
|
45
|
+
2. **Extract detailed design spec from Figma** — Follow the Design Spec Extraction Protocol (`.cursor/rules/design-spec-extraction.mdc`). Extract EXACT values for every visible element. Resolve all `var()` from `figma-variables.json`. Produce the Design Spec Table. **DO NOT SKIP THIS.**
|
|
46
|
+
3. **Map Figma values to tokens** — font sizes → Tailwind classes, colours → CSS variables, spacing → Tailwind. Update the spec table's Tailwind/CSS column.
|
|
47
|
+
4. **Build HTML structure** — semantic HTML + Tailwind + CSS variables. Dynamic content via Liquid assigns. **Use the Design Spec Table as the blueprint — every row must appear in code.**
|
|
48
|
+
5. **Add schema** — custom syntax (not Shopify). All labels use `t:` keys. Heading/title fields → `text`; body/description → `richtext` (never `richtext` on heading blocks). Include `padding_top`/`padding_bottom` with Figma-accurate defaults. At least one preset.
|
|
49
|
+
6. **Add style block + script** — `{% style %}` for dynamic values, script tag if JS component needed.
|
|
50
|
+
7. **Self-compare against Design Spec Table** — For every row in the spec, verify the corresponding HTML element has the exact Tailwind class / CSS variable. Fix any mismatches before saving. Produce a self-compare summary.
|
|
51
|
+
8. **Code QA** — every `section.settings.X` has a schema field, no raw hex, no raw px fonts, loops have empty states, images have all attrs, labels use `t:` keys, heading fields use `text` not `richtext`.
|
|
52
|
+
|
|
53
|
+
### Step 3 — Write File
|
|
54
|
+
Save to `sections/<section_name>.liquid`.
|
|
55
|
+
|
|
56
|
+
### Step 4 — Log Result
|
|
57
|
+
Record one of:
|
|
58
|
+
- `BUILT` — section created successfully (include spec match percentage)
|
|
59
|
+
- `SKIPPED` — SHARED section, no build needed
|
|
60
|
+
- `FAILED` — could not build (missing Figma data, unresolved tokens, etc.)
|
|
61
|
+
|
|
62
|
+
Proceed to the next section. Do not stop the batch for warnings — log them and continue.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## After All Sections
|
|
67
|
+
|
|
68
|
+
### i18n Keys
|
|
69
|
+
Collect all `t:sections.<name>.settings.*` and `t:sections.<name>.blocks.*` keys from every built section. Add them to `i18n/en.schema.json` under the appropriate `sections.<name>` paths.
|
|
70
|
+
|
|
71
|
+
### Summary Report
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
BUILD PAGE SECTIONS — <page_name> (<theme_name>)
|
|
75
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
76
|
+
|
|
77
|
+
# | Section | Status | Spec Rows | Match % | Reference
|
|
78
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
79
|
+
1 | header | SKIPPED | — | — | shared
|
|
80
|
+
2 | hero-banner | BUILT | 24 | 100% | sections/hero-banner.liquid
|
|
81
|
+
3 | product-carousel | BUILT | 18 | 97% | sections/product-carousel-section.liquid
|
|
82
|
+
4 | featured-collection | BUILT | 15 | 100% | none (NEW)
|
|
83
|
+
...
|
|
84
|
+
|
|
85
|
+
OVERALL DESIGN ACCURACY: <percentage>% across all sections
|
|
86
|
+
|
|
87
|
+
SUMMARY
|
|
88
|
+
Built: <n> | Skipped: <n> | Failed: <n>
|
|
89
|
+
|
|
90
|
+
⚠️ UNMAPPED TOKENS (review):
|
|
91
|
+
- [section]: [token name] → used [fallback]
|
|
92
|
+
|
|
93
|
+
⚠️ UNRESOLVED SPEC ITEMS:
|
|
94
|
+
- [section]: [element] → [property] could not be verified
|
|
95
|
+
|
|
96
|
+
NEXT STEPS:
|
|
97
|
+
1. /qa-sections <theme_name> — batch QA all built sections
|
|
98
|
+
2. /compare-section per section — only for sections with <100% match
|
|
99
|
+
3. /assemble-page <theme_name> <page> — generate page JSON
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Notes
|
|
105
|
+
|
|
106
|
+
- This command uses the same self-compare verification as `/build-section`. Most design accuracy issues are caught and fixed during the build itself.
|
|
107
|
+
- If a section build fails, the batch continues. Fix failed sections individually with `/build-section`.
|
|
108
|
+
- The developer can interrupt the batch at any time. Already-written files are kept.
|
|
109
|
+
- Section groups (`header-group.json`, `footer-group.json`) are NOT built by this command — they are config files that reference sections.
|
|
110
|
+
- The Design Spec Table for each section is logged but not saved to disk. Run `/compare-section` to regenerate it for any section that needs further review.
|