Home

/

Claude Skills

/

Collection Sort

Collection Sort

by

  • MERCHANDISING
  • MARGIN
  • INVENTORY
  • ECOMMERCE
Works with the AI tools you already use
+19 agents

Collection page ordering for ecommerce teams: rank products on contribution margin and stock cover, then push the sort order that sells what you can profitably ship.

Collection pages are usually sorted by best selling, which is a loop: the products at the top sell most because they are at the top. Nothing in that order knows which products carry margin, which have twelve weeks of cover you need to clear, and which are about to run out and should not be promoted at all. The first row of a collection is the most valuable placement on the site and it is set by a rule nobody revisits. This skill ranks products on contribution margin, stock cover and conversion rate together, and returns a sort order per collection.

What It Does

  • Scores every product on contribution margin, stock cover and conversion rate.
  • Demotes products about to sell out so the placement is not wasted.
  • Promotes excess cover where the margin still supports selling it.
  • Keeps genuinely strong sellers visible rather than sorting purely on margin.
  • Adjusts the order per collection rather than applying one rule sitewide.
  • Returns the sort order with the score and the reason behind each position.

Use Cases

  • Break the best-selling loop that keeps the same products at the top all season.
  • Clear excess cover by promotion rather than by discount.
  • Stop giving the first row to a product that runs out on Thursday.
  • Re-sort collections weekly rather than whenever someone remembers.

Example Session

How should the outerwear collection be sorted this week?

Four changes to the top of the collection. The current first product should move down.

  • Product | Now | Proposed | Margin | Cover | Reason
  • Quilted jacket | 1 | 6 | 22% | 1.5 weeks | Nearly out, stop promoting
  • Wool coat | 7 | 1 | 41% | 11 weeks | Best margin, cover to clear
  • Rain shell | 3 | 2 | 34% | 7 weeks | Strong on both
  • Parka | 12 | 4 | 38% | 14 weeks | Excess cover, margin holds

The quilted jacket is top of the collection with a week and a half of cover: every session it takes is a session that cannot convert into anything shippable by Friday. Moving the wool coat up costs nothing and puts 41% margin with eleven weeks of cover in the position that gets the most attention. The parka at position twelve is the cheapest clearance you have, because promotion is free and a markdown is not.

Why This Beats Prompting It Yourself

Best Selling vs What You Can Profitably Ship: The Hidden Risk

A generic prompt will sort by sales, which is how the collection is already sorted and why the same products stay at the top. That order carries no information about margin, and none at all about stock. It will happily keep a product in the first row for the week after it sells out, and leave the excess cover you need to clear at position twelve.

When You Still Need Stock Cover In The Ranking

Placement is inventory you are spending, so it should follow what you can actually ship. This skill puts 41% margin and eleven weeks of cover in the first position, and moves a product with a week and a half of stock down to six. Promotion is the cheapest way to clear cover, which is why a re-sort usually saves a markdown rather than following one.

Known Limitations

The score needs product cost and live inventory to be meaningful, and without cost it ranks on revenue and cover only, which the output labels. Conversion rate per product needs enough sessions to be stable, so long tail products are ranked with a wider band rather than promoted on thin evidence. It produces the order and does not apply it to your store.

Install It

  • Download the ZIP.
    It is free and there is no account to create.
  • Unzip it into your agent's skills folder.
    Claude Code reads ~/.claude/skills/, which is hidden by default: the command in the folder block opens it. Other agents scan their own directory, so drop the same folder there instead.
  • Ask your agent to use it.
    Restart the agent if it was already running, then it picks the skill up with no config.

skills folder

Copy

~/.claude/skills/collection-sort/
  SKILL.md
  references/scoring.md
  sorts/
  # one sort per collection, per run

# macOS: create the folder and open it in Finder
mkdir -p ~/.claude/skills && open ~/.claude/skills

# Windows: paste in the Explorer address bar
%USERPROFILE%\.claude\skills\

Frequently asked questions

How is this different from sorting by best selling?

Best selling is self-reinforcing and blind to margin and stock. This scores margin, cover and conversion together, so a product about to run out moves down and excess cover with healthy margin moves up. The top of the collection stops being a record of last month.

Which agents does the skill run in?

Any agent that supports the open SKILL.md format: Claude Code, Cursor, Codex CLI, GitHub Copilot, Gemini CLI, Manus, Grok and others load it unmodified. The format is portable, the location is not. Each agent scans its own skills directory, so you drop the same folder into whichever one yours uses. There is no config file to edit and no API key to provision.

Will it bury my best sellers?

No. Conversion rate is part of the score precisely so that a product selling strongly on its own merits stays visible. What changes is that it no longer holds the first position purely because it held it last week, and products with real margin and cover get a chance at the placement.

What does it need connected to work?

Product cost, live inventory and session or conversion data per product. Without cost it ranks on revenue and cover, which still fixes the stock problem and is labeled clearly as a partial score.

How often should the sort be refreshed?

Weekly for most catalogs, daily during a peak trading period or a clearance push. The inputs that move fastest are stock cover and conversion, and both can change enough in a week to make a sort order actively wrong.

What is included with the skill?

The skill itself, the scoring reference, the sort template, and the per-collection weightings. It is free and security scanned. We re-publish the ZIP when the scoring model changes, so download it again if your sort orders start looking odd.

Collection order decides what sells, and at what margin.

Polar ranks products on contribution margin and stock cover on one definition, so the sort you push forward promotes what you can profitably ship.

Book a demo

Popular in E-commerce

<script type="application/ld+json">{"@context":"https://schema.org","@type":"FAQPage","mainEntity":[{"@type":"Question","name":"How is this different from sorting by best selling?","acceptedAnswer":{"@type":"Answer","text":"Best selling is self-reinforcing and blind to margin and stock. This scores margin, cover and conversion together, so a product about to run out moves down and excess cover with healthy margin moves up. The top of the collection stops being a record of last month."}},{"@type":"Question","name":"Which agents does the skill run in?","acceptedAnswer":{"@type":"Answer","text":"Any agent that supports the open SKILL.md format: Claude Code, Cursor, Codex CLI, GitHub Copilot, Gemini CLI, Manus, Grok and others load it unmodified. The format is portable, the location is not. Each agent scans its own skills directory, so you drop the same folder into whichever one yours uses. There is no config file to edit and no API key to provision."}},{"@type":"Question","name":"Will it bury my best sellers?","acceptedAnswer":{"@type":"Answer","text":"No. Conversion rate is part of the score precisely so that a product selling strongly on its own merits stays visible. What changes is that it no longer holds the first position purely because it held it last week, and products with real margin and cover get a chance at the placement."}},{"@type":"Question","name":"What does it need connected to work?","acceptedAnswer":{"@type":"Answer","text":"Product cost, live inventory and session or conversion data per product. Without cost it ranks on revenue and cover, which still fixes the stock problem and is labeled clearly as a partial score."}},{"@type":"Question","name":"How often should the sort be refreshed?","acceptedAnswer":{"@type":"Answer","text":"Weekly for most catalogs, daily during a peak trading period or a clearance push. The inputs that move fastest are stock cover and conversion, and both can change enough in a week to make a sort order actively wrong."}},{"@type":"Question","name":"What is included with the skill?","acceptedAnswer":{"@type":"Answer","text":"The skill itself, the scoring reference, the sort template, and the per-collection weightings. It is free and security scanned. We re-publish the ZIP when the scoring model changes, so download it again if your sort orders start looking odd."}}]}</script>