Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

b2c-debug

БесплатноБез исполняемых скриптовНе проверен

Debug B2C Commerce server-side scripts using the b2c CLI. Use this skill whenever the user needs to set breakpoints, step through code, inspect variables…

SalesforceCommerceCloudот SalesforceCommerceCloud★ 58 звёзд на GitHub

Об этом скилле

B2C Debug Skill

Debug server-side scripts on Salesforce B2C Commerce instances — set breakpoints, step through code, and inspect variables in SFRA controllers, hooks, jobs, and custom APIs.

Prefer MCP debugging when available: debug_control resumes/steps; debug_inspect reads stacks and variables; debug_evaluate evaluates expressions. See skill://mcp/b2c-mcp-debugger/SKILL.md for the MCP workflow. Use the CLI for a requested terminal session or when MCP is unavailable.

b2c debug provides a Debug Adapter Protocol (DAP) debug adapter for IDEs. For terminal or headless use without the MCP tools, b2c debug cli also offers an interactive REPL and a JSONL --rpc mode.

Tip: If b2c is not installed globally, use npx @salesforce/b2c-cli instead (e.g., npx @salesforce/b2c-cli debug cli).

Configuration & Authentication

The CLI resolves the target instance and debugger credentials from environment variables (including project .env), the selected project-local or shared dw.json, and configuration plugins. It does not search parent directories. package.json supplies only non-sensitive defaults; ~/.mobify supplies MRT credentials, not debugger credentials. Flags like --server, --username, and --password are usually unnecessary — only pass them to override what's auto-detected.

Run b2c setup inspect to see the resolved configuration and which source provided each value (use --json for scripting; keep secrets masked unless the user explicitly requests their values). For precedence rules and troubleshooting, see the b2c-cli:b2c-config skill.

For MCP debugging, pass projectDirectory to debug_start_session whenever the MCP server may have been launched outside the project. The tool uses that root to load the project's .env and default dw.json; pass configPath to select a different primary dw.json-format file and instanceName to select a named instance from the primary or shared default file. Cartridge discovery and local/server source mapping default to projectDirectory; pass cartridgeDirectory only when the cartridges live under a different root. The start call captures this information in resolution, which debug_list_sessions returns without requiring the caller to repeat it. The MCP server controls its SDAPI client identity internally, so callers do not pass a debugger client ID.

Prerequisites

  • Basic Auth credentials for a BM user with WebDAV_Manage_Customization: a username and a WebDAV File Access and UX Studio access key used as the password (not the Account Manager password)

Interactive Debugging

Start a Debug Session

# Start interactive debugger
b2c debug cli

# Specify cartridge directory for source mapping
b2c debug cli --cartridge-path ./cartridges

# Use a custom client ID (for concurrent sessions)
b2c debug cli --client-id my-session

Set Breakpoints

In the REPL:

break Cart.js:42
break Checkout.js:100 if basket.totalGrossPrice > 100
breakpoints
delete 1

Inspect State When Halted

stack
vars
members basket.productLineItems
eval basket.productLineItems.length
eval request.httpParameterMap.get("pid").stringValue

Control Execution

continue
step
stepin
stepout

Thread Management

threads
thread 5
frame 2

RPC Mode (Headless / Agent Use)

For headless scripts, agents, and programmatic integration, use --rpc mode. Commands and responses are JSONL (one JSON object per line) on stdin/stdout.

b2c debug cli --rpc

Send Commands

{"id": 1, "command": "set_breakpoints", "args": {"breakpoints": [{"file": "Cart.js", "line": 42}]}}
{"id": 2, "command": "get_stack"}
{"id": 3, "command": "get_variables", "args": {"scope": "local"}}
{"id": 4, "command": "evaluate", "args": {"expression": "basket.totalGrossPrice"}}
{"id": 5, "command": "continue"}

Receive Responses and Events

{"event": "ready", "data": {}}
{"id": 1, "result": {"breakpoints": [{"id": 1, "file": "Cart.js", "line": 42, "script_path": "/app_storefront/cartridge/controllers/Cart.js"}]}}
{"event": "thread_stopped", "data": {"thread_id": 5, "location": {"file": "Cart.js", "line": 42, "function_name": "show"}}}

Available RPC Commands

Command Key Args Description
set_breakpoints breakpoints: [{file, line, condition?}] Replace all breakpoints
list_breakpoints List current breakpoints
continue thread_id? Resume halted thread
step_over thread_id? Step to next line
step_into thread_id? Step into function
step_out `
Полный SKILL.md на GitHub

Установить b2c-debug в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

evals/trigger-evals.json

FAQ

Что делает скилл b2c-debug?

Debug B2C Commerce server-side scripts using the b2c CLI. Use this skill whenever the user needs to set breakpoints, step through code, inspect variables, evaluate expressions, or investigate runtime behavior on a B2C Commerce instance. Also use when the user wants to understand what a script is doing at runtime, capture state at a specific line, or drive the debugger from a headless script — even if they just say "debug this controller" or "what's the value of basket at line 42".

Как установить скилл b2c-debug?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл b2c-debug запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить b2c-debug с