Rule
0 installs · 0 said it worked
Shopify Liquid theme development best-practices rules for Cursor
Cursor rules guiding an assistant through Shopify theme work in Liquid, JavaScript, and CSS, covering structure, performance, accessibility, and testing.
People use this for
- shopify liquid theme rules
- shopify theme development guidelines
- write shopify liquid code following best practices
- set up cursor rules for shopify theme work
- help me structure a shopify theme with sections and snippets
- Name
shopify-liquid-theme-development-best-practices-rules-for-cursor- Works with
- Cursor
- License
- CC0(as observed at the source)
- Version
- v1 · updated Nov 29, 2026
Imported on Nov 29, 2026 from github.com . License observed at the source on Nov 29, 2026: CC0.
Are you the author?Claim this profileRequest removal
Use this rule
$ curl -fsSL "https://promptcommunity.dev/api/v1/posts/shopify-liquid-theme-development-best-practices-rules-for-cursor-bctc/export/mdc" -o .cursor/rules/shopify-liquid-theme-development-best-practices-rules-for-cursor.mdcThen open a new session; Cursor picks it up from .cursor/rules/.
Manual install
Save shopify-liquid-theme-development-best-practices-rules-for-cursor.mdc as .cursor/rules/shopify-liquid-theme-development-best-practices-rules-for-cursor.mdc for this project or ~/.cursor/rules/shopify-liquid-theme-development-best-practices-rules-for-cursor.mdc for every project, then start a new session.
Rule
description: "Best practices for Shopify theme development with Liquid, JavaScript, and CSS" globs: ["/*.liquid", "assets//.js", "assets/**/.css", "sections//*.liquid", "snippets//.liquid", "templates/**/.liquid"] alwaysApply: false
Shopify Theme Development Best Practices
Project Structure
- Adopt a clear directory structure, e.g.,
sections,snippets,templates,assets. - Organize generic modules (like JavaScript functionalities) into separate files.
- Keep Liquid files concise and focused on single responsibilities, avoiding monolithic files.
- Organize templates and sections by page or functionality.
- Implement proper internationalization (i18n) file management.
- Utilize SCSS/CSS Modules for style organization to prevent global pollution.
Liquid Templating
- Prefer the
rendertag overinclude. - Limit database queries within loops to avoid N+1 issues.
- Use filters judiciously, especially complex computational ones.
- Leverage Liquid's caching mechanisms to reduce redundant calculations.
- Avoid complex logic handling directly in Liquid; move intricate logic to JavaScript.
- Use
assignandcaptureto define and reuse variables effectively.
JavaScript Development
- Modularize JS, using ES Modules for imports and exports.
- Follow modern JavaScript best practices, such as
const/let, arrow functions, etc. - Avoid direct DOM manipulation; prioritize event delegation.
- Optimize JavaScript performance to reduce repaints and reflows.
- Consider using Webpack/Rollup for bundling and code optimization.
- Write clear comments and JSDoc.
CSS/SCSS Styling
- Adhere to naming conventions like BEM, OOCSS, or Utility-First CSS.
- Optimize CSS selectors to improve rendering performance.
- Use CSS variables to manage theme configurations like colors and fonts.
- Implement responsive design to ensure consistent theme appearance across devices.
- Minimize CSS file size by removing unused styles.
- Make good use of SCSS mixins and functions.
Sections and Blocks
- Utilize Section Schema to define configurable options.
- Maintain section independence and reusability.
- Provide clear presets for sections.
- Use Blocks appropriately to enhance section flexibility.
- Ensure sections provide a good user experience in the Shopify Customizer.
- Avoid hardcoding content within sections; use Schema configurations whenever possible.
Performance Optimization
- Optimize image loading by using Shopify's CDN and the
image_urlfilter. - Minify JavaScript and CSS files.
- Leverage browser caching.
- Reduce the number of HTTP requests.
- Consider lazy loading.
- Monitor theme performance using Google Lighthouse and Shopify Theme Check.
Accessibility (A11y)
- Ensure all interactive elements are keyboard accessible.
- Provide meaningful
alttext for images. - Use correct HTML semantic tags.
- Consider color contrast.
- Implement clear focus states.
- Use ARIA attributes to enhance the accessibility of complex components.
Maintenance and Scalability
- Write clear code comments and documentation.
- Follow naming conventions to maintain code consistency.
- Regularly test theme functionalities.
- Ensure compatibility across different browsers and devices.
- Consider future extensibility, avoiding tight coupling.
- Use Shopify CLI for local development and deployment.
Quality and Testing
- Use Shopify Theme Check for static code analysis.
- Write unit tests (where applicable).
- Conduct thorough end-to-end testing.
- Test in various environments (local, development store, production store).
- Focus on compatibility testing (browsers, devices, Shopify versions).
- Test error handling and edge cases.
No result recorded yet. Added it? File a Tried-it report so the next person knows how it went in your editor.
Tried it
Reports from people who added this rule to their editor. They roll up into the badges above.
No one has filed a report yet. Try the prompt and be the first.
Related rules
- Quality engineering agent role for risk-based test strategy and CI quality gates
A senior quality engineering role prompt that guides an assistant through risk-based test strategy, test automation architecture, CI/CD quality gates, edge-case analysis, and defect management, writing results to a TODO checklist file.
Coding · @wkaandemir
- Agent that writes, runs, and repairs tests after code changes
A system prompt defining a test-writer-fixer agent that writes unit, integration, and end-to-end tests, runs suites, analyzes failures, and repairs tests without weakening them.
Coding · @ersinyilmaz
- Cursor rules for writing and testing Xian smart contracts in Python
A Cursor rules file that guides the assistant through writing Xian blockchain smart contracts in Python, covering naming, state, context variables, events, error handling, and unittest-based testing with security checks.
Coding · @patrickjs
- Cursor rules for writing TestRail test cases from features or automated tests
A Cursor rules file that sets the assistant as a QA engineer and guides it to produce structured TestRail test cases with preconditions, numbered steps, expected results, test data, and TestRail CSV or markdown formats.
Data & Finance · @patrickjs
- Flaky Test Detector: separate flaky CI tests from real failures
Agent skill that reads repeated CI run results (JUnit XML or CSV history), flags tests that pass and fail without code changes, ranks them by flip and failure rate, and recommends targeted fixes or quarantine plans instead of retries.
Coding · @f
License: CC0v1 · published Nov 29, 2026
Comments
No comments yet. If you tried this prompt, say how it went.