bc-performance

Optimize BigCommerce storefront performance — CDN, image optimization, lazy loading, Stencil theme optimization, API response caching, GraphQL query efficiency, and Core Web Vitals. Use when improving store speed or diagnosing performance issues.

17 stars

Best use case

bc-performance is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Optimize BigCommerce storefront performance — CDN, image optimization, lazy loading, Stencil theme optimization, API response caching, GraphQL query efficiency, and Core Web Vitals. Use when improving store speed or diagnosing performance issues.

Teams using bc-performance should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/bc-performance/SKILL.md --create-dirs "https://raw.githubusercontent.com/OrcaQubits/agentic-commerce-skills-plugins/main/bigcommerce-commerce/skills/bc-performance/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/bc-performance/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How bc-performance Compares

Feature / Agentbc-performanceStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Optimize BigCommerce storefront performance — CDN, image optimization, lazy loading, Stencil theme optimization, API response caching, GraphQL query efficiency, and Core Web Vitals. Use when improving store speed or diagnosing performance issues.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# BigCommerce Performance Optimization

## Before writing code

**Fetch live docs**:
1. Web-search `site:developer.bigcommerce.com performance` for performance guide
2. Web-search `bigcommerce stencil theme performance optimization` for theme tuning
3. Web-search `bigcommerce core web vitals optimization` for CWV improvements

## Platform-Level Performance

### BigCommerce CDN

BigCommerce automatically serves storefronts via its global CDN:
- Static assets (JS, CSS, images) cached at edge
- Akamai-powered infrastructure
- Automatic HTTPS/SSL
- No CDN configuration needed from developers

### Server-Side Rendering

Stencil themes are server-rendered by BigCommerce:
- HTML generated on BigCommerce infrastructure
- Response times depend on template complexity and front matter data
- Minimize front matter requests for faster server response

## Stencil Theme Optimization

### Reduce Front Matter Data

Front matter declares what data to load per page — only request what you need:
- Remove unused front matter sections (e.g., `related_products` if not displayed)
- Reduce `limit` values to minimum needed
- Use `{{#if}}` to conditionally render sections, but note the data is still fetched

### JavaScript Optimization

- **Bundle size**: minimize third-party dependencies
- **Code splitting**: use dynamic imports for page-specific code
- **Defer non-critical JS**: use `defer` or `async` attributes
- **Remove unused jQuery plugins** if the theme ships jQuery
- **Tree shaking**: ensure webpack is configured for dead code elimination

### CSS Optimization

- Remove unused SCSS — audit with coverage tools
- Minimize use of `@extend` (causes CSS bloat)
- Use CSS custom properties for runtime theming instead of SCSS variables where appropriate
- Critical CSS: inline above-the-fold styles

### Image Optimization

- Use BigCommerce's image CDN — images are auto-resized via `{{getImage}}` helper
- Specify appropriate image dimensions: `{{getImage product.image 'product_size'}}`
- Use modern formats: BigCommerce CDN serves WebP when supported
- Lazy load below-the-fold images: `loading="lazy"`
- Use responsive images with `srcset` and `sizes`

### Template Optimization

- Minimize Handlebars helper nesting depth
- Reduce the number of partials per page
- Cache computed values — don't repeat the same helper call
- Use `{{#if}}` to skip rendering for empty data

## API Performance

### REST API Optimization

- Use `include` to fetch sub-resources in one request (avoid N+1)
- Use `include_fields` / `exclude_fields` to reduce response payload
- Implement caching for read-heavy data (products, categories)
- Respect rate limits — batch operations where possible
- Use webhooks instead of polling for real-time data

### GraphQL Optimization

- Request only needed fields — avoid over-fetching
- Use pagination (`first`/`after`) — never request all items
- Use fragments for reusable field sets
- Be aware of query complexity limits
- Cache GraphQL responses on your side (Catalyst uses Next.js caching)

### Caching Patterns

| Data Type | Cache Strategy | TTL |
|-----------|---------------|-----|
| Product catalog | CDN / ISR | 5–60 minutes |
| Category tree | CDN / ISR | 5–60 minutes |
| Cart | No cache | Real-time |
| Customer data | No cache | Real-time |
| Store settings | Long cache | 1–24 hours |
| Static assets | CDN | Long-term (versioned) |

## Core Web Vitals

### LCP (Largest Contentful Paint)

- Optimize hero images: correct size, preload, no lazy load
- Minimize server response time (reduce front matter)
- Preload critical fonts: `<link rel="preload" href="font.woff2" as="font">`

### FID / INP (Interaction to Next Paint)

- Minimize main thread blocking — defer heavy JS
- Break up long tasks
- Use `requestIdleCallback` for non-critical work
- Reduce JavaScript bundle size

### CLS (Cumulative Layout Shift)

- Set explicit dimensions on images and embeds
- Reserve space for dynamic content (ads, lazy-loaded elements)
- Avoid inserting content above existing content
- Use `font-display: swap` with size-adjusted fallback fonts

