sdk-module-development

Add modules and exports to the @salesforce/b2c-tooling-sdk package.

51|16|Updated Oct 31, 2025
One-click install
npx skills add https://github.com/SalesforceCommerceCloud/b2c-developer-tooling --skill sdk-module-development
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sdk-module-development
Source: https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/tree/main/.claude/skills/sdk-module-development
Command: npx skills add https://github.com/SalesforceCommerceCloud/b2c-developer-tooling --skill sdk-module-development

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps developers extend the B2C Tooling SDK by adding new modules and exports in a consistent, maintainable way.

Core Features & Use Cases

  • Module scaffolding: Create a new module directory under src/, implement the feature, and expose it via a barrel index.ts.
  • Exports integration: Update package.json with a development export path and proper import/require mappings so the new module is consumable by consumers.
  • Documentation alignment: Add module-level JSDoc and optional main index exports to surface the new module in the SDK's public API.
  • Use Case: A team adds a new analytics module to the SDK and makes it available through a consistent exports surface for internal and external consumers.

Quick Start

Create a new module under packages/b2c-tooling-sdk/src/my-module, implement your feature, add a barrel file that re-exports, update package.json exports with a development entry pointing to src/my-module/index.ts, optionally export from the main index.ts, then run pnpm --filter @salesforce/b2c-tooling-sdk run build.

Frequently Asked Questions about sdk-module-development

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new module to the B2C Tooling SDK?

To add a new module to the B2C Tooling SDK, create a directory under packages/b2c-tooling-sdk/src, implement your feature in TypeScript, and expose it via a barrel index.ts file. This ensures consistent module scaffolding across the SDK.

What is a barrel file in TypeScript module development?

A barrel file in TypeScript module development is an index.ts file that re-exports modules. In the B2C Tooling SDK, barrel files enforce a consistent module pattern and surface new modules in the SDK's public API for internal and external consumers.

How do I configure package.json exports for a new SDK module?

Configure package.json exports for a new SDK module by adding a development export path pointing to src/my-module/index.ts, along with proper import and require mappings. This makes the new module consumable by consumers at development time.

Do I need to update the main index.ts when extending the SDK?

Updating the main index.ts when extending the SDK is optional but recommended. Adding module-level JSDoc and optional main index exports surfaces the new module in the SDK's public API, ensuring documentation alignment and discoverability.

What's the best way to document a new module added to the SDK?

The best way to document a new module added to the SDK is to add module-level JSDoc comments within the source files. This approach aligns with the SDK's documentation patterns and surfaces the module's functionality in the public API.

How do I build the SDK after adding new exports?

After adding new exports to the B2C Tooling SDK, run the build command pnpm --filter @salesforce/b2c-tooling-sdk run build. This compiles the TypeScript modules and integrates the new development export paths into the final package.