From salesforce-commerce
Builds SFCC B2C Commerce cartridges with directory structure (controllers/, models/, scripts/, templates/, static/), stacking, naming (app_custom_*, plugin_*), path config, and certification requirements. Use for creating or modifying cartridges.
npx claudepluginhub orcaqubits/agentic-commerce-skills-plugins --plugin salesforce-commerceThis skill is limited to using the following tools:
Build B2C Commerce cartridges following Salesforce Commerce Cloud architecture patterns.
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.
Build B2C Commerce cartridges following Salesforce Commerce Cloud architecture patterns.
Fetch live documentation FIRST:
Web-search for:
Web-fetch official sources:
Verify before coding:
app_custom_mysite/
├── cartridge/
│ ├── controllers/ # Route handlers
│ ├── models/ # Business logic
│ ├── scripts/ # Helpers, middleware
│ ├── templates/ # ISML + i18n resources
│ └── static/ # Compiled CSS/JS/images
└── cartridge.properties
| Directory | Contents | Notes |
|---|---|---|
controllers/ | Server-side JS route handlers | Each file exports route actions (e.g., Product-Show) |
models/ | Data models and business logic | Keep controllers thin; move logic here |
scripts/ | Utility helpers, middleware, services | Subdirs: helpers/, middleware/, services/ |
templates/default/ | ISML templates per locale | default/ is the fallback locale |
templates/resources/ | i18n .properties files | Resource bundles for Resource.msg() |
forms/default/ | XML form definitions | Server-side validation rules |
static/default/ | Compiled CSS, JS, images | Built from client/default/ source |
client/default/ | Source SCSS and JS | Input for webpack/sgmf-scripts build |
experience/components/ | Page Designer components | Visual merchandising building blocks |
| Prefix | Purpose | Example |
|---|---|---|
app_custom_* | Site-specific customizations | app_custom_mysite |
plugin_* | Reusable feature modules | plugin_wishlists |
int_* | Third-party integrations | int_paypal, int_stripe |
bm_* | Business Manager extensions | bm_custom_admin |
app_storefront_base | Base SFRA cartridge | Core framework (do not modify) |
modules/ | Shared modules (non-cartridge) | Utility libraries consumed by cartridges |
The cartridge path defines file resolution order (configured in Business Manager > Site Settings):
app_custom_mysite:plugin_wishlists:int_paypal:app_storefront_base
Resolution: Left to right. When SFCC resolves a file (e.g., controllers/Product.js), it searches each cartridge in path order and uses the first match. This enables non-destructive customization -- overlay specific files without modifying base cartridges.
Overlay constraints:
cartridge/ to overridemodule.superModule| Type | Contains | When to Use |
|---|---|---|
| Storefront | Controllers, templates, static assets | Customer-facing site logic |
| Integration | Service definitions, API clients | Third-party system connections |
| Plugin | Self-contained feature | Reusable cross-site features |
| Business Manager | BM extensions, custom modules | Admin panel customizations |
Controllers can extend base behavior using module.superModule:
// Pattern: extend base controller
// Fetch live docs for server.extend() API
var server = require('server');
server.extend(module.superModule);
// Add or override route actions here
This avoids duplicating the entire base controller when you only need to modify one action.
Required fields: cartridge ID and multi-language flag. Optional: version and compatibility version. Fetch live docs for the exact property key format (demandware.cartridges.<id>.*) before creating this file.
SFRA uses sgmf-scripts for compiling client-side SCSS and JS. Source files live in cartridge/client/default/ and compile to cartridge/static/default/. Webpack configuration maps entry points for JS bundles and SCSS compilation.
| Tool | Purpose |
|---|---|
sgmf-scripts --compile js | Compile client-side JavaScript |
sgmf-scripts --compile css | Compile SCSS to CSS |
sgmf-scripts --watch | Watch mode for development |
sfcc-ci | CLI for code upload and deployment automation |
| Category | Key Requirements |
|---|---|
| Technical | Compatible with latest SFRA; no hardcoded credentials; passes code profiler |
| Documentation | Installation guide, BM configuration steps, troubleshooting guide |
| Security | Input validation, CSRF protection, secure credential storage |
| Testing | Unit tests, integration tests, performance benchmarks, multi-site compatibility |
Pattern: upload cartridge code to a code version on the sandbox/instance, then activate that version in Business Manager. Use WebDAV upload or the sfcc-ci CLI tool for automation.
| Step | Action |
|---|---|
| 1 | Upload code to a named code version via WebDAV or sfcc-ci |
| 2 | Set the active code version in BM > Administration > Code Deployment |
| 3 | Update cartridge path in BM > Site Settings if new cartridges were added |
| 4 | Clear caches and verify storefront behavior |
# Pattern: scaffold a new cartridge
# Fetch live docs for sgmf-scripts CLI options
mkdir -p app_custom_mysite/cartridge/{controllers,models,scripts,templates/default}
app_custom_*; reusable features in plugin_*.app_storefront_base directory layout for clean overlays.module.superModule to extend controllers rather than copying entire files.scripts/helpers/; keep controllers thin.<isinclude> components.cartridge.properties version on each release.sfcc-ci for CI/CD pipeline integration.Fetch the SFRA GitHub repo, B2C Commerce cartridge development docs, and LINK certification guidelines for exact directory conventions, build tool APIs, and deployment procedures before implementing.