PluginBench
Skill
Review
Audit score 70

integrating-b2b-commerce-open-code-components

forcedotcom/sf-skills

Integrate Salesforce B2B Commerce open source components into your store's Experience Builder.

What is integrating-b2b-commerce-open-code-components?

This skill clones the official Salesforce B2B Commerce open source components repository and copies all LWC components and labels into your B2B Commerce store's site metadata. Use it when you want to add pre-built open source commerce components to a new or existing B2B store.

  • Clones the official B2B Commerce open source components repository from GitHub
  • Verifies your project structure and identifies the active package directory
  • Locates or retrieves your B2B Commerce store metadata from the connected org
  • Copies all open source LWC components into your store's site metadata
  • Copies associated label files required by the components
  • Makes all components immediately available in Experience Builder

How to install integrating-b2b-commerce-open-code-components

npx skills add https://github.com/forcedotcom/sf-skills --skill integrating-b2b-commerce-open-code-components
Prerequisites
  • An SFDX project with sfdx-project.json configured
  • A B2B Commerce store already created in your org or locally in site metadata
  • A connected Salesforce org (for retrieving store metadata if not local)
  • Git installed and available in your environment
Claude Code
Cursor
Windsurf
Cline

How to use integrating-b2b-commerce-open-code-components

  1. 1.The skill automatically resolves your active package directory from sfdx-project.json
  2. 2.It checks if the open source repository is already cloned; if not, it clones it to .tmp/b2b-commerce-open-source-components
  3. 3.It verifies your B2B store metadata exists locally or retrieves it from your connected org
  4. 4.It checks for existing components in your store and offers options to overwrite or merge
  5. 5.It copies all LWC components from the repository to your store's sfdc_cms__lwc directory
  6. 6.It copies all associated label files to your store's sfdc_cms__label directory
  7. 7.After completion, deploy the updated site metadata using sf project deploy start

Use cases

Good for
  • Adding pre-built open source components to a newly created B2B Commerce store
  • Updating an existing store with the latest open source components
  • Integrating multiple reusable commerce components at once instead of manually copying each one
  • Ensuring your store has access to all officially supported open source components
Who it's for
  • B2B Commerce developers and administrators
  • Salesforce developers building custom B2B storefronts
  • Teams managing multiple B2B Commerce stores

integrating-b2b-commerce-open-code-components FAQ

What happens if I already have components in my store?

The skill detects existing components and offers two options: overwrite all with the latest from the repository, or copy only new components that don't already exist in your store.

Do I need a connected org to use this skill?

If your store metadata is already in your local project, no. If not, the skill will attempt to retrieve it from a connected org. If no org is available and no local store exists, it will delegate to the creating-b2b-commerce-store skill.

Where are the components copied to?

Components are copied to <package-dir>/main/default/digitalExperiences/site/<store-name>/sfdc_cms__lwc/ and labels to sfdc_cms__label/, where <package-dir> is your active package directory from sfdx-project.json.

What do I do after the integration completes?

Deploy the updated site metadata using sf project deploy start, then open Experience Builder to see the new components in the palette. Publish your site when ready.

Can I re-clone the repository if it's already cloned?

Yes. The skill detects an existing clone and offers the option to reuse it or remove and re-clone a fresh copy from GitHub.

Full instructions (SKILL.md)

Source of truth, from forcedotcom/sf-skills.


name: integrating-b2b-commerce-open-code-components description: "Integrate Salesforce B2B Commerce open source components from GitHub into B2B Commerce stores. Use when users mention "integrate open code components", "open source B2B commerce", "add open code components", "forcedotcom/b2b-commerce-open-source-components", or want to add open source commerce components to their store. Copies all components and labels so they become available in Experience Builder." allowed-tools: Bash(git clone:) Bash(cp:) Read metadata: version: "1.0"

When to Use This Skill

Use this skill when you need to:

  • Integrate all open source B2B Commerce components into a store
  • Add open source components to a new or existing B2B Commerce store
  • Make open code components available in Experience Builder

Rules

  1. Always explain before executing. Before running any command, you MUST tell the user what the command does and why you are running it. Never just show a raw command and ask for permission. The user should be able to read your explanation and understand the purpose before approving.

Overview

