j4flmao/agent-skills/headless

Claude Code and agent skill by j4flmao/agent-skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Use this skill when the user says 'headless commerce', 'shopify hydrogen', 'storefront api', 'oxygen', 'composable commerce', 'headless shopify', 'commerce frontend caching'. It designs headless storefronts (Shopify Hydrogen/Storefront API and other commerce APIs): data fetching, caching per data type, cart handling, and deployment. Do NOT use for: checkout conversion tactics (use checkout-optimization), cart/order backend modeling (use ecommerce-checkout-cart), payment gateways (use ecommerce-payment-processing).

Install

npx vskill@latest install j4flmao/agent-skills/headless

SKILL.md

Headless E-commerce

Purpose

Build a custom storefront on top of a commerce backend (Shopify, commercetools, BigCommerce, Saleor, Medusa) while keeping catalog pages fast and cacheable and keeping personalized data (cart, customer) uncached and correct. Checkout usually stays on the platform's hosted checkout.

Agent Protocol

Trigger

"headless commerce", "hydrogen", "storefront api", "oxygen", "composable commerce", "headless shopify", "storefront caching".

Input Context
  • Commerce platform and plan; whether hosted checkout is required.
  • Frontend framework preference (Hydrogen on React Router, Next.js, Astro).
  • Catalog size, update frequency, markets/currencies.
Output Artifact

Architecture + data-fetching/caching plan; route loader code on request.

Response Format
Platform: {backend} Frontend: {framework} Hosting: {Oxygen|Vercel|Cloudflare|...}
Data -> cache: {products: long, collections: short, cart/customer: none}
Checkout: {hosted|custom}
Risks: {list}

When Headless Is Worth It

SituationRecommendation
Standard store, theme customization enoughStay on platform themes (Shopify Online Store 2.0)
Custom UX, content-heavy storytelling, multiple frontends (web/app/kiosk)Headless
Small team without frontend ops capacityAvoid — you now own SEO, performance, analytics, a11y
Many markets/brands on one catalogHeadless with shared component library

Caching by Data Type

DataCacheWhy
Product details, collections, menusCacheLong() / CDN with stale-while-revalidateChanges rarely; revalidate via webhook-driven purge if available
Inventory/price-sensitive listingsCacheShort()Minutes of staleness acceptable
Cart, customer account, buyer-specific pricingCacheNone()Personalized; caching leaks data between users
Search resultsShort or noneHigh cardinality

Hydrogen Loader (React Router based)

Hydrogen queries use template strings tagged with #graphql (enables codegen and editor support). Cache strategy is passed per query.

typescript
import { CacheLong } from '@shopify/hydrogen';
import type { LoaderFunctionArgs } from 'react-router';
const PRODUCT_QUERY = `#graphql
query Product($handle: String!, $country: CountryCode, $language: LanguageCode)
@inContext(country: $country, language: $language) {
product(handle: $handle) {
id
title
descriptionHtml
selectedOrFirstAvailableVariant {
id
availableForSale
price { amount currencyCode }
}
}
}
` as const;
export async function loader({ params, context }: LoaderFunctionArgs) {
if (!params.handle) throw new Response('Missing product handle', { status: 400 });
const { product } = await context.storefront.query(PRODUCT_QUERY, {
variables: { handle: params.handle },
cache: CacheLong(),
});
if (!product) throw new Response(`Product not found: ${params.handle}`, { status: 404 });
return { product };
}

Older Hydrogen versions import loader types from @shopify/remix-oxygen; check the project's package.json before generating imports.

Cart

  • Use the Storefront API Cart object (cartCreate, cartLinesAdd, cartLinesUpdate); persist cart ID in a cookie. Hydrogen's createCartHandler wraps this.
  • Never cache cart reads; perform cart mutations in actions (POST), not loaders.
  • Send the shopper to cart.checkoutUrl for hosted checkout.

Query Discipline

  • Colocate GraphQL fragments with the components that render them; request only rendered fields.
  • Paginate with first/after cursors; avoid first: 250 everywhere.
  • Storefront API rate limits are generous but not infinite — cache at the edge and avoid N+1 per product card (fetch lists in one query).
  • Use @inContext(country, language) for market-specific pricing/translations.

Deployment

  • Hydrogen deploys to Oxygen (Shopify's hosting) or any Workers-compatible/Node host.
  • Set Cache-Control headers deliberately on documents; personalized routes private, no-store.
  • Preserve SEO: canonical URLs, hreflang for markets, structured data (Product, Offer), sitemap generation.

Anti-Patterns

Anti-patternConsequence
Caching responses that include cart/customer dataData leak across users
Client-side fetching of all catalog dataPoor LCP and SEO
Rebuilding the whole site on every price change (pure SSG)Stale prices; use SSR + cache or ISR-style revalidation
Rebuilding checkout from scratchLoses platform fraud, tax, payments compliance
Exposing private Admin API tokens in the frontendStore compromise; only public Storefront tokens client-side

Checklist

  • [ ] Cache strategy defined for every query
  • [ ] No personalized data in cached responses
  • [ ] Product/collection 404s handled
  • [ ] Market/locale context passed to queries
  • [ ] Structured data + canonical tags on product pages
  • [ ] Hosted checkout via checkoutUrl

References

  • skills/ecommerce/checkout-cart/references/cart-architecture.md
  • skills/ecommerce/checkout-cart/references/checkout-ux.md

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
27
Repository forks
1
7-day trend score
22

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/j4flmao/agent-skills/headless/badge)](https://verified-skill.com/skills/j4flmao/agent-skills/headless)

Something wrong with this skill or its page? Tell us.