shopify-metafields
БесплатноБез исполняемых скриптовНе проверенStore custom data on any Shopify resource — products, orders, customers — using typed metafield definitions accessible from Liquid and the Storefront API
от finsilabs★ 69 звёзд на GitHubОб этом скилле
Shopify Metafields
Overview
Metafields let you attach structured custom data to Shopify resources — products, variants, orders, customers, collections, and pages — without building a separate database. Metafield definitions enforce type validation (text, number, date, URL, JSON, file, product reference, etc.) and make metafields available in the Liquid template editor and Storefront API. Metaobjects extend this concept to create reusable, standalone custom data structures.
When to Use This Skill
- When products need additional attributes beyond Shopify's default fields (care instructions, dimensions, certifications)
- When storing per-customer data such as loyalty tier, subscription status, or B2B account number
- When building content-managed sections in a theme using metafield references (FAQs, size guides, feature callouts)
- When attaching order-level custom data from checkout (gift message, delivery instructions)
- When creating reusable structured content entries with Metaobjects (team members, press mentions, specs)
Core Instructions
Create metafield definitions via the Admin API
Definitions enforce type and make metafields storefront-accessible:
// Create a metafield definition for product care instructions const response = await adminClient.request(` mutation CreateMetafieldDefinition($definition: MetafieldDefinitionInput!) { metafieldDefinitionCreate(definition: $definition) { createdDefinition { id name namespace key type { name } } userErrors { field message code } } } `, { variables: { definition: { name: "Care Instructions", namespace: "custom", key: "care_instructions", type: "multi_line_text_field", ownerType: "PRODUCT", description: "Washing and care instructions for the product", visibleToStorefrontApi: true, // Optional: pin to product admin UI (use pinnedPosition in API version 2023-10+) pinnedPosition: 1, }, }, });Available types:
single_line_text_field,multi_line_text_field,number_integer,number_decimal,date,date_time,boolean,url,json,color,weight,volume,dimension,rating,file_reference,product_reference,variant_reference,collection_reference,page_reference,metaobject_reference,list.<type>.Write metafields via the Admin API
// Set a metafield on a product export async function setProductMetafield( productId: string, namespace: string, key: string, value: string, type: string ) { const response = await adminClient.request(` mutation SetMetafield($metafields: [MetafieldsSetInput!]!) { metafieldsSet(metafields: $metafields) { metafields { id key namespace value } userErrors { field message code } } } `, { variables: { metafields: [ { ownerId: productId, namespace, key, value, type, }, ], }, }); return response.data.metafieldsSet; } // Example: Set care instructions on a product await setProductMetafield( "gid://shopify/Product/1234567890", "custom", "care_instructions", "Machine wash cold. Tumble dry low. Do not bleach.", "multi_line_text_field" );Read metafields in Liquid templates
Once a definition exists with
visibleToStorefrontApi: true, metafields are available in Liquid via themetafieldsobject:{% comment %} product.metafields.namespace.key {% endcomment %} {% if product.metafields.custom.care_instructions != blank %} <div class="care-instructions"> <h3>Care Instructions</h3> {{ product.metafields.custom.care_instructions | metafield_tag }} </div> {% endif %} {% comment %} Access a product reference metafield {% endcomment %} {% assign related = product.metafields.custom.related_product.value %} {% if related %} <a href="{{ related.url }}">{{ related.title }}</a> {% endif %} {% comment %} Access a list of file references (images) {% endcomment %} {% for image in product.metafields.custom.gallery_images.value %} <img src="{{ image | image_url: width: 800 }}" alt="{{ image.alt }}"> {% endfor %}Read metafields via the Storefront API
// Query product with metafields in the Storefront API const { data } = await storefront.request(` query GetProductWithMetafields($handle: String!) { product(handle: $handle) { id title # Metafields must be explicitly requested by namespace + key careInstructions: metafield(namespace: "custom", key: "care_instructions")
Установить shopify-metafields в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
claude-codecursorgemini-clicopilotcodex-clikiroopencodeВложенные файлы
FAQ
Что делает скилл shopify-metafields?
Store custom data on any Shopify resource — products, orders, customers — using typed metafield definitions accessible from Liquid and the Storefront API
Как установить скилл shopify-metafields?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл shopify-metafields запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic