shopify-admin-product-lifecycle-manager
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePurpose
用途
Queries products matching a tag, vendor, collection, or status filter and bulk-transitions them to a target status (DRAFT, ACTIVE, or ARCHIVED). Used for seasonal launches (DRAFT → ACTIVE), end-of-season sunsetting (ACTIVE → ARCHIVED), and pre-launch staging (creating as DRAFT, activating on a date).
查询符合标签、供应商、合集或状态筛选条件的产品,并将其批量切换至目标状态(DRAFT、ACTIVE 或 ARCHIVED)。适用于季节性上新(DRAFT → ACTIVE)、季末产品退市(ACTIVE → ARCHIVED)以及上线前筹备(创建为 DRAFT 状态,指定日期激活)等场景。
Prerequisites
前置条件
- Authenticated Shopify CLI session:
shopify store auth --store <domain> --scopes read_products,write_products - API scopes: ,
read_productswrite_products
- 已完成身份认证的 Shopify CLI 会话:
shopify store auth --store <domain> --scopes read_products,write_products - API 权限:、
read_productswrite_products
Parameters
参数
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| store | string | yes | — | Store domain (e.g., mystore.myshopify.com) |
| filter | string | yes | — | Product filter query (e.g., |
| target_status | string | yes | — | Target status: |
| dry_run | bool | no | true | Preview products without executing mutations |
| format | string | no | human | Output format: |
| 参数 | 类型 | 必填 | 默认值 | 描述 |
|---|---|---|---|---|
| store | string | 是 | — | 店铺域名(例如 mystore.myshopify.com) |
| filter | string | 是 | — | 产品筛选查询条件(例如 |
| target_status | string | 是 | — | 目标状态: |
| dry_run | bool | 否 | true | 仅预览匹配产品,不实际执行变更操作 |
| format | string | 否 | human | 输出格式: |
Safety
安全提示
⚠️ ARCHIVED products are hidden from all sales channels and cannot be purchased. ACTIVE products are immediately visible to customers. Run withto review the product list before committing — especially for ARCHIVED transitions which are hard to reverse in bulk.dry_run: true
⚠️ ARCHIVED 产品会对所有销售渠道隐藏,无法被购买。ACTIVE 产品会立即对客户可见。提交操作前请先使用配置预览产品列表,尤其是切换至 ARCHIVED 状态的操作,批量回滚难度极高。dry_run: true
Workflow Steps
工作流步骤
-
OPERATION:— query Inputs:
products,query: <filter>, pagination cursor Expected output: Products withfirst: 250,id,title,status; paginate untiltagshasNextPage: false -
Filter to products NOT already in— skip those already correct
target_status -
OPERATION:— mutation Inputs:
productUpdate,id: <product_id>Expected output:status: <target_status>,product { id, title, status }userErrors
-
操作:— 查询 输入:
products、query: <filter>、分页游标 预期输出: 包含first: 250、id、title、status的产品列表,分页查询直到tagshasNextPage: false -
过滤掉已经处于的产品 —— 跳过状态已符合要求的产品
target_status -
操作:— 变更 输入:
productUpdate、id: <product_id>预期输出:status: <target_status>、product { id, title, status }userErrors
GraphQL Operations
GraphQL 操作
graphql
undefinedgraphql
undefinedproducts:query — validated against api_version 2025-01
products:query — validated against api_version 2025-01
query ProductsByFilter($query: String!, $after: String) {
products(first: 250, after: $after, query: $query) {
edges {
node {
id
title
status
vendor
tags
publishedAt
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
```graphqlquery ProductsByFilter($query: String!, $after: String) {
products(first: 250, after: $after, query: $query) {
edges {
node {
id
title
status
vendor
tags
publishedAt
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
```graphqlproductUpdate:mutation — validated against api_version 2025-01
productUpdate:mutation — validated against api_version 2025-01
mutation ProductUpdateStatus($input: ProductInput!) {
productUpdate(input: $input) {
product {
id
title
status
}
userErrors {
field
message
}
}
}
undefinedmutation ProductUpdateStatus($input: ProductInput!) {
productUpdate(input: $input) {
product {
id
title
status
}
userErrors {
field
message
}
}
}
undefinedSession Tracking
会话追踪
Claude MUST emit the following output at each stage. This is mandatory.
On start, emit:
╔══════════════════════════════════════════════╗
║ SKILL: Product Lifecycle Manager ║
║ Store: <store domain> ║
║ Started: <YYYY-MM-DD HH:MM UTC> ║
╚══════════════════════════════════════════════╝After each step, emit:
[N/TOTAL] <QUERY|MUTATION> <OperationName>
→ Params: <brief summary of key inputs>
→ Result: <count or outcome>If , prefix every mutation step with and do not execute it.
dry_run: true[DRY RUN]On completion, emit:
For (default):
format: human══════════════════════════════════════════════
OUTCOME SUMMARY
Products matched: <n>
Already at target: <n> (skipped)
Status updated: <n>
Errors: <n>
Output: lifecycle_update_<date>.csv
══════════════════════════════════════════════For , emit:
format: jsonjson
{
"skill": "product-lifecycle-manager",
"store": "<domain>",
"started_at": "<ISO8601>",
"completed_at": "<ISO8601>",
"dry_run": true,
"filter": "<query>",
"target_status": "ACTIVE",
"outcome": {
"matched": 0,
"skipped_already_correct": 0,
"updated": 0,
"errors": 0,
"output_file": "lifecycle_update_<date>.csv"
}
}Claude 必须在每个阶段输出以下内容,此为强制要求。
启动时输出:
╔══════════════════════════════════════════════╗
║ SKILL: Product Lifecycle Manager ║
║ Store: <store domain> ║
║ Started: <YYYY-MM-DD HH:MM UTC> ║
╚══════════════════════════════════════════════╝每完成一个步骤后输出:
[N/TOTAL] <QUERY|MUTATION> <OperationName>
→ Params: <brief summary of key inputs>
→ Result: <count or outcome>如果 ,请在每个变更步骤前添加 前缀,且不实际执行操作。
dry_run: true[DRY RUN]完成时输出:
若为 (默认配置):
format: human══════════════════════════════════════════════
OUTCOME SUMMARY
Products matched: <n>
Already at target: <n> (skipped)
Status updated: <n>
Errors: <n>
Output: lifecycle_update_<date>.csv
══════════════════════════════════════════════若为 ,输出:
format: jsonjson
{
"skill": "product-lifecycle-manager",
"store": "<domain>",
"started_at": "<ISO8601>",
"completed_at": "<ISO8601>",
"dry_run": true,
"filter": "<query>",
"target_status": "ACTIVE",
"outcome": {
"matched": 0,
"skipped_already_correct": 0,
"updated": 0,
"errors": 0,
"output_file": "lifecycle_update_<date>.csv"
}
}Output Format
输出格式
CSV file with columns:
, , , , ,
lifecycle_update_<YYYY-MM-DD>.csvproduct_idtitleprevious_statusnew_statusvendortagsCSV 文件 ,包含以下列:
、、、、、
lifecycle_update_<YYYY-MM-DD>.csvproduct_idtitleprevious_statusnew_statusvendortagsError Handling
错误处理
| Error | Cause | Recovery |
|---|---|---|
| API rate limit exceeded | Wait 2 seconds, retry up to 3 times |
| Product locked or invalid state | Log error, skip product, continue |
| No products match filter | Filter too narrow | Exit with 0 matches, suggest broadening filter |
| 错误 | 原因 | 解决方案 |
|---|---|---|
| API 调用超出频率限制 | 等待2秒,最多重试3次 |
productUpdate 操作返回 | 产品被锁定或状态无效 | 记录错误,跳过当前产品,继续执行后续操作 |
| 无产品匹配筛选条件 | 筛选条件过于严格 | 提示匹配数为0并退出,建议放宽筛选条件 |
Best Practices
最佳实践
- Use tags to mark seasonal batches before running (e.g., tag products with before activating them) so the filter is precise.
launch:2026-05 - ARCHIVED status removes products from all channels including the storefront, POS, and buy buttons — confirm this is the intent before running at scale.
- For large catalogs (500+ products), rate limiting will slow execution — the skill retries automatically but large batches may take several minutes.
- Pair with before activating DRAFT products to ensure they have all required fields.
product-data-completeness-score
- 运行前使用标签标记季节性批次产品(例如在激活产品前给产品打上 标签),确保筛选条件精准。
launch:2026-05 - ARCHIVED 状态会将产品从所有渠道移除,包括店铺前台、POS 系统和购买按钮 —— 大规模执行操作前请确认符合预期。
- 针对大型商品目录(500+ 产品),频率限制会减慢执行速度 —— 该工具会自动重试,但大批量操作可能需要数分钟完成。
- 激活 DRAFT 状态产品前,可配合 工具使用,确保产品填写了所有必填字段。
product-data-completeness-score