Shopify liquid

From Starchild-ai-agent/official-skills · View interactive version

Shopify liquid is an AI agent skill from the GitHub repository Starchild-ai-agent/official-skills. Liquid is an open-source templating language created by Shopify. It is the backbone of Shopify themes and is used to load dynamic content on storefronts. Keywords: liquid, theme, shopify-theme, liquid-component, liquid-block, liquid-section, liquid-snippet, liquid-schemas, shopify-theme-schemas

How to use this skill

Skill file

<!-- AUTO-GENERATED — do not edit directly.

Edit src/data/raw-api-instructions/{api}.md in shopify-dev-tools,

then run: npm run generate_agent_skills (outputs to distributed-agent-skills/) -->


name: shopify-liquid

description: "Liquid is an open-source templating language created by Shopify. It is the backbone of Shopify themes and is used to load dynamic content on storefronts. Keywords: liquid, theme, shopify-theme, liquid-component, liquid-block, liquid-section, liquid-snippet, liquid-schemas, shopify-theme-schemas"

compatibility: Claude Code, Claude Desktop, Cursor

metadata:

author: Shopify


Your task

You are an experienced Shopify theme developer, implement user requests by generating theme components that are consistent with the 'Key principles' and the 'Theme architecture'.

Theme Architecture

Key principles: focus on generating snippets, blocks, and sections; users may create templates using the theme editor

Directory structure

.
├── assets          # Stores static assets (CSS, JS, images, fonts, etc.)
├── blocks          # Reusable, nestable, customizable components
├── config          # Global theme settings and customization options
├── layout          # Top-level wrappers for pages (layout templates)
├── locales         # Translation files for theme internationalization
├── sections        # Modular full-width page components
├── snippets        # Reusable Liquid code or HTML fragments
└── templates       # Templates combining sections and blocks to define page structures
`sections`
`blocks`
`snippets`
`layout`
`config`
`assets`
`locales`
`templates`

CSS & JavaScript

LiquidDoc

Snippets and blocks (when blocks are statically rendered) must include the LiquidDoc header that documents the purpose of the file and required parameters. Example:

{% doc %}
  Renders a responsive image that might be wrapped in a link.

  @param {image} image - The image to be rendered
  @param {string} [url] - An optional destination URL for the image

  @example
  {% render 'image', image: product.featured_image %}
{% enddoc %}

<a href="{{ url | default: '#' }}">{{ image | image_url: width: 200, height: 200 | image_tag }}</a>

The `{% schema %}` tag on blocks and sections

Key principles: follow the "Good practices" and "Validate the {% schema %} content" using JSON schemas

Good practices

When defining the {% schema %} tag on sections and blocks, follow these guidelines to use the values:

Single property settings: For settings that correspond to a single CSS property, use CSS variables:

<div class="collection" style="--gap: {{ block.settings.gap }}px">
  Example
</div>

{% stylesheet %}
  .collection {
    gap: var(--gap);
  }
{% endstylesheet %}

{% schema %}
{
  "settings": [{
    "type": "range",
    "label": "gap",
    "id": "gap",
    "min": 0,
    "max": 100,
    "unit": "px",
    "default": 0,
  }]
}
{% endschema %}

Multiple property settings: For settings that control multiple CSS properties, use CSS classes:

<div class="collection {{ block.settings.layout }}">
  Example
</div>

{% stylesheet %}
  .collection--full-width {
    /* multiple styles */
  }
  .collection--narrow {
    /* multiple styles */
  }
{% endstylesheet %}

{% schema %}
{
  "settings": [{
    "type": "select",
    "id": "layout",
    "label": "layout",
    "values": [
      { "value": "collection--full-width", "label": "t:options.full" },
      { "value": "collection--narrow", "label": "t:options.narrow" }
    ]
  }]
}
{% endschema %}
Mobile layouts

If you need to create a mobile layout and you want the merchant to be able to select one or two columns, use a select input:

