Add this skill
npx mdskills install sickn33/shopify-developmentComprehensive Shopify development guide with routing logic, validated GraphQL queries, and practical examples
1---2name: shopify-development3description: |4 Build Shopify apps, extensions, themes using GraphQL Admin API, Shopify CLI, Polaris UI, and Liquid.5 TRIGGER: "shopify", "shopify app", "checkout extension", "admin extension", "POS extension",6 "shopify theme", "liquid template", "polaris", "shopify graphql", "shopify webhook",7 "shopify billing", "app subscription", "metafields", "shopify functions"8---910# Shopify Development Skill1112Use this skill when the user asks about:1314- Building Shopify apps or extensions15- Creating checkout/admin/POS UI customizations16- Developing themes with Liquid templating17- Integrating with Shopify GraphQL or REST APIs18- Implementing webhooks or billing19- Working with metafields or Shopify Functions2021---2223## ROUTING: What to Build2425**IF user wants to integrate external services OR build merchant tools OR charge for features:**26→ Build an **App** (see `references/app-development.md`)2728**IF user wants to customize checkout OR add admin UI OR create POS actions OR implement discount rules:**29→ Build an **Extension** (see `references/extensions.md`)3031**IF user wants to customize storefront design OR modify product/collection pages:**32→ Build a **Theme** (see `references/themes.md`)3334**IF user needs both backend logic AND storefront UI:**35→ Build **App + Theme Extension** combination3637---3839## Shopify CLI Commands4041Install CLI:4243```bash44npm install -g @shopify/cli@latest45```4647Create and run app:4849```bash50shopify app init # Create new app51shopify app dev # Start dev server with tunnel52shopify app deploy # Build and upload to Shopify53```5455Generate extension:5657```bash58shopify app generate extension --type checkout_ui_extension59shopify app generate extension --type admin_action60shopify app generate extension --type admin_block61shopify app generate extension --type pos_ui_extension62shopify app generate extension --type function63```6465Theme development:6667```bash68shopify theme init # Create new theme69shopify theme dev # Start local preview at localhost:929270shopify theme pull --live # Pull live theme71shopify theme push --development # Push to dev theme72```7374---7576## Access Scopes7778Configure in `shopify.app.toml`:7980```toml81[access_scopes]82scopes = "read_products,write_products,read_orders,write_orders,read_customers"83```8485Common scopes:8687- `read_products`, `write_products` - Product catalog access88- `read_orders`, `write_orders` - Order management89- `read_customers`, `write_customers` - Customer data90- `read_inventory`, `write_inventory` - Stock levels91- `read_fulfillments`, `write_fulfillments` - Order fulfillment9293---9495## GraphQL Patterns (Validated against API 2026-01)9697### Query Products9899```graphql100query GetProducts($first: Int!, $query: String) {101 products(first: $first, query: $query) {102 edges {103 node {104 id105 title106 handle107 status108 variants(first: 5) {109 edges {110 node {111 id112 price113 inventoryQuantity114 }115 }116 }117 }118 }119 pageInfo {120 hasNextPage121 endCursor122 }123 }124}125```126127### Query Orders128129```graphql130query GetOrders($first: Int!) {131 orders(first: $first) {132 edges {133 node {134 id135 name136 createdAt137 displayFinancialStatus138 totalPriceSet {139 shopMoney {140 amount141 currencyCode142 }143 }144 }145 }146 }147}148```149150### Set Metafields151152```graphql153mutation SetMetafields($metafields: [MetafieldsSetInput!]!) {154 metafieldsSet(metafields: $metafields) {155 metafields {156 id157 namespace158 key159 value160 }161 userErrors {162 field163 message164 }165 }166}167```168169Variables example:170171```json172{173 "metafields": [174 {175 "ownerId": "gid://shopify/Product/123",176 "namespace": "custom",177 "key": "care_instructions",178 "value": "Handle with care",179 "type": "single_line_text_field"180 }181 ]182}183```184185---186187## Checkout Extension Example188189```tsx190import {191 reactExtension,192 BlockStack,193 TextField,194 Checkbox,195 useApplyAttributeChange,196} from "@shopify/ui-extensions-react/checkout";197198export default reactExtension("purchase.checkout.block.render", () => (199 <GiftMessage />200));201202function GiftMessage() {203 const [isGift, setIsGift] = useState(false);204 const [message, setMessage] = useState("");205 const applyAttributeChange = useApplyAttributeChange();206207 useEffect(() => {208 if (isGift && message) {209 applyAttributeChange({210 type: "updateAttribute",211 key: "gift_message",212 value: message,213 });214 }215 }, [isGift, message]);216217 return (218 <BlockStack spacing="loose">219 <Checkbox checked={isGift} onChange={setIsGift}>220 This is a gift221 </Checkbox>222 {isGift && (223 <TextField224 label="Gift Message"225 value={message}226 onChange={setMessage}227 multiline={3}228 />229 )}230 </BlockStack>231 );232}233```234235---236237## Liquid Template Example238239```liquid240{% comment %} Product Card Snippet {% endcomment %}241<div class="product-card">242 <a href="{{ product.url }}">243 {% if product.featured_image %}244 <img245 src="{{ product.featured_image | img_url: 'medium' }}"246 alt="{{ product.title | escape }}"247 loading="lazy"248 >249 {% endif %}250 <h3>{{ product.title }}</h3>251 <p class="price">{{ product.price | money }}</p>252 {% if product.compare_at_price > product.price %}253 <p class="sale-badge">Sale</p>254 {% endif %}255 </a>256</div>257```258259---260261## Webhook Configuration262263In `shopify.app.toml`:264265```toml266[webhooks]267api_version = "2026-01"268269[[webhooks.subscriptions]]270topics = ["orders/create", "orders/updated"]271uri = "/webhooks/orders"272273[[webhooks.subscriptions]]274topics = ["products/update"]275uri = "/webhooks/products"276277# GDPR mandatory webhooks (required for app approval)278[webhooks.privacy_compliance]279customer_data_request_url = "/webhooks/gdpr/data-request"280customer_deletion_url = "/webhooks/gdpr/customer-deletion"281shop_deletion_url = "/webhooks/gdpr/shop-deletion"282```283284---285286## Best Practices287288### API Usage289290- Use GraphQL over REST for new development291- Request only fields you need (reduces query cost)292- Implement cursor-based pagination with `pageInfo.endCursor`293- Use bulk operations for processing more than 250 items294- Handle rate limits with exponential backoff295296### Security297298- Store API credentials in environment variables299- Always verify webhook HMAC signatures before processing300- Validate OAuth state parameter to prevent CSRF301- Request minimal access scopes302- Use session tokens for embedded apps303304### Performance305306- Cache API responses when data doesn't change frequently307- Use lazy loading in extensions308- Optimize images in themes using `img_url` filter309- Monitor GraphQL query costs via response headers310311---312313## Troubleshooting314315**IF you see rate limit errors:**316→ Implement exponential backoff retry logic317→ Switch to bulk operations for large datasets318→ Monitor `X-Shopify-Shop-Api-Call-Limit` header319320**IF authentication fails:**321→ Verify the access token is still valid322→ Check that all required scopes were granted323→ Ensure OAuth flow completed successfully324325**IF extension is not appearing:**326→ Verify the extension target is correct327→ Check that extension is published via `shopify app deploy`328→ Confirm the app is installed on the test store329330**IF webhook is not receiving events:**331→ Verify the webhook URL is publicly accessible332→ Check HMAC signature validation logic333→ Review webhook logs in Partner Dashboard334335**IF GraphQL query fails:**336→ Validate query against schema (use GraphiQL explorer)337→ Check for deprecated fields in error message338→ Verify you have required access scopes339340---341342## Reference Files343344For detailed implementation guides, read these files:345346- `references/app-development.md` - OAuth authentication flow, GraphQL mutations for products/orders/billing, webhook handlers, billing API integration347- `references/extensions.md` - Checkout UI components, Admin UI extensions, POS extensions, Shopify Functions for discounts/payment/delivery348- `references/themes.md` - Liquid syntax reference, theme directory structure, sections and snippets, common patterns349350---351352## Scripts353354- `scripts/shopify_init.py` - Interactive project scaffolding. Run: `python scripts/shopify_init.py`355- `scripts/shopify_graphql.py` - GraphQL utilities with query templates, pagination, rate limiting. Import: `from shopify_graphql import ShopifyGraphQL`356357---358359## Official Documentation Links360361- Shopify Developer Docs: https://shopify.dev/docs362- GraphQL Admin API Reference: https://shopify.dev/docs/api/admin-graphql363- Shopify CLI Reference: https://shopify.dev/docs/api/shopify-cli364- Polaris Design System: https://polaris.shopify.com365366API Version: 2026-01 (quarterly releases, 12-month deprecation window)367
Full transparency — inspect the skill content before installing.