/shopify-commerce:shopify-performancefrom shopify-commerce
Optimizes Shopify store speed with Liquid rendering best practices, asset optimization, CDN strategies, Core Web Vitals, Hydrogen caching, image optimization, preloading, and lazy loading.
Ships in shopify-commerce. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Fetch live docs:
site:shopify.dev theme performance for theme optimizationsite:shopify.dev hydrogen caching for Hydrogen caching strategiessite:web.dev core web vitals for current CWV guidelines and thresholdssite:shopify.dev image optimization cdn for image URL transformssite:shopify.dev theme speed report for Shopify's built-in speed metrics{% render %} (not {% include %}) — isolated scope prevents variable conflictsO(n²) in Liquid is expensiveforloop iterations with limit: parameter{% assign %} instead of repeating expressions{{ product.title }} not {{ product | json }}all_products[handle] in loops — each is a separate data lookup{{ content_for_header }} scripts (managed by Shopify — cannot remove, but minimize additional scripts)| Anti-Pattern | Why It's Slow | Better Approach |
|---|---|---|
Nested for loops | O(n²) rendering | Flatten data, use single loop |
all_products[handle] in loop | Data fetch per iteration | Pass products via section settings |
{% include %} with variables | Shared scope causes conflicts | Use {% render %} (isolated) |
Complex {% if %} chains | Evaluated every render | Simplify conditions, use {% case %} |
| Unused sections in templates | Rendered even if hidden | Remove from JSON template |
{{ 'style.css' | asset_url | stylesheet_tag }} for proper caching<head>media="print" onload="this.media='all'"<script defer> or dynamic import()async attribute)<head>Shopify CDN image optimization:
# Responsive images with srcset
{{ image | image_url: width: 800 }}
{{ image | image_url: width: 400 }}
# Srcset pattern
<img
srcset="{{ image | image_url: width: 400 }} 400w,
{{ image | image_url: width: 800 }} 800w,
{{ image | image_url: width: 1200 }} 1200w"
sizes="(max-width: 600px) 400px, (max-width: 1000px) 800px, 1200px"
src="{{ image | image_url: width: 800 }}"
alt="{{ image.alt }}"
loading="lazy"
width="{{ image.width }}"
height="{{ image.height }}"
>
Key image practices:
loading="lazy" for below-the-fold imagesfetchpriority="high" for LCP imagewidth and height to prevent layout shift?width=, ?height=, ?crop=, ?format=Fetch live docs: Web-search
site:shopify.dev image_url filter parametersfor current CDN transform options — new parameters are added over time.
Target: < 2.5 seconds
<link rel="preload" as="image" href="{{ image | image_url: width: 1200 }}">fetchpriority="high" on LCP imageTarget: < 0.1
width and height on all images and mediaaspect-ratio CSS property for responsive media containersTarget: < 200ms
requestIdleCallback or setTimeout(fn, 0)Fetch live docs: CWV thresholds and measurement methodology evolve. Web-search
site:web.dev core web vitals thresholdsfor current targets.
// Pattern: apply cache strategy to storefront query
const data = await storefront.query(QUERY, {
cache: CacheLong(), // products, collections
});
const cart = await storefront.query(CART_QUERY, {
cache: CacheShort(), // dynamic data
});
| Strategy | Use For |
|---|---|
CacheLong() | Products, collections, pages |
CacheShort() | Cart, personalized content |
CacheNone() | Customer-specific data |
CacheCustom({...}) | Fine-tuned scenarios |
Fetch live docs for exact TTL values — Hydrogen caching defaults may change across versions.
defer() in loaders for non-critical data<Suspense> + <Await><Link prefetch="intent">Shopify's global CDN:
| Tool | What It Measures |
|---|---|
| Shopify Theme Speed Report | Overall theme score in admin |
| Google Lighthouse | CWV + performance audit |
| WebPageTest | Real-world loading waterfall |
| Chrome DevTools Performance | JS profiling, layout shifts |
| Search Console CWV Report | Field data from real users |
font-display: swap for custom fontsFetch the Shopify performance documentation, Core Web Vitals guides, and Hydrogen caching docs for exact optimization techniques and current best practices before implementing.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
23 skills in this plugin
/js-modernWrite modern JavaScript and TypeScript — ES6+ features, async/await, modules, destructuring, optional chaining, TypeScript types, and modern tooling. Use when writing JavaScript/TypeScript for Shopify themes, apps, Functions, or Hydrogen storefronts./node-backendBuild Node.js backends for Shopify apps — Remix server, @shopify/shopify-app-remix, session storage, OAuth handling, API proxy, webhook processing, and deployment. Use when building the server-side component of Shopify apps./react-patternsBuild React applications with Remix — loaders, actions, hooks, Server/Client Components, nested routes, error boundaries, form handling, and streaming SSR. Use when building Shopify Hydrogen storefronts or Remix-based apps./shopify-agentic-ucpIntegrate Shopify UCP discovery, agent profiles, catalog/cart tools, and checkout handoff using the merchant's current schemas and trust tier./shopify-api-graphqlUse Shopify GraphQL APIs — Admin API for server-side CRUD, Storefront API for client-side queries, versioning, cost-based rate limiting, bulk operations, pagination. Use when integrating with Shopify data./shopify-api-restMIGRATION SKILL: Shopify REST Admin API — endpoint patterns, authentication, rate limits, and REST-to-GraphQL migration guide. The REST Admin API is deprecated (October 2024). Use this skill only for maintaining legacy integrations or planning migration to GraphQL.npx claudepluginhub orcaqubits/agentic-commerce-skills-plugins --plugin shopify-commerceOther plugins' skills for the same job