forcedotcom/sf-skills/platform-dsar-policy-manage
Claude Code and agent skill by forcedotcom/sf-skills
- community
Checking that the SKILL.md file is still in the repository.
Set up, edit, run, and audit a customer's personal-data portability map (DsarPolicy / Right-to-Portability export). Use for choosing subject roots, follow/stop relationships and fields, including requests to figure out what counts as personal data: elicit the admin's classification decisions, never guess. Covers inactive policy authoring/review, subject resolution, ACTIVE-policy export with bounded polling and terminal-only download, history and coverage gaps. This end-to-end workflow can dispa…
Install
npx vskill@latest install forcedotcom/sf-skills/platform-dsar-policy-manageSKILL.md
The same SKILL.md was published earlier as forcedotcom/sf-skills/platform-dsar-policy-manage.
platform-dsar-policy-manage: DsarPolicy Right to Portability, end to end
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 orthe answer*, never a play-by-play. Do not open with "This is a coverage-gap audit / WorkflowD…", "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 yourmethod 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. Aplain-language sentence about the user's data/org is fine; a sentence about *the skill, itsworkflows, rules, tools, or files* is not.
Load-bearing calls (get these right or the task fails)
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.
- Route through the SOR tool FIRST — before any `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.
- Export, never erasure. A run produces an export file; it does not erase/redact/delete the
subject. If the request frames it as deletion ("remove them", "erase", "clear out"), correct that first and never report the subject as erased. Erasure is a separate mechanism — if that's the goal, say so and stop. You may still export if authorization is clear, after correcting the premise.
- Do not guess personal data. Which objects/relationships hold the subject's data is the
admin's classification call. If the request delegates it ("figure out what counts", "wire the whole thing up"), do not author a guessed tree — enumerate the decisions the admin must make (roots; per-relationship follow/stop; fields), mark any proposal pending admin disposition. An over-broad guess exports other people's records.
- Caps are hard — name the cap and stop; don't graph-walk. Tree caps: **10 children/path, depth
10, 200 nodes. An unbounded request ("everything", "the whole graph") cannot fit. Do not** enumerate the object graph to "try" (never finishes, burns the turn). Name the specific cap exceeded and offer a bounded alternative (split policies, prune branches). Never silently truncate.
- Poll a couple of times, then ask — don't block on terminal. The run handle serves status
and file. An early getfile returns 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.
- History is a read. Run history = a SOQL query over `DsarPolicyLog`. Not
installListView,
not a UI list; it starts no run.
- Never auto-activate or republish. Activation is a deliberate, human-confirmed step. Editing an
ACTIVE policy needs it deactivated first — deactivate → edit → stop, report, get explicit user confirmation before reactivating. New policies stay INACTIVE until the user activates. Auto-republishing breaks the reviewable audit trail disputes depend on.
- **Work silently — never narrate the skill's internals (applies to every workflow; see the
masthead above). The user asked a domain question; answer it, don't describe how the skill answers it. Run the tools and present the result — no intermediate narration of: that you are about to read / are reading the skill's guide, mechanics, or reference files ("let me read the skill's guide and mechanics"); which workflow this is ("this is a coverage-gap audit / Workflow D", "Workflow C-style read") — the user does not think in workflow letters, so never name one; which SOR/routing tool you're using or that you're "loading schemas / discovering / dispatching"; the load-bearing rule numbers ("per rule #1"); the reject-look-alikes step; the operation graph or GET-vs-dispatch plumbing (`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".
The DsarPolicy object model
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.
Pick the workflow (by the verb)
| 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.
Workflow A — Configure
Recipe (metadata shape, relationship/field resolution, lifecycle transitions): references/configure.md.
- Classify first — short-circuit before any describe. Three shapes; two never reach authoring:
- Unbounded ("everything", "whole graph") — can't fit caps. Don't describe/walk. Write the
cap-refusal report (call #3), stop.
- Under-specified — delegates classification, no root/field named. Don't author a guess.
Write the elicitation report (the admin's decisions; support multiple roots; proposals pending disposition), stop.
- Bounded & specified — named roots/relationships/fields fitting the caps → continue.
- Confirm type + describe named objects only (don't assume names, don't expand beyond what's named):
``bash 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).
- Validate the tree (don't eyeball caps/names):
``bash python3 scripts/validate-policy-tree.py <tree.json> ` Checks children≤10, depth≤10, nodes≤200, and devname [a-zA-Z]+[a-zA-Z0-9_]*`.
- Author metadata INACTIVE under
${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).
- Deploy (best effort):
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.
- Report the outcome reached — cap-refusal / elicitation / authored — per
references/report-format.md. Never a truncated tree called "complete".
Workflow B — Run an export
Endpoints, sample envelopes, poll/download sequence: references/export-and-history.md.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/platform-dsar-policy-manage/SKILL.md
Popularity
- Repository stars
- 1,054
- Repository forks
- 353
- 7-day trend score
- 40
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/forcedotcom/sf-skills/platform-dsar-policy-manage)