climaybe 1.7.3 β 1.8.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 +8 -6
- package/bin/version.txt +1 -1
- package/package.json +1 -1
- package/src/commands/add-cursor-skill.js +12 -7
- package/src/commands/init.js +10 -5
- package/src/cursor/rules/00-rule-index.mdc +24 -0
- package/src/cursor/rules/accessibility-rules.mdc +527 -0
- package/src/cursor/rules/commit-rules.mdc +286 -0
- package/src/cursor/rules/cursor-rule-template.mdc +66 -0
- package/src/cursor/rules/examples/section-example.liquid +52 -0
- package/src/cursor/rules/examples/snippet-example.liquid +83 -0
- package/src/cursor/rules/figma-design-system.mdc +182 -0
- package/src/cursor/rules/global-rules-reference.mdc +62 -0
- package/src/cursor/rules/javascript-standards.mdc +1125 -0
- package/src/cursor/rules/js-refactor-tasks.mdc +123 -0
- package/src/cursor/rules/linear-task-creation.mdc +105 -0
- package/src/cursor/rules/liquid-doc-rules.mdc +595 -0
- package/src/cursor/rules/liquid.mdc +228 -0
- package/src/cursor/rules/project-overview.mdc +81 -0
- package/src/cursor/rules/schemas.mdc +150 -0
- package/src/cursor/rules/sections.mdc +25 -0
- package/src/cursor/rules/snippets.mdc +134 -0
- package/src/cursor/rules/tailwindcss-rules.mdc +410 -0
- package/src/cursor/skills/accessibility-pass/SKILL.md +54 -0
- package/src/cursor/skills/changelog-release/SKILL.md +50 -0
- package/src/cursor/skills/commit/SKILL.md +27 -0
- package/src/cursor/skills/commit-in-groups/SKILL.md +55 -0
- package/src/cursor/skills/linear-create-task/SKILL.md +81 -0
- package/src/cursor/skills/liquid-doc-comments/SKILL.md +37 -0
- package/src/cursor/skills/locale-translation-prep/SKILL.md +49 -0
- package/src/cursor/skills/schema-section-change/SKILL.md +39 -0
- package/src/cursor/skills/section-from-spec/SKILL.md +39 -0
- package/src/cursor/skills/theme-check-fix/SKILL.md +47 -0
- package/src/index.js +3 -2
- package/src/lib/commit-tooling.js +0 -44
- package/src/lib/config.js +1 -1
- package/src/lib/cursor-bundle.js +47 -0
- package/src/lib/prompts.js +3 -2
- package/src/workflows/build/reusable-build.yml +1 -1
- package/src/workflows/shared/version-bump.yml +5 -2
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Git commit conventions for Shopify theme projects (emoji + type + description)
|
|
3
|
+
globs:
|
|
4
|
+
- "**/*"
|
|
5
|
+
alwaysApply: false
|
|
6
|
+
---
|
|
7
|
+
# Commit Rules for Shopify Theme Projects
|
|
8
|
+
|
|
9
|
+
## Commit Convention
|
|
10
|
+
|
|
11
|
+
Follow conventional commit format with emoji prefixes for all commits:
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
<emoji> <type>: <description>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Commit Types
|
|
18
|
+
|
|
19
|
+
### π¨ `fix:` - Bug Fixes
|
|
20
|
+
- Fixes for broken functionality
|
|
21
|
+
- Bug patches and error corrections
|
|
22
|
+
- Performance fixes
|
|
23
|
+
|
|
24
|
+
**Examples:**
|
|
25
|
+
```
|
|
26
|
+
π¨ fix: modal close button not working
|
|
27
|
+
π¨ fix: cart total calculation error
|
|
28
|
+
π¨ fix: mobile navigation menu overlap
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### π `feat:` - New Features
|
|
32
|
+
- New functionality additions
|
|
33
|
+
- Feature implementations
|
|
34
|
+
- New components or sections
|
|
35
|
+
|
|
36
|
+
**Examples:**
|
|
37
|
+
```
|
|
38
|
+
π feat: add product quick view functionality
|
|
39
|
+
π feat: implement infinite scroll for collections
|
|
40
|
+
π feat: add newsletter signup modal
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### β»οΈ `refactor:` - Code Refactoring
|
|
44
|
+
- Code restructuring without changing functionality
|
|
45
|
+
- Performance improvements
|
|
46
|
+
- Code cleanup and optimization
|
|
47
|
+
|
|
48
|
+
**Examples:**
|
|
49
|
+
```
|
|
50
|
+
β»οΈ refactor: optimize product card rendering
|
|
51
|
+
β»οΈ refactor: restructure JavaScript build system
|
|
52
|
+
β»οΈ refactor: improve web component lifecycle management
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### π¨ `style:` - UI/Styling Changes
|
|
56
|
+
- Visual design updates
|
|
57
|
+
- CSS/styling modifications
|
|
58
|
+
- Layout adjustments
|
|
59
|
+
|
|
60
|
+
**Examples:**
|
|
61
|
+
```
|
|
62
|
+
π¨ style: update button hover states
|
|
63
|
+
π¨ style: improve mobile responsive design
|
|
64
|
+
π¨ style: adjust typography spacing
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### ποΈ `remove:` - Code Removal
|
|
68
|
+
- Removing unused code
|
|
69
|
+
- Deleting deprecated features
|
|
70
|
+
- Cleaning up legacy code
|
|
71
|
+
|
|
72
|
+
**Examples:**
|
|
73
|
+
```
|
|
74
|
+
ποΈ remove: unused JavaScript functions
|
|
75
|
+
ποΈ remove: deprecated Liquid snippets
|
|
76
|
+
ποΈ remove: old CSS classes
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### π§ `wip:` - Work in Progress
|
|
80
|
+
- Incomplete features
|
|
81
|
+
- Experimental code
|
|
82
|
+
- Development in progress
|
|
83
|
+
- Temporary implementations
|
|
84
|
+
|
|
85
|
+
**Examples:**
|
|
86
|
+
```
|
|
87
|
+
π§ wip: product quick view modal (incomplete)
|
|
88
|
+
π§ wip: experimental infinite scroll implementation
|
|
89
|
+
π§ wip: temporary mobile navigation solution
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### π `docs:` - Documentation
|
|
93
|
+
- README updates
|
|
94
|
+
- Code documentation
|
|
95
|
+
- Comment additions
|
|
96
|
+
- Documentation improvements
|
|
97
|
+
|
|
98
|
+
**Examples:**
|
|
99
|
+
```
|
|
100
|
+
π docs: update installation instructions
|
|
101
|
+
π docs: add component usage examples
|
|
102
|
+
π docs: improve code comments
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### β¨ `ai:` - AI Rules & Automation
|
|
106
|
+
- AI-generated code improvements
|
|
107
|
+
- Automated refactoring
|
|
108
|
+
- Code optimization rules
|
|
109
|
+
- AI-assisted development
|
|
110
|
+
|
|
111
|
+
**Examples:**
|
|
112
|
+
```
|
|
113
|
+
β¨ ai: implement automated code formatting rules
|
|
114
|
+
β¨ ai: optimize web component performance with AI suggestions
|
|
115
|
+
β¨ ai: add intelligent error handling patterns
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### π§ `chore:` - Maintenance Tasks
|
|
119
|
+
- Build system updates
|
|
120
|
+
- Configuration changes
|
|
121
|
+
- Dependency management
|
|
122
|
+
- Development tool updates
|
|
123
|
+
|
|
124
|
+
**Examples:**
|
|
125
|
+
```
|
|
126
|
+
π§ chore: update Tailwind CSS to v4
|
|
127
|
+
π§ chore: add new npm scripts
|
|
128
|
+
π§ chore: update Shopify CLI version
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### β¬οΈ `upgrade:` - Dependencies
|
|
132
|
+
- Package updates
|
|
133
|
+
- Version upgrades
|
|
134
|
+
- Security patches
|
|
135
|
+
|
|
136
|
+
**Examples:**
|
|
137
|
+
```
|
|
138
|
+
β¬οΈ upgrade: update Shopify CLI to latest version
|
|
139
|
+
β¬οΈ upgrade: bump Tailwind CSS dependencies
|
|
140
|
+
β¬οΈ upgrade: security patch for npm packages
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Commit Message Guidelines
|
|
144
|
+
|
|
145
|
+
### Description Format
|
|
146
|
+
- Use imperative mood ("add" not "added")
|
|
147
|
+
- Keep descriptions concise but descriptive
|
|
148
|
+
- Start with lowercase letter
|
|
149
|
+
- No period at the end
|
|
150
|
+
|
|
151
|
+
### Good Examples
|
|
152
|
+
```
|
|
153
|
+
π¨ fix: resolve cart total calculation error
|
|
154
|
+
π feat: implement product quick view modal
|
|
155
|
+
β»οΈ refactor: optimize web component performance
|
|
156
|
+
π¨ style: improve mobile navigation layout
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### Bad Examples
|
|
160
|
+
```
|
|
161
|
+
π¨ fix: fixed the bug
|
|
162
|
+
π feat: Added new feature
|
|
163
|
+
β»οΈ refactor: Refactored code for better performance.
|
|
164
|
+
π¨ style: Updated styling
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## Multi-line Commit Messages
|
|
168
|
+
|
|
169
|
+
For complex changes, use multi-line format:
|
|
170
|
+
|
|
171
|
+
```
|
|
172
|
+
π¨ fix: resolve cart total calculation error
|
|
173
|
+
|
|
174
|
+
- Fix floating point precision issues
|
|
175
|
+
- Add proper error handling for invalid prices
|
|
176
|
+
- Update cart API response validation
|
|
177
|
+
|
|
178
|
+
Closes #123
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## Breaking Changes
|
|
182
|
+
|
|
183
|
+
For breaking changes, use `!` after the type and include migration notes:
|
|
184
|
+
|
|
185
|
+
```
|
|
186
|
+
β»οΈ refactor!: restructure web component API
|
|
187
|
+
|
|
188
|
+
BREAKING CHANGE: Component initialization now requires config object
|
|
189
|
+
Migration: Update component calls to use new API format
|
|
190
|
+
|
|
191
|
+
- Old: new MyComponent()
|
|
192
|
+
- New: new MyComponent({ config: {} })
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## Scope (Optional)
|
|
196
|
+
|
|
197
|
+
You can add scope to specify the area of change:
|
|
198
|
+
|
|
199
|
+
```
|
|
200
|
+
π¨ fix(web-components): resolve event listener memory leak
|
|
201
|
+
π feat(sections): add new product grid layout
|
|
202
|
+
π¨ style(header): improve mobile navigation
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## File-specific Commits
|
|
206
|
+
|
|
207
|
+
When committing changes to specific file types, include context:
|
|
208
|
+
|
|
209
|
+
```
|
|
210
|
+
π¨ fix(liquid): resolve template rendering error in product page
|
|
211
|
+
π feat(js): add new utility functions for DOM manipulation
|
|
212
|
+
π¨ style(css): update button component styling
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
## Commit Frequency
|
|
216
|
+
|
|
217
|
+
- Commit frequently with small, focused changes
|
|
218
|
+
- Each commit should represent a single logical change
|
|
219
|
+
- Avoid large commits with multiple unrelated changes
|
|
220
|
+
- Use feature branches for complex changes
|
|
221
|
+
|
|
222
|
+
## Pre-commit Checklist
|
|
223
|
+
|
|
224
|
+
Before committing, ensure:
|
|
225
|
+
- [ ] Code follows project standards
|
|
226
|
+
- [ ] All tests pass (if applicable)
|
|
227
|
+
- [ ] No console errors in browser
|
|
228
|
+
- [ ] Responsive design works on all breakpoints
|
|
229
|
+
- [ ] Accessibility requirements met
|
|
230
|
+
- [ ] Performance impact considered
|
|
231
|
+
|
|
232
|
+
## Branch Naming
|
|
233
|
+
|
|
234
|
+
Use descriptive branch names:
|
|
235
|
+
- `feature/product-quick-view`
|
|
236
|
+
- `fix/cart-calculation-bug`
|
|
237
|
+
- `refactor/web-components`
|
|
238
|
+
- `style/mobile-navigation`
|
|
239
|
+
|
|
240
|
+
## Pull Request Guidelines
|
|
241
|
+
|
|
242
|
+
When creating pull requests:
|
|
243
|
+
- Use descriptive titles
|
|
244
|
+
- Include detailed descriptions
|
|
245
|
+
- Reference related issues
|
|
246
|
+
- Add screenshots for UI changes
|
|
247
|
+
- Test on multiple devices/browsers
|
|
248
|
+
|
|
249
|
+
## Examples by Category
|
|
250
|
+
|
|
251
|
+
### Web Components
|
|
252
|
+
```
|
|
253
|
+
π¨ fix: resolve web component memory leak in disconnectedCallback
|
|
254
|
+
π feat: add new electric-slider component with touch support
|
|
255
|
+
β»οΈ refactor: optimize web component event handling
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### Shopify Sections
|
|
259
|
+
```
|
|
260
|
+
π¨ fix: resolve section rendering error in collection page
|
|
261
|
+
π feat: add new product recommendations section
|
|
262
|
+
π¨ style: improve section spacing and layout
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
### JavaScript
|
|
266
|
+
```
|
|
267
|
+
π¨ fix: resolve async/await error in cart API
|
|
268
|
+
π feat: add utility functions for DOM manipulation
|
|
269
|
+
β»οΈ refactor: optimize JavaScript build system
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
### CSS/Styling
|
|
273
|
+
```
|
|
274
|
+
π¨ style: update button component design system
|
|
275
|
+
π¨ style: improve mobile responsive breakpoints
|
|
276
|
+
π¨ style: add new color palette variables
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
### Liquid Templates
|
|
280
|
+
```
|
|
281
|
+
π¨ fix: resolve Liquid syntax error in product template
|
|
282
|
+
π feat: add new product variant selector
|
|
283
|
+
β»οΈ refactor: optimize Liquid template performance
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
This commit convention ensures clear, consistent, and informative commit messages that help track project progress and facilitate collaboration.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: How to add or edit Cursor rules in our project
|
|
3
|
+
globs:
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
---
|
|
6
|
+
# Cursor Rules Location
|
|
7
|
+
|
|
8
|
+
How to add new cursor rules to the project
|
|
9
|
+
|
|
10
|
+
1. Always place rule files in PROJECT_ROOT/.cursor/rules/:
|
|
11
|
+
```
|
|
12
|
+
.cursor/rules/
|
|
13
|
+
βββ your-rule-name.mdc
|
|
14
|
+
βββ another-rule.mdc
|
|
15
|
+
βββ ...
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
2. Follow the naming convention:
|
|
19
|
+
- Use kebab-case for filenames
|
|
20
|
+
- Always use .mdc extension
|
|
21
|
+
- Make names descriptive of the rule's purpose
|
|
22
|
+
|
|
23
|
+
3. Directory structure:
|
|
24
|
+
```
|
|
25
|
+
PROJECT_ROOT/
|
|
26
|
+
βββ .cursor/
|
|
27
|
+
β βββ rules/
|
|
28
|
+
β βββ your-rule-name.mdc
|
|
29
|
+
β βββ ...
|
|
30
|
+
βββ ...
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
4. Never place rule files:
|
|
34
|
+
- In the project root
|
|
35
|
+
- In subdirectories outside .cursor/rules
|
|
36
|
+
- In any other location
|
|
37
|
+
|
|
38
|
+
5. Cursor rules have the following structure:
|
|
39
|
+
|
|
40
|
+
````
|
|
41
|
+
---
|
|
42
|
+
description: Short description of the rule's purpose
|
|
43
|
+
globs: optional/path/pattern/**/*
|
|
44
|
+
alwaysApply: false
|
|
45
|
+
---
|
|
46
|
+
# Rule Title
|
|
47
|
+
|
|
48
|
+
Main content explaining the rule with markdown formatting.
|
|
49
|
+
|
|
50
|
+
1. Step-by-step instructions
|
|
51
|
+
2. Code examples
|
|
52
|
+
3. Guidelines
|
|
53
|
+
|
|
54
|
+
Example:
|
|
55
|
+
```typescript
|
|
56
|
+
// Good example
|
|
57
|
+
function goodExample() {
|
|
58
|
+
// Implementation following guidelines
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Bad example
|
|
62
|
+
function badExample() {
|
|
63
|
+
// Implementation not following guidelines
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
````
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{% liquid
|
|
2
|
+
assign section_id = section.settings.custom_id | default: section.id
|
|
3
|
+
assign section_class = 'section-' | append: section.type
|
|
4
|
+
%}
|
|
5
|
+
|
|
6
|
+
<section
|
|
7
|
+
id="{{ section_id }}"
|
|
8
|
+
class="{{ section_class }}"
|
|
9
|
+
style="
|
|
10
|
+
--section-padding-top: {{ section.settings.padding_top }}px;
|
|
11
|
+
--section-padding-bottom: {{ section.settings.padding_bottom }}px;
|
|
12
|
+
"
|
|
13
|
+
>
|
|
14
|
+
<div class="page-width">
|
|
15
|
+
{% content_for 'blocks' %}
|
|
16
|
+
</div>
|
|
17
|
+
</section>
|
|
18
|
+
|
|
19
|
+
{% stylesheet %}
|
|
20
|
+
.{{ section_class }} {
|
|
21
|
+
padding-top: var(--section-padding-top, 40px);
|
|
22
|
+
padding-bottom: var(--section-padding-bottom, 40px);
|
|
23
|
+
}
|
|
24
|
+
{% endstylesheet %}
|
|
25
|
+
|
|
26
|
+
{% schema %}
|
|
27
|
+
{
|
|
28
|
+
"name": "t:names.section_name",
|
|
29
|
+
"tag": "section",
|
|
30
|
+
"class": "section-name",
|
|
31
|
+
"blocks": [
|
|
32
|
+
{"type": "@theme"},
|
|
33
|
+
{"type": "@app"}
|
|
34
|
+
],
|
|
35
|
+
"settings": [
|
|
36
|
+
{
|
|
37
|
+
"type": "range",
|
|
38
|
+
"id": "padding_top",
|
|
39
|
+
"label": "t:settings.padding",
|
|
40
|
+
"min": 0,
|
|
41
|
+
"max": 100,
|
|
42
|
+
"default": 40,
|
|
43
|
+
"unit": "px"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"presets": [
|
|
47
|
+
{
|
|
48
|
+
"name": "t:names.section_name"
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
{% endschema %}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
{% doc %}
|
|
2
|
+
Product Card Snippet Template
|
|
3
|
+
|
|
4
|
+
@param product - {Object} Product object (required)
|
|
5
|
+
@param show_vendor - {Boolean} Display vendor name (default: false)
|
|
6
|
+
@param show_quick_add - {Boolean} Show quick add button (default: false)
|
|
7
|
+
@param image_ratio - {String} Image aspect ratio (default: 'adapt')
|
|
8
|
+
@param card_class - {String} Additional CSS classes
|
|
9
|
+
|
|
10
|
+
@example
|
|
11
|
+
{% render 'product-card',
|
|
12
|
+
product: product,
|
|
13
|
+
show_vendor: true,
|
|
14
|
+
image_ratio: 'square'
|
|
15
|
+
%}
|
|
16
|
+
{% enddoc %}
|
|
17
|
+
|
|
18
|
+
{% liquid
|
|
19
|
+
# Parameter validation and defaults
|
|
20
|
+
assign product = product | default: empty
|
|
21
|
+
assign show_vendor = show_vendor | default: false
|
|
22
|
+
assign show_quick_add = show_quick_add | default: false
|
|
23
|
+
assign image_ratio = image_ratio | default: 'adapt'
|
|
24
|
+
assign card_class = card_class | default: ''
|
|
25
|
+
|
|
26
|
+
# Early return if required parameters missing
|
|
27
|
+
unless product != empty
|
|
28
|
+
echo '<!-- Error: product parameter required for product-card snippet -->'
|
|
29
|
+
break
|
|
30
|
+
endunless
|
|
31
|
+
|
|
32
|
+
# Build CSS classes
|
|
33
|
+
assign card_classes = 'product-card'
|
|
34
|
+
if card_class != blank
|
|
35
|
+
assign card_classes = card_classes | append: ' ' | append: card_class
|
|
36
|
+
endif
|
|
37
|
+
if image_ratio != 'adapt'
|
|
38
|
+
assign card_classes = card_classes | append: ' product-card--' | append: image_ratio
|
|
39
|
+
endif
|
|
40
|
+
%}
|
|
41
|
+
|
|
42
|
+
<div
|
|
43
|
+
class="{{ card_classes }}"
|
|
44
|
+
data-product-id="{{ product.id }}"
|
|
45
|
+
>
|
|
46
|
+
<div class="product-card__media">
|
|
47
|
+
{% if product.featured_image %}
|
|
48
|
+
<a
|
|
49
|
+
href="{{ product.url }}"
|
|
50
|
+
class="product-card__link"
|
|
51
|
+
>
|
|
52
|
+
{{
|
|
53
|
+
product.featured_image
|
|
54
|
+
| image_url: width: 800
|
|
55
|
+
| image_tag: alt: product.featured_image.alt
|
|
56
|
+
| default: product.title, loading: 'lazy', class: 'product-card__image'
|
|
57
|
+
}}
|
|
58
|
+
</a>
|
|
59
|
+
{% else %}
|
|
60
|
+
<div class="product-card__placeholder">
|
|
61
|
+
{{ 'product-1' | placeholder_svg_tag: 'product-card__placeholder-svg' }}
|
|
62
|
+
</div>
|
|
63
|
+
{% endif %}
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
<div class="product-card__info">
|
|
67
|
+
<h3 class="product-card__title">
|
|
68
|
+
<a href="{{ product.url }}">{{ product.title | escape }}</a>
|
|
69
|
+
</h3>
|
|
70
|
+
|
|
71
|
+
{% if show_vendor and product.vendor != blank %}
|
|
72
|
+
<p class="product-card__vendor">{{ product.vendor | escape }}</p>
|
|
73
|
+
{% endif %}
|
|
74
|
+
|
|
75
|
+
{% render 'price', product: product, show_compare_at: true %}
|
|
76
|
+
|
|
77
|
+
{% if show_quick_add and product.available %}
|
|
78
|
+
<div class="product-card__actions">
|
|
79
|
+
{% render 'product-form', product: product, form_type: 'quick-add', show_quantity: false %}
|
|
80
|
+
</div>
|
|
81
|
+
{% endif %}
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Rules for implementing Figma designs using the Figma MCP server. Covers component organization, styling conventions, design tokens, asset handling, and the required Figma-to-code workflow for this Shopify theme (Liquid + Tailwind + native JS).
|
|
3
|
+
globs:
|
|
4
|
+
- "sections/**/*.liquid"
|
|
5
|
+
- "snippets/**/*.liquid"
|
|
6
|
+
- "_styles/**/*.css"
|
|
7
|
+
- "assets/*.css"
|
|
8
|
+
- "_scripts/**/*.js"
|
|
9
|
+
alwaysApply: false
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Figma Design System Rules β Voldt Theme
|
|
13
|
+
|
|
14
|
+
This document defines how to translate Figma designs into code for this project. The theme is a **Shopify theme** (Liquid templates, Tailwind CSS v4, native JavaScript web components). Figma MCP output is typically React + Tailwind; treat that as design reference only and implement using this projectβs stack and conventions.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## 1. Design System Structure
|
|
19
|
+
|
|
20
|
+
### 1.1 Token Definitions
|
|
21
|
+
|
|
22
|
+
**Location and format**
|
|
23
|
+
|
|
24
|
+
- **Primitives (colors, z-index):** `_styles/01_theme/01_primitives.css`
|
|
25
|
+
- Raw color scales: `--color-dune-*`, `--color-abbey-*`, `--color-dust-*`, `--color-blue-*`, system colors, `--layer-*`.
|
|
26
|
+
- **Sizes (spacing, breakpoints, borders, grid):** `_styles/02_base/02.01_sizes.css`
|
|
27
|
+
- Spacing: `--px-s-*`, `--py-s-*`, `--gaps-x-*`, `--gaps-y-*`, `--mx-s-outer`, `--height-b-*`, `--height-icon-*`.
|
|
28
|
+
- Breakpoints: `--breakpoint-lg: 60rem`.
|
|
29
|
+
- Border/stroke: `--border-*`, `--stroke-*`.
|
|
30
|
+
- Grid: `--grid-columns-base`, `--grid-gutter-base`, `--grid-margin-base`, etc.
|
|
31
|
+
- **Semantic colors:** `_styles/02_base/02.02_colors.css`
|
|
32
|
+
- Use these, not raw primitives: `--background-color-surface`, `--background-color-subtle`, `--background-color-emphasis`, `--background-color-accent`, `--text-color-primary`, `--text-color-secondary`, `--text-color-on-accent`, `--border-color-primary`, `--border-color-secondary`.
|
|
33
|
+
- Color schemes: utilities `color-schema-primary`, `color-schema-secondary`, `color-schema-muted`, `color-schema-accent-1`, `color-schema-accent-2`, `color-schema-accent-3`, `color-schema-contrast`.
|
|
34
|
+
- **Typography:** `_styles/02_base/02.03_typography.css`
|
|
35
|
+
- Font: `--font-body`, `--font-heading`, `--font-weight-*`.
|
|
36
|
+
- Utilities: `text-body`, `text-body-lg`, `text-ui-base`, `text-caption`, `display-1`β`display-3`, heading classes `.h1`β`.h6`.
|
|
37
|
+
|
|
38
|
+
**Rules**
|
|
39
|
+
|
|
40
|
+
- IMPORTANT: Never hardcode hex/hsl colors in Liquid or CSS. Use semantic tokens (e.g. `bg-surface`, `text-primary`, `border-secondary`) or Tailwind theme values that reference these tokens.
|
|
41
|
+
- Spacing and layout must use the project scale (e.g. `px-s-inner`, `py-s-base`, `gap-x-b-base`, `mx-s-outer`) or Tailwind utilities that map to them.
|
|
42
|
+
- Typography must use the projectβs font and size utilities (e.g. `text-body`, `font-heading`, `.h2`).
|
|
43
|
+
|
|
44
|
+
### 1.2 Component Library
|
|
45
|
+
|
|
46
|
+
**Where components live**
|
|
47
|
+
|
|
48
|
+
- **Sections (full-width, schema-driven):** `sections/*.liquid` β e.g. `sections/s--hero-banner.liquid`, `sections/s--featured-collection.liquid`.
|
|
49
|
+
- **Snippets (reusable UI):**
|
|
50
|
+
- Atoms: `snippets/a--*.liquid` (e.g. `a--icon.liquid`, `a--button.liquid`, `a--input.liquid`).
|
|
51
|
+
- Molecules: `snippets/m--*.liquid` (e.g. `m--product-card.liquid`, `m--accordion.liquid`, `m--modal.liquid`).
|
|
52
|
+
- Feature-specific: `snippets/product--*.liquid`, `snippets/cart--*.liquid`, `snippets/header--*.liquid`, etc.
|
|
53
|
+
- **Web components (JS):** `_scripts/*.js` β e.g. `electric-modal.js`, `electric-slider.js`, `electric-disclosure.js`. Reference implementation: `_scripts/electric-modal.js`.
|
|
54
|
+
|
|
55
|
+
**Architecture**
|
|
56
|
+
|
|
57
|
+
- No React/Vue. UI is Liquid (sections + snippets) plus native JS web components.
|
|
58
|
+
- New UI from Figma: prefer adding or composing existing snippets/sections; add new snippets/sections only when no fit exists.
|
|
59
|
+
- Sections must have a valid `{% schema %}` and semantic HTML; snippets must have LiquidDoc `{%- doc -%}` and follow `.cursor/rules/snippets.mdc` and `.cursor/rules/liquid.mdc`.
|
|
60
|
+
|
|
61
|
+
### 1.3 Frameworks & Libraries
|
|
62
|
+
|
|
63
|
+
- **Templating:** Liquid only (Shopify theme).
|
|
64
|
+
- **Styling:** Tailwind CSS v4. Entry: `_styles/main.css` (imports Tailwind, tokens, component CSS). Compiled output: `assets/style.css`.
|
|
65
|
+
- **Script:** Native JS only (no React/Vue). Web components with `#` private fields, AbortController for listeners, JSDoc; see `.cursor/rules/javascript-standards.mdc`.
|
|
66
|
+
- **Build:** Tailwind processes `_styles/main.css`; content sources (for class scanning) are listed in `_styles/main.css` (`@source` for layout, blocks, sections, snippets, templates, assets).
|
|
67
|
+
|
|
68
|
+
### 1.4 Asset Management
|
|
69
|
+
|
|
70
|
+
- **Theme assets:** `assets/` β CSS, JS, and static files. Reference in Liquid with `{{ 'filename.css' | asset_url }}` or `{{ 'filename.js' | asset_url }}`.
|
|
71
|
+
- **Images:** Use Shopify CDN via filters: `{{ image | image_url: width: N }}` for responsive widths; use `srcset` where appropriate (see existing snippets/sections).
|
|
72
|
+
- **Icons:** Do not add new icon packages. Use the icon system below (inline SVG via `a--icon` or assets from Figma MCP when provided).
|
|
73
|
+
- **Figma MCP assets:** If the Figma MCP server returns a localhost (or other) URL for an image/SVG, use that source directly. Do not replace with placeholders when a real URL is given.
|
|
74
|
+
- Store any downloaded assets from Figma in `assets/` and reference via `asset_url`.
|
|
75
|
+
|
|
76
|
+
### 1.5 Icon System
|
|
77
|
+
|
|
78
|
+
- **Definition:** Icons are inline SVGs in `snippets/a--icon.liquid`, selected by name via `icon: 'name'`.
|
|
79
|
+
- **Usage:** `{% render 'a--icon', icon: 'search', size: 'base', class: '...' %}`. Parameters: `icon` (required), `class`, `color`, `size` (xxs|xs|sm|base|lg|xl), `width`/`height`, `stroke`, `animate`, `aria_label`, `aria_hidden`, etc. See LiquidDoc in `a--icon.liquid`.
|
|
80
|
+
- **Naming:** kebab-case (e.g. `chevron-d`, `arrow-r-up`, `circle-arrow-r`). Add new icons in the same file as new `when 'name'` branches; keep `fill="none"` and use `{{ color }}` or `currentColor` for strokes/fills.
|
|
81
|
+
- **Sizing:** Prefer `size` (uses `--height-icon-*` tokens); or `width`/`height` for explicit dimensions. Stroke from size or `stroke` param (`stroke-sm`, `stroke-base`, etc.).
|
|
82
|
+
|
|
83
|
+
### 1.6 Styling Approach
|
|
84
|
+
|
|
85
|
+
- **Methodology:** Utility-first with Tailwind. Custom utilities and theme in `_styles/main.css` and `_styles/02_base/*.css`, `_styles/01_theme/*.css`.
|
|
86
|
+
- **CRITICAL β Static classes only:** Tailwind scans at build time; Liquid runs on the server. Do not build class names with Liquid variables (e.g. no `duration-{{ x }}`, `text-{{ color }}`). Use fixed classes or conditionals that output full class names, e.g. `{% if size == 'sm' %}text-sm{% else %}text-base{% endif %}`.
|
|
87
|
+
- **Responsive:** Mobile-first. Use `md:` and `lg:` prefixes; breakpoints align with `theme(--breakpoint-md)` and `theme(--breakpoint-lg)`.
|
|
88
|
+
- **Semantic tokens in Tailwind:** Use `bg-surface`, `text-primary`, `border-secondary`, etc., which map to the CSS variables in `02.02_colors.css`. Do not introduce new ad-hoc color names; extend tokens in `_styles/` if needed.
|
|
89
|
+
- **Custom component CSS:** Add in `_styles/` (e.g. `_styles/atoms/`, `_styles/molecules/`) and import from `_styles/main.css`.
|
|
90
|
+
|
|
91
|
+
### 1.7 Project Structure
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
_layout/theme.liquid # Main layout
|
|
95
|
+
_scripts/ # Web components and utilities (native JS)
|
|
96
|
+
_styles/ # Tailwind entry, tokens, component CSS
|
|
97
|
+
main.css
|
|
98
|
+
01_theme/01_primitives.css
|
|
99
|
+
02_base/02.01_sizes.css, 02.02_colors.css, 02.03_typography.css
|
|
100
|
+
atoms/, molecules/, core/
|
|
101
|
+
assets/ # Compiled CSS/JS and static assets
|
|
102
|
+
sections/ # Liquid section files
|
|
103
|
+
snippets/ # Reusable Liquid snippets (a--*, m--*, etc.)
|
|
104
|
+
templates/ # Page templates
|
|
105
|
+
locales/ # Translation files
|
|
106
|
+
config/ # Theme settings
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
- **Feature organization:** Sections and snippets are named by feature or type (e.g. `product--main`, `cart--drawer`, `s--hero-banner`, `m--product-card`). Follow existing naming (prefix + `--` + descriptor).
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## 2. Figma MCP Integration Rules
|
|
114
|
+
|
|
115
|
+
### 2.1 Required Flow (do not skip)
|
|
116
|
+
|
|
117
|
+
1. Run **get_design_context** for the exact node(s) to implement.
|
|
118
|
+
2. If the response is too large or truncated, run **get_metadata** to get a high-level map, then **get_design_context** again for only the required node(s).
|
|
119
|
+
3. Run **get_screenshot** for a visual reference of the node/variant.
|
|
120
|
+
4. After you have both design context and screenshot, download any assets needed (use MCP asset/localhost sources when provided), then implement.
|
|
121
|
+
5. Implement in **this stack:** Liquid sections/snippets + Tailwind (and _styles tokens) + native JS if needed. Do not ship React/Vue or arbitrary new frameworks.
|
|
122
|
+
6. Validate against the Figma screenshot for 1:1 look and behavior before marking complete.
|
|
123
|
+
|
|
124
|
+
### 2.2 Implementation Rules
|
|
125
|
+
|
|
126
|
+
- Treat Figma MCP output (e.g. React + Tailwind) as **design and behavior reference**, not as final code. Translate to Liquid + Tailwind + this themeβs tokens and components.
|
|
127
|
+
- **Reuse existing snippets/sections** from `snippets/` and `sections/` instead of duplicating (e.g. buttons β `a--button`, icons β `a--icon`, cards β `m--*` cards, modals β `m--modal` / electric-modal).
|
|
128
|
+
- Use the projectβs **color system** (semantic tokens from `02.02_colors.css`), **typography** (`02.03_typography.css`, utilities), and **spacing/sizes** (`02.01_sizes.css`, Tailwind utilities that use them).
|
|
129
|
+
- **Tailwind:** Only static class names; map Figma colors to semantic tokens (e.g. `bg-surface`, `text-primary`); use project breakpoints and spacing scale.
|
|
130
|
+
- Respect **accessibility** (WCAG 2.1 AA): semantic HTML, ARIA where needed, keyboard and screen reader support; see `.cursor/rules/accessibility-rules.mdc`.
|
|
131
|
+
- Respect **JS standards**: no new dependencies; if adding behavior, use native JS/web components per `.cursor/rules/javascript-standards.mdc`.
|
|
132
|
+
- Aim for **1:1 visual parity** with the Figma design and validate with the screenshot.
|
|
133
|
+
|
|
134
|
+
### 2.3 Asset Handling
|
|
135
|
+
|
|
136
|
+
- The Figma MCP server can serve image and SVG assets. When it returns a **localhost (or other) source** for an image or SVG, use that source directly.
|
|
137
|
+
- IMPORTANT: Do not add or rely on new icon libraries; use `snippets/a--icon.liquid` or assets provided by Figma MCP.
|
|
138
|
+
- IMPORTANT: Do not use or create placeholders when a real asset URL is provided by the MCP.
|
|
139
|
+
- Store downloaded assets in `assets/` and reference them via `{{ 'filename' | asset_url }}` in Liquid.
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## 3. Project-Specific Conventions
|
|
144
|
+
|
|
145
|
+
### 3.1 Liquid
|
|
146
|
+
|
|
147
|
+
- Follow `.cursor/rules/liquid.mdc`: e.g. assign computed values before passing to `render`; no inline `append` in `render` parameters; valid tags/filters only.
|
|
148
|
+
- Use `{%- doc -%}` and LiquidDoc for all new snippets; document params and examples per `.cursor/rules/liquid-doc-rules.mdc` and `.cursor/rules/snippets.mdc`.
|
|
149
|
+
|
|
150
|
+
### 3.2 Sections
|
|
151
|
+
|
|
152
|
+
- Every section: valid `{% schema %}`, semantic HTML, section-scoped classes. Follow `.cursor/rules/sections.mdc` and `.cursor/rules/schemas.mdc` for schema definitions.
|
|
153
|
+
|
|
154
|
+
### 3.3 Accessibility
|
|
155
|
+
|
|
156
|
+
- Semantic structure, ARIA where needed, keyboard and focus behavior, WCAG 2.1 AA. See `.cursor/rules/accessibility-rules.mdc`. Use the accessibility-pass skill when asked for an a11y audit.
|
|
157
|
+
|
|
158
|
+
### 3.4 Performance
|
|
159
|
+
|
|
160
|
+
- No layout thrashing; batch reads/writes; use requestAnimationFrame for animations; lazy-load images where appropriate. JS: AbortController, cleanup in disconnectedCallback, performance targets from project-overview (e.g. init < 16ms).
|
|
161
|
+
|
|
162
|
+
### 3.5 Code Quality
|
|
163
|
+
|
|
164
|
+
- JS: JSDoc for public APIs, private `#` fields, try/catch around critical work. Liquid: LiquidDoc and parameter defaults/validation. Tailwind: static classes and semantic tokens only.
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## 4. Quick Reference: Mapping Figma to This Theme
|
|
169
|
+
|
|
170
|
+
| Figma / MCP output | This theme |
|
|
171
|
+
|------------------------|------------|
|
|
172
|
+
| React component | Liquid section or snippet(s) |
|
|
173
|
+
| Tailwind arbitrary colors | Semantic tokens: `bg-surface`, `text-primary`, `border-secondary`, etc. |
|
|
174
|
+
| Tailwind spacing | Project scale: `px-s-inner`, `gap-x-b-base`, `py-s-base`, etc. |
|
|
175
|
+
| Icon component | `{% render 'a--icon', icon: 'name', size: 'base' %}` |
|
|
176
|
+
| Button | `{% render 'a--button', ... %}` or `a--button-tw` as per project |
|
|
177
|
+
| Modal / overlay | `m--modal` snippet + `_scripts/electric-modal.js` pattern |
|
|
178
|
+
| Images | `{{ image \| image_url: width: N }}`; responsive with `srcset` |
|
|
179
|
+
| New SVG icon | Add in `snippets/a--icon.liquid` as new `when 'icon-name'` |
|
|
180
|
+
| New color/size token | Add in `_styles/02_base/` or `01_theme/` and use via Tailwind/utilities |
|
|
181
|
+
|
|
182
|
+
Use this document together with the Figma MCP flow (get_design_context β get_screenshot β implement β validate) so that every Figma-driven change stays consistent with this design system and stack.
|