shopify-development by sickn33/antigravity-awesome-skills
npx skills add https://github.com/sickn33/antigravity-awesome-skills --skill shopify-development当用户询问以下内容时使用此技能:
如果用户想要集成外部服务 或 构建商家工具 或 为功能收费: → 构建一个应用(参见 references/app-development.md)
如果用户想要自定义结账流程 或 添加管理后台界面 或 创建 POS 操作 或 实现折扣规则: → 构建一个扩展(参见 references/extensions.md)
如果用户想要自定义店铺前端设计 或 修改产品/集合页面: → 构建一个主题(参见 references/themes.md)
如果用户同时需要后端逻辑和店铺前端界面: → 构建应用 + 主题扩展组合
安装 CLI:
npm install -g @shopify/cli@latest
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
创建并运行应用:
shopify app init # 创建新应用
shopify app dev # 启动开发服务器并建立隧道
shopify app deploy # 构建并上传到 Shopify
生成扩展:
shopify app generate extension --type checkout_ui_extension
shopify app generate extension --type admin_action
shopify app generate extension --type admin_block
shopify app generate extension --type pos_ui_extension
shopify app generate extension --type function
主题开发:
shopify theme init # 创建新主题
shopify theme dev # 在 localhost:9292 启动本地预览
shopify theme pull --live # 拉取线上主题
shopify theme push --development # 推送到开发主题
在 shopify.app.toml 中配置:
[access_scopes]
scopes = "read_products,write_products,read_orders,write_orders,read_customers"
常用权限范围:
read_products, write_products - 产品目录访问权限read_orders, write_orders - 订单管理权限read_customers, write_customers - 客户数据权限read_inventory, write_inventory - 库存水平权限read_fulfillments, write_fulfillments - 订单履约权限query GetProducts($first: Int!, $query: String) {
products(first: $first, query: $query) {
edges {
node {
id
title
handle
status
variants(first: 5) {
edges {
node {
id
price
inventoryQuantity
}
}
}
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
query GetOrders($first: Int!) {
orders(first: $first) {
edges {
node {
id
name
createdAt
displayFinancialStatus
totalPriceSet {
shopMoney {
amount
currencyCode
}
}
}
}
}
}
mutation SetMetafields($metafields: [MetafieldsSetInput!]!) {
metafieldsSet(metafields: $metafields) {
metafields {
id
namespace
key
value
}
userErrors {
field
message
}
}
}
变量示例:
{
"metafields": [
{
"ownerId": "gid://shopify/Product/123",
"namespace": "custom",
"key": "care_instructions",
"value": "Handle with care",
"type": "single_line_text_field"
}
]
}
import {
reactExtension,
BlockStack,
TextField,
Checkbox,
useApplyAttributeChange,
} from "@shopify/ui-extensions-react/checkout";
export default reactExtension("purchase.checkout.block.render", () => (
<GiftMessage />
));
function GiftMessage() {
const [isGift, setIsGift] = useState(false);
const [message, setMessage] = useState("");
const applyAttributeChange = useApplyAttributeChange();
useEffect(() => {
if (isGift && message) {
applyAttributeChange({
type: "updateAttribute",
key: "gift_message",
value: message,
});
}
}, [isGift, message]);
return (
<BlockStack spacing="loose">
<Checkbox checked={isGift} onChange={setIsGift}>
This is a gift
</Checkbox>
{isGift && (
<TextField
label="Gift Message"
value={message}
onChange={setMessage}
multiline={3}
/>
)}
</BlockStack>
);
}
{% comment %} 产品卡片代码片段 {% endcomment %}
<div class="product-card">
<a href="{{ product.url }}">
{% if product.featured_image %}
<img
src="{{ product.featured_image | img_url: 'medium' }}"
alt="{{ product.title | escape }}"
loading="lazy"
>
{% endif %}
<h3>{{ product.title }}</h3>
<p class="price">{{ product.price | money }}</p>
{% if product.compare_at_price > product.price %}
<p class="sale-badge">Sale</p>
{% endif %}
</a>
</div>
在 shopify.app.toml 中:
[webhooks]
api_version = "2026-01"
[[webhooks.subscriptions]]
topics = ["orders/create", "orders/updated"]
uri = "/webhooks/orders"
[[webhooks.subscriptions]]
topics = ["products/update"]
uri = "/webhooks/products"
# GDPR 强制要求的 Webhook(应用审核所需)
[webhooks.privacy_compliance]
customer_data_request_url = "/webhooks/gdpr/data-request"
customer_deletion_url = "/webhooks/gdpr/customer-deletion"
shop_deletion_url = "/webhooks/gdpr/shop-deletion"
pageInfo.endCursorimg_url 过滤器优化图片如果看到速率限制错误: → 实现指数退避重试逻辑 → 对于大型数据集切换到批量操作 → 监控 X-Shopify-Shop-Api-Call-Limit 响应头
如果身份验证失败: → 验证访问令牌是否仍然有效 → 检查是否已授予所有必需的权限范围 → 确保 OAuth 流程已成功完成
如果扩展未显示: → 验证扩展目标是否正确 → 检查扩展是否已通过 shopify app deploy 发布 → 确认应用已安装在测试店铺上
如果 Webhook 未接收到事件: → 验证 Webhook URL 是否可公开访问 → 检查 HMAC 签名验证逻辑 → 在合作伙伴仪表板中查看 Webhook 日志
如果 GraphQL 查询失败: → 根据模式验证查询(使用 GraphiQL 浏览器) → 检查错误信息中是否有已弃用的字段 → 验证您是否拥有必需的访问权限范围
如需详细的实现指南,请阅读以下文件:
references/app-development.md - OAuth 身份验证流程、产品/订单/计费的 GraphQL 变更操作、Webhook 处理器、计费 API 集成references/extensions.md - 结账 UI 组件、管理后台 UI 扩展、POS 扩展、用于折扣/支付/配送的 Shopify Functionsreferences/themes.md - Liquid 语法参考、主题目录结构、版块和代码片段、常见模式scripts/shopify_init.py - 交互式项目脚手架。运行:python scripts/shopify_init.pyscripts/shopify_graphql.py - 包含查询模板、分页、速率限制的 GraphQL 工具。导入:from shopify_graphql import ShopifyGraphQLAPI 版本:2026-01(季度发布,12 个月弃用窗口)
此技能适用于执行概述中描述的工作流程或操作。
每周安装量
991
仓库
GitHub 星标数
27.4K
首次出现
2026 年 1 月 19 日
安全审计
安装于
opencode798
gemini-cli775
codex756
github-copilot687
cursor671
claude-code633
Use this skill when the user asks about:
IF user wants to integrate external services OR build merchant tools OR charge for features: → Build an App (see references/app-development.md)
IF user wants to customize checkout OR add admin UI OR create POS actions OR implement discount rules: → Build an Extension (see references/extensions.md)
IF user wants to customize storefront design OR modify product/collection pages: → Build a Theme (see references/themes.md)
IF user needs both backend logic AND storefront UI: → Build App + Theme Extension combination
Install CLI:
npm install -g @shopify/cli@latest
Create and run app:
shopify app init # Create new app
shopify app dev # Start dev server with tunnel
shopify app deploy # Build and upload to Shopify
Generate extension:
shopify app generate extension --type checkout_ui_extension
shopify app generate extension --type admin_action
shopify app generate extension --type admin_block
shopify app generate extension --type pos_ui_extension
shopify app generate extension --type function
Theme development:
shopify theme init # Create new theme
shopify theme dev # Start local preview at localhost:9292
shopify theme pull --live # Pull live theme
shopify theme push --development # Push to dev theme
Configure in shopify.app.toml:
[access_scopes]
scopes = "read_products,write_products,read_orders,write_orders,read_customers"
Common scopes:
read_products, write_products - Product catalog accessread_orders, write_orders - Order managementread_customers, write_customers - Customer dataread_inventory, write_inventory - Stock levelsread_fulfillments, write_fulfillments - Order fulfillmentquery GetProducts($first: Int!, $query: String) {
products(first: $first, query: $query) {
edges {
node {
id
title
handle
status
variants(first: 5) {
edges {
node {
id
price
inventoryQuantity
}
}
}
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
query GetOrders($first: Int!) {
orders(first: $first) {
edges {
node {
id
name
createdAt
displayFinancialStatus
totalPriceSet {
shopMoney {
amount
currencyCode
}
}
}
}
}
}
mutation SetMetafields($metafields: [MetafieldsSetInput!]!) {
metafieldsSet(metafields: $metafields) {
metafields {
id
namespace
key
value
}
userErrors {
field
message
}
}
}
Variables example:
{
"metafields": [
{
"ownerId": "gid://shopify/Product/123",
"namespace": "custom",
"key": "care_instructions",
"value": "Handle with care",
"type": "single_line_text_field"
}
]
}
import {
reactExtension,
BlockStack,
TextField,
Checkbox,
useApplyAttributeChange,
} from "@shopify/ui-extensions-react/checkout";
export default reactExtension("purchase.checkout.block.render", () => (
<GiftMessage />
));
function GiftMessage() {
const [isGift, setIsGift] = useState(false);
const [message, setMessage] = useState("");
const applyAttributeChange = useApplyAttributeChange();
useEffect(() => {
if (isGift && message) {
applyAttributeChange({
type: "updateAttribute",
key: "gift_message",
value: message,
});
}
}, [isGift, message]);
return (
<BlockStack spacing="loose">
<Checkbox checked={isGift} onChange={setIsGift}>
This is a gift
</Checkbox>
{isGift && (
<TextField
label="Gift Message"
value={message}
onChange={setMessage}
multiline={3}
/>
)}
</BlockStack>
);
}
{% comment %} Product Card Snippet {% endcomment %}
<div class="product-card">
<a href="{{ product.url }}">
{% if product.featured_image %}
<img
src="{{ product.featured_image | img_url: 'medium' }}"
alt="{{ product.title | escape }}"
loading="lazy"
>
{% endif %}
<h3>{{ product.title }}</h3>
<p class="price">{{ product.price | money }}</p>
{% if product.compare_at_price > product.price %}
<p class="sale-badge">Sale</p>
{% endif %}
</a>
</div>
In shopify.app.toml:
[webhooks]
api_version = "2026-01"
[[webhooks.subscriptions]]
topics = ["orders/create", "orders/updated"]
uri = "/webhooks/orders"
[[webhooks.subscriptions]]
topics = ["products/update"]
uri = "/webhooks/products"
# GDPR mandatory webhooks (required for app approval)
[webhooks.privacy_compliance]
customer_data_request_url = "/webhooks/gdpr/data-request"
customer_deletion_url = "/webhooks/gdpr/customer-deletion"
shop_deletion_url = "/webhooks/gdpr/shop-deletion"
pageInfo.endCursorimg_url filterIF you see rate limit errors: → Implement exponential backoff retry logic → Switch to bulk operations for large datasets → Monitor X-Shopify-Shop-Api-Call-Limit header
IF authentication fails: → Verify the access token is still valid → Check that all required scopes were granted → Ensure OAuth flow completed successfully
IF extension is not appearing: → Verify the extension target is correct → Check that extension is published via shopify app deploy → Confirm the app is installed on the test store
IF webhook is not receiving events: → Verify the webhook URL is publicly accessible → Check HMAC signature validation logic → Review webhook logs in Partner Dashboard
IF GraphQL query fails: → Validate query against schema (use GraphiQL explorer) → Check for deprecated fields in error message → Verify you have required access scopes
For detailed implementation guides, read these files:
references/app-development.md - OAuth authentication flow, GraphQL mutations for products/orders/billing, webhook handlers, billing API integrationreferences/extensions.md - Checkout UI components, Admin UI extensions, POS extensions, Shopify Functions for discounts/payment/deliveryreferences/themes.md - Liquid syntax reference, theme directory structure, sections and snippets, common patternsscripts/shopify_init.py - Interactive project scaffolding. Run: python scripts/shopify_init.pyscripts/shopify_graphql.py - GraphQL utilities with query templates, pagination, rate limiting. Import: from shopify_graphql import ShopifyGraphQLAPI Version: 2026-01 (quarterly releases, 12-month deprecation window)
This skill is applicable to execute the workflow or actions described in the overview.
Weekly Installs
991
Repository
GitHub Stars
27.4K
First Seen
Jan 19, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
opencode798
gemini-cli775
codex756
github-copilot687
cursor671
claude-code633
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
102,200 周安装
Grimoire CLI 使用指南:区块链法术编写、验证与执行全流程
940 周安装
Grimoire Uniswap 技能:查询 Uniswap 元数据与生成代币/资金池快照的 CLI 工具
940 周安装
Grimoire Aave 技能:查询 Aave V3 元数据和储备快照的 CLI 工具
941 周安装
Railway CLI 部署指南:使用 railway up 命令快速部署代码到 Railway 平台
942 周安装
n8n Python 代码节点使用指南:在自动化工作流中编写 Python 脚本
943 周安装
Flutter Platform Views 实现指南:Android/iOS/macOS原生视图与Web嵌入教程
943 周安装