## Headless (Catalyst) Performance

### Next.js Optimizations

- **Static Generation**: pre-render product/category pages at build
- **ISR**: revalidate on interval for fresh data without full rebuild
- **Edge Functions**: run logic at CDN edge
- **Image Optimization**: `next/image` for automatic resizing, WebP, lazy loading
- **Font Optimization**: `next/font` for zero-CLS web fonts

### GraphQL Caching in Catalyst

- Server-side: Next.js data cache with revalidation
- Client-side: SWR or React Query for client-fetched data
- Storefront API responses can be cached at CDN level

## Best Practices

- Measure before optimizing — use Lighthouse, WebPageTest, Chrome DevTools
- Minimize front matter data — only fetch what the page displays
- Lazy load images below the fold
- Defer non-critical JavaScript
- Reduce third-party script impact (analytics, chat, pixels)
- Use BigCommerce CDN for all assets — don't self-host
- Cache API responses for read-heavy data
- Use ISR/SSG for headless storefronts
- Monitor Core Web Vitals in Google Search Console
- Test performance across device types and connection speeds

Fetch the BigCommerce performance documentation and Stencil optimization guide for current CDN features, image handling, and performance best practices before implementing.

Related Skills

woo-performance

17
from OrcaQubits/agentic-commerce-skills-plugins

Optimize WooCommerce performance — object caching, transients, HPOS, database optimization, Action Scheduler, lazy loading, and query optimization. Use when improving store performance or diagnosing slowness.

spree-performance

17
from OrcaQubits/agentic-commerce-skills-plugins

Profile and optimize a Spree application — N+1 queries with bullet/scout, database indexing strategy for Spree's polymorphic associations, Rails fragment + Russian doll caching, ActiveStorage variant pre-generation, Sidekiq queue tuning, MeiliSearch vs Postgres FTS tradeoffs, Puma worker/thread sizing, CDN strategy for catalog pages, asset precompile time, and load testing. Use when Spree is slow, the database is hot, or you're preparing for a traffic spike (Black Friday, launch).

shopify-performance

17
from OrcaQubits/agentic-commerce-skills-plugins

Optimize Shopify performance — Liquid rendering, asset optimization, CDN strategies, Core Web Vitals, Hydrogen caching, image optimization, preloading, and lazy loading. Use when improving Shopify store speed.

sf-performance

17
from OrcaQubits/agentic-commerce-skills-plugins

Optimize Salesforce Commerce performance — B2C (cartridge caching, CDN configuration, ISML rendering optimization, lazy loading) and B2B (SOQL optimization, LWC lazy loading, Apex bulkification). Both platforms target Core Web Vitals and image optimization.

magento-performance

17
from OrcaQubits/agentic-commerce-skills-plugins

Optimize Magento 2 performance — full page cache (Varnish), Redis, indexer tuning, JavaScript/CSS optimization, database optimization, and profiling. Use when diagnosing slow pages, optimizing load times, or configuring caching.

woo-testing

17
from OrcaQubits/agentic-commerce-skills-plugins

Test WooCommerce extensions — PHPUnit unit/integration tests, WP test suite, WooCommerce test helpers, E2E with Playwright, and WP-CLI test scaffolding. Use when writing tests for WooCommerce plugins or setting up a test environment.

woo-shipping

17
from OrcaQubits/agentic-commerce-skills-plugins

Build WooCommerce shipping methods — WC_Shipping_Method, shipping zones, shipping classes, rate calculation, tracking, and integration with carriers. Use when creating custom shipping integrations or configuring shipping logic.

woo-setup

17
from OrcaQubits/agentic-commerce-skills-plugins

Install WooCommerce, configure the development stack, and set up a local dev environment with WP-CLI, Docker, or wp-env. Use when setting up a new WooCommerce project or development environment.

woo-security

17
from OrcaQubits/agentic-commerce-skills-plugins

Implement WooCommerce security — nonces, capabilities, input sanitization, output escaping, data validation, PCI compliance considerations, and WordPress security best practices. Use when hardening a WooCommerce store or reviewing security posture.

woo-plugin-dev

17
from OrcaQubits/agentic-commerce-skills-plugins

Create WooCommerce extensions/plugins — file structure, main plugin file, activation/deactivation hooks, custom database tables, autoloading, and WordPress plugin API. Use when building new WooCommerce extensions or structuring plugin code.

woo-payments

17
from OrcaQubits/agentic-commerce-skills-plugins

Build WooCommerce payment gateways — WC_Payment_Gateway, direct/redirect/hosted integrations, tokenization, subscriptions support, refunds, and PCI compliance. Use when creating custom payment method integrations.

woo-hooks-filters

17
from OrcaQubits/agentic-commerce-skills-plugins

Master the WordPress hook system for WooCommerce — actions, filters, hook priorities, WooCommerce-specific hooks, and extensibility patterns. Use when adding functionality via hooks or understanding the WooCommerce execution flow.