b2c-scaffold
B2C Scaffold Skill
Use the b2c scaffold commands to generate B2C Commerce components from templates.
Tip: If
b2cis not installed globally, usenpx @salesforce/b2c-cliinstead.
Examples
List Available Scaffolds
# list all scaffolds
b2c scaffold list
# list only cartridge scaffolds
b2c scaffold list --category cartridge
# show extended info (description, tags)
b2c scaffold list -x
Generate a Cartridge
# generate interactively
b2c scaffold cartridge
# generate with name
b2c scaffold cartridge --name app_custom
# generate to specific directory
b2c scaffold cartridge --name app_custom --output ./src/cartridges
# skip prompts, use defaults
b2c scaffold cartridge --name app_custom --force
# preview without creating files
b2c scaffold cartridge --name app_custom --dry-run
Generate a Controller
# generate interactively (prompts for cartridge selection)
b2c scaffold controller
# generate with all options
b2c scaffold controller \
--option controllerName=Account \
--option cartridgeName=app_custom \
--option routes=Show,Submit
Generate a Hook
# generate a system hook
b2c scaffold hook \
--option hookName=validateBasket \
--option hookType=system \
--option hookPoint=dw.order.calculate \
--option cartridgeName=app_custom
# generate an OCAPI hook
b2c scaffold hook \
--option hookName=modifyBasket \
--option hookType=ocapi \
--option hookPoint=dw.ocapi.shop.basket.beforePOST \
--option cartridgeName=app_custom
Generate a Custom API
# generate a shopper API
b2c scaffold custom-api \
--option apiName=loyalty-points \
--option apiType=shopper \
--option cartridgeName=app_custom
# generate an admin API
b2c scaffold custom-api \
--option apiName=inventory-sync \
--option apiType=admin \
--option cartridgeName=app_custom
Generate a Job Step
# generate a task-based job step
b2c scaffold job-step \
--option stepId=custom.CleanupOrders \
--option stepType=task \
--option cartridgeName=app_custom
# generate a chunk-based job step
b2c scaffold job-step \
--option stepId=custom.ImportProducts \
--option stepType=chunk \
--option cartridgeName=app_custom
Generate a Page Designer Component
b2c scaffold page-designer-component \
--option componentId=heroCarousel \
--option componentName="Hero Carousel" \
--option componentGroup=content \
--option cartridgeName=app_custom
Get Scaffold Info
# see parameters and usage for a scaffold
b2c scaffold info cartridge
b2c scaffold info controller
Search Scaffolds
# search by keyword
b2c scaffold search api
# search within a category
b2c scaffold search template --category page-designer
Create Custom Scaffolds
# create a project-local scaffold
b2c scaffold init my-component --project
# create a user scaffold
b2c scaffold init my-component --user
# validate a custom scaffold
b2c scaffold validate ./.b2c/scaffolds/my-component
Built-in Scaffolds
| Scaffold | Category | Description |
|---|---|---|
cartridge |
cartridge | B2C cartridge with standard structure |
controller |
cartridge | SFRA controller with routes and middleware |
hook |
cartridge | Hook with hooks.json registration |
custom-api |
custom-api | Custom SCAPI with OAS 3.0 schema |
job-step |
job | Job step with steptypes.json registration |
page-designer-component |
page-designer | Page Designer component |
Related Skills
b2c-cli:b2c-code- Deploy generated cartridges to B2C instancesb2c:b2c-controllers- SFRA controller patterns and best practicesb2c:b2c-hooks- B2C hook extension pointsb2c:b2c-custom-api-development- Custom API development guideb2c:b2c-custom-job-steps- Job step implementation patternsb2c:b2c-page-designer- Page Designer component development
More from salesforcecommercecloud/b2c-developer-tooling
b2c-docs
Search and read B2C Commerce Script API documentation and XSD schemas using the b2c CLI. Use this skill whenever the user needs to look up class methods, understand API signatures, find available properties on commerce objects (baskets, orders, products, customers), or check XML schema formats for imports. Also use when writing server-side scripts and needing API reference — even if they just say "what methods does Basket have" or "what fields can I import for products".
116b2c-webdav
List, upload, download, and manage files on B2C Commerce instances via WebDAV. Use this skill whenever the user needs to upload files to IMPEX directories, download exports from an instance, list remote files, create or delete directories, or zip/unzip files on the server. Also use when managing file transfers to sandboxes or browsing instance file systems -- even if they just say 'upload a file to the instance' or 'check what's in the IMPEX folder'.
103b2c-slas-auth-patterns
Implement SLAS authentication patterns in B2C Commerce including passwordless login (email OTP, SMS OTP, passkeys), session bridging between PWA Kit/Storefront Next and SFRA, hybrid authentication (B2C 25.3+), token refresh flows, trusted system on behalf of (TSOB), and JWT validation. Use this skill whenever the user asks about shopper authentication beyond basic login, token exchange flows, passwordless or biometric auth, keeping sessions alive across storefronts, handling 409 Conflict errors on token endpoints, refreshing shopper tokens, or validating JWTs — even if they don't mention SLAS by name.
90b2c-config
Inspect and debug CLI configuration, instance connections, and authentication. Use this skill whenever the user needs to check which dw.json or credentials are active, manage multiple instance profiles, retrieve OAuth tokens for scripting, troubleshoot authentication failures or connection errors, or integrate with VS Code or other editors. Also use when environment variables override config or the wrong sandbox is being targeted -- even if they just say 'why is it connecting to the wrong instance' or 'get me an access token'.
90b2c-controllers
Create storefront controllers using SFRA or classic patterns with server.get/post, middleware chains, and res.render/json. Use this skill whenever the user needs to build a page route, handle form submissions, create AJAX endpoints, extend or override existing controllers, or add middleware to a request pipeline. Also use when debugging route registration or response rendering -- even if they just say 'new page endpoint' or 'handle a POST request'.
86b2c-scapi-schemas
Browse and retrieve SCAPI OpenAPI schema specifications. Use this skill whenever the user needs to list available SCAPI APIs, inspect endpoint paths or request/response shapes, explore data models for products or orders, check which fields an API returns, or understand SCAPI versioning. Also use when looking up API details before building an integration -- even if they just say 'what fields does the product API return' or 'show me the SCAPI endpoints'.
84