Shopify Admin Compare At Price Cleanup logo

Shopify Admin Compare At Price Cleanup

Organization
40RTY-ai
shopify-admin-compare-at-price-cleanup

Removes stale compareAtPrice values where current price >= compareAtPrice (no real discount) or compareAtPrice has been set for over a configurable age threshold.

Overview

Publisher40RTY-ai
Repositoryshopify-admin-skills
Skill nameshopify-admin-compare-at-price-cleanup
Stars
200
Forks
22
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by 40RTY-ai on GitHub. Read the source before you install it.

Installation

Install the Shopify Admin Compare At Price Cleanup AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/40RTY-ai/shopify-admin-skills/tree/main/skills/merchandising/shopify-admin-compare-at-price-cleanup
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/40RTY-ai/shopify-admin-skills.git /tmp/shopify-admin-skills
mkdir -p .claude/skills
cp -r /tmp/shopify-admin-skills/skills/merchandising/shopify-admin-compare-at-price-cleanup .claude/skills/shopify-admin-compare-at-price-cleanup
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Shopify Admin Compare At Price Cleanup in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Shopify Admin Compare At Price Cleanup on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Shopify Admin Compare At Price Cleanup is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Purpose

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

ParameterTypeRequiredDefaultDescription
storestringyes—Store domain (e.g., mystore.myshopify.com)
dry_runboolnotruePreview the cleanup without executing mutations
clean_no_discountboolnotrueClear compareAtPrice when price >= compareAtPrice
clean_staleboolnotrueClear compareAtPrice set longer than max_age_days
max_age_daysintegerno90Age threshold in days for the stale rule (uses variant updatedAt as proxy)
collection_idstringno—Optional collection GID to scope the cleanup
tag_filterstringno—Optional product tag to scope the cleanup
formatstringnohumanOutput format: human or json

Safety

⚠️ Step 2 executes productVariantsBulkUpdate mutations that overwrite compareAtPrice to 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 with dry_run: true and review the CSV before running with dry_run: false.

Workflow Steps

  1. OPERATION: productVariants — query Inputs: first: 250, query: <built from collection_id or tag_filter>, select price, compareAtPrice, updatedAt, product { id, title, vendor }, sku, pagination cursor Expected output: All variants in scope with current pricing; paginate until hasNextPage: false

  2. Filter to variants meeting either rule: clean_no_discount AND compareAtPrice != null AND parseFloat(compareAtPrice) <= parseFloat(price), OR clean_stale AND compareAtPrice != null AND (now - updatedAt) > max_age_days. Group by product.id for batched mutation.

  3. OPERATION: productVariantsBulkUpdate — mutation (skipped when dry_run: true) Inputs: Per product, productId plus [{ id: variantId, compareAtPrice: null }] Expected output: Updated variants with compareAtPrice set to null; collect userErrors per batch

  4. Write the CSV (always, even on dry run) for audit trail and revert capability.

GraphQL Operations

graphql
# 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
    }
  }
}
graphql
# 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:

json
{
  "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

ErrorCauseRecovery
userErrors in mutation responseVariant locked or in active subscription contractLog per-variant error, continue with remaining variants
THROTTLEDAPI rate limit exceededWait 2 seconds, retry up to 3 times
compareAtPrice already null mid-runAnother process cleared it concurrentlySkip, count as no-op success
updatedAt newer than expectedConcurrent edit during the auditRe-query single variant before mutation; skip if rule no longer matches

Best Practices

  1. Always run with dry_run: true first and review the CSV. There is no bulk undo for compareAtPrice clearing.
  2. Disable clean_stale (set clean_stale: false) during long planned promotions — your "stale" sale is actually intentional.
  3. Use collection_id to scope the cleanup to evergreen products and exclude an active sale collection.
  4. After running live, spot-check 5–10 variants in the storefront to confirm strikethrough pricing is gone.
  5. Schedule a quarterly run as part of catalog hygiene; combine with seo-metadata-audit and product-data-completeness-score for an end-of-quarter merchandising sweep.

Frequently asked questions

What does the Shopify Admin Compare At Price Cleanup AI skill do?

Removes stale compareAtPrice values where current price >= compareAtPrice (no real discount) or compareAtPrice has been set for over a configurable age threshold.

Why use Shopify Admin Compare At Price Cleanup on TypingMind?

Because you install it once and use it with any model. Shopify Admin Compare At Price Cleanup is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Shopify Admin Compare At Price Cleanup in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/40RTY-ai/shopify-admin-skills/tree/main/skills/merchandising/shopify-admin-compare-at-price-cleanup. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Shopify Admin Compare At Price Cleanup?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Shopify Admin Compare At Price Cleanup?

As many as you like. As long as a model supports skills, you can use Shopify Admin Compare At Price Cleanup with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Shopify Admin Compare At Price Cleanup AI skill free?

Yes. It is published on GitHub by 40RTY-ai under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