AI Blocks › Run your online store
Collection order sorter
Pick a collection. Get in-stock products moved to the top and sold-out ones to the bottom. Changes your live store.
Collection order sorter is a free AI skill for the job "Run your online store". Give the instructions to an AI assistant that supports the required files and tools, then review its output.
Free · No account · MIT licence · Made by 40rty AI · Level: beginner · Thinking: low
Made by 40rty AI. See the original on GitHub; we copied it as it is, with its licence.
What it does
Products in stock move to the top of a Shopify collection and sold-out ones drop to the bottom. It changes your live store, so shoppers see what they can actually buy first. It reads every product in a manual collection, sorts them by total inventory, and sends the new order in one update. You choose highest stock first or lowest first. A dry-run mode shows the plan without changing anything. It only works on manual collections, not smart ones driven by rules. It needs a signed-in Shopify CLI and read and write product permissions. You can undo it by running the opposite sort.
You give it
- Your store domain
- The collection ID
- Sort direction (optional)
- A signed-in Shopify CLI with product permissions
You get
- A preview of the new order
- The reordered live collection
- A report of what moved
- A way to reverse it
Use it when
- Sold-out items sit at the top of your best collection.
- You want a quick reorder without clicking through the admin.
- You want to preview the new order before it goes live.
- A launch sold out and you need to refresh the page.
How to use it
- Add it to your AI once: download it and add the folder to Claude, ChatGPT or Codex as a skill.
- Ask for the job in your own words. Your AI opens the skill when it fits.
- It works best when your AI can access your Shopify admin and change live store data.