data360-code-extension-generate
БесплатноЗапускает вложенные скриптыНе проверен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…
от forcedotcom★ 1 200 звёзд на GitHubОб этом скилле
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)
- Pass
--target-org <ORG_ALIAS>explicitly torun,deployand everysf org/sf apicommand, even when it's the CLI default.init,scanandzipreject it (Nonexistent flag: --target-org). - Shell state doesn't persist. Start every block that runs
sf data-code-extension,python3orpipwith 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 oreval: some hosts (for example Code Builder) ask for approval on each one. CopyPY_ENVandAPI_VERSIONexactly ascheck_env.shprints them. - Check before you install, and skip anything already present.
- Confirm with the user before changing the org: deploy, delete, or running a deployed transform.
- Hand interactive or privileged steps to the user:
sf org login web, enabling Code Extension, installing or starting Docker Desktop,sudo, installing Homebrew. - Never print secrets (access tokens, session IDs, OAuth client IDs or consumer keys).
- 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.
- Schema first, then code (Phase 2). Never write code first and ask the user to check the schema afterwards.
- 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 apior the UI only when it isn't connected or a call fails, and say which you used. OnSession not found(404), retry once before falling back. Details: references/mcp-integration.md. - stderr: when piping
sf … --jsonintojq, use2>/dev/null, never2>&1(warnings break the JSON). Never redirect stderr onscan,runordeploy; 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:
sfcan't run in this shell: your host's
Установить data360-code-extension-generate в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл data360-code-extension-generate?
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.
Как установить скилл data360-code-extension-generate?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл data360-code-extension-generate запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
skill-creator
Create 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…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic