storefront-best-practices
ALWAYS use this skill when working on ecommerce storefronts, online stores, shopping sites. Use for ANY storefront component including checkout pages, cart, payment flows, product pages, product listings, navigation, homepage, or ANY page/component in a storefront. CRITICAL for adding checkout, implementing cart, integrating Medusa backend, or building any ecommerce functionality. Framework-agnostic (Next.js, SvelteKit, TanStack Start, React, Vue). Provides patterns, decision frameworks, backend integration guidance.
What this skill does
# Ecommerce Storefront Best Practices Comprehensive guidance for building modern, high-converting ecommerce storefronts covering UI/UX patterns, component design, layout structures, SEO optimization, and mobile responsiveness. ## When to Apply **ALWAYS load this skill when working on ANY storefront task:** - **Adding checkout page/flow** - Payment, shipping, order placement - **Implementing cart** - Cart page, cart popup, add to cart functionality - **Building product pages** - Product details, product listings, product grids - **Creating navigation** - Navbar, megamenu, footer, mobile menu - **Integrating Medusa backend** - SDK setup, cart, products, payment - **Any storefront component** - Homepage, search, filters, account pages - Building new ecommerce storefronts from scratch - Improving existing shopping experiences and conversion rates - Optimizing for usability, accessibility, and SEO - Designing mobile-responsive ecommerce experiences **Example prompts that should trigger this skill:** - "Add a checkout page" - "Implement shopping cart" - "Create product listing page" - "Connect to Medusa backend" - "Add navigation menu" - "Build homepage for store" ## CRITICAL: Load Reference Files When Needed **⚠️ ALWAYS load `reference/design.md` BEFORE creating ANY UI component** - Discovers existing design tokens (colors, fonts, spacing, patterns) - Prevents introducing inconsistent styles - Provides guardrails for maintaining brand consistency - **Required for every component, not just new storefronts** **Load these references based on what you're implementing:** - **Starting a new storefront?** → MUST load `reference/design.md` first to discover user preferences - **Connecting to backend API?** → MUST load `reference/connecting-to-backend.md` first - **Connecting to Medusa backend?** → MUST load `reference/medusa.md` for SDK setup, pricing, regions, and Medusa patterns - **Implementing homepage?** → MUST load `reference/components/navbar.md`, `reference/components/hero.md`, `reference/components/footer.md`, and `reference/layouts/home-page.md` - **Implementing navigation?** → MUST load `reference/components/navbar.md` and optionally `reference/components/megamenu.md` - **Building product listing?** → MUST load `reference/layouts/product-listing.md` first - **Building product details?** → MUST load `reference/layouts/product-details.md` first - **Implementing checkout?** → MUST load `reference/layouts/checkout.md` first - **Optimizing for SEO?** → MUST load `reference/seo.md` first - **Optimizing for mobile?** → MUST load `reference/mobile-responsiveness.md` first **Minimum requirement:** Load at least 1-2 reference files relevant to your specific task before implementing. ## Planning and Implementation Workflow **IMPORTANT: If you create a plan for implementing storefront features, include the following in your plan:** When implementing each component, page, layout, or feature in the plan: 1. **Refer back to this skill** before starting implementation 2. **Load relevant reference files** listed above for the specific component/page you're building 3. **Follow the patterns and guidance** in the reference files 4. **Check common mistakes** sections to avoid known pitfalls **Example plan structure:** ``` Task 1: Implement Navigation - Load reference/components/navbar.md - Follow patterns from navbar.md (dynamic category fetching, cart visibility, etc.) - Refer to skill for common mistakes (e.g., hardcoding categories) Task 2: Implement Product Listing Page - Load reference/layouts/product-listing.md - Follow pagination/filtering patterns from product-listing.md - Use reference/components/product-card.md for product grid items - Check skill for backend integration guidance Task 3: Implement Checkout Flow - Load reference/layouts/checkout.md - Load reference/medusa.md for Medusa payment integration - Follow component architecture recommendations (separate step components) - Refer to skill for payment method fetching requirements ``` **Why this matters:** - Plans provide high-level strategy - Reference files provide detailed implementation patterns - Skill file contains critical mistakes to avoid - Following this workflow ensures consistency and best practices ## Critical Ecommerce-Specific Patterns ### Accessibility - **CRITICAL: Cart count updates require `aria-live="polite"`** - Screen readers won't announce without it - Ensure keyboard navigation for all cart/checkout interactions ### Mobile - **Sticky bottom elements MUST use `env(safe-area-inset-bottom)`** - iOS home indicator will cut off purchase buttons otherwise - 44px minimum touch targets for cart actions, variant selectors, quantity buttons ### Performance - **ALWAYS add `loading="lazy"` to product images below fold** - Don't rely on browser defaults - Optimize product images for mobile (<500KB) - Most ecommerce traffic is mobile ### Conversion Optimization - Clear CTAs throughout shopping flow - Minimal friction in checkout (guest checkout if supported) - Trust signals (reviews, security badges, return policy) near purchase buttons - Clear pricing and shipping information upfront ### SEO - **Product schema (JSON-LD) required** - Critical for Google Shopping and rich snippets - Use [PageSpeed Insights](https://pagespeed.web.dev/) to measure Core Web Vitals ### Visual Design - **NEVER use emojis** in storefront UI - Use icons or images instead (unprofessional, accessibility issues) ### Backend Integration - **Backend detection**: If in monorepo, check for backend directory. If unsure, ask user which backend is used. - **NEVER hardcode dynamic content**: Always fetch categories, regions, products, shipping options, etc. from backend - they change frequently - Never assume API structure - verify endpoints and data formats ### ⚠️ CRITICAL: Backend SDK Method Verification Workflow **YOU MUST FOLLOW THIS EXACT WORKFLOW BEFORE WRITING CODE THAT CONNECTS TO BACKEND:** **Step 1: PAUSE - Do NOT write code yet** - You are about to write code that calls a backend API or SDK method (e.g., Medusa SDK, REST API, GraphQL) - **STOP** - Do not proceed to code without verification **Step 2: QUERY the documentation or MCP server** - **If MCP server available**: Query it for the exact method (for example, medusa MCP) - **If no MCP server**: Search official documentation - **Find**: Exact method name, parameters, return type **Step 3: VERIFY what you found** - State out loud to the user: "I need to verify the correct method for [operation]. Let me check [MCP server/documentation]." - Show the user what you found: "According to [source], the method is `sdk.store.cart.methodName(params)`" - Confirm the method signature and parameters **Step 4: ONLY THEN write the code** - Now you can write code using the verified method - Use the exact signature you found **Step 5: CHECK for TypeScript errors** - After writing the code, check for any TypeScript/type errors related to the SDK - If you see type errors on SDK methods, it means you used an incorrect method name or wrong parameters - **Type errors are a sign you didn't verify correctly** - Go back to Step 2 **THIS IS NOT OPTIONAL - THIS IS MANDATORY ERROR PREVENTION** **It is a CRITICAL ERROR to:** - ❌ Write code that calls backend APIs/SDKs without explicitly querying docs/MCP first - ❌ Guess method names or parameters - ❌ Ignore TypeScript errors on SDK methods (errors indicate incorrect method usage) - ❌ Copy examples from this skill without verification (examples may be outdated) - ❌ Assume SDK methods match REST API endpoints **For Medusa specifically:** - **Medusa pricing**: Display prices as-is - DO NOT divide by 100 (unlike Stripe, Medusa stores prices in display format) - **Medusa MCP server**: https://docs.medusajs.com/mcp - Recommend setup if not installed - Load `reference/medusa.md` for Medusa-specific patterns (regions, pricing, etc.) ### Routing Patterns - **ALWAYS use dynamic routes** for products and categories - NEV
Related in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.