{% schema %}
{
  "type": "select",
  "id": "columns_mobile",
  "label": "Columns on mobile",
  "options": [
    { "value": 1, "label": "1" },
    { "value": "2", "label": "2" }
  ]
}
{% endschema %}

Liquid

Liquid delimiters

Tip:

Adding a dash (-) after {%/{{ or before %}/}} trims spaces or newlines next to the tag.

Examples:

Liquid operators

Comparison operators:

Logical operators:

Comparison and comparison tags

Key condition principles:

Basic comparison example:

{% if product.title == "Awesome Shoes" %}
  These shoes are awesome!
{% endif %}

Multiple Conditions:

{% if product.type == "Shirt" or product.type == "Shoes" %}
  This is a shirt or a pair of shoes.
{% endif %}

Contains Usage:

{% elsif %} (used inside if/unless only)

{% if a %}
  ...
{% elsif b %}
  ...
{% endif %}

{% unless %}

{% unless condition %}
  ...
{% endunless %}

{% case %}

{% case variable %}
  {% when 'a' %}
    a
  {% when 'b' %}
    b
  {% else %}
    other
{% endcase %}

{% else %} (used inside if, unless, case, or for)

{% if product.available %}
  In stock
{% else %}
  Sold out
{% endif %}

_or inside a for loop:_

{% for item in collection.products %}
  {{ item.title }}
{% else %}
  No products found.
{% endfor %}
Variables and variable tags
{% assign my_variable = 'value' %}

{% capture my_variable %}
  Contents of variable
{% endcapture %}

{% increment counter %}
{% decrement counter %}

Liquid filters

You can chain filters in Liquid, passing the result of one filter as the input to the next.

See these filters:

Each filter can pass its return value to the next filter as long as the types match.

For example, upcase returns a string, which is suitable input for split, which then produces an array for last to use.

Here's how the filters are executed step by step to eventually return "WORLD":

{{ "hello world" | upcase | split: " " | last }}
Array
Cart
Collection
Color
Customer
Date
Default
Font
Format
Hosted_file
Html
Localization
Math
Media
Metafield
Money
Payment
String
Tag

Liquid objects

Global objects
`/article` page
`/blog` page
`/cart` page
`/checkout` page
`/collection` page
`/customers/account` page
`/customers/addresses` page
`/customers/order` page
`/gift_card.liquid` page
`/metaobject` page
`/page` page
`/product` page
`/robots.txt.liquid` page
`/search` page

Liquid tags

content_for

The content_for tag requires a type parameter to differentiate between rendering a number of theme blocks ('blocks') and a single static block ('block').

Syntax:

{% content_for 'blocks' %}
{% content_for 'block', type: "slide", id: "slide-1" %}
form

Because there are many different form types available in Shopify themes, the form tag requires a type. Depending on the

form type, an additional parameter might be required. You can specify the following form types:

Syntax:

{% form 'form_type' %}
  content
{% endform %}
layout

Syntax:

{% layout name %}
assign

You can create variables of any basic type, object, or object property.

Caution:

Predefined Liquid objects can be overridden by variables with the same name.

To make sure that you can access all Liquid objects, make sure that your variable name doesn't match a predefined object's name.

Syntax:

{% assign variable_name = value %}
break

Syntax:

{% break %}
capture

You can create complex strings with Liquid logic and variables.

Caution:

Predefined Liquid objects can be overridden by variables with the same name.

To make sure that you can access all Liquid objects, make sure that your variable name doesn't match a predefined object's name.

Syntax:

{% capture variable %}
  value
{% endcapture %}
case

Syntax:

{% case variable %}
  {% when first_value %}
    first_expression
  {% when second_value %}
    second_expression
  {% else %}
    third_expression
{% endcase %}
comment

Any text inside comment tags won't be output, and any Liquid code will be parsed, but not executed.

Syntax:

{% comment %}
  content
{% endcomment %}
continue

Syntax:

{% continue %}
cycle

The cycle tag must be used inside a for loop.

Tip:

Use the cycle tag to output text in a predictable pattern. For example, to apply odd/even classes to rows in a table.

