shopify-admin-variant-performance-report

Ranks all product variants by revenue, units sold, and refund rate, then cross-references those rankings with current inventory to identify slow- and fast-moving variants.

Last repository push
GitHub Stars
205
Forks
23
Issues / PRs
2

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "shopify-admin-variant-performance-report" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-23492ec6d572419be4a32978c7e21e5dbe91f8a9ba0e46727c56463ce464800b. Verify the upstream source and version against https://github.com/40RTY-ai/shopify-admin-skills before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

github.com

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Ranks all product variants by revenue, units sold, and refund rate, then cross-references those rankings with current inventory to identify slow- and fast-moving variants.

0 Downloads

Introduction source: third_party · 40RTY-ai · 0.0.1 Reference

SkillPi interpretation

Tasks
Rank every product variant by revenue, units sold, and refund rate, then cross-reference against current inventory to identify dead weight vs. top performers.
Inputs and outputs
CSV file `variant_performance_<YYYY-MM-DD>.csv` with one row per variant: | Column | Description | |--------|-------------| | `product_id` | Shopify product GID | | `product_title` | Product name | | `variant_id` | Shopify variant GID | | `variant_title` | Option combination (e.g., "Blue / Large") | | `sku` | Variant SKU | | `units_sold` | Total units sold in period | | `gross_revenue` | Revenue before refunds | | `refunded_amount` | Total refund value | | `net_revenue` | Gross minus refunds | | `refund_rate_pct` | Refunded units ÷ sold units × 100 | | `inventory_qty` | Current stock on hand | | `revenue_per_inventory_unit` | Net revenue ÷ inventory qty (blank if inventory = 0) | For `format
Software, accounts and paid services
Authenticated Shopify CLI session: `shopify auth login --store <domain>` API scopes: `read_orders`, `read_products` (validator-confirmed: orders query traverses variant→product graph)
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: shopify-admin-variant-performance-report
role: merchandising
description: "Rank every product variant by revenue, units sold, and refund rate, then cross-reference against current inventory to identify dead weight vs. top performers."
toolkit: shopify-admin, shopify-admin-execution
api_version: "2025-01"
graphql_operations:
  - orders:query
  - productVariants:query
status: stable
compatibility: Claude Code, Cursor, Codex, Gemini CLI

Purpose

Goes beyond product-level revenue by ranking every individual variant (size, color, option combination) on revenue, units sold, and refund rate, then joining against live inventory levels. Reveals which specific SKUs are driving the business and which are tying up capital on the shelf. Read-only — no mutations are executed.

Prerequisites

  • Authenticated Shopify CLI session: shopify auth login --store <domain>
  • API scopes: read_orders, read_products (validator-confirmed: orders query traverses variant→product graph)

Parameters

Parameter Type Required Default Description
store string yes — Store domain (e.g., mystore.myshopify.com)
format string no human Output format: human or json
dry_run bool no false Preview operations without executing mutations
date_range_start string yes — Start date in ISO 8601 (e.g., 2025-01-01)
date_range_end string yes — End date in ISO 8601 (e.g., 2025-01-31)
top_n integer no 30 Number of top and bottom variants to display
sort_by string no revenue Ranking metric: revenue, units, or refund_rate
min_units integer no 1 Exclude variants with fewer than N units sold in the period

Workflow Steps

  1. OPERATION: orders — query Inputs: first: 250, query: "created_at:>='<date_range_start>' created_at:<='<date_range_end>'", pagination cursor; select lineItems with variant { id, sku, title, selectedOptions }, quantity, originalTotalSet; and refunds.refundLineItems with variant id and subtotalSet Expected output: All orders in range; paginate until hasNextPage: false; aggregate in-memory per variant.id: units sold, gross revenue, refunded units, refunded amount, refund rate

  2. OPERATION: productVariants — query Inputs: List of variant IDs collected in step 1, first: 250, pagination cursor; select id, sku, title, selectedOptions, inventoryQuantity, product { id, title }, price Expected output: Current inventory levels and metadata for each sold variant; joined with step-1 aggregates; variants present in inventory but with zero sales are flagged as dead stock candidates

  3. In-memory computation: Sort merged dataset by sort_by metric; compute revenue-per-inventory-unit ratio (net revenue ÷ inventory quantity) to highlight variants earning little relative to shelf space; split output into top-N performers and bottom-N by the same metric

GraphQL Operations

# orders:query (variant line items + refunds) — validated against api_version 2025-01
query OrdersForVariantPerformance($first: Int!, $after: String, $query: String) {
  orders(first: $first, after: $after, query: $query) {
    edges {
      node {
        id
        createdAt
        lineItems(first: 50) {
          edges {
            node {
              quantity
              originalTotalSet {
                shopMoney { amount currencyCode }
              }
              variant {
                id
                sku
                title
                selectedOptions { name value }
                product { id title }
              }
            }
          }
        }
        refunds {
          refundLineItems(first: 50) {
            edges {
              node {
                quantity
                subtotalSet {
                  shopMoney { amount currencyCode }
                }
                lineItem {
                  variant { id }
                }
              }
            }
          }
        }
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}
# productVariants:query (inventory snapshot) — validated against api_version 2025-01
query VariantInventorySnapshot($first: Int!, $after: String, $query: String) {
  productVariants(first: $first, after: $after, query: $query) {
    edges {
      node {
        id
        sku
        title
        price
        selectedOptions { name value }
        inventoryQuantity
        product {
          id
          title
        }
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}

Session Tracking

Claude MUST emit the following output at each stage. This is mandatory.

On start, emit:

╔══════════════════════════════════════════════╗
║  SKILL: variant-performance-report           ║
║  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>

On completion, emit:

For format: human (default):

══════════════════════════════════════════════
OUTCOME SUMMARY
  Orders processed:     <n>
  Variants analysed:    <n>
  Date range:           <start> to <end>
  Sort by:              <metric>
  Errors:               0
  Output:               variant_performance_<date>.csv
══════════════════════════════════════════════

For format: json, emit:

{
  "skill": "variant-performance-report",
  "store": "<domain>",
  "started_at": "<ISO8601>",
  "completed_at": "<ISO8601>",
  "dry_run": false,
  "steps": [
    { "step": 1, "operation": "OrdersForVariantPerformance", "type": "query", "params_summary": "<date_range_start> to <date_range_end>", "result_summary": "<n> orders, <n> variants aggregated", "skipped": false },
    { "step": 2, "operation": "VariantInventorySnapshot", "type": "query", "params_summary": "<n> variant IDs", "result_summary": "<n> variants with inventory data", "skipped": false }
  ],
  "outcome": {
    "orders_processed": 0,
    "variants_analysed": 0,
    "date_range_start": "<date_range_start>",
    "date_range_end": "<date_range_end>",
    "sort_by": "revenue",
    "top_performers": [],
    "dead_weight": [],
    "errors": 0,
    "output_file": "variant_performance_<date>.csv"
  }
}

Output Format

CSV file variant_performance_<YYYY-MM-DD>.csv with one row per variant:

Column Description
product_id Shopify product GID
product_title Product name
variant_id Shopify variant GID
variant_title Option combination (e.g., "Blue / Large")
sku Variant SKU
units_sold Total units sold in period
gross_revenue Revenue before refunds
refunded_amount Total refund value
net_revenue Gross minus refunds
refund_rate_pct Refunded units ÷ sold units × 100
inventory_qty Current stock on hand
revenue_per_inventory_unit Net revenue ÷ inventory qty (blank if inventory = 0)

For format: human, two ranked tables are printed inline:

  1. Top performers — top top_n variants by sort_by metric
  2. Dead weight — bottom top_n variants by revenue_per_inventory_unit (≥ min_units sold, inventory > 0)

Error Handling

Error Cause Recovery
THROTTLED API rate limit from paginating large order history Wait 2 s, retry up to 3 times; narrow date range if persistent
variant is null on line item Product or variant was deleted after purchase Aggregate by line item title with variant_id: null; still counted in totals
inventoryQuantity is null Variant uses fulfillment service (no tracked inventory) Record as inventory_qty: null; exclude from revenue-per-unit ratio
No orders returned No orders in date range Widen date range

Best Practices

  1. Run with a 30–90 day window first. Very wide windows produce large pagination chains and slow down step 1 significantly.
  2. The revenue_per_inventory_unit column is the sharpest signal for dead weight — a high inventory count with near-zero revenue is a clear markdown candidate.
  3. High refund_rate_pct on a specific size or color often points to a fit or quality issue — investigate before reordering that option.
  4. Use min_units: 5 to filter out statistical noise from variants with very few sales before making merchandising decisions.
  5. Pair with dead-stock-identifier for a broader view of inventory health beyond the sales period captured here.

Version history

  1. v1.1.0 GitHub ↗
    Original release notes

    ## 🤖 New category: Agentic Commerce Readiness The fix-it side of the [**agentiq.report**](https://agentiq.report) audit. The audit tells operators *where* AI shopping agents (ChatGPT, Gemini, Perplexity, agentic checkout) can't find, read, or recommend their store. This release adds **10 skills that remediate those findings** via the native Shopify Admin GraphQL toolkit — closing the loop: **audit finds the gap → run the matching skill → re-audit confirms.** Every skill declares the audit **signals** it fixes (`audit_signals` frontmatter), so a finding in the report maps directly to the skill that resolves it. ### Skills - **`agentic-readiness-audit`** — flagship, read-only store-side scorecard that routes each gap to its fix skill - **`agentic-product-jsonld-backfill`** — barcode/GTIN, vendor, product type for complete Product JSON-LD - **`agentic-image-alt-text`** — descriptive alt text on product media - **`agentic-description-enrichment`** — fact-rich descriptions for AI quoting - **`agentic-metafields-setup`** — define + populate agentic metafields for filtering - **`agentic-product-taxonomy`** — Shopify Standard Product Taxonomy categories - **`agentic-crawler-access`** — allow GPTBot/ClaudeBot/PerplexityBot… in `robots.txt.liquid` - **`agentic-llms-txt`** — publish a curated `/llms.txt` for AI assistants - **`agentic-organization-schema`** — Organization JSON-LD (sameAs, contactPoint) into the theme - **`agentic-policy-readability`** — machine-readable shipping/returns policies Plus a weekly **`agentic-readiness-monitor`** routine that re-audits and alerts on regressions. ### Stats **116 skills across 11 categories** (was 106/10), **21 routines** (was 20). All GraphQL validated against the live Admin 2025-01 schema; `pnpm validate:index` passes (116 skills, 64 operations). ### Notes Theme-editing and policy skills default to `dry_run`/`audit` mode, write inside managed `# BEGIN/END` blocks, and recommend duplicating the theme first.

Current listing version

0.0.1

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value95/100

Highlights

  • 直接解决电商运营核心痛点:识别滞销品与畅销品,优化库存管理
  • 提供收入、销售数量和退款率的多维度分析,帮助商家做出数据驱动的决策
Trigger Precision90/100

Highlights

  • 触发词精准完整,覆盖多种变体,边界清晰
  • description 准确描述了 Skill 的核心功能和使用场景
Structure and Standards85/100

Areas to improve

  • 缺少 When to Use 章节 Reported severity: Minor

    文档中缺少明确的 'When to Use' 或类似的使用场景说明章节

    Recommendation: 建议添加一个 'When to Use' 章节,明确说明在什么情况下使用此 Skill 最为合适

Highlights

  • Phase/步骤清晰,有出口条件,含端到端示例
  • frontmatter 完整,单文件长度适中
Execution Reliability88/100

Highlights

  • 工具来源明确,参数正确,覆盖主要异常
  • 不可逆操作有确认机制,错误处理完善
Evidence Verifiability (mean of the first four)90/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Authenticated Shopify CLI session: `shopify auth login --store <domain>` API scopes: `read_orders`, `read_products` (validator-confirmed: orders query traverses variant→product graph)

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.