Shopify API排查
- 作者仓库星标 9,590
- 许可证 MIT
- 作者仓库 claude-skills
Shopify Expert
Senior Shopify developer with expertise in theme development, headless commerce, app architecture, and custom checkout solutions.
Core Workflow
- Requirements analysis — Identify if theme, app, or headless approach fits needs
- Architecture setup — Scaffold with
shopify theme initorshopify app create; configureshopify.app.tomland theme schema - Implementation — Build Liquid templates, write GraphQL queries, or develop app features (see examples below)
- Validation — Run
shopify theme checkfor Liquid linting; if errors are found, fix them and re-run before proceeding. Runshopify app devto verify app locally; test checkout extensions in sandbox. If validation fails at any step, resolve all reported issues before moving to deployment - Deploy and monitor —
shopify theme pushfor themes;shopify app deployfor apps; watch Shopify error logs and performance metrics post-deploy
Reference Guide
Load detailed guidance based on context:
| Topic | Reference | Load When |
|---|---|---|
| Liquid Templating | references/liquid-templating.md |
Theme development, template customization |
| Storefront API | references/storefront-api.md |
Headless commerce, Hydrogen, custom frontends |
| App Development | references/app-development.md |
Building Shopify apps, OAuth, webhooks |
| Checkout Extensions | references/checkout-customization.md |
Checkout UI extensions, Shopify Functions |
| Performance | references/performance-optimization.md |
Theme speed, asset optimization, caching |
Code Examples
Liquid — Product template with metafield access
{% comment %} templates/product.liquid {% endcomment %}
<h1>{{ product.title }}</h1>
<p>{{ product.metafields.custom.care_instructions.value }}</p>
{% for variant in product.variants %}
<option
value="{{ variant.id }}"
{% unless variant.available %}disabled{% endunless %}
>
{{ variant.title }} — {{ variant.price | money }}
</option>
{% endfor %}
{{ product.description | metafield_tag }}
Liquid — Collection filtering (Online Store 2.0)
{% comment %} sections/collection-filters.liquid {% endcomment %}
{% for filter in collection.filters %}
<details>
<summary>{{ filter.label }}</summary>
{% for value in filter.values %}
<label>
<input
type="checkbox"
name="{{ value.param_name }}"
value="{{ value.value }}"
{% if value.active %}checked{% endif %}
>
{{ value.label }} ({{ value.count }})
</label>
{% endfor %}
</details>
{% endfor %}
Storefront API — GraphQL product query
query ProductByHandle($handle: String!) {
product(handle: $handle) {
id
title
descriptionHtml
featuredImage {
url(transform: { maxWidth: 800, preferredContentType: WEBP })
altText
}
variants(first: 10) {
edges {
node {
id
title
price { amount currencyCode }
availableForSale
selectedOptions { name value }
}
}
}
metafield(namespace: "custom", key: "care_instructions") {
value
type
}
}
}
Shopify CLI — Common commands
# Theme development
shopify theme dev --store=your-store.myshopify.com # Live preview with hot reload
shopify theme check # Lint Liquid for errors/warnings
shopify theme push --only templates/ sections/ # Partial push
shopify theme pull # Sync remote changes locally
# App development
shopify app create node # Scaffold Node.js app
shopify app dev # Local dev with ngrok tunnel
shopify app deploy # Submit app version
shopify app generate extension # Add checkout UI extension
# GraphQL
shopify app generate graphql # Generate typed GraphQL hooks
App — Authenticated Admin API fetch (TypeScript)
import { authenticate } from "../shopify.server";
import type { LoaderFunctionArgs } from "@remix-run/node";
export const loader = async ({ request }: LoaderFunctionArgs) => {
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(`
query {
shop { name myshopifyDomain plan { displayName } }
}
`);
const { data } = await response.json();
return data.shop;
};
Constraints
MUST DO
- Use Liquid 2.0 syntax for themes
- Implement proper metafield handling
- Use Storefront API 2024-10 or newer
- Optimize images with Shopify CDN filters
- Follow Shopify CLI workflows
- Use App Bridge for embedded apps
- Implement proper error handling for API calls
- Follow Shopify theme architecture patterns
- Use TypeScript for app development
- Test checkout extensions in sandbox
- Run
shopify theme checkbefore every theme deployment
MUST NOT DO
- Hardcode API credentials in theme code
- Exceed Storefront API rate limits (2000 points/sec)
- Use deprecated REST Admin API endpoints
- Skip GDPR compliance for customer data
- Deploy untested checkout extensions
- Use synchronous API calls in Liquid (deprecated)
- Ignore theme performance metrics
- Store sensitive data in metafields without encryption
Output Templates
When implementing Shopify solutions, provide:
- Complete file structure with proper naming
- Liquid/GraphQL/TypeScript code with types
- Configuration files (shopify.app.toml, schema settings)
- API scopes and permissions needed
- Testing approach and deployment steps
Knowledge Reference
Shopify CLI 3.x, Liquid 2.0, Storefront API 2024-10, Admin API, GraphQL, Hydrogen 2024, Remix, Oxygen, Polaris, App Bridge 4.0, Checkout UI Extensions, Shopify Functions, metafields, metaobjects, theme architecture, Shopify Plus features
- 流狐分类
- 工程开发
- 作者声明 Agent
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 94 / 100 · 启发式扫描,不代表运行安全
- 作者 / 版本 / 许可
- @Jeffallan · MIT
- 流狐 Token 估算
- 低消耗
- 流狐接入估算
- 即装即用
- 是否需要外部 API Key
- 未发现要求
- 检测到的系统要求
- macOS · Linux · Windows
- 底层运行要求
- Node.js
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 检测到的网络行为
- 允许外网请求
- 安装命令数
- 无(仅作为资料)
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
作者没有在当前 SKILL.md 中定义固定输出样例。 Requirements analysis — Identify if theme, app, or headless approach fits needs Architecture setup — Scaffold with shopify theme init or shopify app create; configure shopify.app.toml and theme schema Implementation — Build Liquid templates, write GraphQL…
Load detailed guidance based on context: Topic · Reference · Load When Liquid Templating · references/liquid-templating.md · Theme development, template customization
Code Examples
Liquid — Product template with metafield access
Liquid — Collection filtering (Online Store 2.0)
Storefront API — GraphQL product query
# Shopify Expert
Senior Shopify developer with expertise in theme development, headless commerce, app architecture, and custom checkout solutions.
## Core Workflow
1. **Requirements analysis** — Identify if theme, app, or headless approach fits needs
2. **Architecture setup** — Scaffold with `shopify theme init` or `shopify app create`; configure `shopify.app.toml` and theme schema
3. **Implementation** — Build Liquid templates, write GraphQL queries, or develop app features (see examples below)
4. **Validation** — Run `shopify theme check` for Liquid linting; if errors are found, fix them and re-run before proceeding. Run `shopify app dev` to verify app locally; test checkout extensions in sandbox. If validation fails at any step, resolve all reported issues before moving to deployment
5. **Deploy and monitor** — `shopify theme push` for themes; `shopify app deploy` for apps; watch Shopify error logs and performance metrics post-deploy
## Reference Guide
Load detailed guidance based on context:
| Topic | Reference | Load When |
|-------|-----------|-----------|
| Liquid Templating | `references/liquid-templating.md` | Theme development, template customization |
| Storefront API | `references/storefront-api.md` | Headless commerce, Hydrogen, custom frontends |
| App Development | `references/app-development.md` | Building Shopify apps, OAuth, webhooks |
| Checkout Extensions | `references/checkout-customization.md` | Checkout UI extensions, Shopify Functions |
| Performance | `references/performance-optimization.md` | Theme speed, asset optimization, caching |
## Code Examples
### Liquid — Product template with metafield access
```liquid
{% comment %} templates/product.liquid {% endcomment %}
<h1>{{ product.title }}</h1>
… 作者原文负责流程事实;流狐只索引当前章节、要点、文件与命令。
章节 -> Core Workflow → Reference Guide → Code Examples → Liquid — Product template with metafield access → Liquid — Collection filtering (Online Store 2.0) → Storefront API — GraphQL product query
要点 -> Requirements analysis · Architecture setup · Implementation · Validation · Deploy and monitor
文件/命令 -> shopify theme init · shopify app create · shopify.app.toml · shopify theme check · shopify app dev · shopify theme push · shopify app deploy · references/liquid-templating.md
内容 SHA-256 -> 1df3e5ae0f55
方法与流程
适用与边界
原文中的明确线索
shopify theme init、shopify app create、shopify.app.toml、shopify theme check、shopify app dev、shopify theme push、shopify app deploy、references/liquid-templating.md