AgentSkillsCN

b2c-docs

借助 b2c cli 搜索并阅读 B2C Commerce(SFCC/Demandware)脚本 API 文档与 XSD 架构。当您编写 B2C 脚本、查找 SFCC/Demandware/B2C Commerce 脚本 API 的类定义,或解答关于 URL、产品、订单等问题时,可运用此技能。此外,您还可以参考 XML 格式的导入/导出(XSD)规范,验证 dw.* API 命名空间中的类方法、属性及其使用方式。

SKILL.md
--- frontmatter
name: b2c-docs
description: Search and read B2C Commerce (SFCC/Demandware) Script API documentation and XSD schemas with the b2c cli. Use when writing B2C scripts, looking up classes for the SFCC/Demandware/B2C Commerce script API, answering "how do I" questions about URLs, products, orders. Also use for import/export XML format (XSD) reference. Use to verify class methods, properties, and usage in the dw.* API namespace

B2C Docs Skill

Use the b2c CLI to search and read bundled Script API documentation and XSD schemas for Salesforce B2C Commerce.

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

Examples

Search Documentation

bash
# Search for a class by name
b2c docs search ProductMgr

# Search with partial match
b2c docs search "catalog product"

# Limit results
b2c docs search status --limit 5

# List all available documentation
b2c docs search --list

Read Documentation

bash
# Read documentation for a class (renders in terminal)
b2c docs read ProductMgr

# Read by fully qualified name
b2c docs read dw.catalog.ProductMgr

# Output raw markdown (for piping)
b2c docs read ProductMgr --raw

# Output as JSON
b2c docs read ProductMgr --json

Download Documentation

Download the latest Script API documentation from a B2C Commerce instance:

bash
# Download to a directory
b2c docs download ./my-docs

# Download with specific server
b2c docs download ./docs --server sandbox.demandware.net

# Keep the original archive
b2c docs download ./docs --keep-archive

Read XSD Schemas

Read bundled XSD schema files for import/export data formats:

bash
# Read a schema by name
b2c docs schema catalog

# Fuzzy match schema name
b2c docs schema order

# List all available schemas
b2c docs schema --list

# Output as JSON
b2c docs schema catalog --json

Common Classes

ClassDescription
dw.catalog.ProductMgrProduct management and queries
dw.catalog.ProductProduct data and attributes
dw.order.BasketShopping basket operations
dw.order.OrderOrder processing
dw.customer.CustomerMgrCustomer management
dw.system.SiteSite configuration
dw.web.URLUtilsURL generation utilities

Common Schemas

SchemaDescription
catalogProduct catalog import/export
orderOrder data import/export
customerCustomer data import/export
inventoryInventory data import/export
pricebookPrice book import/export
promotionPromotion definitions
couponCoupon codes import/export
jobsJob step definitions

More Commands

See b2c docs --help for a full list of available commands and options.