
commerce-b2b-open-code-components-integrate
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.
- Installs
- 4.6K
- Last 24h
- —
- Trending rank
- —
- Security
- Pass
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/forcedotcom/sf-skills --skill commerce-b2b-open-code-components-integrate- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads commerce-b2b-open-code-components-integrate automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
Security audits
Independent scans of the skill's instructions and bundled files.
SKILL.md
The instructions your agent reads when the skill is triggered.
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
- 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:
- 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 - If directory exists and contains
force-app/main/default/sfdc_cms__lwcandsfdc_cms__label, present options:"Open source repository is already cloned. How would you like to proceed?"
- Reuse existing — Use the already cloned repository
- Re-clone — Remove and clone fresh from GitHub
- 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.
- If clone fails: inform user and abort
Check 2: Store and Site Metadata
Verify a store is selected and site metadata is available locally:
- 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. - If store metadata exists: use it. If multiple stores found, ask user to select one.
- If no store metadata found: Try retrieving from the connected org before delegating:
- Run
sf org list(or checksf config get target-org) to find a connected org. Ask the user to confirm or pick one if more than one. - List
DigitalExperienceBundlesite bundles in that org withsf org list metadata --metadata-type DigitalExperienceBundle --target-org <alias>. Filter tosite/*entries. - 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>/. - Only if no connected org is available, or no site bundles are found, or retrieve fails: delegate to the commerce-b2b-store-create skill.
- Run
Required state after all checks:
- Package dir — the value resolved in Check 0 (e.g.,
force-app) - Store name — the selected
fullNamevalue (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/*andsfdc_cms__label/*(the open source repo's own layout — alwaysforce-app) - Destination:
<package-dir>/main/default/digitalExperiences/site/<store-name>/sfdc_cms__lwc/andsfdc_cms__label/(<package-dir>resolved in Check 0)
Steps:
- Tell user: "I'm checking if open code components already exist in your store's site metadata." Check if destination directories already contain files.
- If files exist, present options:
"Components already exist in {store-name}. How would you like to proceed?"
- Overwrite all — Replace all existing components with latest from repo
- Copy only new — Skip existing components, copy only ones not yet present
- 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.
- Tell user: "I'm copying the associated label files that these components need." Copy all label directories from source to destination.
- 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?"
- Reuse existing — Use the already cloned repository
- Re-clone — Remove and clone fresh from GitHub
User: "1"
Agent: "I'm checking if your project already has B2B store metadata locally..."
- [done] 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?"
- Overwrite all — Replace all existing components with latest from repo
- 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..."
- [done] 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
| Error | Message | Action |
|---|---|---|
| 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
FAQ
What does the commerce-b2b-open-code-components-integrate skill do?
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.
How do I install commerce-b2b-open-code-components-integrate?
Run npx skills add https://github.com/forcedotcom/sf-skills --skill commerce-b2b-open-code-components-integrate in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/commerce-b2b-open-code-components-integrate/ (personal) or .claude/skills/commerce-b2b-open-code-components-integrate/ (project).
Which AI agents can use commerce-b2b-open-code-components-integrate?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is commerce-b2b-open-code-components-integrate safe to install?
Security partners have reviewed it: Gen Agent Trust Hub passed; Socket passed; Snyk passed. As with any skill, read the SKILL.md and bundled scripts before installing.
Who maintains commerce-b2b-open-code-components-integrate?
It is published by forcedotcom in forcedotcom/sf-skills. It has 4,632 recorded installs.
More from forcedotcom/sf-skills
platform-apex-generate
forcedotcom/sf-skills
Primary Apex authoring skill for class generation, refactoring, and review. ALWAYS ACTIVATE when the user mentions Apex, .cls, triggers, or asks to create/refactor a class (service, selector, domain, batch, queueable, schedulable, invocable, DTO, utility, interface, abstract, exception, REST resource). Use this skill for requests involving SObject CRUD, mapping collections, fetching related records, scheduled jobs, batch jobs, trigger design, @AuraEnabled controllers, @RestResource endpoints, custom REST APIs, or code review of existing Apex.
platform-apex-test-generate
forcedotcom/sf-skills
Use to generate and validate Apex test classes with TestDataFactory patterns, bulk testing (251+ records), mocking, assertions, and disciplined test-fix loops. Use when creating Apex test classes (for triggers, services, controllers, batch jobs, queueables, and callouts), improving coverage, debugging or fixing failing Apex tests, or running test/coverage analysis. Triggers on Test.cls files, sf apex run test, coverage reports. Do NOT trigger for production Apex (use platform-apex-generate) or Jest/LWC tests.
platform-apex-test-run
forcedotcom/sf-skills
Apex test execution, coverage analysis, and test-fix loops with 120-point scoring. Use when the user runs Apex tests, checks code coverage, fixes failing tests, or touches Test.cls / Test.cls files. DO NOT TRIGGER when writing Apex production code (use platform-apex-generate), Agentforce agent testing (use agentforce-test), or Jest/LWC tests (use experience-lwc-generate).
platform-apex-logs-debug
forcedotcom/sf-skills
Salesforce debug log analysis and troubleshooting with 100-point scoring. TRIGGER when: user analyzes debug logs, hits governor limits, reads stack traces, or touches .log files from Salesforce orgs. DO NOT TRIGGER when: running Apex tests (use platform-apex-test-run), generating or fixing Apex code (use platform-apex-generate), or Agentforce session tracing (use agentforce-observe).
platform-soql-query
forcedotcom/sf-skills
Use when the user needs SOQL/SOSL authoring or optimization: natural-language-to-query generation, relationship queries, aggregates, query-plan/selectivity analysis, and performance or safety improvements. TRIGGER when the user writes, optimizes, or debugs SOQL/SOSL, touches .soql files, or asks about relationship queries, aggregates, or query performance. DO NOT TRIGGER for bulk data operations (use platform-data-manage), Apex DML logic (use platform-apex-generate), or report/dashboard queries.
platform-metadata-deploy
forcedotcom/sf-skills
Salesforce DevOps automation using sf CLI v2. TRIGGER when: user deploys metadata, validates a deploy or does a dry-run, deploys to a Production org, quick-deploys a validated job ID, ships/promotes to prod, creates/manages scratch orgs or sandboxes, sets up CI/CD pipelines, or troubleshoots deployment errors with sf project deploy. DO NOT TRIGGER when: writing Apex code, building LWC components (use experience-lwc-generate), creating metadata definitions (use platform-custom-object-generate), deleting metadata from an org (use platform-destructive-deploy), or querying org data (use platform-data-manage).
Popular other skills
hyperframes-cli
heygen-com/hyperframes
The HyperFrames CLI by job - scaffold, check, look at frames, edit the timeline, preview, render locally or in the cloud, publish, project history - plus reading its JSON and recovering from build or render failures.
triage
mattpocock/skills
Move issues and external PRs through a state machine of triage roles, categorise, verify, grill if needed, and write agent-ready briefs.
ask-matt
mattpocock/skills
Ask which skill or flow fits your situation. A router over the skills in this repo.
to-questionnaire
mattpocock/skills
Turn a decision you can't fully answer into a questionnaire for someone else to fill in.
loop-me
mattpocock/skills
Grill me about specs for the workflows I want to build, within this workspace.