collection-reorganization
Installation
SKILL.md
Purpose
Reorders products in a manual Shopify collection by inventory level without navigating the Shopify admin UI. Replaces apps like Reputon Collection Sort or manual drag-and-drop ordering — this skill queries all products in the collection, computes the desired sort order by totalInventory, and applies it in a single collectionReorderProducts mutation. Note: only works on manual (custom) collections — smart collections managed by Shopify rules are not supported.
Prerequisites
- Authenticated Shopify CLI session:
shopify auth login --store <domain> - API scopes:
read_products,write_products
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| store | string | yes | — | Store domain (e.g., mystore.myshopify.com) |
| format | string | no | human | Output format: human or json |
| dry_run | bool | no | false | Preview operations without executing mutations |
| collection_id | string | yes | — | GID of the manual collection (e.g., gid://shopify/Collection/123) |
| sort_by | string | no | inventory_desc | inventory_desc (highest stock first) or inventory_asc (lowest stock first) |