shopify
Guide for implementing Shopify apps, extensions, themes, and integrations using GraphQL/REST APIs, Shopify CLI, Polaris UI, and various extension types (Checkout, Admin, POS). Use when building Shopify apps, implementing checkout extensions, customizing admin interfaces, creating themes with Liquid, or integrating with Shopify's APIs.
Best use case
shopify is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Guide for implementing Shopify apps, extensions, themes, and integrations using GraphQL/REST APIs, Shopify CLI, Polaris UI, and various extension types (Checkout, Admin, POS). Use when building Shopify apps, implementing checkout extensions, customizing admin interfaces, creating themes with Liquid, or integrating with Shopify's APIs.
Teams using shopify should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/shopify/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How shopify Compares
| Feature / Agent | shopify | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Guide for implementing Shopify apps, extensions, themes, and integrations using GraphQL/REST APIs, Shopify CLI, Polaris UI, and various extension types (Checkout, Admin, POS). Use when building Shopify apps, implementing checkout extensions, customizing admin interfaces, creating themes with Liquid, or integrating with Shopify's APIs.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Shopify Development
This skill provides comprehensive guidance for building on the Shopify platform, including apps, extensions, themes, and API integrations.
## When to Use This Skill
Use this skill when you need to:
- Build Shopify apps (public or custom)
- Create checkout, admin, or POS UI extensions
- Develop themes using Liquid templating
- Integrate with Shopify APIs (GraphQL Admin API, REST API, Storefront API)
- Implement Shopify Functions (discounts, payments, delivery, validation)
- Build headless storefronts with Hydrogen
- Configure webhooks and metafields
- Use Shopify CLI for development workflows
## Core Platform Components
### 1. Shopify CLI
**Installation:**
```bash
npm install -g @shopify/cli@latest
```
**Essential Commands:**
- `shopify app init` - Create new app
- `shopify app dev` - Start local development server
- `shopify app deploy` - Deploy app to Shopify
- `shopify app generate extension` - Add extension to app
- `shopify theme dev` - Preview theme locally
- `shopify theme pull/push` - Sync theme files
For detailed CLI reference, see [reference/cli-commands.md](reference/cli-commands.md)
### 2. GraphQL Admin API (Recommended)
**Primary API for new development.** Efficient, type-safe, flexible.
**Endpoint:**
```
https://{shop-name}.myshopify.com/admin/api/2025-01/graphql.json
```
**Authentication:**
```javascript
headers: {
'X-Shopify-Access-Token': 'your-access-token',
'Content-Type': 'application/json'
}
```
**Common Operations:**
- Query products, orders, customers, inventory
- Create/update/delete resources via mutations
- Bulk operations for large datasets
- Real-time data with subscriptions
For comprehensive GraphQL reference, see [reference/graphql-admin-api.md](reference/graphql-admin-api.md)
### 3. REST Admin API (Maintenance Mode)
**Use only for legacy systems.** Shopify recommends GraphQL for all new development.
**Base URL:**
```
https://{shop-name}.myshopify.com/admin/api/2025-01/{resource}.json
```
**Rate Limits:**
- Standard: 2 requests/second
- Plus: 4 requests/second
### 4. UI Frameworks
#### Polaris (React)
Design system for consistent Shopify UI:
```bash
npm install @shopify/polaris
```
#### Polaris Web Components
Framework-agnostic components:
```html
<script src="https://cdn.shopify.com/shopifycloud/polaris.js"></script>
```
## Extension Types
### Checkout UI Extensions
Customize checkout experience with native-rendered components.
**Generate:**
```bash
shopify app generate extension --type checkout_ui_extension
```
**Configuration:** `shopify.extension.toml`
**Common Components:** View, BlockStack, InlineLayout, Button, TextField, Checkbox, Banner
For detailed extension reference, see [reference/ui-extensions.md](reference/ui-extensions.md)
### Admin UI Extensions
Extend Shopify admin interface.
**Types:**
- App blocks (embedded in native pages)
- App overlays (modal experiences)
- Links (product/collection/order pages)
### POS Extensions
Customize Point of Sale experience.
**Types:**
- Smart Grid Tiles (quick access actions)
- Modals (dialogs and forms)
- Cart modifications (custom discounts/line items)
### Post-Purchase Extensions
Upsell offers after checkout completion.
**Target:** `purchase.thank-you.block.render`
### Customer Account UI Extensions
Customize post-purchase account pages.
**Targets:** Account overview, order status/index
## Shopify Functions
Serverless backend customization running on Shopify infrastructure.
**Function Types:**
- **Discounts:** Cart, product, shipping, order discounts
- **Payment customization:** Hide/rename/reorder payment methods
- **Delivery customization:** Custom shipping options
- **Order routing:** Fulfillment location rules
- **Validation:** Cart and checkout business rules
- **Fulfillment constraints:** Bundle shipping rules
**Languages:** JavaScript, Rust, AssemblyScript
**Generate:**
```bash
shopify app generate extension --type function
```
## Theme Development
### Liquid Templating
**Core Concepts:**
- **Objects:** `{{ product.title }}` - Output dynamic content
- **Filters:** `{{ product.price | money }}` - Transform data
- **Tags:** `{% if %} {% for %} {% case %}` - Control flow
**Common Objects:**
- `product` - Product data
- `collection` - Collection data
- `cart` - Shopping cart
- `customer` - Customer account
- `shop` - Store information
**Architecture:**
- **Layouts:** Base templates
- **Templates:** Page structures
- **Sections:** Reusable content blocks (Online Store 2.0)
- **Snippets:** Smaller components
**Development:**
```bash
shopify theme dev # Local preview
shopify theme pull # Download from store
shopify theme push # Upload to store
```
## Authentication & Security
### OAuth 2.0 Flow
For public apps accessing merchant stores:
1. Redirect merchant to authorization URL
2. Merchant approves access
3. Receive authorization code
4. Exchange code for access token
5. Store token securely
### Access Scopes
Request minimum permissions needed:
- `read_products` - View products
- `write_products` - Modify products
- `read_orders` - View orders
- `write_orders` - Modify orders
Full scope list: https://shopify.dev/api/usage/access-scopes
### Session Tokens
For embedded apps in Shopify admin using App Bridge.
## Webhooks
Real-time event notifications from Shopify.
**Configuration:** `shopify.app.toml`
**Common Topics:**
- `orders/create`, `orders/updated`, `orders/paid`
- `products/create`, `products/update`, `products/delete`
- `customers/create`, `customers/update`
- `app/uninstalled`
**GDPR Mandatory Webhooks:**
- `customers/data_request`
- `customers/redact`
- `shop/redact`
## Metafields
Custom data storage for extending Shopify resources.
**Owners:** Products, variants, customers, orders, collections, shop
**Types:** text, number, date, URL, JSON, file_reference
**Access:** Admin API, Storefront API, Liquid templates
## Best Practices
### Performance
- Use GraphQL instead of REST for efficiency
- Request only needed fields in queries
- Implement pagination for large datasets
- Use bulk operations for batch processing
- Respect rate limits (cost-based for GraphQL)
### User Experience
- Follow Polaris design guidelines
- Implement loading states
- Provide clear error messages
- Support keyboard navigation
- Test across devices
### Security
- Store API credentials securely
- Use environment variables for tokens
- Implement webhook verification
- Follow OAuth best practices
- Request minimal access scopes
### Code Quality
- Use TypeScript for type safety
- Write comprehensive error handling
- Implement retry logic with exponential backoff
- Log errors for debugging
- Keep dependencies updated
### Testing
- Use development stores for testing
- Test across different store plans
- Verify webhook handling
- Test app uninstall flow
- Validate GDPR compliance
## Development Workflow
1. **Initialize App:**
```bash
shopify app init
```
2. **Configure Access Scopes:**
Edit `shopify.app.toml`:
```toml
[access_scopes]
scopes = "read_products,write_products"
```
3. **Start Development Server:**
```bash
shopify app dev
```
4. **Generate Extensions:**
```bash
shopify app generate extension
```
5. **Test in Development Store:**
Install app on test store
6. **Deploy to Production:**
```bash
shopify app deploy
```
## Common Patterns
### Fetch Products (GraphQL)
```graphql
query {
products(first: 10) {
edges {
node {
id
title
handle
variants(first: 5) {
edges {
node {
id
price
inventoryQuantity
}
}
}
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
```
### Create Product (GraphQL)
```graphql
mutation {
productCreate(input: {
title: "New Product"
productType: "Clothing"
variants: [{
price: "29.99"
sku: "SKU123"
}]
}) {
product {
id
title
}
userErrors {
field
message
}
}
}
```
### Checkout Extension (React)
```javascript
import { useState } from 'react';
import {
render,
BlockStack,
TextField,
Checkbox,
useApi
} from '@shopify/ui-extensions-react/checkout';
function Extension() {
const { extensionPoint } = useApi();
const [checked, setChecked] = useState(false);
return (
<BlockStack>
<TextField label="Gift Message" />
<Checkbox checked={checked} onChange={setChecked}>
This is a gift
</Checkbox>
</BlockStack>
);
}
render('Checkout::Dynamic::Render', () => <Extension />);
```
## Resources
### Documentation
- Official docs: https://shopify.dev/docs
- GraphQL API: https://shopify.dev/docs/api/admin-graphql
- Shopify CLI: https://shopify.dev/docs/api/shopify-cli
- Polaris: https://polaris.shopify.com
### Tools
- GraphiQL Explorer: Built into Shopify admin
- Shopify CLI: Development workflow
- Partner Dashboard: App management
- Development stores: Free testing environments
### Learning
- Shopify Developer Changelog: API updates and deprecations
- Built for Shopify: Quality program for apps
- Community forums: Help and discussions
## Reference Documentation
This skill includes detailed reference documentation:
- [GraphQL Admin API Reference](reference/graphql-admin-api.md) - Comprehensive API guide
- [Shopify CLI Commands](reference/cli-commands.md) - Complete CLI reference
- [UI Extensions](reference/ui-extensions.md) - Extension types and components
## Troubleshooting
### Common Issues
**Rate Limit Errors:**
- Monitor `X-Shopify-Shop-Api-Call-Limit` header
- Implement exponential backoff
- Use bulk operations for large datasets
**Authentication Failures:**
- Verify access token is valid
- Check required scopes are granted
- Ensure OAuth flow completed correctly
**Webhook Not Receiving Events:**
- Verify webhook URL is accessible
- Check webhook signature validation
- Review webhook logs in Partner Dashboard
**Extension Not Appearing:**
- Verify extension target is correct
- Check extension is published
- Ensure app is installed on store
## Version Management
Shopify uses quarterly API versioning (YYYY-MM format):
- Current: 2025-01
- Each version supported for 12 months
- Test updates before quarterly releases
- Use version-specific endpoints
## App Distribution
### Custom Apps
Single merchant installation, no review required.
### Public Apps
App Store listing with Shopify review:
- Follow app requirements
- Complete Built for Shopify criteria
- Define pricing model
- Submit for review
---
**Note:** This skill covers the Shopify platform as of January 2025. Always refer to official Shopify documentation for the latest updates and API versions.Related Skills
git-commit-formatter
生成符合 Conventional Commits 规范的 Git 提交信息。当用户要求生成提交、创建 commit 或写提交信息时使用
deploy-staging
将当前分支部署到测试环境。当用户要求部署、发布到测试或在 staging 环境测试时使用
code-reviewer
进行系统化的代码审查,检查代码质量、安全性和性能。当用户要求审查代码、review 或检查代码时使用
turborepo
Guide for implementing Turborepo - a high-performance build system for JavaScript and TypeScript monorepos. Use when setting up monorepos, optimizing build performance, implementing task pipelines, configuring caching strategies, or orchestrating tasks across multiple packages.
test-expert
Testing methodologies, test-driven development (TDD), unit and integration testing, and testing best practices across multiple frameworks. Use when the user needs to write tests, implement TDD, or improve test coverage and quality.
template-skill
Replace with description of the skill and when Claude should use it.
tailwindcss
Guide for implementing Tailwind CSS - a utility-first CSS framework for rapid UI development. Use when styling applications with responsive design, dark mode, custom themes, or building design systems with Tailwind's utility classes.
skill-creator
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
shell-scripting
Specialized knowledge of Bash and Zsh scripting, shell automation, command-line tools, and scripting best practices. Use when the user needs to write, debug, or optimize shell scripts or work with command-line tools.
shadcn-ui
Guide for implementing shadcn/ui - a collection of beautifully-designed, accessible UI components built with Radix UI and Tailwind CSS. Use when building user interfaces, adding UI components, or implementing design systems in React-based applications.
repomix
Guide for using Repomix - a powerful tool that packs entire repositories into single, AI-friendly files. Use when packaging codebases for AI analysis, generating context for LLMs, creating codebase snapshots, analyzing third-party libraries, or preparing repositories for security audits.
remix-icon
Guide for implementing RemixIcon - an open-source neutral-style icon library with 3,100+ icons in outlined and filled styles. Use when adding icons to applications, building UI components, or designing interfaces. Supports webfonts, SVG, React, Vue, and direct integration.