Syntax:

{% cycle string, string, ... %}
decrement

Variables that are declared with decrement are unique to the layout, template,

or section file that they're created in. However, the variable is shared across

snippets included in the file.

Similarly, variables that are created with decrement are independent from those created with CODE1

and CODE0. However, decrement and CODE2 share

variables.

Syntax:

{% decrement variable_name %}
doc

The doc tag allows developers to include documentation within Liquid

templates. Any content inside doc tags is not rendered or outputted.

Liquid code inside will be parsed but not executed. This facilitates

tooling support for features like code completion, linting, and inline

documentation.

For detailed documentation syntax and examples, see the

CODE0 reference.

Syntax:

{% doc %}
  Renders a message.

  @param {string} foo - A string value.
  @param {string} [bar] - An optional string value.

  @example
  {% render 'message', foo: 'Hello', bar: 'World' %}
{% enddoc %}
echo

Using the echo tag is the same as wrapping an expression in curly brackets ({{ and }}). However, unlike the curly

bracket method, you can use the echo tag inside CODE1 tags.

Tip:

You can use filters on expressions inside echo tags.

Syntax:

{% liquid
  echo expression
%}
for

You can do a maximum of 50 iterations with a for loop. If you need to iterate over more than 50 items, then use the

CODE0 tag to split the items over multiple pages.

Tip:

Every for loop has an associated CODE1 object with information about the loop.

Syntax:

{% for variable in array %}
  expression
{% endfor %}
if

Syntax:

{% if condition %}
  expression
{% endif %}
increment

Variables that are declared with increment are unique to the layout, template,

or section file that they're created in. However, the variable is shared across

snippets included in the file.

Similarly, variables that are created with increment are independent from those created with CODE1

and CODE0. However, increment and CODE2 share

variables.

Syntax:

{% increment variable_name %}
raw

Syntax:

{% raw %}
  expression
{% endraw %}
render

Inside snippets and app blocks, you can't directly access variables that are created outside

of the snippet or app block. However, you can specify variables as parameters

to pass outside variables to snippets.

While you can't directly access created variables, you can access global objects, as well as any objects that are

directly accessible outside the snippet or app block. For example, a snippet or app block inside the product template

can access the CODE0 object, and a snippet or app block inside a section

can access the CODE0 object.

Outside a snippet or app block, you can't access variables created inside the snippet or app block.

Note:

When you render a snippet using the render tag, you can't use the CODE1 tag

inside the snippet.

Syntax:

{% render 'filename' %}
tablerow

The tablerow tag must be wrapped in HTML <table> and </table> tags.

Tip:

Every tablerow loop has an associated CODE1 object with information about the loop.

Syntax:

{% tablerow variable in array %}
  expression
{% endtablerow %}
unless

Tip:

Similar to the CODE0 tag, you can use elsif to add more conditions to an unless tag.

Syntax:

{% unless condition %}
  expression
{% endunless %}
paginate

Because CODE0 loops are limited to 50 iterations per page, you need to use the paginate tag to

iterate over an array that has more than 50 items. The following arrays can be paginated:

Within the paginate tag, you have access to the CODE1 object. You can use this

object, or the CODE0 filter, to build page navigation.

Syntax:

{% paginate array by page_size %}
  {% for item in array %}
    forloop_content
  {% endfor %}
{% endpaginate %}

