forcedotcom/sf-skills / skills/platform-policy-rule-generate
platform-policy-rule-generate
VerifiedTHE skill for creating a Data Cloud / Data Governance access policy — authors and deploys a PolicyRuleDefinitionSet + PolicyRuleDefinition pair (CRUD) covering OLS, FLS, RLS, masking/transform, and tag/classification-based access for the DATACLOUD or ALL consumer. TRIGGER when the user wants to create/write/author a Data Cloud or Data Governance policy, access policy, or policy rule, or to grant access to a Data Cloud object THROUGH A POLICY — a Data Cloud policy-create request routes here, not to the tag/classification surface. Resolves every reference via Data 360 MCP. SCOPE: Data Cloud policies only (not Security Center, DSAR, or User Access Policies). DO NOT TRIGGER to create tags/classifications, or to grant object/dataspace access via a PERMISSION SET / RBAC grant (use platform-dataspace-access-configure). For a vague object-access ask, surface both skills and ASK the permission-set way vs the policy way; if unsure the object is Data Cloud, ask which first.
references/conjunction-expression.md
View on GitHub# Conjunction Expressions
Conditions are numbered in document order, starting at `1`. The `<conjunctionExpression>` uses those numbers in prefix notation.
For six conditions grouped as two entity-type checks, two principal checks, and two tag checks:
```xml
<conjunctionExpression>(AND (OR 1 2) (AND 3 4) (AND 5 6))</conjunctionExpression>
```
**Top-level operator must always be `AND`.** Never emit a bare top-level `(OR 1 2)` — the UI treats it as `// ERROR: Unsupported rule!` and silently drops the rule — and never emit a bare top-level condition index for a tag/classification, permission, record-field or dataspace condition (e.g. `3` instead of `(AND 3)`), which crashes the builder — a lone permission or tag condition is still wrapped. **The one exception** is a solitary `ENTITYTYPE IS FIELD` condition in an FLS or Transform rule, which the builder itself persists bare (see `examples/FieldReadDeny` and `examples/LastCharactersFieldMasking`); the `OBJECT`/`FIELD` pair in OLS is still an `(OR 1 2)` group. `OR` is allowed only inside a single section's local group, never as (or at) the top level. Wrap every local group under a top-level `AND`: `(AND (OR 1 2))`, `(AND 3)`. See `ui-compatibility.md` for the full non-round-trip checklist.
FLS deny (field-only) with three alternative tags and a permission exemption — bare `ENTITYTYPE` (1), tag group (2-4), permission group (5):
```xml
<conjunctionExpression>(AND 1 (OR 2 3 4) (AND 5))</conjunctionExpression>
```
The permission exemption is a `CONTAINS_NONE` `ASSIGNED_PERMISSIONS_PATH` condition inside `when`, never an `UNLESS`. Leaving it as a bare `5` saves and deploys but the builder cannot open the policy.
Construction:
1. Number every `<conditions>` element from top to bottom.
2. Build each local group using those numbers.
3. Combine the groups with the top-level `AND` operator — never a bare top-level `OR` or a bare index.
4. Check that every referenced number exists exactly once in the intended expression.
Do not renumber conditions after changing their order without updating the expression.
An `EXISTS` resource expression can contain nested `policyRuleDefinitionCondition` elements. Its `whereClauseConjunction` has a separate one-indexed namespace. For one nested condition, use `<whereClauseConjunction>1</whereClauseConjunction>` exactly as preserved by the semantic `ExistsJoinRLS` example.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |