commerce-b2b-open-code…
Integrate Salesforce B2B Commerce open source components from GitHub into B2B Commerce stores. Use when users mention \"integrate open code components\",…
Develop and deploy Data Cloud Code Extensions using SF CLI plugin. Use this skill when creating custom Python transformations for Data Cloud, deploying code extensions, or testing data transformations. Supports init, run, scan, and deploy operations.
$ npx -y skills add forcedotcom/sf-skills --skill data360-code-extension-generate --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/data360-code-extension-generateContext preview
The summary Claude sees to decide when to auto-load this skill.
Develop and deploy Data Cloud Code Extensions using SF CLI plugin. Use this skill when creating custom Python transformations for Data Cloud, deploying code extensions, or testing data transformations. Supports init, run, scan, and deploy operations.
name: data360-code-extension-generate
description: "Develop and deploy Data Cloud Code Extensions using SF CLI plugin. Use this skill when creating custom Python transformations for Data Cloud, deploying code extensions, or testing data transformations. Supports init, run, scan, and deploy operations."
metadata:
version: "1.0"
domains: ["Data 360", "Developer Experience"]
relatedSkills:
- "data360-schema-get"
cliTools:
- tool: ["docker"]
semver: ">=20.0.0"
- tool: ["pip"]
semver: ">=23.0.0"
- tool: ["python"]
semver: ">=3.11.0"
- tool: ["python3"]
semver: ">=3.11.0"
- tool: ["sf"]
semver: ">=2.0.0"This skill provides a complete workflow for developing, testing, and deploying custom Python code extensions to Salesforce Data Cloud. Code extensions allow you to write Python transformations that read from and write to Data Lake Objects (DLOs) and Data Model Objects (DMOs).
Before executing any code extension commands, verify prerequisites:
1. **SF CLI with plugin installed**
sf plugins --core | grep data-code-extension
If not installed:
sf plugins install @salesforce/plugin-data-code-extension
2. **Python 3.11**
python --version # Should show 3.11.x
3. **Data Cloud Custom Code SDK**
pip list | grep salesforce-data-customcode
If not installed:
pip install salesforce-data-customcode
4. **Docker running** (for deploy only)
docker ps
5. **Authenticated org**
sf org display --target-org <org_alias> --json
Create a new code extension project with scaffolding.
**Commands:**
For **script-based** code extensions (batch transformations):
sf data-code-extension script init --package-dir <directory>
For **function-based** code extensions (real-time):
sf data-code-extension function init --package-dir <directory>
**Required Option:**
**What it creates:**
my-transform/ # Project root ├── payload/ # CRITICAL: This is what --package-dir must point to for deploy │ ├── entrypoint.py # Main transformation code │ └── config.json # Code extension configuration ├── requirements.txt # Python dependencies └── README.md
**IMPORTANT:** Understanding the directory structure is critical for successful deployment.
**Commands and their directory requirements:**
| Command | Run From | Path/File Argument | |---------|----------|-------------------| | `init` | Parent directory | `<project-name>` or `.` | | `scan` | Project root | `./payload/entrypoint.py` | | `run` | Project root | `./payload/entrypoint.py` | | `deploy` | Project root | `--package-dir ./payload` (**REQUIRED**) |
**CRITICAL: The `--package-dir` argument in deploy command MUST point to the `payload` directory, not the project root.**
Edit `payload/entrypoint.py` with transformation logic.
**Script Example (Batch):**
from datacustomcode import Client
client = Client()
# Read from DLO
df = client.read_dlo('Employee__dll')
# Transform data (uppercase position field)
df['position_upper'] = df['position'].str.upper()
# Write to output DLO
client.write_to_dlo('Employee_Upper__dll', df, 'overwrite')**Function Example (Real-time):**
from datacustomcode import FunctionClient
def transform(event, context):
client = FunctionClient(context)
input_data = event['data']
output = {
'name': input_data['name'].upper(),
'status': 'processed'
}
return output**Common Operations:**
Scan the entrypoint file to detect required permissions and generate config.json.
**Command:**
sf data-code-extension script scan --entrypoint ./payload/entrypoint.py
**What it detects:**
**CRITICAL: Before running tests locally, validate that all DLOs used in your code exist and have the expected fields.**
After scanning, review the generated `config.json` to identify all DLOs:
cat payload/config.json
**Use the `data360-schema-get` skill to verify DLOs exist and check field names.**
For each DLO referenced in your code:
1. **Verify DLO exists:**
python3 scripts/get_dlo_schema.py <org_alias> <dlo_name>
2. **Verify field names match** — compare fields used in your `entrypoint.py` against the DLO schema.
3. **Check all DLOs:**
Before proceeding to run, ensure:
This repository provides a curated collection of Salesforce agent skills for building applications.
Repo: forcedotcom/sf-skills
Integrate Salesforce B2B Commerce open source components from GitHub into B2B Commerce stores. Use when users mention \"integrate open code components\",…
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…
Use this skill to diagnose and resolve what blocks a DevOps Center promotion of a work item's feature branch: Git merge conflicts and deployment failures.…
Use this skill to manage the full lifecycle of a DevOps Center pipeline — list all pipelines, get a single pipeline's details, create a new pipeline linked to…
Analyzes DevOps Center test failures and Code Analyzer violations in plain language — failure category, offending file/class/method/line, rule violated, fix…
Configures DevOps Center pipeline testing infrastructure: enables a test provider so its suites become available, re-syncs a configured provider to pull in new…