Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

jamstack-storefront

БесплатноБез исполняемых скриптовНе проверен

Build a blazing-fast storefront with Next.js or Astro that pre-renders product pages as static HTML and fetches live data from commerce APIs

finsilabsот finsilabs★ 69 звёзд на GitHub

Об этом скилле

Jamstack Storefront

Overview

A Jamstack storefront pre-renders catalog pages at build time for maximum performance and CDN cacheability, while using client-side JavaScript and commerce APIs for dynamic functionality (cart, checkout, account). Next.js with Incremental Static Regeneration (ISR) and Astro with on-demand rendering are the two dominant approaches, each offering different tradeoffs between build times, freshness, and interactivity. This skill covers setting up a Jamstack commerce site, managing catalog regeneration, and integrating headless commerce APIs.

When to Use This Skill

  • When SEO and Core Web Vitals scores are top priorities — static HTML scores near-perfect Lighthouse results
  • When you have a large catalog that rarely changes and want sub-100ms page loads from CDN
  • When you want to decouple the commerce backend (Shopify, Saleor, commercetools) from the storefront deployment cycle
  • When your team wants to use modern React/Astro tooling rather than a platform's proprietary theme system
  • When you need to combine commerce data with a CMS (Contentful, Sanity) at build time

Prerequisites & Platform Notes

This skill is written for custom/headless storefronts (Node.js, Python, or similar backend). The code examples use TypeScript/Node.js and can be adapted to any stack.

Shopify: Shopify Hydrogen is Shopify's headless framework. MACH/composable patterns apply when using Shopify as the commerce backend with a custom frontend, or when mixing Shopify with other best-of-breed services. WooCommerce: WooCommerce can serve as a headless backend via its REST API and WPGraphQL. These patterns apply when decoupling the frontend from WordPress. Magento: Magento's GraphQL API and PWA Studio support headless architectures. These composable patterns apply to Magento as a backend service in a MACH stack.

You'll need:

  • Node.js 18+ (or adapt to your backend language)
  • Redis for caching/queues
  • An email sending service (SendGrid, AWS SES, or Postmark)
  • CDN (Cloudflare, CloudFront, or Fastly)

Core Instructions

  1. Bootstrap a Next.js commerce storefront

    npx create-next-app@latest my-store --typescript --tailwind --app
    cd my-store
    npm install @shopify/storefront-api-client graphql
    

    Configure the Storefront API client:

    // lib/shopify.ts
    import {createStorefrontApiClient} from '@shopify/storefront-api-client';
    
    export const shopify = createStorefrontApiClient({
      storeDomain: process.env.SHOPIFY_STORE_DOMAIN!,
      publicAccessToken: process.env.SHOPIFY_STOREFRONT_TOKEN!,
      apiVersion: '2025-01',
    });
    
  2. Statically generate product pages with ISR

    // app/products/[handle]/page.tsx (Next.js App Router)
    import {shopify} from '@/lib/shopify';
    import {notFound} from 'next/navigation';
    
    // ISR: revalidate every 60 seconds
    export const revalidate = 60;
    
    // Pre-build top products at build time
    export async function generateStaticParams() {
      const {data} = await shopify.request(TOP_PRODUCTS_QUERY, {
        variables: {first: 200},
      });
      return data.products.edges.map(({node}: any) => ({handle: node.handle}));
    }
    
    export default async function ProductPage({params}: {params: {handle: string}}) {
      const {data} = await shopify.request(PRODUCT_QUERY, {
        variables: {handle: params.handle},
      });
    
      if (!data.product) notFound();
    
      return <ProductDetail product={data.product} />;
    }
    
    const PRODUCT_QUERY = `
      query ProductByHandle($handle: String!) {
        product(handle: $handle) {
          id title descriptionHtml
          images(first: 5) { edges { node { url altText } } }
          variants(first: 20) {
            edges { node { id title price { amount currencyCode } availableForSale } }
          }
        }
      }
    `;
    
  3. Build an Astro storefront for minimal JavaScript overhead

    Astro ships zero JS by default — components are server-rendered to static HTML unless explicitly hydrated:

    npm create astro@latest -- --template minimal
    cd my-astro-store
    npx astro add tailwind
    npm install @astrojs/node graphql-request
    
    ---
    // src/pages/products/[handle].astro
    import {GraphQLClient, gql} from 'graphql-request';
    import Layout from '../../layouts/Layout.astro';
    import AddToCartButton from '../../components/AddToCartButton.tsx'; // Island
    
    export async function getStaticPaths() {
      const client = new GraphQLClient(import.meta.env.SALEOR_API_URL);
      const {products} = await client.request(gql`query { products(first: 200, channel: "default-channel") { edges { node { slug } } } }`);
      return products.edges.map(({node}: any) => ({params: {handle: node.slug}}));
    }
    
    const {handle} = Astro.params;
    const client = new GraphQLClient(import.meta.env.SALEOR_API_URL);
    const {product} = await client.request(PRODUCT_QUERY, {slug: handle, channel:
    
Полный SKILL.md на GitHub

Установить jamstack-storefront в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

claude-code
cursor
gemini-cli
copilot
codex-cli
kiro
opencode

Вложенные файлы

evals/isr-webhook-revalidation-with-cache-tags/criteria.jsonevals/isr-webhook-revalidation-with-cache-tags/task.mdevals/next-js-shopify-isr-product-pages/criteria.jsonevals/next-js-shopify-isr-product-pages/task.mdevals/zustand-cart-with-localstorage-persisten/criteria.jsonevals/zustand-cart-with-localstorage-persisten/task.mdtile.json

FAQ

Что делает скилл jamstack-storefront?

Build a blazing-fast storefront with Next.js or Astro that pre-renders product pages as static HTML and fetches live data from commerce APIs

Как установить скилл jamstack-storefront?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл jamstack-storefront запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить jamstack-storefront с