agentleFS
mohitkalemohitkale/shopify-devkit/skills/liquid-section/SKILL.md

liquid-section

Skill0 starsChanged 4 months agoMITView on GitHub

Generate a Liquid section for a Shopify Online Store 2.0 theme with a settings schema, blocks, and presets that appear in the theme editor. Use when the user asks to create a new section, add a hero or featured collection, build a custom section, or scaffold a Liquid section file.

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 1 is distinctive, and 10 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 10

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Create a Liquid section file under sections/ that includes HTML, a {% schema %} block with settings and blocks, and at least one preset so …

    line 10
  2. Distinctive:

    Ask the user: "What is the purpose of this section?

    line 18
  3. Very specific:

    Write the file to sections/<handle>.liquid.

    line 21
  4. Very specific:

    If the section is meant for a JSON template, tell the user which templates/*.json file to add it to and show the exact JSON snippet.

    line 22
  5. Very specific:

    Always include at least one presets entry so merchants can add the section.

    line 29
  6. Very specific:

    If the section should only appear in certain places, add enabled_on or disabled_on with templates or groups.

    line 31
  7. Very specific:

    Every image has an alt attribute.

    line 194
  8. Very specific:

    Do not output raw customer data without escape.

    line 201
  9. Very specific:

    Do not use inline <script> that executes logic.

    line 202
  10. Very specific:

    Do not omit the presets array.

    line 203
  11. Very specific:

    Do not write the section to a folder other than sections/.

    line 204

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Generate a Shopify Liquid section

Create a Liquid section file under sections/ that includes HTML, a {% schema %} block with settings and blocks, and at least one preset so the section appears in the theme editor's "Add section" list.

Inputs

$ARGUMENTS is an optional section handle (for example featured-collection). If empty, ask the user for the handle and purpose.

Workflow

  1. Ask the user: "What is the purpose of this section? (for example: hero banner, featured product, image with text, newsletter signup)". Do not skip this step. The purpose drives the settings schema.
  2. Confirm the theme root. Look for config/settings_schema.json with Glob. If not found, ask the user to point to the theme root.
  3. Confirm the section handle. It must be kebab-case. Examples: hero-banner, featured-collection, image-with-text.
  4. Write the file to sections/<handle>.liquid. Announce the write before creating the file.
  5. If the section is meant for a JSON template, tell the user which templates/*.json file to add it to and show the exact JSON snippet.

Schema rules the section must follow

  1. The name field is the display name in the editor. Capitalize normally.
  2. Settings must include type, id, and label. Use default values where sensible.
  3. For blocks, set max_blocks to a realistic limit (for example 3 for a hero, 12 for a product list).
  4. Always include at least one presets entry so merchants can add the section.
  5. Include "tag": "section" and a "class" to make CSS targeting predictable.
  6. If the section should only appear in certain places, add enabled_on or disabled_on with templates or groups.

Example: hero banner section

Write to sections/hero-banner.liquid:

<section
  class="hero-banner hero-banner--{{ section.settings.height }}"
  style="background-color: {{ section.settings.background_color }};"
>
  {% if section.settings.image %}
    {{
      section.settings.image
      | image_url: width: 2000
      | image_tag:
          alt: section.settings.heading,
          loading: 'eager',
          fetchpriority: 'high',
          widths: '375, 750, 1100, 1500, 2000',
          sizes: '100vw',
          class: 'hero-banner__image'
    }}
  {% endif %}

  <div class="hero-banner__content" style="color: {{ section.settings.text_color }};">
    {% if section.settings.heading != blank %}
      <h1 class="hero-banner__heading">{{ section.settings.heading | escape }}</h1>
    {% endif %}
    {% if section.settings.subheading != blank %}
      <p class="hero-banner__subheading">{{ section.settings.subheading | escape }}</p>
    {% endif %}

    {% for block in section.blocks %}
      {% case block.type %}
        {% when 'button' %}
          <a
            class="hero-banner__button"
            href="{{ block.settings.link }}"
            {{ block.shopify_attributes }}
          >
            {{ block.settings.label | escape }}
          </a>
      {% endcase %}
    {% endfor %}
  </div>
</section>

{% schema %}
{
  "name": "Hero banner",
  "tag": "section",
  "class": "section-hero-banner",
  "settings": [
    {
      "type": "image_picker",
      "id": "image",
      "label": "Background image"
    },
    {
      "type": "text",
      "id": "heading",
      "label": "Heading",
      "default": "Welcome to the store"
    },
    {
      "type": "text",
      "id": "subheading",
      "label": "Subheading",
      "default": "Discover our new arrivals"
    },
    {
      "type": "color",
      "id": "background_color",
      "label": "Background color",
      "default": "#f4f4f4"
    },
    {
      "type": "color",
      "id": "text_color",
      "label": "Text color",
      "default": "#121212"
    },
    {
      "type": "select",
      "id": "height",
      "label": "Height",
      "options": [
        { "value": "small", "label": "Small" },
        { "value": "medium", "label": "Medium" },
        { "value": "large", "label": "Large" }
      ],
      "default": "medium"
    }
  ],
  "blocks": [
    {
      "type": "button",
      "name": "Button",
      "settings": [
        {
          "type": "text",
          "id": "label",
          "label": "Label",
          "default": "Shop now"
        },
        {
          "type": "url",
          "id": "link",
          "label": "Link"
        }
      ]
    }
  ],
  "max_blocks": 2,
  "presets": [
    {
      "name": "Hero banner",
      "blocks": [
        { "type": "button" }
      ]
    }
  ]
}
{% endschema %}

Example: add the section to the home page JSON template

Edit templates/index.json:

{
  "sections": {
    "hero": {
      "type": "hero-banner",
      "blocks": {
        "cta": {
          "type": "button",
          "settings": {
            "label": "Shop now",
            "link": "/collections/all"
          }
        }
      },
      "block_order": ["cta"],
      "settings": {
        "heading": "New season, fresh picks",
        "subheading": "Find your favorite new piece",
        "height": "large"
      }
    },
    "main": {
      "type": "main-index",
      "settings": {}
    }
  },
  "order": ["hero", "main"]
}

Accessibility checks to apply

  1. Every image has an alt attribute. Use the heading or a dedicated alt setting.
  2. Headings follow a logical order. The hero is the only <h1> on a page.
  3. Buttons and links have visible text or aria-label.
  4. Color contrast between text and background meets WCAG AA. Warn the user if the default pair is below 4.5:1.

Do not

  • Do not output raw customer data without escape. Any settings.text, block.settings.*, or metafield that includes user content must be escaped.
  • Do not use inline <script> that executes logic. Put scripts in assets/ and reference them from layout/theme.liquid or a javascript schema entry.
  • Do not omit the presets array. Without it, merchants cannot add the section in the editor.
  • Do not write the section to a folder other than sections/.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.