shopify-admin-product-lifecycle-manager

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Purpose

用途

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_products
    ,
    write_products
  • 已完成身份认证的 Shopify CLI 会话:
    shopify store auth --store <domain> --scopes read_products,write_products
  • API 权限:
    read_products
    write_products

Parameters

参数

ParameterTypeRequiredDefaultDescription
storestringyesStore domain (e.g., mystore.myshopify.com)
filterstringyesProduct filter query (e.g.,
tag:summer-2026
,
vendor:Nike
,
status:draft
)
target_statusstringyesTarget status:
ACTIVE
,
DRAFT
, or
ARCHIVED
dry_runboolnotruePreview products without executing mutations
formatstringnohumanOutput format:
human
or
json
参数类型必填默认值描述
storestring店铺域名(例如 mystore.myshopify.com)
filterstring产品筛选查询条件(例如
tag:summer-2026
vendor:Nike
status:draft
target_statusstring目标状态:
ACTIVE
DRAFT
ARCHIVED
dry_runbooltrue仅预览匹配产品,不实际执行变更操作
formatstringhuman输出格式:
human
json

Safety

安全提示

⚠️ ARCHIVED products are hidden from all sales channels and cannot be purchased. ACTIVE products are immediately visible to customers. Run with
dry_run: true
to review the product list before committing — especially for ARCHIVED transitions which are hard to reverse in bulk.
⚠️ ARCHIVED 产品会对所有销售渠道隐藏,无法被购买。ACTIVE 产品会立即对客户可见。提交操作前请先使用
dry_run: true
配置预览产品列表,尤其是切换至 ARCHIVED 状态的操作,批量回滚难度极高。

Workflow Steps

工作流步骤

  1. OPERATION:
    products
    — query Inputs:
    query: <filter>
    ,
    first: 250
    , pagination cursor Expected output: Products with
    id
    ,
    title
    ,
    status
    ,
    tags
    ; paginate until
    hasNextPage: false
  2. Filter to products NOT already in
    target_status
    — skip those already correct
  3. OPERATION:
    productUpdate
    — mutation Inputs:
    id: <product_id>
    ,
    status: <target_status>
    Expected output:
    product { id, title, status }
    ,
    userErrors
  1. 操作:
    products
    — 查询 输入:
    query: <filter>
    first: 250
    、分页游标 预期输出: 包含
    id
    title
    status
    tags
    的产品列表,分页查询直到
    hasNextPage: false
  2. 过滤掉已经处于
    target_status
    的产品 —— 跳过状态已符合要求的产品
  3. 操作:
    productUpdate
    — 变更 输入:
    id: <product_id>
    status: <target_status>
    预期输出:
    product { id, title, status }
    userErrors

GraphQL Operations

GraphQL 操作

graphql
undefined
graphql
undefined

products: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 } } }

```graphql
query ProductsByFilter($query: String!, $after: String) { products(first: 250, after: $after, query: $query) { edges { node { id title status vendor tags publishedAt } } pageInfo { hasNextPage endCursor } } }

```graphql

productUpdate: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 } } }
undefined
mutation ProductUpdateStatus($input: ProductInput!) { productUpdate(input: $input) { product { id title status } userErrors { field message } } }
undefined

Session 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
dry_run: true
, prefix every mutation step with
[DRY RUN]
and do not execute it.
On completion, emit:
For
format: human
(default):
══════════════════════════════════════════════
OUTCOME SUMMARY
  Products matched:    <n>
  Already at target:   <n> (skipped)
  Status updated:      <n>
  Errors:              <n>
  Output:              lifecycle_update_<date>.csv
══════════════════════════════════════════════
For
format: json
, emit:
json
{
  "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: json
,输出:
json
{
  "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
lifecycle_update_<YYYY-MM-DD>.csv
with columns:
product_id
,
title
,
previous_status
,
new_status
,
vendor
,
tags
CSV 文件
lifecycle_update_<YYYY-MM-DD>.csv
,包含以下列:
product_id
title
previous_status
new_status
vendor
tags

Error Handling

错误处理

ErrorCauseRecovery
THROTTLED
API rate limit exceededWait 2 seconds, retry up to 3 times
userErrors
on productUpdate
Product locked or invalid stateLog error, skip product, continue
No products match filterFilter too narrowExit with 0 matches, suggest broadening filter
错误原因解决方案
THROTTLED
API 调用超出频率限制等待2秒,最多重试3次
productUpdate 操作返回
userErrors
产品被锁定或状态无效记录错误,跳过当前产品,继续执行后续操作
无产品匹配筛选条件筛选条件过于严格提示匹配数为0并退出,建议放宽筛选条件

Best Practices

最佳实践

  • Use tags to mark seasonal batches before running (e.g., tag products with
    launch:2026-05
    before activating them) so the filter is precise.
  • 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
    product-data-completeness-score
    before activating DRAFT products to ensure they have all required fields.
  • 运行前使用标签标记季节性批次产品(例如在激活产品前给产品打上
    launch:2026-05
    标签),确保筛选条件精准。
  • ARCHIVED 状态会将产品从所有渠道移除,包括店铺前台、POS 系统和购买按钮 —— 大规模执行操作前请确认符合预期。
  • 针对大型商品目录(500+ 产品),频率限制会减慢执行速度 —— 该工具会自动重试,但大批量操作可能需要数分钟完成。
  • 激活 DRAFT 状态产品前,可配合
    product-data-completeness-score
    工具使用,确保产品填写了所有必填字段。