--- name: platform-policy-rule-generate description: "Use this skill when authoring PolicyRuleDefinition and PolicyRuleDefinitionSet metadata XML for Salesforce Data Cloud governance policies, or when editing *.policyRuleDefinition / *.policyRuleDefinitionSet files. Covers the category decision tree, full schema for all policy variants (ACCESS, GOVERNANCE, RECORD, TRANSFORM), UI-compatibility rules for the Data Governance Policy Builder, output hygiene for user-facing agent responses, and validation guardrails. Do NOT use this skill for UserAccessPolicy, AccessPolicy, SharingRules, PermissionSet, or any other access-control metadata type — those have their own types and live outside the PolicyRuleDefinition schema." metadata: version: "1.0" domains: ["Platform", "Data 360"] minApiVersion: "64.0" cliTools: - tool: ["jq"] semver: ">=1.6.0" - tool: ["sf"] semver: ">=2.0.0" --- # Authoring Policy Rule Definitions **Gating:** requires the `EnforceOMatic` and `PolicyRuleMDAPI` org permissions. **Min API version:** 64.0 (66.0 for conditions using `PolicyJsonExpression`). This skill covers the **on-disk metadata XML format** for authoring policies. Use it whenever a task asks to write a `*.policyRuleDefinition` or `*.policyRuleDefinitionSet` file, or ship a metadata package containing them. The runtime side (RuleProvider, hooks) is out of scope. --- > **Eval coverage:** This skill is exercised by the team's ADK eval framework, not by `tests/evals/` under the skill directory. Five datasets covering the ACCESS / GOVERNANCE / RECORD / TRANSFORM variants live in `packages/adk-eval/eval/domains/platform-policy-rule-generate/datasets/`. ## 1. Package Layout A deployable package always contains: ```text / package.xml policyRuleDefinitionSets/.policyRuleDefinitionSet policyRuleDefinitions/.policyRuleDefinition ``` `package.xml` template (use `[ftest]` for ftests, `64.0` or higher for real orgs): ```xml Rule0 PolicyRuleDefinition Set1 PolicyRuleDefinitionSet 64.0 ``` --- ## 2. PolicyRuleDefinitionSet Schema ```xml Optional free text false true ``` | Element | Req | Notes | |---------|-----|-------| | `