Skip to content

forcedotcom/sf-skills / skills/data360-code-extension-generate

data360-code-extension-generate

Verified

Create, develop, test, and deploy Data 360 (Data Cloud) Code Extensions with the sf CLI data-code-extension plugin and the salesforce-data-customcode Python SDK. Use this skill when creating or writing a code extension script or function (for example one that reads a DLO and writes a DLO), creating custom PySpark transformations for Data 360, editing an existing code extension payload/entrypoint.py, setting up a local code extension environment, scanning, running locally, deploying, or redeploying code extensions. Supports environment setup, init, scan, run, zip, and deploy for script and function packages.

FileKindSize
SKILL.mdskill md17.0 KB
references/README.mdmarkdown3.2 KB
references/environment-setup.mdmarkdown10.5 KB
references/mcp-integration.mdmarkdown3.6 KB
references/quick-reference.mdmarkdown7.1 KB
references/run-logs.mdmarkdown2.3 KB
references/schema-discovery.mdmarkdown2.7 KB
references/troubleshooting.mdmarkdown9.0 KB
scripts/check_env.shexecutablescript10.2 KB
scripts/venv_hook.shexecutablescript888 B

scripts/venv_hook.sh

View on GitHub
#!/usr/bin/env bash
# Venv mode only. Pins PySpark to the project venv's Python by adding two exports
# to <PROJECT_DIR>/.venv/bin/activate. Safe to rerun; adds the lines once.
# Usage: bash venv_hook.sh <PROJECT_DIR>
# Rerun after recreating the venv (a new venv regenerates activate).

PROJECT_DIR="${1:?usage: venv_hook.sh <PROJECT_DIR>}"
ACTIVATE="$PROJECT_DIR/.venv/bin/activate"

[ -f "$ACTIVATE" ] || { echo "❌ $ACTIVATE not found; create the venv first: python3.11 -m venv .venv"; exit 1; }

if grep -q 'PYSPARK_PYTHON' "$ACTIVATE"; then
  echo "✅ PySpark hook already present in $ACTIVATE, skipping"
else
  cat >> "$ACTIVATE" <<'EOF'

# Data 360 code extension: Spark driver and workers must use this venv's Python 3.11
export PYSPARK_PYTHON="$VIRTUAL_ENV/bin/python"
export PYSPARK_DRIVER_PYTHON="$VIRTUAL_ENV/bin/python"
EOF
  echo "✅ PySpark hook added to $ACTIVATE"
fi
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 321kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 321kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 321kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 197kUpdated Claude CodeCodexVerifiedInstall