/b2c-cli:b2c-projectfrom b2c-cli
Analyzes B2C Commerce project source code to trace controller endpoints, middleware, overlays, hooks, Custom APIs, and job steps across the cartridge path. Use before modifying controllers or upgrading SFRA.
Ships in b2c-cli. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Use b2c project (preview) to answer questions about a project's storefront code from its source, without an instance or credentials. It reads the cartridges under the project directory (--project-directory, or the current directory; folders with a .project file) and composes them in cartridge path order.
Tip: If
b2cis not installed globally, usenpx @salesforce/b2c-cliinstead. Add--jsonto any command for structured output.
MCP parity: If the
b2c-dx-mcpserver is connected,project_inspectcovers these commands:aspect: "summary"(b2c project index, plus what each aspect returns),"endpoints"(withfilter,cartridge,uses),"endpoint"withid,"hooks","customApis", and"jobSteps". Unlike the CLI, it can read the cartridge path live from the instance: passsiteIdfor a specific site. Every result hascartridgePath(the cartridges used, in order) andcartridgePathSource(instance,configured,site-file, ordiscovery); when it isn'tinstanceorconfigured, followcartridgePathHintand say where the order came from. Only cartridges on the path are indexed (others are innotOnPath); passallCartridges: trueto include them.
Results depend on cartridge order. The CLI uses the cartridges value from dw.json or SFCC_CARTRIDGES; without it, a site's <custom-cartridges> from a sites/<site-id>/site.xml in the project (the latest migration or import set by timestamp prefix; siteId/SFCC_SITE_ID picks the site); then discovery order with app_storefront_base and modules last. Check the order and its source with:
b2c project index # prints "Cartridge path: a:b:c" and "Order: from site X in <file>"
With --json, cartridgeOrder.source is configured, site-file, or discovery. If the order is a guess or doesn't match the site, ask the user for the site's cartridge path (or read it with b2c sites cartridges list --site-id <site>) and set cartridges in dw.json before drawing conclusions about overlays. Cartridges not on the path are left out of endpoints and hooks (the site doesn't run them); b2c project index lists them, and --all-cartridges includes them after the path.
List to find endpoints, then get one for the detail:
# Compact list: id, methods, cartridge that serves it, cartridges that change it, middleware as written
b2c project endpoints list --json
# Narrow by ID, by a cartridge that defines or changes the route, or by middleware
b2c project endpoints list Cart-
b2c project endpoints list --cartridge int_paypal
b2c project endpoints list --uses userLoggedIn
# Everything that runs for one endpoint, in order, the statements that built it, and its issues
b2c project endpoints get Cart-AddProduct --json
In b2c project endpoints get --json:
endpoint.chain is the execution order. Each entry has id (csrf.validateAjaxRequest, server.middleware.https, function for handlers), expression (as written, such as csrfProtection.validateAjaxRequest), cartridge, relPath, line, via (prepend/append when another cartridge added it), and source (where required middleware is implemented, with the function's line).endpoint.steps lists the server.get/post/use/replace/append/prepend statements across cartridges in the order the platform applies them; a replace step has replaced (the old chain) and dropped (security middleware it lost).endpoint.events lists route event listeners registered by chain entries with this.on('route:BeforeComplete' | 'route:Complete' | 'route:Redirect', fn), in the order they run. Each has event, cartridge, relPath, line, step (index into chain of the middleware that registers it), via, and conditional (registered inside a condition). route:BeforeComplete listeners run after the last chain step and before rendering, so code that saves data or changes the response often lives there, not in the chain itself.issues lists problems: POST without a CSRF check, or a server.replace() that dropped CSRF, login, HTTPS, or the GET/POST restriction.Key SFRA facts when reasoning about routes:
server.replace() registers the new chain with server.use(), so it drops everything from the base route, including the GET/POST method check. Repeat the security middleware or use append/prepend.server.prepend() runs before the base chain, server.append() after it. A CSRF check added with append runs after the handler, so it doesn't protect anything.*/cartridge/... requires and module.superModule follow the cartridge path from left to right.b2c project hooks list # every extension point, registrations in cartridge path order
b2c project hooks list dw.ocapi.shop.basket # filter by name
b2c project hooks list --issues --json
dw.*, including OCAPI/SCAPI hooks): registrations run in cartridge path order. The first one that returns a value (such as a Status) skips the later registrations and the system implementation; returning nothing lets them run. An OCAPI/SCAPI hook that returns Status.OK skips the system implementation, including basket calculation. returnsValue: "yes" on a registration means some path returns a value.HookMgr.callHook(name, functionName, ...)), so registrations list exports and calledFunctions (each function the project calls, with its line and callers, the call sites) instead of a fixed function. registeredIn is the hooks.json file and line.When a hook "doesn't fire", look for an earlier registration (to its left on the cartridge path) that returns a value. Fix by returning nothing unless the intent is to stop processing.
b2c project apis list --json
b2c project apis list --issues
Each endpoint has method, path, security, scopes, and apiType (shopper/admin) from schema.yaml, implementationFile, public, and problems (no operation with the endpoint's operationId, missing script or export, missing exports.<name>.public = true). An API defined in more than one cartridge is flagged; check which cartridge is on the site's (or Business Manager's, for org-level Admin APIs) cartridge path. Use the b2c-custom-api-development skill to fix contracts and registration.
b2c project job-steps list --json
b2c project job-steps list --cartridge int_jobs
Each step has typeId, kind (script-module-step or chunk-script-module-step), cartridge, module, function (execute by default for task steps), parameters, registeredIn (the steptypes.json file and line), implementationFile (with the function's line), and problems (module not found, function not exported). Use the b2c-job skill to run or define jobs that use them.
b2c security scan uses the same index for its route rules; use b2c project endpoints get to triage a route finding (see the b2c-security skill).b2c project index --json returns the whole index (endpoints with chains and steps, hooks, Custom APIs, job steps) in one call when you need several answers.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub salesforcecommercecloud/b2c-developer-tooling --plugin b2c-cli28 skills in this plugin
/b2c-amManage Account Manager resources including API clients, users, roles, and organizations. Use this skill whenever the user needs to create or update API clients, onboard or offboard developers, assign Account Manager roles scoped to tenants, audit user permissions, look up organizations, or provision API clients for CI/CD pipelines. Also use when managing AM role assignments or querying Account Manager data — even if they just say "add a new developer" or "set up an API client". For instance-level Business Manager administration (BM roles, BM users, BM access keys, BM whoami), defer to the `b2c-cli:b2c-bm-users-roles` skill./b2c-bm-users-rolesManage Business Manager users, access roles, role permissions, and per-user access keys on a B2C Commerce instance using the b2c CLI. Use this skill whenever the user needs to list or search BM users on a sandbox or production instance, identify which BM user an OAuth token resolves to ("whoami"), assign or revoke instance-level access roles, edit role permissions, look up a user's WebDAV / OCAPI / Storefront access key, or rotate access keys for SSO-managed users. Also use when the user asks "what's my BM login on sandbox X", "rotate my WebDAV password", "how do I make a custom BM role", "audit BM users on this instance", or "delete a stale BM user from a sandbox".Other plugins' skills for the same job