The `paginate` tag allows the user to paginate to the 25,000th item in the array and no further. To reach items further in
the array the array should be filtered further before paginating. See
[Pagination Limits](/themes/best-practices/performance/platform#pagination-limits) for more information.
javascript

Each section, block or snippet can have only one {% javascript %} tag.

To learn more about how JavaScript that's defined between the javascript tags is loaded and run, refer to the documentation for javascript tags.

Caution:

Liquid isn't rendered inside of {% javascript %} tags. Including Liquid code can cause syntax errors.

Syntax:

{% javascript %}
  javascript_code
{% endjavascript %}
section

Rendering a section with the section tag renders a section statically. To learn more about sections and how to use

them in your theme, refer to Render a section.

Syntax:

{% section 'name' %}
stylesheet

Each section, block or snippet can have only one {% stylesheet %} tag.

To learn more about how CSS that's defined between the stylesheet tags is loaded and run, refer to the documentation for stylesheet tags.

Caution:

Liquid isn't rendered inside of {% stylesheet %} tags. Including Liquid code can cause syntax errors.

Syntax:

{% stylesheet %}
  css_styles
{% endstylesheet %}
sections

Use this tag to render section groups as part of the theme's layout content. Place the sections tag where you want to render it in the layout.

To learn more about section groups and how to use them in your theme, refer to Section groups.

Syntax:

{% sections 'name' %}
style

Note:

If you reference color settings inside style tags, then

the associated CSS rules will update as the setting is changed in the theme editor, without a page refresh.

Syntax:

{% style %}
  CSS_rules
{% endstyle %}
else

You can use the else tag with the following tags:

Syntax:

{% else %}
  expression
else

Syntax:

{% for variable in array %}
  first_expression
{% else %}
  second_expression
{% endfor %}
liquid

Because the tags don't have delimeters, each tag needs to be on its own line.

Tip:

Use the CODE0 tag to output an expression inside liquid tags.

Syntax:

{% liquid
  expression
%}

Translation development standards

Translation requirements

Translation filter usage

Use {{ 'key' | t }} for all text:

<!-- Good -->
<h2>{{ 'sections.featured_collection.title' | t }}</h2>
<p>{{ 'sections.featured_collection.description' | t }}</p>
<button>{{ 'products.add_to_cart' | t }}</button>

<!-- Bad -->
<h2>Featured Collection</h2>
<p>Check out our best products</p>
<button>Add to cart</button>

Translation with variables

Use variables for interpolation:

<!-- Liquid template -->
<p>{{ 'products.price_range' | t: min: product.price_min | money, max: product.price_max | money }}</p>
<p>{{ 'general.pagination.page' | t: page: paginate.current_page, pages: paginate.pages }}</p>

Corresponding keys in locale files:

{
  "products": {
    "price_range": "From {{ min }} to {{ max }}"
  },
  "general": {
    "pagination": {
      "page": "Page {{ page }} of {{ pages }}"
    }
  }
}

Best practices

Content guidelines:

Variable usage:

Localization standards

Auto-attached when working in locales/ directory.

File structure

locales/
├── en.default.json          # English (required)
├── en.default.schema.json   # English (required)
├── es.json                  # Spanish
├── est.schema.json          # Spanish
├── fr.json                  # French
├── frt.schema.json          # French
└── pt-BR.json               # Portuguese
└── pt-BR..schema.json       # Portuguese
Locale files

Locale files are JSON files containing translations for all the text strings used throughout a Shopify theme and its editor. They let merchants easily update and localize repeated words and phrases, making it possible to translate store content and settings into multiple languages for international customers. These files provide a centralized way to manage and edit translations.

Example:

{
  "general": {
    "cart": "Cart",
    "checkout": "Checkout"
  },
  "products": {
    "add_to_cart": "Add to Cart"
  }
}
Schema locale files

Schema locale files, saved with a .schema.json extension, store translation strings specifically for theme editor setting schemas. They follow a structured organization—category, group, and description—to give context to each translation, enabling accurate localization of editor content. Schema locale files must use the IETF language tag format in their naming, such as en-GB.schema.json for British English or fr-CA.schema.json for Canadian French.

Example:

{
  "products": {
    "card": {
      "description": "Product card layout"
    }
  }
}

Key organization

Hierarchical structure:

{
  "general": {
    "meta": {
      "title": "{{ shop_name }}",
      "description": "{{ shop_description }}"
    },
    "accessibility": {
      "skip_to_content": "Skip to content",
      "close": "Close"
    }
  },
  "products": {
    "add_to_cart": "Add to cart",
    "quick_view": "Quick view",
    "price": {
      "regular": "Regular price",
      "sale": "Sale price",
      "unit": "Unit price"
    }
  }
}

Usage

{{ 'general.meta.title' | t: shop_name: shop.name }}
{{ 'general.meta.description' | t: shop_description: shop.description }}

Translation guidelines

Key naming:

Content rules:

Examples per kind of asset

`snippet`

{% doc %}
  Renders a responsive image that might be wrapped in a link.

  When `width`, `height` and `crop` are provided, the image will be rendered
  with a fixed aspect ratio.

  Serves as an example of how to use the `image_url` filter and `image_tag` filter
  as well as how you can use LiquidDoc to document your code.

  @param {image} image - The image to be rendered
  @param {string} [url] - An optional destination URL for the image
  @param {string} [css_class] - Optional class to be added to the image wrapper
  @param {number} [width] - The highest resolution width of the image to be rendered
  @param {number} [height] - The highest resolution height of the image to be rendered
  @param {string} [crop] - The crop position of the image

  @example
  {% render 'image', image: product.featured_image %}
  {% render 'image', image: product.featured_image, url: product.url %}
  {% render 'image',
    css_class: 'product__image',
    image: product.featured_image,
    url: product.url,
    width: 1200,
    height: 800,
    crop: 'center',
  %}
{% enddoc %}

{% liquid
  unless height
    assign width = width | default: image.width
  endunless

  if url
    assign wrapper = 'a'
  else
    assign wrapper = 'div'
  endif
%}

<{{ wrapper }}
  class="image {{ css_class }}"
  {% if url %}
    href="{{ url }}"
  {% endif %}
>
  {{ image | image_url: width: width, height: height, crop: crop | image_tag }}
</{{ wrapper }}>

{% stylesheet %}
  .image {
    display: block;
    position: relative;
    overflow: hidden;
    width: 100%;
    height: auto;
  }

  .image > img {
    width: 100%;
    height: auto;
  }
{% endstylesheet %}

{% javascript %}
  function doSomething() {
    // example
  }
  doSomething()
{% endjavascript %}

`block`

Text
{% doc %}
  Renders a text block.

  @example
  {% content_for 'block', type: 'text', id: 'text' %}
{% enddoc %}

<div
  class="text {{ block.settings.text_style }}"
  style="--text-align: {{ block.settings.alignment }}"
  {{ block.shopify_attributes }}
>
  {{ block.settings.text }}
</div>

{% stylesheet %}
  .text {
    text-align: var(--text-align);
  }
  .text--title {
    font-size: 2rem;
    font-weight: 700;
  }
  .text--subtitle {
    font-size: 1.5rem;
  }
{% endstylesheet %}

{% schema %}
{
  "name": "t:general.text",
  "settings": [
    {
      "type": "text",
      "id": "text",
      "label": "t:labels.text",
      "default": "Text"
    },
    {
      "type": "select",
      "id": "text_style",
      "label": "t:labels.text_style",
      "options": [
        { "value": "text--title", "label": "t:options.text_style.title" },
        { "value": "text--subtitle", "label": "t:options.text_style.subtitle" },
        { "value": "text--normal", "label": "t:options.text_style.normal" }
      ],
      "default": "text--title"
    },
    {
      "type": "text_alignment",
      "id": "alignment",
      "label": "t:labels.alignment",
      "default": "left"
    }
  ],
  "presets": [{ "name": "t:general.text" }]
}
{% endschema %}
Group
{% doc %}
  Renders a group of blocks with configurable layout direction, gap and
  alignment.

  All settings apply to only one dimension to reduce configuration complexity.

  This component is a wrapper concerned only with rendering its children in
  the specified layout direction with appropriate padding and alignment.

  @example
  {% content_for 'block', type: 'group', id: 'group' %}
{% enddoc %}

<div
  class="group {{ block.settings.layout_direction }}"
  style="
    --padding: {{ block.settings.padding }}px;
    --alignment: {{ block.settings.alignment }};
  "
  {{ block.shopify_attributes }}
>
  {% content_for 'blocks' %}
</div>

{% stylesheet %}
  .group {
    display: flex;
    flex-wrap: nowrap;
    overflow: hidden;
    width: 100%;
  }
  .group--horizontal {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--padding);
  }
  .group--vertical {
    flex-direction: column;
    align-items: var(--alignment);
    padding: var(--padding) 0;
  }
{% endstylesheet %}

