shopify-admin-metafield-definition-audit
Installation
SKILL.md
Purpose
Inventories every metafield definition (PRODUCT, VARIANT, CUSTOMER, ORDER, COLLECTION, COMPANY, LOCATION, and others) and flags definitions that are unused (zero values stored), undocumented (missing description), or share a namespace.key collision across owner types. Definition sprawl is a leading source of theme/app bugs and slow Admin search. Read-only — no mutations. Provides the data foundation for a definition-cleanup workflow.
Prerequisites
- Authenticated Shopify CLI session:
shopify store auth --store <domain> --scopes read_products,read_customers,read_orders,read_inventory - API scopes: read scopes for any owner types in scope (defaults:
read_products,read_customers,read_orders)
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| store | string | yes | — | Store domain (e.g., mystore.myshopify.com) |
| owner_types | string | no | all | Comma-separated owner types to scan (e.g. PRODUCT,CUSTOMER); all scans every supported type |
| flag_unused | bool | no | true | Flag definitions whose metafieldsCount is zero |
| flag_undocumented | bool | no | true | Flag definitions with empty/null description |
| flag_duplicates | bool | no | true | Flag namespace.key pairs that exist on more than one owner type |
| format | string | no | human | Output format: human or json |