From salesforce-commerce
Develops SFRA-based Salesforce B2C Commerce storefronts using cartridge overlays, module.superModule extensions, server-side MVC, and site customizations. For SFRA storefront development.
npx claudepluginhub orcaqubits/agentic-commerce-skills-plugins --plugin salesforce-commerceThis skill is limited to using the following tools:
**Fetch live docs:**
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Guides MCP server integration in Claude Code plugins via .mcp.json or plugin.json configs for stdio, SSE, HTTP types, enabling external services as tools.
Fetch live docs:
github.com/SalesforceCommerceCloud/storefront-reference-architecture for SFRA sourcesite:developer.salesforce.com SFRA architecture MVC for MVC patternssite:developer.salesforce.com SFRA cartridge overlay for overlay best practicessite:developer.salesforce.com module.superModule for extension patternssite:developer.salesforce.com SFRA getting started for latest docsSFRA (Storefront Reference Architecture) is the reference implementation for B2C Commerce storefronts:
| Principle | Rule |
|---|---|
| Overlay | Never modify app_storefront_base -- create custom cartridges that layer on top |
| Extend | Use module.superModule to inherit and augment, not replace |
| Hooks | Use commerce hooks for order, payment, and shipping customization |
| Services | Use the Service Framework for external integrations (payment gateways, ERP) |
The cartridge path (configured in Business Manager) resolves files left-to-right. The leftmost cartridge wins.
Example path: app_custom:app_storefront_base
controllers/Product.js checks app_custom first, falls back to app_storefront_baseapp_custom/cartridge/
├── controllers/ # Route handlers
├── models/ # Data models
├── scripts/ # Helpers, services
├── templates/ # ISML templates
├── experience/ # Page Designer
└── client/default/ # JS + SCSS source (Webpack)
module.superModule resolves to the next cartridge in the path that provides the same module. This is how you extend without duplicating:
var base = module.superModule; server.extend(base); then use append/prepend/replacebase.call(this, apiProduct, options), then add properties| Layer | Location | Role |
|---|---|---|
| Controller | controllers/*.js | Route handling via server module |
| Model | models/**/*.js | Transform API data to view-friendly objects |
| View | templates/default/**/*.isml | ISML templates for HTML rendering |
| Client JS | client/default/js/ | Browser-side behavior (Webpack bundled) |
| SCSS | client/default/scss/ | Styles (compiled to CSS) |
| Approach | When | Trade-off |
|---|---|---|
server.extend(base) + append | Adding data, logging, analytics | Keeps base logic; auto-receives base updates |
server.replace('Route', fn) | Fundamentally different logic | You own the entire implementation; no base updates |
Prefer extend + append in nearly all cases. Only replace when the base logic is wrong for your use case.
SFRA uses Webpack to build client assets from client/default/js/ and client/default/scss/. Output goes to cartridge/static/default/. Client JS can extend base modules:
// Pattern: Extend base client module
var base = require('base/product/detail');
// Fetch live docs for base module API
Site.getCurrent().getCustomPreferenceValue('prefName') -- store-level configurationCustomObjectMgr.getCustomObject('Type', 'key') -- custom data structuresdw.* APIapp_storefront_baseapp_custom_[sitename] or int_custom_[feature]module.superModule to extend -- avoid code duplicationserver.extend() to inherit base routesnext() in middleware chain<isinclude> for reusable componentsResource.msg('key', 'bundle', null)Transaction.wrap() for all database writesCacheMgrFetch the SFRA GitHub repository, developer documentation, and module.superModule guide for exact patterns, API references, and best practices before implementing.