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.
In this repository5 other files it gives its agents.
- admin-api-querySkill
- checkout-ui-extSkill
- shopify-functionSkill
- theme-auditSkill
- theme-initSkill
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
- Very specific: line 10
Create a Liquid section file under sections/ that includes HTML, a {% schema %} block with settings and blocks, and at least one preset so …
- Distinctive: line 18
Ask the user: "What is the purpose of this section?
- Very specific: line 21
Write the file to sections/<handle>.liquid.
- Very specific: line 22
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.
- Very specific: line 29
Always include at least one presets entry so merchants can add the section.
- Very specific: line 31
If the section should only appear in certain places, add enabled_on or disabled_on with templates or groups.
- Very specific: line 194
Every image has an alt attribute.
- Very specific: line 201
Do not output raw customer data without escape.
- Very specific: line 202
Do not use inline <script> that executes logic.
- Very specific: line 203
Do not omit the presets array.
- Very specific: line 204
Do not write the section to a folder other than sections/.
≈ “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.
Files
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
- 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.
- Confirm the theme root. Look for
config/settings_schema.jsonwith Glob. If not found, ask the user to point to the theme root. - Confirm the section handle. It must be kebab-case. Examples:
hero-banner,featured-collection,image-with-text. - Write the file to
sections/<handle>.liquid. Announce the write before creating the file. - If the section is meant for a JSON template, tell the user which
templates/*.jsonfile to add it to and show the exact JSON snippet.
Schema rules the section must follow
- The
namefield is the display name in the editor. Capitalize normally. - Settings must include
type,id, andlabel. Usedefaultvalues where sensible. - For blocks, set
max_blocksto a realistic limit (for example 3 for a hero, 12 for a product list). - Always include at least one
presetsentry so merchants can add the section. - Include
"tag": "section"and a"class"to make CSS targeting predictable. - If the section should only appear in certain places, add
enabled_onordisabled_onwithtemplatesorgroups.
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
- Every image has an
altattribute. Use the heading or a dedicated alt setting. - Headings follow a logical order. The hero is the only
<h1>on a page. - Buttons and links have visible text or
aria-label. - 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. Anysettings.text,block.settings.*, or metafield that includes user content must be escaped. - Do not use inline
<script>that executes logic. Put scripts inassets/and reference them fromlayout/theme.liquidor ajavascriptschema entry. - Do not omit the
presetsarray. Without it, merchants cannot add the section in the editor. - Do not write the section to a folder other than
sections/.
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
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.

