shopify-admin-compare-at-price-cleanup
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-compare-at-price-cleanup" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-7aa26002992f05f0153e26de5d891b1d115a78cc0e5cc45a1d29691574bac131. 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
Remove expired compareAtPrice values: delete compareAtPrice entries that meet either condition — the current price is greater than or equal to the compareAtPrice (no real discount), or the compareAtPrice was set earlier than a configurable time threshold.
Introduction source: third_party · 40RTY-ai · 0.0.1 Reference
SkillPi interpretation
- Tasks
- Removes stale compareAtPrice values where current price >= compareAtPrice (no real discount) or compareAtPrice has been set for over a configurable age threshold.
- Inputs and outputs
- CSV file `compare_at_cleanup_<YYYY-MM-DD>.csv` with columns: `variant_id`, `product_id`, `product_title`, `vendor`, `sku`, `price`, `original_compare_at_price`, `rule_matched`, `variant_updated_at`, `mutation_status`
- Software, accounts and paid services
- Authenticated Shopify CLI session: `shopify store auth --store <domain> --scopes read_products,write_products` API scopes: `read_products`, `write_products`
- Testing
- Not tested
Browse files
Frontmatter
name: shopify-admin-compare-at-price-cleanup
role: merchandising
description: "Removes stale compareAtPrice values where current price >= compareAtPrice (no real discount) or compareAtPrice has been set for over a configurable age threshold."
toolkit: shopify-admin, shopify-admin-execution
api_version: "2025-01"
graphql_operations:
- productVariants:query
- productVariantsBulkUpdate:mutation
status: stable
compatibility: Claude Code, Cursor, Codex, Gemini CLIPurpose
Identifies variants with a compareAtPrice that no longer represents a genuine discount and clears it, so storefront strikethrough pricing reflects real savings rather than legacy noise. Two conditions are flagged: (a) compareAtPrice <= price (no discount, often left over from a price increase), and (b) compareAtPrice set for longer than max_age_days (stale "always on sale" optics that hurt long-term price perception and can violate advertising standards in some regions). Defaults to dry-run.
Prerequisites
- Authenticated Shopify CLI session:
shopify store auth --store <domain> --scopes read_products,write_products - API scopes:
read_products,write_products
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| store | string | yes | — | Store domain (e.g., mystore.myshopify.com) |
| dry_run | bool | no | true | Preview the cleanup without executing mutations |
| clean_no_discount | bool | no | true | Clear compareAtPrice when price >= compareAtPrice |
| clean_stale | bool | no | true | Clear compareAtPrice set longer than max_age_days |
| max_age_days | integer | no | 90 | Age threshold in days for the stale rule (uses variant updatedAt as proxy) |
| collection_id | string | no | — | Optional collection GID to scope the cleanup |
| tag_filter | string | no | — | Optional product tag to scope the cleanup |
| format | string | no | human | Output format: human or json |
Safety
⚠️ Step 2 executes
productVariantsBulkUpdatemutations that overwritecompareAtPriceto null. The original strikethrough value is not preserved server-side — record the dry-run CSV before committing if you want a restore path. Always start withdry_run: trueand review the CSV before running withdry_run: false.
Workflow Steps
-
OPERATION:
productVariants— query Inputs:first: 250,query: <built from collection_id or tag_filter>, selectprice,compareAtPrice,updatedAt,product { id, title, vendor },sku, pagination cursor Expected output: All variants in scope with current pricing; paginate untilhasNextPage: false -
Filter to variants meeting either rule:
clean_no_discountANDcompareAtPrice != nullANDparseFloat(compareAtPrice) <= parseFloat(price), ORclean_staleANDcompareAtPrice != nullAND(now - updatedAt) > max_age_days. Group byproduct.idfor batched mutation. -
OPERATION:
productVariantsBulkUpdate— mutation (skipped whendry_run: true) Inputs: Per product,productIdplus[{ id: variantId, compareAtPrice: null }]Expected output: Updated variants withcompareAtPriceset to null; collectuserErrorsper batch -
Write the CSV (always, even on dry run) for audit trail and revert capability.
GraphQL Operations
# productVariants:query — validated against api_version 2025-01
query VariantsForCompareAtCleanup($query: String, $after: String) {
productVariants(first: 250, after: $after, query: $query) {
edges {
node {
id
sku
price
compareAtPrice
updatedAt
product {
id
title
vendor
tags
}
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
# productVariantsBulkUpdate:mutation — validated against api_version 2025-01
mutation ClearCompareAtPrice($productId: ID!, $variants: [ProductVariantsBulkInput!]!) {
productVariantsBulkUpdate(productId: $productId, variants: $variants) {
productVariants {
id
price
compareAtPrice
}
userErrors {
field
message
}
}
}
Session Tracking
Claude MUST emit the following output at each stage. This is mandatory.
On start, emit:
╔══════════════════════════════════════════════╗
║ SKILL: Compare-At Price Cleanup ║
║ 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):
══════════════════════════════════════════════
COMPARE-AT PRICE CLEANUP (<dry-run|live>)
Variants inspected: <n>
No-discount cleared: <n>
Stale (>= <days>d): <n>
Total cleared: <n>
Errors: <n>
Output: compare_at_cleanup_<date>.csv
══════════════════════════════════════════════
For format: json, emit:
{
"skill": "compare-at-price-cleanup",
"store": "<domain>",
"dry_run": true,
"variants_inspected": 0,
"cleared_no_discount": 0,
"cleared_stale": 0,
"total_cleared": 0,
"errors": 0,
"output_file": "compare_at_cleanup_<date>.csv"
}
Output Format
CSV file compare_at_cleanup_<YYYY-MM-DD>.csv with columns:
variant_id, product_id, product_title, vendor, sku, price, original_compare_at_price, rule_matched, variant_updated_at, mutation_status
Error Handling
| Error | Cause | Recovery |
|---|---|---|
userErrors in mutation response |
Variant locked or in active subscription contract | Log per-variant error, continue with remaining variants |
THROTTLED |
API rate limit exceeded | Wait 2 seconds, retry up to 3 times |
compareAtPrice already null mid-run |
Another process cleared it concurrently | Skip, count as no-op success |
updatedAt newer than expected |
Concurrent edit during the audit | Re-query single variant before mutation; skip if rule no longer matches |
Best Practices
- Always run with
dry_run: truefirst and review the CSV. There is no bulk undo for compareAtPrice clearing. - Disable
clean_stale(setclean_stale: false) during long planned promotions — your "stale" sale is actually intentional. - Use
collection_idto scope the cleanup to evergreen products and exclude an active sale collection. - After running live, spot-check 5–10 variants in the storefront to confirm strikethrough pricing is gone.
- Schedule a quarterly run as part of catalog hygiene; combine with
seo-metadata-auditandproduct-data-completeness-scorefor an end-of-quarter merchandising sweep.
Version history
-
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
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 解决 Shopify 商家清理过期 compareAtPrice 的实际业务需求
- 提升价格展示准确性和合规性,具有明确实用价值
Highlights
- description 完整描述了触发条件和功能边界
- 参数定义清晰,包含多种过滤选项
Highlights
- 结构完整:Purpose、Prerequisites、Parameters、Workflow Steps、GraphQL Operations、Session Tracking、Output Format、Error Handling、Best Practices
- 包含端到端示例和详细步骤
- frontmatter 完整
Highlights
- 工具来源明确(Shopify Admin API)
- 参数正确,API 版本指定
- 覆盖主要异常(userErrors、THROTTLED、并发修改等)
- 不可逆操作有确认机制(dry-run 模式)
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.
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_products,write_products` API scopes: `read_products`, `write_products`
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.