{% schema %}
{
  "name": "t:general.group",
  "blocks": [{ "type": "@theme" }],
  "settings": [
    {
      "type": "select",
      "id": "layout_direction",
      "label": "t:labels.layout_direction",
      "default": "group--vertical",
      "options": [
        { "value": "group--horizontal", "label": "t:options.direction.horizontal" },
        { "value": "group--vertical", "label": "t:options.direction.vertical" }
      ]
    },
    {
      "visible_if": "{{ block.settings.layout_direction == 'group--vertical' }}",
      "type": "select",
      "id": "alignment",
      "label": "t:labels.alignment",
      "default": "flex-start",
      "options": [
        { "value": "flex-start", "label": "t:options.alignment.left" },
        { "value": "center", "label": "t:options.alignment.center" },
        { "value": "flex-end", "label": "t:options.alignment.right" }
      ]
    },
    {
      "type": "range",
      "id": "padding",
      "label": "t:labels.padding",
      "default": 0,
      "min": 0,
      "max": 200,
      "step": 2,
      "unit": "px"
    }
  ],
  "presets": [
    {
      "name": "t:general.column",
      "category": "t:general.layout",
      "settings": {
        "layout_direction": "group--vertical",
        "alignment": "flex-start",
        "padding": 0
      }
    },
    {
      "name": "t:general.row",
      "category": "t:general.layout",
      "settings": {
        "layout_direction": "group--horizontal",
        "padding": 0
      }
    }
  ]
}
{% endschema %}

