一键导入
shopify-workflow-tools
Shopify CLI commands, development workflow, and essential tools for theme development
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Shopify CLI commands, development workflow, and essential tools for theme development
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Prisma ORM best practices for Shopify apps including multi-tenant data isolation, query optimization, transaction patterns, and migration strategies. Auto-invoked when working with database operations.
Build consistent UI using Polaris Web Components patterns for common page layouts like index pages, detail pages, forms, and empty states. Use this skill when creating new pages or refactoring existing UI components.
Common Shopify Admin GraphQL API patterns for product queries, metafield operations, webhooks, and bulk operations. Auto-invoked when working with Shopify API integration.
Polaris composition patterns and page templates for common Shopify app layouts. Provides index tables, settings pages, dashboards, and resource management patterns. Auto-invoked when building page layouts.
Core Polaris Web Components fundamentals including component library structure, design tokens, responsive patterns, and SSR compatibility. Auto-invoked when working with Polaris components.
Internationalization fundamentals for multi-language Shopify themes
基于 SOC 职业分类
| name | Shopify Workflow & Tools |
| description | Shopify CLI commands, development workflow, and essential tools for theme development |
# Clone the Dawn reference theme
shopify theme init
# Clone a specific theme
shopify theme init --clone-url https://github.com/Shopify/dawn.git
# Start local development server with hot-reload
shopify theme dev --store=example.myshopify.com
# Development server options
shopify theme dev --store=example.myshopify.com --port=9293
shopify theme dev --store=example.myshopify.com --theme-editor-sync
Features:
http://127.0.0.1:9292# Push as unpublished theme (recommended first push)
shopify theme push --unpublished
# Push to specific theme
shopify theme push --theme=THEME_ID
# Push with development flag
shopify theme push --development
# Pull published theme
shopify theme pull
# Pull specific theme
shopify theme pull --theme=THEME_ID
# Pull only specific files
shopify theme pull --only=templates/*.json,sections/*.liquid
# Publish theme
shopify theme publish --theme=THEME_ID
# List all themes
shopify theme list
shopify theme delete --theme=THEME_ID
# Run theme check
shopify theme check
# Auto-fix issues
shopify theme check --auto-correct
# Clone starter theme
shopify theme init
# Navigate to theme directory
cd your-theme-name
# Install dependencies (if using package.json)
npm install
# Start development
shopify theme dev --store=your-store.myshopify.com
# Start dev server
shopify theme dev --store=example.myshopify.com
# Open browser to http://127.0.0.1:9292
# Make changes to Liquid, CSS, JavaScript
# See changes instantly (hot-reload for CSS/sections)
# Check for theme issues
shopify theme check
# Fix auto-fixable issues
shopify theme check --auto-correct
# First deployment (as unpublished)
shopify theme push --unpublished
# Or push to development theme
shopify theme push --development
# Verify in Shopify admin
# Theme Library > View theme
# List themes to get THEME_ID
shopify theme list
# Publish theme
shopify theme publish --theme=THEME_ID
Shopify's official linting tool for themes.
npm install -g @shopify/theme-check
# Run checks
theme-check .
# Auto-fix issues
theme-check . --auto-correct
# Check specific files
theme-check sections/header.liquid
Install the "Shopify Liquid" extension for:
your-theme/
├── config/
│ ├── settings_schema.json # Global theme settings (required)
│ └── settings_data.json # Theme setting values (auto-generated)
├── layout/
│ └── theme.liquid # Base layout (required)
├── templates/
│ ├── index.json # Homepage template (required)
│ ├── product.json # Product page template
│ ├── collection.json # Collection page template
│ └── 404.liquid # 404 page
├── sections/
│ └── *.liquid # Reusable sections
├── snippets/
│ └── *.liquid # Reusable code fragments
├── assets/
│ └── *.* # CSS, JS, images, fonts
└── locales/
└── en.default.json # Default language (required)
# Create development store
# Visit partners.shopify.com
# Stores > Add store > Development store
shopify theme dev or --development flag--unpublished flag# Initialize git
git init
# Add .gitignore
echo "config/settings_data.json" >> .gitignore
echo "node_modules/" >> .gitignore
echo ".DS_Store" >> .gitignore
# Commit theme
git add .
git commit -m "Initial theme commit"
Important: .gitignore should exclude:
config/settings_data.json (store-specific)node_modules/ (dependencies).DS_Store (macOS files){%- comment -%}
Debug output using assign and display
{%- endcomment -%}
{%- assign debug = true -%}
{%- if debug -%}
<pre>
Product: {{ product | json }}
Cart: {{ cart | json }}
</pre>
{%- endif -%}
{% javascript %}
console.log('Product data:', {{ product | json }});
console.log('Settings:', {{ section.settings | json }});
{% endjavascript %}
# Verbose output
shopify theme check --verbose
# Output to file
shopify theme check > check-results.txt
{%- # Use appropriate image sizes -%}
<img
srcset="
{{ image | image_url: width: 400 }} 400w,
{{ image | image_url: width: 800 }} 800w,
{{ image | image_url: width: 1200 }} 1200w
"
sizes="(min-width: 1024px) 33vw, (min-width: 768px) 50vw, 100vw"
src="{{ image | image_url: width: 800 }}"
loading="lazy"
>
{%- # Defer non-critical JavaScript -%}
<script src="{{ 'theme.js' | asset_url }}" defer></script>
{%- # Preload critical assets -%}
<link rel="preload" href="{{ 'theme.css' | asset_url }}" as="style">
{%- # Good - assign complex logic to variable -%}
{%- liquid
assign is_on_sale = false
if product.compare_at_price > product.price
assign is_on_sale = true
endif
-%}
{%- if is_on_sale -%}
<span>On Sale</span>
{%- endif -%}
{%- # Bad - inline complex logic -%}
{% if product.compare_at_price > product.price %}
<span>On Sale</span>
{% endif %}
name: Deploy Theme
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Shopify CLI
run: npm install -g @shopify/cli @shopify/theme
- name: Push theme
run: shopify theme push --development
env:
SHOPIFY_CLI_THEME_TOKEN: ${{ secrets.SHOPIFY_CLI_THEME_TOKEN }}
# Authentication
shopify auth login
# Theme commands
shopify theme list # List all themes
shopify theme info # Show theme info
shopify theme dev # Start dev server
shopify theme push # Push theme
shopify theme pull # Pull theme
shopify theme publish # Publish theme
shopify theme delete # Delete theme
shopify theme check # Check theme for issues
shopify theme package # Package theme as .zip
# Theme check
theme-check . # Run checks
theme-check . --auto-correct # Fix issues
theme-check . --config=.theme-check.yml # Use custom config
# Help
shopify theme --help # Show help
shopify theme dev --help # Show dev command help
# Check if port is in use
lsof -i :9292
# Use different port
shopify theme dev --port=9293
# Re-authenticate
shopify auth logout
shopify auth login
# Force push (caution: overwrites remote)
shopify theme push --force
# Pull first, then push
shopify theme pull
shopify theme push
npm update -g @shopify/cliUse these tools and workflows to build, test, and deploy Shopify themes efficiently.