К основному содержанию
скилл CX Codex

commerce-b2b-open-code-components-integrate — скилл для Claude Code

Копирует открытые компоненты Salesforce B2B Commerce из GitHub в метаданные сайта магазина, чтобы они появились в палитре Experience Builder.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add forcedotcom/sf-skills --skill commerce-b2b-open-code-components-integrate -a claude-code
Открыть на GitHub

Что делает commerce-b2b-open-code-components-integrate

Скилл берёт официальный репозиторий forcedotcom/b2b-commerce-open-source-components и переносит оттуда все LWC-компоненты и связанные с ними наборы меток в каталог сайта вашего магазина. После деплоя они становятся доступны в палитре Experience Builder.

Перед копированием скилл проходит несколько проверок. Он читает sfdx-project.json и выбирает активный каталог пакета — запись с "default": true, а если такой нет, первую в списке. Затем смотрит, склонирован ли репозиторий в .tmp/b2b-commerce-open-source-components, и проверяет, есть ли в проекте метаданные магазина. Если их нет, скилл пробует вытащить бандл сайта из подключённой организации через sf project retrieve start. Когда ни организации, ни бандла нет, работа передаётся скиллу commerce-b2b-store-create.

Нужны git и sf версии 2.0.0 или выше, минимальная версия API — 56.0. Если sfdx-project.json отсутствует или в нём нет packageDirectories, скилл останавливается и ничего не копирует. Когда компоненты в магазине уже лежат, он спросит: перезаписать всё или добавить только новые.

Какие задачи решает

  • перенести открытые компоненты B2B Commerce в метаданные сайта магазина
  • подтянуть бандл сайта из подключённой организации, если локально его нет
  • добавить в магазин только те компоненты, которых там ещё не было
  • обновить уже стоящие компоненты свежими версиями из репозитория
  • вывести компоненты в палитру Experience Builder после деплоя

Примеры запросов агенту

  • Добавь открытые компоненты B2B Commerce в магазин My_B2B_Store1
  • Склонируй репозиторий открытых компонентов и перенеси их в метаданные сайта
  • Обнови компоненты в магазине свежими версиями из репозитория

Как установить commerce-b2b-open-code-components-integrate

1Через Skills CLI (Vercel)

npx skills add forcedotcom/sf-skills --skill commerce-b2b-open-code-components-integrate -a claude-code

2Вручную: положить файлы

~/.claude/skills/commerce-b2b-open-code-components-integrate/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/commerce-b2b-open-code-components-integrate/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Из того же набора167

commerce-b2b-store-create Ведёт по шагам к созданию B2B-магазина Commerce в Salesforce и выгружает метаданные витрины в репозиторий. Пригодится, когда нужно развернуть витрину из уже готового магазина. CX Codex +1 4 700установок mobile-platform-offline-validate Проверяет компоненты LWC на совместимость с офлайн-режимом Komaci в Salesforce Mobile App Plus. Находит ошибки прайминга и формирует исправления кода. CX Codex +1 4 700установок mobile-platform-native-capabilities-integrate Помогает собрать Salesforce LWC с нативными функциями мобильного устройства: сканированием, геолокацией, NFC и платежами. Нужен при работе с lightning/mobileCapabilities. CX Codex +1 4 700установок commerce-b2b-open-code-components-replace Меняет стандартные B2B Commerce компоненты на открытые аналоги в content.json метаданных сайта. Или просто показывает соответствия, если менять файлы не нужно. CX Codex +1 4 600установок platform-policy-rule-generate Помогает писать метаданные PolicyRuleDefinition и PolicyRuleDefinitionSet для Salesforce Data Cloud: схема, дерево категорий, проверки перед деплоем. CX Codex +1 4 100установок platform-custom-report-type-generate Помогает агенту создавать и проверять метаданные Salesforce Custom Report Type: база, связи, доступные поля. Пригодится при разборе ошибок деплоя .reportType-meta.xml. CX Codex +1 4 000установок platform-sharing-owd-configure Скилл читает и меняет Organization-Wide Default для объектов Salesforce: показывает текущие уровни доступа и правит sharingModel в метаданных. CX Codex +1 3 700установок platform-encryption-configure Скилл для настройки Salesforce Shield Platform Encryption через метаданные и консультаций по архитектуре управления ключами. CX Codex +1 3 600установок

Похожие

mcp-builder официальный anthropics Скилл проводит через создание MCP-сервера на TypeScript или Python: от изучения протокола до тестов и оценки качества. 130 949установок claude-api официальный anthropics Справочник по Anthropic SDK и API Claude для генерации кода без устаревших параметров и выдуманных методов. 74 198установок lark-im larksuite Скилл подключает Lark IM к агенту: он отправляет сообщения, ищет историю, управляет чатами и файлами. Подойдёт для задач вокруг командных коммуникаций. CX Codex +1 472 900установок lark-event larksuite Слушает события Lark/Feishu и отдаёт их потоком NDJSON. Подходит для ботов, обработчиков сообщений и долгих подписчиков. CX Codex +1 466 800установок caveman-discover JuliusBrussee Находит точки вызова LLM в репозитории и размечает их воркфлоу для Caveman Cloud, чтобы расходы на токены не сливались в одну общую кучу. CX Codex +1 104 400установок migration JuliusBrussee Скилл задаёт правила безопасных миграций схем, данных и API с обязательным откатом. Пригодится при изменениях, где нельзя терять данные или ломать совместимость. CX Codex +1 103 900установок

Рядом в теме «Бэкенд и API»

Всё по теме «Бэкенд и API» →

Вопросы о commerce-b2b-open-code-components-integrate

Как установить commerce-b2b-open-code-components-integrate в Claude Code?

Выполните npx skills add forcedotcom/sf-skills --skill commerce-b2b-open-code-components-integrate -a claude-code. Файл скилла появится по пути ~/.claude/skills/commerce-b2b-open-code-components-integrate/SKILL.md.

Что делает commerce-b2b-open-code-components-integrate?

Копирует все открытые LWC-компоненты и наборы меток из репозитория forcedotcom/b2b-commerce-open-source-components в каталог сайта вашего магазина. После деплоя они доступны в Experience Builder.

Что нужно, чтобы скилл сработал?

Установленные git и sf версии 2.0.0 или выше и активный каталог пакета в sfdx-project.json. Минимальная версия API — 56.0.

Исходный текст

SKILL.md · Apache-2.0
---
name: commerce-b2b-open-code-components-integrate
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:*) Bash(sf org list:*) Bash(sf config get:*) Bash(sf project retrieve start:*) Read
metadata:
  version: "1.0"
  domains: ["Commerce", "Experience"]
  minApiVersion: "56.0"
  relatedSkills:
    - "commerce-b2b-store-create"
  cliTools:
    - tool: ["git"]
      semver: ">=2.0.0"
    - tool: ["sf"]
      semver: ">=2.0.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 **commerce-b2b-store-create** 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:**
```text
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..."
- [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?"
> 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..."
- [done] Copied 45 components and 38 label sets

```text
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

© forcedotcom · Apache-2.0 · forcedotcom/sf-skills

Смотрите также

Спонсоры проекта

Компании, которые помогают держать аналитику открытой