`section`

<div class="example-section full-width">
  {% if section.settings.background_image %}
    <div class="example-section__background">
      {{ section.settings.background_image | image_url: width: 2000 | image_tag }}
    </div>
  {% endif %}

  <div class="custom-section__content">
    {% content_for 'blocks' %}
  </div>
</div>

{% stylesheet %}
  .example-section {
    position: relative;
    overflow: hidden;
    width: 100%;
  }
  .example-section__background {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
  }
  .example-section__background img {
    position: absolute;
    width: 100%;
    height: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  .example-section__content {
    display: grid;
    grid-template-columns: var(--content-grid);
  }

  .example-section__content > * {
    grid-column: 2;
  }
{% endstylesheet %}

{% schema %}
{
  "name": "t:general.custom_section",
  "blocks": [{ "type": "@theme" }],
  "settings": [
    {
      "type": "image_picker",
      "id": "background_image",
      "label": "t:labels.background"
    }
  ],
  "presets": [
    {
      "name": "t:general.custom_section"
    }
  ]
}
{% endschema %}

Final instructions

Design requirements

Code requirements

Safety requirements

Decline requests involving:

Always use Shopify CLI

Shopify CLI Overview

Shopify CLI (@shopify/cli) is a command-line interface tool that helps you generate and work with Shopify apps, themes, and custom storefronts. You can also use it to automate many common development tasks.

Requirements

Installation

Install Shopify CLI globally to run shopify commands from any directory:

npm install -g @shopify/cli@latest
# or
yarn global add @shopify/cli@latest
# or
pnpm install -g @shopify/cli@latest
# or (macOS only)
brew tap shopify/shopify && brew install shopify-cli

Command Structure

Shopify CLI groups commands into topics. The syntax is: shopify [topic] [command] [flags]

General Commands (8 commands)

Authentication

  1. shopify auth logout - Log out of Shopify account

Configuration

  1. shopify config autocorrect on - Enable command autocorrection
  2. shopify config autocorrect off - Disable command autocorrection
  3. shopify config autocorrect status - Check autocorrection status

Utilities

  1. shopify help [command] [flags] - Get help for commands
  2. shopify commands [flags] - List all available commands
  3. shopify search [query] - Search for commands and documentation
  4. shopify upgrade - Upgrade Shopify CLI to latest version
  5. shopify version - Display current CLI version

Common Flags

Most commands support these common flags:

Network Proxy Configuration

For users behind a network proxy (CLI version 3.78+):

export SHOPIFY_HTTP_PROXY=http://proxy.com:8080
export SHOPIFY_HTTPS_PROXY=https://secure-proxy.com:8443
# For authenticated proxies:
export SHOPIFY_HTTP_PROXY=http://username:password@proxy.com:8080

Usage Tips

  1. Always keep CLI updated: shopify upgrade
  2. Use shopify help [command] for detailed command info
  3. Most commands are interactive and will prompt for required information
  4. Use flags to skip prompts in CI/CD environments
  5. Anonymous usage statistics collected by default (opt-out: SHOPIFY_CLI_NO_ANALYTICS=1)
  6. IMPORTANT: YOU MUST ALWAYS USE THE CLI COMMAND TO CREATE APPS AND SCAFFOLD NEW EXTENSIONS

CLI Commands for Shopify Theme (18 commands)

Core Theme Development

  1. shopify theme init [name] [flags] - Create a new theme project
  2. shopify theme dev [flags] - Start local theme development server
  3. shopify theme push [flags] - Upload theme files to store
  1. shopify theme pull [flags] - Download theme files from store

Theme Management

  1. shopify theme list [flags] - List all themes in the store
  2. shopify theme info [flags] - Show theme details
  3. shopify theme publish [flags] - Publish a theme
  4. shopify theme delete [flags] - Delete a theme
  5. shopify theme rename [flags] - Rename a theme
  6. shopify theme duplicate [flags] - Create a copy of a theme

Development Tools

  1. shopify theme check [flags] - Run Theme Check linter
  2. shopify theme console - Open interactive theme console
  1. shopify theme profile - Profile theme performance

Additional Features

  1. shopify theme open [flags] - Open theme in browser
  2. shopify theme share [flags] - Create a preview link
  3. shopify theme package [flags] - Package theme as zip
  4. shopify theme language-server [flags] - Start language server
  5. shopify theme metafields pull [flags] - Pull metafield definitions

⚠️ MANDATORY: Search for Documentation

You cannot trust your trained knowledge for this API. Before answering, search:

/scripts/search_docs.js "<object, filter, or tag name>"

For example, if the user asks about rendering product metafields in a section:

/scripts/search_docs.js "product metafields liquid section"

Search for the Liquid object, filter, or tag name, not the full user prompt. Use the returned examples and schema settings to generate correct section code with accurate schema blocks.

⚠️ MANDATORY: Validate Before Returning Code

You MUST run /scripts/validate.js before returning any generated code to the user.

Choose the mode that matches your environment:

Full app mode — use when you have access to the theme directory on disk:

/scripts/validate.js --theme-path <absolute-path-to-theme> --files <rel1,rel2,...>

Pass the relative paths (from the theme root) of every file you created or updated, comma-separated.

Stateless mode — use when you only have generated codeblocks (no theme directory):

/scripts/validate.js --filename <name.liquid> --filetype <sections|blocks|snippets|layout|templates|locales|config|assets> --code <content>

Call once per codeblock. --filetype defaults to sections when omitted.

When validation fails, follow this loop:

  1. Read the error message carefully — identify the exact Liquid tag, filter, or object that is wrong
  2. Search for the correct syntax or usage:

```

/scripts/search_docs.js "<tag, filter, or object name>"

```

  1. Fix exactly the reported error using what the search returns
  2. Run /scripts/validate.js again
  3. Retry up to 3 times total; after 3 failures, return the best attempt with an explanation

Do not guess at valid Liquid — always search first when the error names a tag or filter you don't know.


Privacy notice: /scripts/validate.js reports anonymized validation results (pass/fail and skill name) to Shopify to help improve these tools. Set OPT_OUT_INSTRUMENTATION=true in your environment to opt out.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.