Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

platform-datamask-run

БесплатноЗапускает вложенные скриптыНе проверен

Data Mask end-to-end operation on a sandbox: configure a masking policy over PII, run the masking job, poll it to completion, report masked-record results…

forcedotcomот forcedotcom★ 1 200 звёзд на GitHub

Об этом скилле

platform-datamask-run: Salesforce Data Mask End-to-End Operation

Use this skill to operate the Salesforce Data Mask feature on a sandbox: configure a masking policy over PII fields, start a masking job, poll it to a terminal state, report which records were masked, and abort a run that is still in progress.

Data Mask is sandbox-only — the run/abort REST endpoints return 403 on production (a runtime sandbox guard). Confirm the target org is a sandbox before starting.

When This Skill Owns the Task

  • Running a Data Mask job against a configured policy
  • Polling masking-job status to completion
  • Reporting masked-record counts / per-object results
  • Aborting (canceling) an in-progress masking run
  • Creating or identifying the policy the job runs against

Delegate elsewhere when the user is:

  • hand-writing anonymization Apex → platform-apex-generate
  • seeding or generating test data → platform-data-manage
  • deploying unrelated metadata → platform-metadata-deploy

The One Thing to Get Right First: the API surface map

The single biggest failure mode is assuming Data Mask entities are ordinary data-API objects. They are not, and the surface differs per entity. Memorize this table before running anything — guessing here is what turns a 3-second job into a 30-minute dead end.

Entity What it is How you reach it
DataMaskPolicy The masking policy shell (config) Tooling API or Metadata API (thin shell: <label>/<description>/<runOnRefresh> only) — NOT standard SOQL/sobject describe
DataMaskPolicyObject An object targeted by a policy (holds the optional row filter) Tooling API only — query AND insert; row-subset "sample" runs set FilterEnabled+WhereCriteria here (no sampleSize on the policy)
DataMaskPolicyField A field + its masking treatment Tooling API only — query AND insert; treatment cols are MaskingCategory + MaskValue
DataMaskPolicyJobRun The job (one masking run) Standard SOQL — sf data query works
DataMaskPolicyJobRunDtl Per-object job detail (child, FK DataMaskPolicyJobRunId) Standard SOQL
Start a run — REST run API POST /services/data/v67.0/platform/data-resilience/data-mask/policies/{policyId}/run
Abort a run — REST run API POST /services/data/v67.0/platform/data-resilience/data-mask/jobs/{jobRunId}/abort

Concretely:

  • sf sobject describe --sobject DataMaskPolicy → NOT_FOUND (don't retry it against standard API)
  • SELECT ... FROM DataMaskPolicy via sf data query → INVALID_TYPE
  • Query the policy via Tooling: sf data query --use-tooling-api --query "SELECT Id, MasterLabel FROM DataMaskPolicy"
  • Query the job / job-detail via standard API: sf data query --query "SELECT Id, Status FROM DataMaskPolicyJobRun"

Full command reference: references/api-surface.md.


Pick the workflow that matches the request

This skill has three paths. Select ONE up front from what the user asked for, then run every step of that path — none has optional steps:

The user wants to… Run Ends when
Configure/edit a policy and mask records; report how many were masked Workflow A — Mask & report (below) The masked count is reported from the detail rows
Only report how many records were masked by a run that already exists Report only — query the existing job and its detail rows (A5); start nothing The masked count is reported from the detail rows
Cancel / abort / stop a masking run Workflow B — Cancel a run (further below) The job's status is confirmed canceled

Choose by the verb in the request. "Create/edit a policy and run it", "mask the PII" → Workflow A. "How many records were masked" about an existing run → Report only: never start a run to answer it. "Abort", "cancel", "stop the run" → Workflow B only, which targets an existing run and never starts one. A mask-and-report request does not include an abort, and a cancel request does not include a run: do not start a job to "demonstrate" cancelling or to replace one that finished — an unrequested run wastes a full ~5–10 min job (see the pool floor in A4) and masks real sandbox data nobody asked to mask.


Workflow A — Mask & report

A1. Confirm sandbox + capture org context

Verify the org is a sandbox and read its instance URL:

sf org display --target-org <alias> --json

Read only result.instanceUrl and result.isSandbox from the output. Do NOT extract, print, or store result.accessToken — every run-API call below goes through sf api request rest, which authenticates from the CLI's own stored login, so no token ever needs to appear in a command, file, or the report.

A2. Identify or create the policy

Prefer reusing an existing policy (fastest, no deploy):

sf da
Полный SKILL.md на GitHub

Установить platform-datamask-run в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/api-surface.mdreferences/policy-authoring.mdreferences/run-and-abort.mdscripts/poll-job.sh

FAQ

Что делает скилл platform-datamask-run?

Data Mask end-to-end operation on a sandbox: configure a masking policy over PII, run the masking job, poll it to completion, report masked-record results, and abort an in-progress run. Use when the user needs to run, monitor, or cancel a Salesforce Data Mask job, mask PII/sandbox data, or work with DataMaskPolicy / DataMaskPolicyJobRun. TRIGGER when: user runs a data mask job, masks sandbox PII, polls masking status, reports masked records, or aborts a running mask. DO NOT TRIGGER when: writing anonymization Apex by hand (use platform-apex-generate), generating test data (use platform-data-manage), or deploying unrelated metadata (use platform-metadata-deploy).

Как установить скилл platform-datamask-run?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл platform-datamask-run запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить platform-datamask-run с