AgentSkillsCN

shopify-developer

全面掌握 Shopify 开发技能,涵盖主题架构、Liquid 模板、Admin API、Storefront API、元字段/元对象、结账扩展性、Shopify Functions、Webhook 以及平台限制。适用于实施或调试 Shopify 应用/主题开发、API 集成、结账自定义,或进行数据建模时使用。如需了解 Hydrogen/无头框架的详细信息,请参考 Context7 MCP 中当前框架的相关文档。

SKILL.md
--- frontmatter
name: shopify-developer
description: Comprehensive Shopify development skill for theme architecture, Liquid, Admin API, Storefront API, metafields/metaobjects, checkout extensibility, Shopify Functions, webhooks, and platform limits. Use when implementing or debugging Shopify app/theme work, API integrations, checkout customizations, or data modeling. For Hydrogen/headless framework specifics, use Context7 MCP for current framework docs.

Shopify Developer

Use this skill as the coordination hub. Keep implementation details in references/ files and load only the file(s) needed for the task.

Authentication

Use quarterly API versions in all endpoints, for example 2026-01.

Admin GraphQL endpoint:

bash
https://${SHOP}.myshopify.com/admin/api/${API_VERSION}/graphql.json

Admin API headers:

bash
X-Shopify-Access-Token: ${SHOPIFY_ACCESS_TOKEN}
Content-Type: application/json

Storefront GraphQL endpoint:

bash
https://${SHOP}.myshopify.com/api/${API_VERSION}/graphql.json

Storefront API headers:

bash
X-Shopify-Storefront-Access-Token: ${SHOPIFY_STOREFRONT_TOKEN}
Content-Type: application/json

Source environment variables from ~/.agents/.env before running commands.

API Conventions

  • Prefer GraphQL over REST for new work.
  • Include API version in the URL; update quarterly.
  • Paginate with cursors (first/after) rather than page numbers.
  • Handle both top-level errors and mutation userErrors.
  • Budget GraphQL query cost and throttle based on available points.
  • Use bulk operations for large export/import workloads.
  • Prefer idempotent mutation patterns for retry-safe writes.

Core Workflows

Theme development pipeline:

  • Pull current theme state, iterate in local dev, push to draft first.
  • Validate theme editor behavior (sections, blocks, settings) before live publish.
  • Reference: references/theme-architecture.md, references/liquid.md.

Product and metafield management:

  • Define metafield/metaobject schemas first, then write values through Admin API.
  • Access values in Liquid and Storefront API using type-safe patterns.
  • Reference: references/admin-api.md, references/metafields-metaobjects.md.

Checkout customization:

  • Use Checkout UI Extensions and Shopify Functions; avoid legacy checkout patterns.
  • Separate UI concerns (extensions) from pricing/fulfillment logic (functions).
  • Reference: references/checkout-extensibility.md, references/shopify-functions.md.

Reference Files

FileWhen to read
references/admin-api.mdProduct/order/customer/inventory GraphQL workflows; bulk operations. Grep hint: bulkOperation.
references/storefront-api.mdHeadless storefront queries, cart operations, customer account flows, localization. Grep hint: cart.
references/metafields-metaobjects.mdMetafield types, definitions, Liquid access, metaobject CRUD. Grep hint: metafieldsSet.
references/liquid.mdLiquid objects, filters, tags, render patterns, metafield rendering, performance tuning.
references/theme-architecture.mdOS 2.0 structure, section schema, templates, app blocks, CLI deployment flow.
references/checkout-extensibility.mdCheckout UI extensions, web pixels, migration timelines, post-purchase extensions.
references/shopify-functions.mdFunction types, WASM constraints, implementation/testing, Scripts migration path.
references/webhooks-events.mdWebhook topics, compliance webhooks, HMAC verification, retries/idempotency.
references/platform-limits.mdAPI versioning, limits, deprecation timelines, plan-specific capabilities.

Gotchas

  1. Use .value when rendering metafields in Liquid.
  2. Use metafieldsDelete (plural), not singular deletion mutation names.
  3. Do not rely on checkout.liquid; migrate to checkout extensibility.
  4. Plan Scripts migration before June 30, 2026 sunset.
  5. Treat REST Admin API as maintenance-only for new implementation.
  6. Rotate to supported API versions before the 12-month support window ends.
  7. Implement idempotency keys for retry-safe writes before April 1, 2026 enforcement.
  8. Remove deprecated Storefront tax fields during API upgrades.
  9. Do not hand-edit config/settings_data.json; use Theme Editor.
  10. Keep Shopify Functions logic minimal to stay inside strict runtime limits.