update-script-api-docs

A command workflow for downloading the latest Salesforce B2C Commerce Script API reference and replacing the SDK’s bundled Markdown documentation. It then rebuilds the documentation search index.

In plain words
What is it for?
Use it to refresh Script API documentation, regenerate its search index, inspect the version, and review the resulting Git changes.
Why use it?
It keeps the SDK’s local reference material aligned with the configured documentation source and shows which version and files changed.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/salesforcecommercecloud/b2c-developer-tooling/update-script-api-docs
Clone the repo
git clone --depth 1 https://github.com/SalesforceCommerceCloud/b2c-developer-tooling

Made for: Claude Code.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 330 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00330
Opus 5 $0.00000 $0.00165
Sonnet 5 $0.00000 $0.00066
Haiku 4.5 $0.00000 $0.00033

Measured 2d ago against content hash ad8a646bf9c4, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

update-script-api-docs scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf /tmp/script-api-docs-update
.claude/commands/update-script-api-docs.md · 41 lines

What it actually says

Update Script API Documentation

Download the latest B2C Commerce Script API documentation from the configured sandbox and update the bundled docs in the SDK.

Steps

  1. Download Script API docs from the configured sandbox using ./cli docs download
  2. Replace the markdown files in packages/b2c-tooling-sdk/data/script-api/
  3. Regenerate the search index with pnpm --filter @salesforce/b2c-tooling-sdk run generate:docs-index
  4. Show the version extracted from index.md header
  5. Show git status/diff summary of what changed

Commands to Run

# Download to temp directory
./cli docs download /tmp/script-api-docs-update

# Check version
head -1 /tmp/script-api-docs-update/index.md

# Replace existing files
rm -f packages/b2c-tooling-sdk/data/script-api/*.md
cp /tmp/script-api-docs-update/*.md packages/b2c-tooling-sdk/data/script-api/

# Regenerate index
pnpm --filter @salesforce/b2c-tooling-sdk run generate:docs-index

# Show changes
git status packages/b2c-tooling-sdk/data/script-api/ --short
git diff packages/b2c-tooling-sdk/data/script-api/*.md --stat

# Cleanup
rm -rf /tmp/script-api-docs-update

After running, summarize:

  • The Script API version (from index.md header like "# B2C Commerce Script API 26.2")
  • Number of files updated
  • Key changes (new classes, deprecated methods, etc.)
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 41 lines · 0 tokens per session scan C ad8a646bf9c4

Subscribe to this mod's changes

update-script-api-docs is a command published in the GitHub repository SalesforceCommerceCloud/b2c-developer-tooling (53 stars, last pushed 2d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 330 tokens. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.