This skill copies all open source B2B Commerce components from the official Salesforce repository (https://github.com/forcedotcom/b2b-commerce-open-source-components) into a B2B Commerce store's site metadata. After integration, the components appear in the Experience Builder component palette.


Startup Flow

When this skill is triggered, perform these checks automatically before copying.

Check 0: Resolve Package Directory

Read sfdx-project.json and pick the active package directory. Extract packageDirectories[] and use the entry with "default": true; if no entry is flagged default, use the first entry. Use this value as <package-dir> everywhere below. If sfdx-project.json is missing or has no packageDirectories, tell the user and abort.

Check 1: Open Source Repository

Verify the repo is cloned at .tmp/b2b-commerce-open-source-components:

  1. If directory does not exist: Tell user: "I'm cloning the official B2B Commerce open source components repository from GitHub into a local .tmp/ folder. This gives us access to all the open code components." Then run: git clone https://github.com/forcedotcom/b2b-commerce-open-source-components .tmp/b2b-commerce-open-source-components
  2. If directory exists and contains force-app/main/default/sfdc_cms__lwc and sfdc_cms__label, present options:

    "Open source repository is already cloned. How would you like to proceed?"

    1. Reuse existing — Use the already cloned repository
    2. Re-clone — Remove and clone fresh from GitHub
  3. If directory exists but structure is invalid: Tell user: "The cloned repository has an unexpected structure. I'll remove it and clone a fresh copy." Then remove and re-clone.
  4. If clone fails: inform user and abort

Check 2: Store and Site Metadata

Verify a store is selected and site metadata is available locally:

  1. Tell user: "I'm checking if your project already has B2B store metadata locally." Check if <package-dir>/main/default/digitalExperiences/site/ contains any store directories.
  2. If store metadata exists: use it. If multiple stores found, ask user to select one.
  3. If no store metadata found: Try retrieving from the connected org before delegating:
    1. Run sf org list (or check sf config get target-org) to find a connected org. Ask the user to confirm or pick one if more than one.
    2. List DigitalExperienceBundle site bundles in that org with sf org list metadata --metadata-type DigitalExperienceBundle --target-org <alias>. Filter to site/* entries.
    3. If at least one site bundle exists, ask the user which to use, then run: sf project retrieve start --metadata "DigitalExperienceBundle:site/<storeName>" --target-org <alias> The bundle lands at <package-dir>/main/default/digitalExperiences/site/<storeName>/.
    4. Only if no connected org is available, or no site bundles are found, or retrieve fails: delegate to the creating-b2b-commerce-store skill.

Required state after all checks:

  • Package dir — the value resolved in Check 0 (e.g., force-app)
  • Store name — the selected fullName value (e.g., My_B2B_Store1)
  • Site metadata path<package-dir>/main/default/digitalExperiences/site/<store-name>/
  • Repo path.tmp/b2b-commerce-open-source-components/

Integration Task

Copy all components and labels from cloned repo to site directory:

  • Source: .tmp/b2b-commerce-open-source-components/force-app/main/default/sfdc_cms__lwc/* and sfdc_cms__label/* (the open source repo's own layout — always force-app)
  • Destination: <package-dir>/main/default/digitalExperiences/site/<store-name>/sfdc_cms__lwc/ and sfdc_cms__label/ (<package-dir> resolved in Check 0)

Steps:

  1. Tell user: "I'm checking if open code components already exist in your store's site metadata." Check if destination directories already contain files.
  2. If files exist, present options:

    "Components already exist in {store-name}. How would you like to proceed?"

    1. Overwrite all — Replace all existing components with latest from repo
    2. Copy only new — Skip existing components, copy only ones not yet present
  3. Tell user: "I'm now copying all open code LWC components from the cloned repository into your store's site metadata directory." Copy all component directories from source to destination.
  4. Tell user: "I'm copying the associated label files that these components need." Copy all label directories from source to destination.
  5. Report: "Copied X components and Y label sets"

Output:

✅ Integration Complete!

Copied: X components and Y label sets to <store-name>

Next Steps:
1. Deploy: sf project deploy start -d <package-dir>/main/default/digitalExperiences/site/<store-name>
2. Open Experience Builder and use new components from the palette
3. Publish your site when ready

Example Interaction

User: "Integrate open code components to my store"

Agent: "I'm checking if the open source components repository is already cloned locally..."

Agent: (repo exists)

"Open source repository is already cloned. How would you like to proceed?"

  1. Reuse existing — Use the already cloned repository
  2. Re-clone — Remove and clone fresh from GitHub

User: "1"

Agent: "I'm checking if your project already has B2B store metadata locally..."

  • ✓ Found store metadata for My_B2B_Store1

Agent: "I'm checking if open code components already exist in your store's site metadata..."

Agent: (files exist)

"Components already exist in My_B2B_Store1. How would you like to proceed?"

  1. Overwrite all — Replace all existing components with latest from repo
  2. Copy only new — Skip existing components, copy only ones not yet present

User: "1"

Agent: "I'm now copying all open code LWC components from the cloned repository into your store's site metadata directory..." Agent: "I'm copying the associated label files that these components need..."

  • ✓ Copied 45 components and 38 label sets
✅ Integration Complete!

Copied: 45 components and 38 label sets to My_B2B_Store1

Next Steps:
1. Deploy: sf project deploy start -d force-app/main/default/digitalExperiences/site/My_B2B_Store1
2. Open Experience Builder and use new components from the palette
3. Publish your site when ready

Error Handling

ErrorMessageAction
Store not found"Store '{name}' not found in org."List stores again
Git clone failed"Failed to clone repository. Check internet connection."Retry or abort
Invalid repo structure"Repository structure has changed. Expected sfdc_cms__lwc and sfdc_cms__label."Warn user, abort
File copy failed"Failed to copy files. Check file permissions."Show error details

Verification Checklist

  • Startup Flow completed: repo cloned, store metadata available
  • Components copied to correct destination path (sfdc_cms__lwc/)
  • Labels copied to correct destination path (sfdc_cms__label/)
  • No file permission errors during copy
  • Deployment command provided and user informed about testing

Related skills

More from forcedotcom/sf-skills and the wider catalog.

INinvestigating-agentforce-architecture logo

investigating-agentforce-architecture

forcedotcom/sf-skills

Declared architecture snapshot for one Agentforce agent: planner, topics, actions, flows, Apex, prompt templates, and NGA plugins. Renders a human-readable architecture document and Mermaid invocation graph from design-time metadata (not runtime audit rows). TRIGGER when user asks to describe, diagram, inventory, audit, document, or diff (e.g. v3 vs v5) the architecture / action tree / topic structure / tool inventory of a specific agent by agent API name in a specific org. DO NOT TRIGGER for runtime session traces, conversation transcripts, generation timings, or gateway audit chains — this skill reads design-time metadata only (use investigating-agentforce-d360 for session traces).

836 installs
INinvestigating-agentforce-d360 logo

investigating-agentforce-d360

forcedotcom/sf-skills

Data Cloud 360° view of a single Agentforce session. TRIGGER when user asks to trace, inspect, summarize, or describe a specific Agentforce session by session id (Agent Session UUID `019d…` or MessagingSession id `0Mw…`). Also triggers on session discovery — find/list/search sessions by time, agent, channel, outcome, or conversation text — when the user has no session id yet. DO NOT TRIGGER for design-time architecture questions (use investigating-agentforce-architecture instead) or for runtime perf/latency/SLO questions that require platform telemetry beyond Data Cloud.

822 installs
MAmanaging-managed-event-subscription logo

managing-managed-event-subscription

forcedotcom/sf-skills

Create, read, update, and delete ManagedEventSubscription metadata in Salesforce. Use this skill for any work involving managed event subscriptions, platform event subscriptions, event channel subscribers, or .managedEventSubscription-meta.xml files. TRIGGER when: user asks to subscribe to a platform event, create a managed subscription, set up event replay, configure an event channel subscriber, update replay preset, activate or deactivate a subscription, delete a subscription, or manage ManagedEventSubscription metadata. SKIP when: user needs to create the platform event channel itself (use generating-platform-event skill) or needs Flow-based event subscriptions (use generating-flow skill).

820 installsAudited
MOmodeling-omnistudio-epc-catalog logo

modeling-omnistudio-epc-catalog

forcedotcom/sf-skills

Model Salesforce Industries EPC product bundles, attributes, and offer metadata with DataPack JSON templates.

1.9k installsAudited
OBobserving-agentforce logo

observing-agentforce

forcedotcom/sf-skills

Analyze production Agentforce agent behavior using session traces and Data Cloud.

2.1k installsAudited
ORorchestrating-datacloud logo

orchestrating-datacloud

forcedotcom/sf-skills

Orchestrate multi-phase Salesforce Data Cloud pipelines: connect, prepare, harmonize, segment, and act.

2.0k installs