
Commerce B2b Open Code Components Replace
Replace OOTB (out-of-the-box) B2B Commerce components with open source equivalents in...
Install
npx skills add forcedotcom/sf-skills --skill commerce-b2b-open-code-components-replace -g -a claude-code -y- Repository
- forcedotcom/sf-skills1.1k
- Category
- Engineering
- Updated
- 5d ago
- License
- Apache-2.0
- Context cost
- Mediumabout 3,000 tokens
- Runs scripts
- No, instructions only
What it does
Replace OOTB (out-of-the-box) B2B Commerce components with open source equivalents in site metadata content.json files, or look up the equivalent open code `site:` component for OOTB definitions. Use when users mention \"replace OOTB components\", \"replace commerce components with open code\", \"swap OOTB for open source\", \"replace commerce_builder:\", \"replace OOTB in site\", \"replace component in site metadata\", \"replace component definition\", \"find open code equivalent\", \"equivalent open code component\", \"OOTB to open code mapping\", \"what is the site component for\", components \"in this view\" or \"for a given view\", or a specific list of component names, and want to update or only discover mappings in their store metadata.
Replacing OOTB B2B Commerce Components with Open Code
This skill replaces OOTB (out-of-the-box) B2B Commerce component definitions in site metadata content.json files with their open source site: equivalents, or looks up the equivalent open code component for given OOTB definitions without making changes. It uses an authoritative mapping loaded from assets/ootb-to-open-code-mapping.json.
Scope
Modes: Full replace runs the scan (Step 1), user selection if needed, then content.json updates (Step 2, 3). Lookup only (user asks for equivalents but not to change files): apply the mapping-authority rule and report OOTB → site: for the named components or for definitions found in the scoped content.json, do not call Write unless the user confirms replacement. View-scoped work: limit file discovery and reads to sfdc_cms__view/<ViewName>/ (or the path the user gives) instead of all views.
Prerequisites
Resolve <package-dir>
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.
Delegate setup
Before replacing components, delegate to the commerce-b2b-open-code-components-integrate skill to ensure:
- Open source repository is cloned at
.tmp/b2b-commerce-open-source-components - Store is selected and site metadata is retrieved locally
- Open code components are copied to the store's site metadata
The integrating skill owns the .tmp/ clone lifecycle (it prompts the user to reuse or re-clone an existing checkout); this skill assumes the clone is already present.
