$npx -y skills add 40RTY-ai/shopify-admin-skills --skill shopify-admin-fulfillment-status-digestGenerate a daily fulfillment triage digest: all open orders segmented by fulfillment age and flagged for holds or exceptions.
| 1 | ## Purpose |
| 2 | Produces a daily ops triage digest of all unfulfilled and partially-fulfilled orders, segmented by how long they've been waiting. Flags orders with active holds. Replaces the manual process of scrolling through the Shopify admin Orders page to find aging orders and exceptions — this skill fetches every open order, computes its age, buckets it into configurable time segments, and surfaces any orders currently on a fulfillment hold, giving the ops team a complete exception queue in a single read-only operation. |
| 3 | |
| 4 | ## Prerequisites |
| 5 | - Authenticated Shopify CLI session: `shopify auth login --store <domain>` |
| 6 | - API scopes: `read_orders` |
| 7 | |
| 8 | ## Parameters |
| 9 | |
| 10 | | Parameter | Type | Required | Default | Description | |
| 11 | |-----------|------|----------|---------|-------------| |
| 12 | | store | string | yes | — | Store domain (e.g., mystore.myshopify.com) | |
| 13 | | format | string | no | human | Output format: `human` or `json` | |
| 14 | | dry_run | bool | no | false | Preview operations without executing mutations | |
| 15 | | aging_thresholds_days | array | no | [1, 3, 7] | Day boundaries for age buckets (e.g., `[1,3,7]` creates: 0–1d, 1–3d, 3–7d, 7d+) | |
| 16 | | include_holds | bool | no | true | Include orders with active fulfillment holds in a separate section | |
| 17 | | limit | integer | no | 250 | Maximum orders to fetch per page | |
| 18 | |
| 19 | ## Workflow Steps |
| 20 | |
| 21 | 1. **OPERATION:** `orders` — query |
| 22 | **Inputs:** `first: <limit>`, `query: "fulfillment_status:unfulfilled OR fulfillment_status:partial"`, sort by `CREATED_AT` ascending (oldest first), paginate until complete |
| 23 | **Expected output:** All open orders with `createdAt`, `name`, `displayFulfillmentStatus`; compute age = now − `createdAt` in days; bucket into aging_thresholds_days segments |
| 24 | |
| 25 | 2. **OPERATION:** `fulfillmentOrders` — query (via nested `order.fulfillmentOrders`) |
| 26 | **Inputs:** For each order from Step 1: `fulfillmentOrders(first: 5)` to check `status` and `requestStatus`; flag any with `status: ON_HOLD` |
| 27 | **Expected output:** Hold status per order, `holdUntil` if set; contribute to the Holds section of the digest |
| 28 | |
| 29 | ## GraphQL Operations |
| 30 | |
| 31 | ```graphql |
| 32 | # orders:query — validated against api_version 2025-01 |
| 33 | query FulfillmentStatusDigest($first: Int!, $after: String, $query: String) { |
| 34 | orders(first: $first, after: $after, query: $query, sortKey: CREATED_AT) { |
| 35 | edges { |
| 36 | node { |
| 37 | id |
| 38 | name |
| 39 | createdAt |
| 40 | displayFulfillmentStatus |
| 41 | displayFinancialStatus |
| 42 | totalPriceSet { |
| 43 | shopMoney { amount currencyCode } |
| 44 | } |
| 45 | customer { |
| 46 | id |
| 47 | firstName |
| 48 | lastName |
| 49 | } |
| 50 | fulfillmentOrders(first: 5) { |
| 51 | edges { |
| 52 | node { |
| 53 | id |
| 54 | status |
| 55 | requestStatus |
| 56 | fulfillAt |
| 57 | } |
| 58 | } |
| 59 | } |
| 60 | } |
| 61 | } |
| 62 | pageInfo { |
| 63 | hasNextPage |
| 64 | endCursor |
| 65 | } |
| 66 | } |
| 67 | } |
| 68 | ``` |
| 69 | |
| 70 | Note: `fulfillmentOrders` is a nested field on the `Order` type — the `fulfillmentOrders:query` frontmatter entry documents that this operation accesses fulfillment order data. |
| 71 | |
| 72 | ## Session Tracking |
| 73 | |
| 74 | **Claude MUST emit the following output at each stage. This is mandatory.** |
| 75 | |
| 76 | **On start**, emit: |
| 77 | ``` |
| 78 | ╔══════════════════════════════════════════════╗ |
| 79 | ║ SKILL: fulfillment-status-digest ║ |
| 80 | ║ Store: <store domain> ║ |
| 81 | ║ Started: <YYYY-MM-DD HH:MM UTC> ║ |
| 82 | ╚══════════════════════════════════════════════╝ |
| 83 | ``` |
| 84 | |
| 85 | **After each step**, emit: |
| 86 | ``` |
| 87 | [N/TOTAL] <QUERY|MUTATION> <OperationName> |
| 88 | → Params: <brief summary of key inputs> |
| 89 | → Result: <count or outcome> |
| 90 | ``` |
| 91 | |
| 92 | **On completion**, emit: |
| 93 | |
| 94 | For `format: human` (default): |
| 95 | ``` |
| 96 | ══════════════════════════════════════════════ |
| 97 | OUTCOME SUMMARY |
| 98 | Total open orders: <n> |
| 99 | By age bucket (0-1d): <n> |
| 100 | By age bucket (1-3d): <n> |
| 101 | By age bucket (3-7d): <n> |
| 102 | By age bucket (7d+): <n> |
| 103 | Orders on hold: <n> |
| 104 | Errors: 0 |
| 105 | Output: none |
| 106 | ══════════════════════════════════════════════ |
| 107 | ``` |
| 108 | |
| 109 | For `format: json`, emit: |
| 110 | ```json |
| 111 | { |
| 112 | "skill": "fulfillment-status-digest", |
| 113 | "store": "<domain>", |
| 114 | "started_at": "<ISO8601>", |
| 115 | "completed_at": "<ISO8601>", |
| 116 | "dry_run": false, |
| 117 | "steps": [ |
| 118 | { "step": 1, "operation": "FulfillmentStatusDigest", "type": "query", "params_summary": "limit: <n>, query: fulfillment_status:unfulfilled OR partial", "result_summary": "<n> orders fetched", "skipped": false }, |
| 119 | { "step": 2, "operation": "fulfillmentOrders", "type": "query", "params_summary": "nested per order, first: 5", "result_summary |