b2c-project
БесплатноБез исполняемых скриптовНе проверенUnderstand a B2C Commerce project's server-side code from source with the b2c CLI — which controller endpoints exist (SFRA and SiteGenesis), what middleware…
от SalesforceCommerceCloud★ 58 звёзд на GitHubОб этом скилле
B2C Project Skill
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.
Get the cartridge path right first
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.
Endpoints and what runs for them
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.chainis the execution order. Each entry hasid(csrf.validateAjaxRequest,server.middleware.https,functionfor handlers),expression(as written, such ascsrfProtection.validateAjaxRequest),cartridge,relPath,line,via(prepend/appendwhen another cartridge added it), andsource(where required middleware is implemented, with the function's line).endpoint.stepslists theserver.get/post/use/replace/append/prependstatements across cartridges in the order the platform applies them; areplacestep hasreplaced(the old chain) anddropped(security middleware it lost).endpoint.eventslists route event listeners registered by chain entries withthis.on('route:BeforeComplete' | 'route:Complete' | 'route:Redirect', fn), in the order they run. Each hasevent,cartridge,relPath,line,step(index intochainof the middleware that registers it),via, andconditional(registered inside a condition).route:BeforeCompletelisteners 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.issueslists problems: POST without a CSRF check, or aserver.replace()that dropped CSRF, login, HTTPS, or the GET/POST restriction.
Key SFRA facts when reasoning about routes:
server.replace()registers the new chain withserver.use(), so it drops everything from the base route, including the GET/POST method check. Repeat the security middleware or useappend/prepend.server.prepend()runs before the base chain,server.append()after it. A CSRF check added withappendruns after the handler, so it doesn't protect anything.*/cartridge/...requires andmodule.superModulefollow the cartridge path from left to right.
Hooks
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
- **System ex
Установить b2c-project в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл b2c-project?
Understand a B2C Commerce project's server-side code from source with the b2c CLI — which controller endpoints exist (SFRA and SiteGenesis), what middleware and handlers run for a URL and which cartridge each comes from, how overlays compose across the cartridge path (server.extend, append, prepend, replace, module.superModule), which hooks are registered for an extension point and in what order, how Custom APIs are wired (api.json, schema.yaml, implementation), and which custom job steps exist (steptypes.json). Use when the user asks "what runs for Cart-AddProduct", "which cartridge handles this route", "why doesn't my override or hook run", "is my afterPOST hook skipping basket calculation", "where is this Custom API implemented", before changing or overriding a controller, or when reviewing overlays before an SFRA upgrade.
Как установить скилл b2c-project?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл b2c-project запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic