/sf-platform:platform-dsar-policy-managefrom Salesforce — Platform & Apex
Manages DsarPolicy lifecycle for Right-to-Portability exports: configure subject-root trees, run exports with bounded polling, audit history and coverage gaps. Elicits admin classification decisions on personal data.
Ships in Salesforce — Platform & Apex. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Operate a DsarPolicy — the metadata driving a Right-to-Portability (RTP) export — across
its lifecycle: configure the tree, run an export, audit runs. A DsarPolicy is a
read/export map: it names which of a subject's records an export collects. It never deletes
anything. The value here is judgment, not XML plumbing.
FIRST LINE OF EVERY RESPONSE — do not narrate the skill. Your first output token is work or the answer, never a play-by-play. Do not open with "This is a coverage-gap audit / Workflow D…", "Let me read the skill's guide/mechanics…", "Per rule #1…", or "Let me discover the SOR…". Don't name the workflow, announce which reference files you're about to read, or describe your method before doing it — just start doing it (call the tool) and, when done, present the result. This is load-bearing call #8, stated up front because it governs your very first token. A plain-language sentence about the user's data/org is fine; a sentence about the skill, its workflows, rules, tools, or files is not.
These override any leading phrasing in the request. Read them first, every time. Call #1 is the
literal first action of every task — before you pick a workflow, before any sf command.
sf/endpoint call, no exceptions. The very
first action of every task here — including a trivial read-only "does a policy exist / list the
policies" lookup — is to scan this run's available tools for a capability-routing tool exposing
discover / describe / dispatch verbs (project-codey / Headless 360 today; any host prefix such
as mcp__<host>__discover; match the verb shape, not a fixed name). If one is present, that is
the entry move: discover → describe → dispatch the DsarPolicyManager SOR (owner Privacy
Center; isActive gates execute/edit/delete) and reject look-alikes (data mask, generic consent,
subject erasure). Do not reach for sf first — grabbing sf on reflex because the task
"looks like a quick lookup" is the top recurring miss, and it is wrong even when it would work.
sf is the fallback only when no routing tool is in reach (checking sf org list to see which
orgs are authenticated locally is fine — that is a client-side auth check, not a SOR call). Every
sf command shown in the workflows below is the no-routing-tool
spelling; when the routing tool is present, dispatch the equivalent operation through it instead.
Detail: references/headless-sor.md.NOT_FOUND / "This file isn't ready yet" — the
contract working, not a failure. Poll ≈2–3×; if still not terminal, stop and ask the user
whether to keep polling — don't loop. A run can sit non-terminal indefinitely on downstream
async processing — platform / Tool Factory territory, not this skill's to diagnose or reach
into; report status in plain terms (running / completed / errored) and let the user decide.
Never download before terminal. A failed run can return HTTP 201 — read the envelope /
RequestStatus in the body, not the HTTP code. getfile segment is dsr, not dsar.DsarPolicyLog. Not installListView,
not a UI list; it starts no run.getAccessInfo, dispatch_readonly, etc.). These steer how you work —
they are not status updates. (The harness still shows its own plain tool-call lines; that is fine —
just don't add your own play-by-play.) What the user DOES see: the final answer, and — where a
call requires it — a plain-language question (AskUserQuestion) or a short scope/consent line about
their org ("I only listed policies; I changed nothing", "this exports, it doesn't delete"). Rule
of thumb: a sentence about their data/org can be user-facing; a sentence about the skill, its
workflows, steps, tools, rules, or files stays internal. Workflow D's method preamble is the one
allowed "here's how I'll do it" line, and even it must be plain-language about the audit approach
("I'll look one level out from your policy's objects and flag fields that might hold personal
data") — it names no workflow letter, rule, tool, or file. That preamble is not a licence to
say "this is Workflow D" or "let me read the mechanics".Each entity is reached a different way — guessing the surface is the top time-sink.
| Entity | What it is | How you reach it |
|---|---|---|
DsarPolicy | Policy shell + lifecycle (ACTIVE/INACTIVE) | Metadata API |
DsarPolicyPath | A tree node: a root object, or a parent→related relationship | Metadata API (child of DsarPolicy) |
DsarPolicyField | A field collected at a path | Metadata API (child of a path) |
DsarPolicyLog | Run log (one row per run) | Standard SOQL |
| Execute an export | — | Connect DSR endpoint (POST) |
| Status / getfile | — | Connect DSR endpoint on the handle; getfile segment dsr |
Resolve the exact Connect route through the routing tool's describe; only when no router is available,
use the verified-contract/sf fallback in references/export-and-history.md. Don't
sf sobject describe DsarPolicy* — the tree is metadata; only DsarPolicyLog answers standard
SOQL. On an MCP surface, each row is one DsarPolicyManager operation.
| Want to… | Run | Ends when |
|---|---|---|
| Set up / edit a policy tree | A — Configure | Bounded policy authored INACTIVE; or an unbounded request's cap is named / an under-specified one's decisions enumerated — and stops |
| Run an export for a subject | B — Export | Subject resolved to a root Id, run status read (running/completed/errored), file located on success — or, if still running after a couple polls, the user is asked whether to continue |
| See past runs | C — History | Prior runs reported from DsarPolicyLog, no run started |
| Find PII not yet covered | D — Coverage gap | Candidates surfaced with per-field reasons, disposition left to the admin — read-only |
Mixed request → do the one asked; don't add an export to a configure, or a run to a history.
Every workflow below assumes call #1 is already done — you have routed through the discover/
describe/dispatch SOR tool (or confirmed none is in reach). The sf
commands in each workflow are the no-routing-tool spelling; with the routing tool present, dispatch
the equivalent operation through it.
Recipe (metadata shape, relationship/field resolution, lifecycle transitions): references/configure.md.
sf org list metadata --metadata-type DsarPolicy --target-org <alias> --json
sf sobject describe --sobject <NamedObject> --target-org <alias> --json
If DsarPolicy can't be listed/described, surface it and stop (accepted terminal outcome).python3 scripts/validate-policy-tree.py <tree.json>
Checks children≤10, depth≤10, nodes≤200, and devname [a-zA-Z]+[a-zA-Z0-9_]*.${outputDir}, faithful to the sanctioned strategy — add no
unapproved path, drop none approved.
Lifecycle gate: INACTIVE to edit/delete, ACTIVE to execute. Change an ACTIVE policy by deactivate → edit → STOP; get explicit user confirmation before reactivating (call #7).
sf project deploy start --source-dir <outputDir> --target-org <alias> --json.
Deploy may fail where the type isn't fully enabled — surface the raw error + prerequisite; don't
fake success. The classification work is valid regardless.references/report-format.md. Never a truncated tree called "complete".Endpoints, sample envelopes, poll/download sequence: references/export-and-history.md.
dataSubjectId.
Resolve to the Id of a record whose type is a ROOT of the chosen policy (Account / Contact /
Individual / Lead / User) — e.g. SOQL Lead/Contact by Email. Confirm the type is a policy
root (execute matches only the root subtree of the subject's type — a non-root subject exports
nothing). On 0 / many / non-root matches, stop and report; never execute a guessed Id.describe, or the verified-contract fallback in references/export-and-history.md when no router is available.
<policy> for
<subject> — confirm?"). Never pick silently.401/403, name the guard and stop — user perm Consent.CAN_EXECUTE_DSAR_POLICY,
org feature Consent.hasDsarPortability. State the poll-then-download ordering even on this
error path (accepted terminal outcome; don't retry blindly).AskUserQuestion; clear
authorization → proceed.DsarPolicyLog.RequestStatus). Early NOT_FOUND / "not ready" is expected. Still not terminal
after a couple polls → stop and ask whether to keep polling; don't loop (non-terminal =
downstream async, not this skill's to diagnose). Report running / completed / errored.dsr. A dsar segment 404s. Report where the
export landed.references/report-format.md: resolved subject (id + type) and policy chosen
(+ that you asked if ambiguous); consent confirmed; export not deletion; outcome from the
envelope / run status in plain terms; file location on success; poll ordering explicit (couple of
polls, file only after terminal, asked if still running). State the ordering even if preconditions
blocked the run.sf data query --target-org <alias> \
--query "SELECT Id, DsarPolicyId, RequestStatus, CreatedDate FROM DsarPolicyLog WHERE DsarPolicyId = '<POLICY_ID>' ORDER BY CreatedDate DESC"
Report prior runs (when, status); "no prior runs" is valid. On absent log / 401/403/404,
surface the raw error + prerequisite. Don't execute the policy; don't use installListView / a UI list.
"What personal data isn't covered yet?" Read-only, deterministic — surfaces candidates for the
admin; classifies nothing, adds/activates nothing. Script + rubric: references/gap-analysis-guide.md;
mechanics: references/gap-scan.md.
--json describe into the turn — a full describe is ~100KB and the accumulated payloads
overflow the event stream, truncating the run before it writes the report (the top failure here).
Project every describe to {name,type,label} first (see references/gap-scan.md). If the
policy/type can't be read (feature off — the accepted env path), stop at a single projected
root describe; don't fan out. Write the report from the root + a couple of one-hop describes,
name the objects you skipped, offer them via the depth gate. The written report is the
deliverable — draft it early and write it; don't gather everything first.| Situation | Do |
|---|---|
| Starting ANY task (even a trivial "list/does-a-policy-exist" read) | FIRST scan this run's tools for a discover/describe/dispatch routing tool (project-codey/Headless 360; any mcp__<host>__… name — match the verb shape). Present → discover/describe/dispatch the DsarPolicyManager SOR. Do NOT open with sf on reflex. sf only when no routing tool is in reach (sf org list for local auth is exempt) |
| "Capture everything / whole graph" | Exceeds caps (10/10/200) — name the cap, offer split/prune; don't walk the graph |
| "What PII are we missing?" | Workflow D — read-only depth-1; candidates + reason; disposition to admin; add/activate nothing |
| Subject given by email/name, no Id | Resolve first (B0): query the policy's root entities; confirm a root type; 0 / many / non-root → stop |
| Multiple ACTIVE policies could match | Confirm which with the user before running — never silent |
Run stuck In Progress after a couple polls | Downstream async (Tool Factory / platform), not the skill's to diagnose — report still running, ask whether to keep polling; don't loop |
getfile "not ready" / NOT_FOUND | Expected pre-terminal — poll again; not a failure |
| HTTP 201 on execute | Not success — read the envelope status |
| getfile 404 | Segment must be dsr, not dsar |
| Just edited an ACTIVE policy | Don't auto-reactivate — stop, report, get explicit confirmation (call #6) |
sf sobject describe DsarPolicy empty | Tree is Metadata-API; only DsarPolicyLog answers SOQL |
DsarPolicy type absent | Surface + stop; don't fabricate |
401/403/404 or missing type | Name the prerequisite and stop; no blind retries |
${outputDir}/report.md)Report only the workflow you ran; each command once; the key result in the first screenful.
Be concise — state each load-bearing point (poll ordering, export-not-deletion, the
one-level limit) once, not restated across an intro, an aside, and a next-steps list; keep it
well under ~150 lines and don't paste exhaustive per-object dumps. On a preflight-error path (feature
/ policy / subject absent), name the blocker + prerequisite, state the ordering once, and stop —
short. Per-workflow contracts (incl. the INACTIVE / confirmed-reactivation lifecycle and the poll
ordering): references/report-format.md.
| File | When |
|---|---|
references/headless-sor.md | MCP surface: discover→describe→dispatch the SOR, reject look-alikes, sf fallback |
references/configure.md | Metadata shape, root/relationship resolution, <tree.json> input, lifecycle, multi-root |
references/export-and-history.md | DSR execute/status/getfile routes, envelopes, poll sequence, dsr segment, history query |
references/report-format.md | Per-workflow report contracts |
references/gap-analysis-guide.md | Workflow D: audit script, steps, candidate-flagging rubric |
references/gap-scan.md | Workflow D mechanics: one-hop enumeration, diff, depth gate, report shape |
scripts/validate-policy-tree.py | Deterministic cap + devname check before authoring |
references/configure.md (opens in a new tab)references/export-and-history.md (opens in a new tab)references/gap-analysis-guide.md (opens in a new tab)references/gap-scan.md (opens in a new tab)references/headless-sor.md (opens in a new tab)references/report-format.md (opens in a new tab)scripts/tests/__init__.py (opens in a new tab)scripts/tests/test_validate_policy_tree.py (opens in a new tab)scripts/validate-policy-tree.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
3 plugins ship this exact skill · first indexed Nov 14, 2026
43 skills in this plugin
/crm-analytics-wave-generateUse to build a Wave Recipe, deploy a CRM Analytics dataset or dashboard, or author the full CRMA asset stack — apps, Wave Recipes (.wdpr), datasets, and dashboards — against a connected Salesforce org via REST and Metadata APIs, without CRM Analytics Studio or Dashboard Builder. TRIGGER when: user asks to build or create a Wave Recipe, generate a .wdpr or .wdpr-meta.xml, deploy a .wdash or .wapp, run a recipe or dataflowjob programmatically, upload CSV data via InsightsExternalData, validate a dataset schema with synthetic data, fetch dataset XMD, audit dashboard SAQL re-encoding, or find unused dataset fields. TRIGGER on keywords: Wave Recipe, CRMA, CRM Analytics, wdpr, wdash, wapp, WaveRecipe, Wave dataflow, dataflowjob, InsightsExternalData, SAQL, dataset XMD, Analytics Studio, R3 format, wave/recipes, wave/dashboards, or analytics on Salesforce objects (opportunities, leads, cases, accounts, sales). DO NOT TRIGGER for standard Salesforce reports or LWC components unrelated to CRM Analytics./design-systems-slds2-migrateMigrate Lightning Web Components from SLDS 1 to SLDS 2 by running the SLDS linter and fixing violations. Use this skill whenever users mention SLDS 2, SLDS uplift, linter violations, LWC token migration, class overrides, hardcoded CSS values that need SLDS hook replacement, or styling hook selection. Covers all styling hook categories — color, spacing, sizing, typography, borders, radius, and shadows. Also use when users mention no-hardcoded-values, no-slds-class-overrides, lwc-to-slds-hooks, no-deprecated-tokens-slds1, or ask about SLDS component migration — even if they don't explicitly say "uplift" or "migration".npx claudepluginhub reej-consulting/reej-sf-skills --plugin sf-platformOther plugins' skills for the same job