dist/cursor/bigcommerce-commerce/skills/bc-stencil/SKILL.md
Build BigCommerce Stencil themes — Handlebars templates, front matter, theme objects, SCSS, JavaScript modules, config.json, schema.json, and Stencil CLI. Use when creating or customizing BigCommerce storefront themes.
npx skillsauth add orcaqubits/agentic-commerce-claude-plugins bc-stencilInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Fetch live docs:
https://developer.bigcommerce.com/docs/storefront/stencil for Stencil overviewhttps://developer.bigcommerce.com/docs/storefront/stencil/themes/context/object-reference for theme object referencesite:developer.bigcommerce.com stencil handlebars helpers for Handlebars helper referenceStencil is BigCommerce's server-rendered theme engine:
.html) define page structuretemplates/
├── layout/
│ ├── base.html # Master layout — header, footer, body
│ └── empty.html # Minimal layout (checkout, etc.)
├── pages/
│ ├── home.html # Homepage
│ ├── product.html # Product detail page
│ ├── category.html # Category listing
│ ├── cart.html # Cart page
│ ├── checkout.html # Checkout page
│ ├── account/ # Customer account pages
│ └── ...
├── components/
│ ├── common/ # Header, footer, navigation
│ ├── products/ # Product cards, options, gallery
│ ├── cart/ # Cart items, totals
│ └── ...
└── ...
YAML block at the top of template files that declares data requirements:
---
product:
videos:
limit: {{theme_settings.product_videos_count}}
reviews:
limit: {{theme_settings.product_reviews_count}}
related_products:
limit: {{theme_settings.related_products_count}}
similar_by_views:
limit: {{theme_settings.similar_by_views_count}}
---
product — product details, images, videos, reviews, related productscategory — category info, products in categorycart — cart items, totalscustomer — logged-in customer datashop_by_brand — brand listingnew_products, featured_products, top_products — product collections| Object | Available On | Contains |
|--------|-------------|----------|
| product | Product page | name, price, images, options, variants, description, reviews |
| category | Category page | name, description, products, subcategories |
| cart | Cart page | items, subtotal, taxes, grand_total |
| customer | When logged in | name, email, addresses, orders |
| settings | All pages | store name, currency, logo, URLs |
| theme_settings | All pages | config.json setting values |
| breadcrumbs | Most pages | navigation breadcrumbs |
| page | CMS pages | title, content, URL |
{{product.title}}
{{product.price.without_tax.formatted}}
{{#each product.images}}
<img src="{{getImage this 'product_size'}}" alt="{{this.alt}}">
{{/each}}
{{#if condition}}...{{else}}...{{/if}} — conditional{{#unless condition}}...{{/unless}} — inverse conditional{{#each collection}}...{{/each}} — iteration{{#with object}}...{{/with}} — context shifting{{getImage image 'size_name'}} — generate image URL at specific size{{cdn 'path/to/asset'}} — CDN-prefixed asset URL{{stylesheet 'path/to/css'}} — include stylesheet{{inject 'variable' value}} — pass data to JavaScript context{{jsContext}} — output injected variables as JSON for JS consumption{{lang 'translation_key'}} — internationalization{{money price}} — format currency{{truncate text length}} — truncate string{{any collection}} — check if collection has items{{all condition1 condition2}} — logical AND{{compare a '===' b}} — comparisonInclude reusable template fragments:
{{> components/products/card product}} — render a partial with context{{> components/common/header}} — include a componenttemplates/components/assets/scss/
├── settings/ # Variables, mixins
│ ├── foundation/
│ └── citadel/
├── components/ # Component styles
├── layouts/ # Layout styles
├── tools/ # Utility mixins
└── theme.scss # Main entry point
Access config.json values: stencilColor("primary"), stencilNumber("font-size"), stencilString("font-family")
Stencil uses webpack for JS bundling:
assets/js/app.jsUse {{inject}} in templates and {{jsContext}} to pass server data to client JS:
{{inject 'productId' product.id}}
<script>{{jsContext}}</script>
Access in JS via this.context in PageManager subclasses.
Cornerstone's page lifecycle manager:
PageManager for page-specific JSonReady() — DOM ready, initialize functionalityassets/js/app.jsTheme configuration with settings and variations:
settings — default values for all theme settingsvariations — named presets (Light, Bold, Warm, etc.)read_only_files — files that cannot be edited in Theme EditorDefines the Theme Editor UI:
color, font, select, checkbox, text, range, imageDimensionconfig.json settings keys{{inject}} to pass data to JS — don't scrape the DOM{{cdn}} for all asset URLs — ensures CDN delivery{{{sanitize html}}} for HTML, {{variable}} auto-escapesFetch the Stencil documentation and theme object reference for exact helper syntax, front matter keys, and object structure before implementing.
development
Build with Spree's headless Next.js storefront — the official `spree/storefront` repo (Next.js 16 App Router with Server Actions and Turbopack, React 19 Server Components, Tailwind CSS 4, TypeScript 5, `@spree/sdk`, Sentry), server-only auth (httpOnly JWT cookies + publishable key), MeiliSearch faceted catalog, one-page checkout with Apple/Google Pay/Klarna/Affirm/SEPA, multi-region market routing, GA4 + JSON-LD SEO, and Vercel/Docker deployment. Use when forking or customizing the storefront, or evaluating headless adoption.
tools
Build Spree extensions as Rails engines — gem scaffolding, `bin/rails g spree:extension`, mounting routes/migrations/assets, the modern `prepend` decorator pattern (`*_decorator.rb` with `self.prepended(base)`), generators (`spree:model_decorator`, `spree:controller_decorator`), the four customization surfaces in preference order (Events > Webhooks > Dependencies > Decorators), Spree::Dependencies for swapping service objects, gem release/versioning, and the deprecated Deface engine. Use when building a reusable Spree extension or adding non-trivial customization to an app.
development
Build with Spree's event bus and Webhooks 2.0 — `Spree::Events` publication, `Spree::Subscriber` DSL with `subscribes_to` and `on`, wildcard matching, lifecycle events (`{model}.created/.updated/.deleted` via `publishes_lifecycle_events`), the canonical event catalog (order.*, payment.*, shipment.*, product.*), Webhooks 2.0 endpoints, HMAC-SHA256 signing (`X-Spree-Webhook-Signature`), exponential-backoff retries, and Sidekiq job orchestration. Use when wiring event-driven business logic, building webhook consumers, or replacing ActiveSupport callback chains.
tools
Cross-cutting Spree development patterns — the customization preference hierarchy (Events > Webhooks > Dependencies > Decorators), `Spree::Dependencies` service-object swapping, the `_decorator.rb` + `prepend` + `self.prepended` idiom, idempotent subscribers and webhook receivers, multi-store scoping discipline, prefixed IDs, calculator polymorphism (shipping/promotion/tax share the base), service-object composition with `dry-monads` or simple results, why to avoid `class_eval` reopening and Deface, and Spree-on-Rails idioms (Hotwire/Turbo Stimulus, ActiveStorage, Action Cable, Sidekiq). Use when designing the architecture of a Spree extension or solving cross-cutting concerns.