shopify-admin-return-reason-analysis

Read-only: Summarize return reasons across orders to identify product quality or product information issues.

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-return-reason-analysis" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-e000f352642460263d0b37f87c532c03f1eff5c8b723d2a9a65a4b75dfde2759. 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

Read-only: Summarize return reasons across orders to identify product quality or product information issues.

0 Downloads

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

SkillPi interpretation

Tasks
Read-only: aggregates return reasons across orders to identify product quality or listing issues.
Inputs and outputs
CSV file `return_reasons_<YYYY-MM-DD>.csv` with columns: `return_id`, `order_name`, `product_title`, `sku`, `quantity`, `return_reason`, `reason_note`, `created_at`
Software, accounts and paid services
Authenticated Shopify CLI session: `shopify store auth --store <domain> --scopes read_orders,read_returns` API scopes: `read_orders`, `read_returns`
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: shopify-admin-return-reason-analysis
role: returns
description: "Read-only: aggregates return reasons across orders to identify product quality or listing issues."
toolkit: shopify-admin, shopify-admin-execution
api_version: "2025-01"
graphql_operations:
  - returns:query
  - orders:query
status: stable
compatibility: Claude Code, Cursor, Codex, Gemini CLI

Purpose

Queries all return requests within a date window and aggregates them by return reason code, product, and SKU. Surfaces which products have the highest return rates and which reasons (wrong size, damaged, not as described, etc.) are most common. Read-only — no mutations.

Prerequisites

  • Authenticated Shopify CLI session: shopify store auth --store <domain> --scopes read_orders,read_returns
  • API scopes: read_orders, read_returns

Parameters

Parameter Type Required Default Description
store string yes — Store domain (e.g., mystore.myshopify.com)
days_back integer no 30 Lookback window for return requests
min_returns integer no 3 Minimum returns per product to include in output
format string no human Output format: human or json

Safety

ℹ️ Read-only skill — no mutations are executed. Safe to run at any time.

Workflow Steps

  1. OPERATION: returns — query Inputs: query: "created_at:>='<NOW - days_back days>'", first: 250, pagination cursor Expected output: Return objects with returnLineItems { returnReason, refundableQuantity, fulfillmentLineItem { lineItem { product { title } variant { sku } } } }; paginate until hasNextPage: false

  2. Aggregate by: return reason → product → SKU; calculate return count and % of total returns per bucket

  3. OPERATION: orders — query (for return rate context) Inputs: Same date window, first: 250; count total orders as denominator for return rate calculation

GraphQL Operations

# returns:query — validated against api_version 2025-01
query ReturnsAnalysis($query: String!, $after: String) {
  returns(first: 250, after: $after, query: $query) {
    edges {
      node {
        id
        status
        createdAt
        order {
          id
          name
        }
        returnLineItems(first: 50) {
          edges {
            node {
              id
              quantity
              returnReason
              returnReasonNote
              fulfillmentLineItem {
                lineItem {
                  product {
                    id
                    title
                  }
                  variant {
                    id
                    sku
                    title
                  }
                }
              }
            }
          }
        }
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}
# orders:query — validated against api_version 2025-01
query OrderCountForPeriod($query: String!) {
  orders(first: 1, query: $query) {
    pageInfo {
      hasNextPage
    }
  }
  ordersCount: orders(first: 250, query: $query) {
    edges {
      node {
        id
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}

Session Tracking

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

On start, emit:

╔══════════════════════════════════════════════╗
║  SKILL: Return Reason Analysis               ║
║  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):

══════════════════════════════════════════════
RETURN REASON ANALYSIS  (<days_back> days)
  Total returns:   <n>
  Total orders:    <n>
  Return rate:     <pct>%

  Top Reasons
  ─────────────────────────────────────────
  Wrong size/fit        <n>  (<pct>%)
  Not as described      <n>  (<pct>%)
  Damaged/defective     <n>  (<pct>%)
  Changed mind          <n>  (<pct>%)
  Other                 <n>  (<pct>%)

  Top Products by Return Volume
  ─────────────────────────────────────────
  <Product Title>   <n> returns  (<SKU>)
  Output: return_reasons_<date>.csv
══════════════════════════════════════════════

For format: json, emit:

{
  "skill": "return-reason-analysis",
  "store": "<domain>",
  "period_days": 30,
  "total_returns": 0,
  "total_orders": 0,
  "return_rate_pct": 0,
  "by_reason": [],
  "by_product": [],
  "output_file": "return_reasons_<date>.csv"
}

Output Format

CSV file return_reasons_<YYYY-MM-DD>.csv with columns: return_id, order_name, product_title, sku, quantity, return_reason, reason_note, created_at

Error Handling

Error Cause Recovery
THROTTLED API rate limit exceeded Wait 2 seconds, retry up to 3 times
No returns in window No return requests in period Exit with summary: 0 returns
Missing product/variant on line item Deleted product Log as "deleted product", include in reason counts

Best Practices

  • Cross-reference high-return products with their listing descriptions and images — "not as described" returns often indicate a copy or photography issue.
  • Use min_returns: 10 for larger stores to focus on statistically significant patterns rather than one-off complaints.
  • Run monthly and compare period-over-period to track whether merchandising or product quality improvements are reducing specific return reasons.
  • Pair with exchange-vs-refund-ratio to understand whether high-return products are recovering revenue via exchanges.

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 Value85/100

Highlights

  • 解决电商运营中的实际痛点:退货原因分析帮助识别产品质量和商品描述问题
  • 具有广泛的Shopify商家用户群体,实用性强
Trigger Precision90/100

Highlights

  • 触发词清晰完整,description位置正确且内容详实
  • 参数定义明确,边界条件清晰
Structure and Standards95/100

Highlights

  • 文档结构完整,包含所有必要章节:目的、前提条件、参数、安全说明、工作流程、GraphQL操作、会话跟踪、输出格式、错误处理和最佳实践
  • 提供了详细的端到端示例和多种输出格式
Execution Reliability90/100

Highlights

  • 使用官方Shopify Admin API,GraphQL查询经过版本验证
  • 包含完善的错误处理机制:API限流重试、空结果处理、已删除产品处理
  • 只读操作确保安全性,无数据修改风险
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 store auth --store <domain> --scopes read_orders,read_returns` API scopes: `read_orders`, `read_returns`

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