j4flmao/agent-skills/headless
Claude Code and agent skill by j4flmao/agent-skills
- community
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/headlessSKILL.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
When Headless Is Worth It
| Situation | Recommendation | |
|---|---|---|
| Standard store, theme customization enough | Stay on platform themes (Shopify Online Store 2.0) | |
| Custom UX, content-heavy storytelling, multiple frontends (web/app/kiosk) | Headless | |
| Small team without frontend ops capacity | Avoid — you now own SEO, performance, analytics, a11y | |
| Many markets/brands on one catalog | Headless with shared component library |
Caching by Data Type
| Data | Cache | Why | |
|---|---|---|---|
| Product details, collections, menus | CacheLong() / CDN with stale-while-revalidate | Changes rarely; revalidate via webhook-driven purge if available | |
| Inventory/price-sensitive listings | CacheShort() | Minutes of staleness acceptable | |
| Cart, customer account, buyer-specific pricing | CacheNone() | Personalized; caching leaks data between users | |
| Search results | Short or none | High 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.
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'screateCartHandlerwraps this. - Never cache cart reads; perform cart mutations in actions (POST), not loaders.
- Send the shopper to
cart.checkoutUrlfor hosted checkout.
Query Discipline
- Colocate GraphQL fragments with the components that render them; request only rendered fields.
- Paginate with
first/aftercursors; avoidfirst: 250everywhere. - 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-Controlheaders deliberately on documents; personalized routesprivate, no-store. - Preserve SEO: canonical URLs,
hreflangfor markets, structured data (Product,Offer), sitemap generation.
Anti-Patterns
| Anti-pattern | Consequence | |
|---|---|---|
| Caching responses that include cart/customer data | Data leak across users | |
| Client-side fetching of all catalog data | Poor 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 scratch | Loses platform fraud, tax, payments compliance | |
| Exposing private Admin API tokens in the frontend | Store 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.mdskills/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
- SKILL.md in the repositoryCheckingskills/ecommerce/headless/SKILL.md
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
[](https://verified-skill.com/skills/j4flmao/agent-skills/headless)