Command Palette

Search for a command to run...

UnylyUnyly
Back to skills

data360-code-extension-generate

FreeRuns bundled scriptsNot checked

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…

forcedotcomby forcedotcom★ 1,200 GitHub stars

About this skill

data360-code-extension-generate

Overview

A Data 360 code extension is customer-owned Python (PySpark) that runs inside Data 360:

Type Purpose Local test
script Batch transformation deployed as a data transform. Reads and writes DLOs or DMOs. script run against real org data
function Custom node for Search Index Chunking (--use-in-feature SearchIndexChunking). function run --test-with test.json

Workflow: environment check → init → discover schemas → develop → scan → run locally → deploy → run the deployed transform. The skill needs only a shell, file editing, and the ability to ask the user questions. It works with a project venv or with a single system Python 3.11 (cloud workspaces, containers).

Use it to set up a code extension environment, create a script or function package, change payload/entrypoint.py, scan, run locally, deploy, redeploy, or clean up.

Agent Rules (apply to every phase)

  1. Pass --target-org <ORG_ALIAS> explicitly to run, deploy and every sf org / sf api command, even when it's the CLI default. init, scan and zip reject it (Nonexistent flag: --target-org).
  2. Shell state doesn't persist. Start every block that runs sf data-code-extension, python3 or pip with the <PY_ENV> line from Phase 0b; other commands don't need it. Write <ORG_ALIAS>, <PROJECT_DIR>, <API_VERSION> and <package_name> literally. Never use $(…), backticks or eval: some hosts (for example Code Builder) ask for approval on each one. Copy PY_ENV and API_VERSION exactly as check_env.sh prints them.
  3. Check before you install, and skip anything already present.
  4. Confirm with the user before changing the org: deploy, delete, or running a deployed transform.
  5. Hand interactive or privileged steps to the user: sf org login web, enabling Code Extension, installing or starting Docker Desktop, sudo, installing Homebrew.
  6. Never print secrets (access tokens, session IDs, OAuth client IDs or consumer keys).
  7. Resolve, print, proceed. Don't ask for values the environment determines (Phase 0a). Ask only when a value is missing or ambiguous. If your shell can't prompt, ask in the conversation and write the files yourself.
  8. Schema first, then code (Phase 2). Never write code first and ask the user to check the schema afterwards.
  9. Data 360 MCP server first for org lookups (schemas, queries, runs, deletes). Do the MCP check (Phase 0b) once per session before the first lookup, even if Phase 0 was skipped. Fall back to sf api or the UI only when it isn't connected or a call fails, and say which you used. On Session not found (404), retry once before falling back. Details: references/mcp-integration.md.
  10. stderr: when piping sf … --json into jq, use 2>/dev/null, never 2>&1 (warnings break the JSON). Never redirect stderr on scan, run or deploy; their errors and tracebacks go there.

Phase 0: Environment and Org Readiness

0a. Resolve parameters

Take what the user already gave and pass "" for the rest; check_env.sh (0b) resolves it:

Parameter Resolution order (first match wins)
PROJECT_DIR User value → $D360_PROJECT_DIR → /home/codebuilder/dx-project if it exists (Code Builder) → current folder
ORG_ALIAS User value → $D360_TARGET_ORG → CLI default org if Connected → the only Connected org. Alias, or username if there's no alias
<package_name> User value, else a snake_case name from the request (for example employee_upper)

Tell the user the values in one line and continue without waiting ("Using org … and project …. Say so if you want different ones."). Stop and ask only if several orgs are Connected with no Connected default (show them), or if none is Connected (ask for the My Domain URL and hand the browser login to the user: environment-setup.md §2).

0b. Run the read-only check

The plugin needs exactly Python 3.11 and uses whatever python3 is on PATH. The check picks system mode (python3 is 3.11 and pip isn't blocked; <PY_ENV> puts the user-base bin folder on PATH) or venv mode (<PROJECT_DIR>/.venv; <PY_ENV> activates it). An existing .venv always means venv mode. Details: references/environment-setup.md §3.

bash <SKILL_DIR>/scripts/check_env.sh "<PROJECT_DIR or empty>" "<ORG_ALIAS or empty>"   # optional 3rd argument: system | venv

It changes nothing. It prints ✅/❌ for sf and the plugin, Python 3.11 (after <PY_ENV>), pip or venv state, salesforce-data-customcode and pipreqs, Java, Docker and the org connection, then PROJECT_DIR=, ORG_ALIAS=, MODE=, PY_ENV= and API_VERSION=. Use the printed PY_ENV and API_VERSION from here on.

For each ❌, follow environment-setup.md in this order, then rerun the check:

  1. sf can't run in this shell: your host's
Full SKILL.md on GitHub

Install data360-code-extension-generate in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

Bundled files

references/README.mdreferences/environment-setup.mdreferences/mcp-integration.mdreferences/quick-reference.mdreferences/run-logs.mdreferences/schema-discovery.mdreferences/troubleshooting.mdscripts/check_env.shscripts/venv_hook.sh

FAQ

What does the data360-code-extension-generate skill do?

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.

How do I install the data360-code-extension-generate skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the data360-code-extension-generate skill run scripts?

Yes, this skill bundles executable scripts. Review the source before installing.

Related skills

Compare data360-code-extension-generate with