shopify-admin-draft-order-cleanup
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "shopify-admin-draft-order-cleanup" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-73db9ea56f0d6dcd1a7d4e944dcd6a74135fe34d8f73032929c56600f995dca2. Verify the upstream source and version against https://github.com/40RTY-ai/shopify-admin-skills before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
github.com
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Find draft orders older than N days and optionally delete those drafts to reduce clutter in the admin backend.
Introduction source: third_party · 40RTY-ai · 0.0.1 Reference
SkillPi interpretation
- Tasks
- Finds stale draft orders older than N days and optionally deletes them to reduce admin clutter.
- Inputs and outputs
- CSV file `draft_cleanup_<YYYY-MM-DD>.csv` with columns: `draft_id`, `draft_name`, `customer_name`, `customer_email`, `created_at`, `total_value`, `currency`, `action`
- Software, accounts and paid services
- Authenticated Shopify CLI session: `shopify store auth --store <domain> --scopes read_orders,write_orders` API scopes: `read_orders`, `write_orders`
- Testing
- Not tested
Browse files
Frontmatter
name: shopify-admin-draft-order-cleanup
role: store-management
description: "Finds stale draft orders older than N days and optionally deletes them to reduce admin clutter."
toolkit: shopify-admin, shopify-admin-execution
api_version: "2025-01"
graphql_operations:
- draftOrders:query
- draftOrderDelete:mutation
status: stable
compatibility: Claude Code, Cursor, Codex, Gemini CLIPurpose
Queries open draft orders older than a configurable age and optionally deletes them. Draft orders accumulate from abandoned B2B quotes, incomplete manual orders, or old integrations and clutter the admin. Stale drafts also inflate pending revenue metrics.
Prerequisites
- Authenticated Shopify CLI session:
shopify store auth --store <domain> --scopes read_orders,write_orders - API scopes:
read_orders,write_orders
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| store | string | yes | — | Store domain (e.g., mystore.myshopify.com) |
| older_than_days | integer | no | 30 | Delete drafts older than this many days |
| dry_run | bool | no | true | Preview drafts to delete without executing mutation |
| format | string | no | human | Output format: human or json |
Safety
⚠️
draftOrderDeletepermanently deletes draft orders. Deleted drafts cannot be recovered. Run withdry_run: trueto review the list before committing. Check that no stale drafts represent active B2B quotes awaiting customer approval before deleting.
Workflow Steps
-
OPERATION:
draftOrders— query Inputs:query: "status:open created_at:<='<NOW - older_than_days days>'",first: 250, pagination cursor Expected output: Stale open draft orders; paginate untilhasNextPage: false -
OPERATION:
draftOrderDelete— mutation Inputs:id: <draft_order_id>Expected output:deletedId,userErrors
GraphQL Operations
# draftOrders:query — validated against api_version 2025-01
query StaleDraftOrders($query: String!, $after: String) {
draftOrders(first: 250, after: $after, query: $query) {
edges {
node {
id
name
status
createdAt
updatedAt
totalPriceSet {
shopMoney {
amount
currencyCode
}
}
customer {
id
displayName
defaultEmailAddress {
emailAddress
}
}
tags
note
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
# draftOrderDelete:mutation — validated against api_version 2025-01
mutation DraftOrderDelete($input: DraftOrderDeleteInput!) {
draftOrderDelete(input: $input) {
deletedId
userErrors {
field
message
}
}
}
Session Tracking
Claude MUST emit the following output at each stage. This is mandatory.
On start, emit:
╔══════════════════════════════════════════════╗
║ SKILL: Draft Order 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):
══════════════════════════════════════════════
OUTCOME SUMMARY
Stale drafts found: <n>
Drafts deleted: <n>
Total value cleared: $<amount>
Errors: <n>
Output: draft_cleanup_<date>.csv
══════════════════════════════════════════════
For format: json, emit:
{
"skill": "draft-order-cleanup",
"store": "<domain>",
"started_at": "<ISO8601>",
"older_than_days": 30,
"dry_run": true,
"outcome": {
"drafts_found": 0,
"drafts_deleted": 0,
"value_cleared": 0,
"currency": "USD",
"errors": 0,
"output_file": "draft_cleanup_<date>.csv"
}
}
Output Format
CSV file draft_cleanup_<YYYY-MM-DD>.csv with columns:
draft_id, draft_name, customer_name, customer_email, created_at, total_value, currency, action
Error Handling
| Error | Cause | Recovery |
|---|---|---|
THROTTLED |
API rate limit exceeded | Wait 2 seconds, retry up to 3 times |
userErrors on delete |
Draft already completed or cancelled | Log as skipped, continue |
| No stale drafts | All drafts are recent or none exist | Exit with 0 results |
Best Practices
- Set
older_than_days: 60or higher for B2B stores where quotes may have longer sales cycles. - Review the dry-run list for drafts with notes or high value before deleting — these may be legitimate pending quotes.
- For B2B scenarios, consider filtering out drafts tagged with
b2b-quoteor similar before running the delete step. - Run monthly as a routine admin hygiene task.
Version history
-
v1.1.0
GitHub ↗
Original release notes
## 🤖 New category: Agentic Commerce Readiness The fix-it side of the [**agentiq.report**](https://agentiq.report) audit. The audit tells operators *where* AI shopping agents (ChatGPT, Gemini, Perplexity, agentic checkout) can't find, read, or recommend their store. This release adds **10 skills that remediate those findings** via the native Shopify Admin GraphQL toolkit — closing the loop: **audit finds the gap → run the matching skill → re-audit confirms.** Every skill declares the audit **signals** it fixes (`audit_signals` frontmatter), so a finding in the report maps directly to the skill that resolves it. ### Skills - **`agentic-readiness-audit`** — flagship, read-only store-side scorecard that routes each gap to its fix skill - **`agentic-product-jsonld-backfill`** — barcode/GTIN, vendor, product type for complete Product JSON-LD - **`agentic-image-alt-text`** — descriptive alt text on product media - **`agentic-description-enrichment`** — fact-rich descriptions for AI quoting - **`agentic-metafields-setup`** — define + populate agentic metafields for filtering - **`agentic-product-taxonomy`** — Shopify Standard Product Taxonomy categories - **`agentic-crawler-access`** — allow GPTBot/ClaudeBot/PerplexityBot… in `robots.txt.liquid` - **`agentic-llms-txt`** — publish a curated `/llms.txt` for AI assistants - **`agentic-organization-schema`** — Organization JSON-LD (sameAs, contactPoint) into the theme - **`agentic-policy-readability`** — machine-readable shipping/returns policies Plus a weekly **`agentic-readiness-monitor`** routine that re-audits and alerts on regressions. ### Stats **116 skills across 11 categories** (was 106/10), **21 routines** (was 20). All GraphQL validated against the live Admin 2025-01 schema; `pnpm validate:index` passes (116 skills, 64 operations). ### Notes Theme-editing and policy skills default to `dry_run`/`audit` mode, write inside managed `# BEGIN/END` blocks, and recommend duplicating the theme first.
Current listing version
0.0.1
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 解决 Shopify 商家后台草稿订单堆积的实际痛点
- 具有广泛受众的实用能力
- 适用于 B2B 和常规电商场景
Highlights
- 触发词精准完整,覆盖多种变体
- 边界清晰,不易误触
Highlights
- Phase/步骤清晰,有出口条件
- 含端到端示例,frontmatter完整
- 单文件≤500行
Highlights
- 工具来源明确,参数正确
- 覆盖主要异常,不可逆操作有确认机制
- API 版本明确,GraphQL 操作已验证
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Authenticated Shopify CLI session: `shopify store auth --store <domain> --scopes read_orders,write_orders` API scopes: `read_orders`, `write_orders`
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.