Bc stencil

From OrcaQubits/agentic-commerce-skills-plugins · View interactive version

Bc stencil is an AI agent skill from the GitHub repository OrcaQubits/agentic-commerce-skills-plugins. 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.

How to use this skill

Skill file

BigCommerce Stencil Theme Development

Before writing code

Fetch live docs:

  1. Fetch https://docs.bigcommerce.com/developer/docs/storefront/stencil/overview for Stencil overview
  2. Fetch https://docs.bigcommerce.com/developer/docs/storefront/stencil/themes/context/object-reference/elements for theme object reference
  3. Web-search site:developer.bigcommerce.com stencil handlebars helpers for Handlebars helper reference

Architecture

How Stencil Works

Stencil is BigCommerce's server-rendered theme engine:

  1. Template files (Handlebars .html) define page structure
  2. Front matter (YAML) at the top of each template declares what data to fetch
  3. BigCommerce injects theme objects (product, category, cart, settings, etc.) into the template context
  4. Handlebars helpers and partials render the data
  5. SCSS compiles to CSS, JS bundles with webpack
  6. Stencil CLI provides local development with hot reload

Template Hierarchy

templates/
├── 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
│   └── ...
└── ...

Front Matter

What It Does

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}}
---

How It Works

Common Front Matter Resources

Theme Objects

Key Objects

| 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 |

Accessing Data

{{product.title}}
{{product.price.without_tax.formatted}}
{{#each product.images}}
  <img src="{{getImage this 'product_size'}}" alt="{{this.alt}}">
{{/each}}

Handlebars Helpers

Control Flow

BigCommerce Custom Helpers

Partials

Include reusable template fragments:

Styling (SCSS)

Structure

assets/scss/
├── settings/               # Variables, mixins
│   ├── foundation/
│   └── citadel/
├── components/             # Component styles
├── layouts/                # Layout styles
├── tools/                  # Utility mixins
└── theme.scss              # Main entry point

Theme Settings in SCSS

Access config.json values: stencilColor("primary"), stencilNumber("font-size"), stencilString("font-family")

JavaScript

Module System

Stencil uses webpack for JS bundling:

Accessing Theme Data in JS

Use {{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.

PageManager

Cornerstone's page lifecycle manager:

Configuration

config.json

Theme configuration with settings and variations:

schema.json

Defines the Theme Editor UI:

Best Practices

Fetch the Stencil documentation and theme object reference for exact helper syntax, front matter keys, and object structure before implementing.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.