@salesforce/afv-skills 1.24.0 → 1.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/skills/commerce-b2b-open-code-components-replace/SKILL.md +244 -0
- package/skills/commerce-b2b-open-code-components-replace/assets/ootb-to-open-code-mapping.json +66 -0
- package/skills/dx-devops-test-failures-analyze/SKILL.md +89 -0
- package/skills/dx-devops-test-failures-analyze/references/code-analyzer-violations.md +26 -0
- package/skills/dx-devops-test-failures-analyze/references/failure-categories.md +85 -0
- package/skills/{checking-devops-prerequisites/SKILL.md → dx-devops-test-failures-analyze/references/prerequisite-checks.md} +8 -37
- package/skills/{creating-fix-work-item/SKILL.md → dx-devops-test-failures-analyze/references/work-item-creation.md} +8 -12
- package/skills/dx-devops-test-pipeline-configure/SKILL.md +72 -0
- package/skills/dx-devops-test-pipeline-configure/references/configuring-quality-gate.md +133 -0
- package/skills/dx-devops-test-pipeline-configure/references/configuring-test-provider.md +80 -0
- package/skills/dx-devops-test-pipeline-configure/references/error-handling.md +39 -0
- package/skills/dx-devops-test-pipeline-configure/references/gotchas.md +37 -0
- package/skills/dx-devops-test-pipeline-configure/references/prerequisite-checks.md +112 -0
- package/skills/dx-devops-test-pipeline-configure/references/syncing-test-providers.md +69 -0
- package/skills/dx-devops-test-suite-assignments-configure/SKILL.md +74 -0
- package/skills/dx-devops-test-suite-assignments-configure/references/api-endpoint.md +30 -0
- package/skills/dx-devops-test-suite-assignments-configure/references/error-handling.md +14 -0
- package/skills/dx-devops-test-suite-assignments-configure/references/prerequisite-checks.md +112 -0
- package/skills/{recommending-devops-tests/SKILL.md → dx-devops-test-suite-assignments-configure/references/recommendation-logic.md} +10 -26
- package/skills/dx-devops-test-suite-assignments-configure/references/suite-assignment-modes.md +99 -0
- package/skills/dx-devops-test-suite-run/SKILL.md +111 -0
- package/skills/dx-devops-test-suite-run/references/error-handling.md +31 -0
- package/skills/dx-devops-test-suite-run/references/polling-configuration.md +78 -0
- package/skills/dx-devops-test-suite-run/references/prerequisite-checks.md +112 -0
- package/skills/dx-devops-test-suite-run/references/retrigger-mode.md +51 -0
- package/skills/dx-org-manage/SKILL.md +192 -0
- package/skills/dx-org-manage/examples/README.md +45 -0
- package/skills/dx-org-manage/examples/scratch-orgs/error_no_devhub.json +9 -0
- package/skills/dx-org-manage/examples/scratch-orgs/error_timeout.json +13 -0
- package/skills/dx-org-manage/examples/scratch-orgs/success_definition_file.json +28 -0
- package/skills/dx-org-manage/examples/scratch-orgs/success_edition.json +26 -0
- package/skills/dx-org-manage/examples/scratch-orgs/success_snapshot.json +27 -0
- package/skills/dx-org-manage/examples/snapshots/error_output.json +9 -0
- package/skills/dx-org-manage/examples/snapshots/success_output.json +15 -0
- package/skills/dx-org-manage/references/cli_flags.md +67 -0
- package/skills/dx-org-manage/references/creating-scratch-org.md +164 -0
- package/skills/dx-org-manage/references/creating-snapshot.md +103 -0
- package/skills/dx-org-manage/references/definition_file_options.md +224 -0
- package/skills/dx-org-manage/references/edition_types.md +78 -0
- package/skills/dx-org-manage/references/opening-org.md +160 -0
- package/skills/dx-org-manage/references/snapshot_usage.md +74 -0
- package/skills/dx-org-permission-set-assign/SKILL.md +98 -0
- package/skills/dx-org-permission-set-assign/examples/error_output.json +19 -0
- package/skills/dx-org-permission-set-assign/examples/success_output.json +16 -0
- package/skills/dx-org-permission-set-assign/references/cli_flags.md +68 -0
- package/skills/experience-cms-brand-apply/SKILL.md +1 -1
- package/skills/experience-ui-bundle-app-coordinate/SKILL.md +31 -19
- package/skills/experience-ui-bundle-file-upload-generate/SKILL.md +1 -1
- package/skills/experience-ui-bundle-frontend-generate/implementation/header-footer.md +1 -1
- package/skills/experience-ui-bundle-salesforce-data-access/SKILL.md +336 -581
- package/skills/experience-ui-bundle-salesforce-data-access/references/caching.md +172 -0
- package/skills/experience-ui-bundle-salesforce-data-access/references/graphiti-cli.md +373 -0
- package/skills/experience-ui-bundle-salesforce-data-access/references/graphql-hand-authoring.md +376 -0
- package/skills/experience-ui-bundle-salesforce-data-access/references/migration.md +119 -0
- package/skills/experience-ui-bundle-salesforce-data-access/references/rest-and-integration.md +152 -0
- package/skills/experience-ui-bundle-salesforce-data-access/references/sdk-api.md +217 -0
- package/skills/experience-ui-bundle-salesforce-data-access/scripts/graphql-search.sh +36 -9
- package/skills/platform-agentsetup-categories-fetch/SKILL.md +109 -0
- package/skills/platform-agentsetup-categories-fetch/references/api-response-schema.md +121 -0
- package/skills/platform-custom-object-generate/SKILL.md +62 -7
- package/skills/platform-custom-object-generate/references/description-enrichment.md +125 -0
- package/skills/platform-metadata-retrieve/SKILL.md +121 -0
- package/skills/platform-metadata-retrieve/examples/error_output.json +10 -0
- package/skills/platform-metadata-retrieve/examples/success_output.json +27 -0
- package/skills/platform-metadata-retrieve/references/cli_flags.md +138 -0
- package/skills/platform-metadata-retrieve/references/retrieval_modes.md +181 -0
- package/skills/platform-sharing-rules-generate/SKILL.md +165 -0
- package/skills/platform-sharing-rules-generate/references/rule-types.md +199 -0
- package/skills/platform-tracing-agentforce-configure/SKILL.md +118 -0
- package/skills/platform-tracing-agentforce-configure/assets/AgentforcePlatformTracing-template.xml +4 -0
- package/skills/platform-tracing-configure/SKILL.md +118 -0
- package/skills/platform-tracing-configure/assets/EventSettings-template.xml +4 -0
- package/skills/platform-trust-archive-manage/SKILL.md +25 -11
- package/skills/platform-trust-archive-manage/examples/monitor-failed-jobs.md +2 -2
- package/skills/platform-trust-archive-manage/references/archive-activity-entity.md +1 -1
- package/skills/platform-trust-archive-manage/references/connect-api-operations.md +51 -12
- package/skills/analyzing-test-failures/SKILL.md +0 -159
- package/skills/configuring-quality-gate/SKILL.md +0 -120
- package/skills/configuring-test-provider/SKILL.md +0 -113
- package/skills/managing-suite-assignments/SKILL.md +0 -161
- package/skills/polling-test-results/SKILL.md +0 -72
- package/skills/running-devops-test-suite/SKILL.md +0 -144
- package/skills/syncing-test-providers/SKILL.md +0 -108
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: platform-sharing-rules-generate
|
|
3
|
+
description: "Use this skill when users need to create, generate, or modify Salesforce Sharing Rules metadata. TRIGGER when: users mention sharing rules, record sharing, criteria-based sharing, role-based sharing, guest user sharing, portal user sharing, sharingRules, sharingCriteriaRules, sharingGuestRules, sharingOwnerRules, .sharingRules-meta.xml files, or ask to share records with specific roles or groups. Also trigger when users want to configure record-level access beyond org-wide defaults (OWD), share object records with roles, groups, or guest users, or set up Experience Site guest user record visibility. SKIP when: user needs permission sets or profiles (use platform-permission-set-generate), or needs object-level security rather than record-level sharing (use platform-permission-set-generate)."
|
|
4
|
+
metadata:
|
|
5
|
+
version: "1.0"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Sharing Rules Generator
|
|
9
|
+
|
|
10
|
+
Generate Salesforce Sharing Rules metadata to control record-level access beyond org-wide defaults. Supports criteria-based rules, role/group-based owner rules, and guest user rules for Experience Sites.
|
|
11
|
+
|
|
12
|
+
## Scope
|
|
13
|
+
|
|
14
|
+
- **In scope**: Generating `sharingCriteriaRules`, `sharingOwnerRules`, and `sharingGuestRules` metadata; retrieving existing sharing rules from an org; appending new rules to existing files; configuring rules for Guest and Portal profiles.
|
|
15
|
+
- **Out of scope**: Changing org-wide defaults (OWD/sharing model), creating Experience Sites, configuring permission sets or profiles (use `platform-permission-set-generate`), territory-based sharing rules.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Clarifying Questions
|
|
20
|
+
|
|
21
|
+
Before generating, confirm with the user if not already clear:
|
|
22
|
+
|
|
23
|
+
- Which object should the sharing rule apply to? (standard or custom object API name)
|
|
24
|
+
- What type of rule? (criteria-based, role/group-based owner rule, or guest user rule)
|
|
25
|
+
- Who should records be shared with? (role name, group, portal role, or guest user nickname)
|
|
26
|
+
- What access level? (Read or Read/Write)
|
|
27
|
+
- For criteria-based rules: what field conditions should match?
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Required Inputs
|
|
32
|
+
|
|
33
|
+
Gather or infer before proceeding:
|
|
34
|
+
|
|
35
|
+
- **Object API name**: The sObject the rule targets (e.g., `Account`, `Property__c`)
|
|
36
|
+
- **Rule type**: One of `sharingCriteriaRules`, `sharingOwnerRules`, or `sharingGuestRules`
|
|
37
|
+
- **Shared-to target**: Role, group, portal role, or guest user community nickname
|
|
38
|
+
- **Access level**: `Read` or `Edit` (maps to Read-Only or Read/Write)
|
|
39
|
+
- **Criteria** (for criteria/guest rules): Field name, operation, and value for each filter item
|
|
40
|
+
|
|
41
|
+
Defaults unless specified:
|
|
42
|
+
- Access level: `Read`
|
|
43
|
+
- `includeRecordsOwnedByAll`: `true` for criteria rules
|
|
44
|
+
- `includeHVUOwnedRecords`: `false` for guest rules
|
|
45
|
+
- Account sharing rules include `accountSettings` with all sub-access levels set to `None`
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Workflow
|
|
50
|
+
|
|
51
|
+
All steps are sequential. Do not skip or reorder.
|
|
52
|
+
|
|
53
|
+
### Phase 1 — Discover
|
|
54
|
+
|
|
55
|
+
1. **Resolve the SFDX project path** — find the project's `sfdx-project.json` and identify the package directory for `sharingRules/`.
|
|
56
|
+
|
|
57
|
+
2. **Check for existing sharing rules** — look for `<packageDir>/sharingRules/<ObjectName>.sharingRules-meta.xml`. If found, read it to understand existing rules and avoid duplicates.
|
|
58
|
+
|
|
59
|
+
3. **If no local file exists**, retrieve from the org:
|
|
60
|
+
```sh
|
|
61
|
+
sf project retrieve start --metadata "SharingRules:<ObjectName>" --target-org <org>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Phase 2 — Determine Rule Type
|
|
65
|
+
|
|
66
|
+
4. **Select the rule type** based on user intent. Read `references/rule-types.md` for the complete schema of each type and its required elements.
|
|
67
|
+
|
|
68
|
+
5. **For Account sharing rules**: the `accountSettings` element is required. Default sub-access levels to `None` unless the user specifies otherwise.
|
|
69
|
+
|
|
70
|
+
6. **For Guest rules**: the `sharedTo` must use `<guestUser>` with the site guest user's community nickname. Never use `<role>` or `<group>` for guest rules.
|
|
71
|
+
|
|
72
|
+
### Phase 3 — Generate
|
|
73
|
+
|
|
74
|
+
7. **Construct the XML** following the schema in `references/rule-types.md`. Key structure:
|
|
75
|
+
- One `.sharingRules-meta.xml` file per object
|
|
76
|
+
- All rules for the same object go in the same file
|
|
77
|
+
- If appending to an existing file, add the new rule element inside the existing `<SharingRules>` root
|
|
78
|
+
|
|
79
|
+
8. **Name the rule** — derive `<fullName>` from the intent (PascalCase, no spaces, descriptive). Generate a matching `<label>` in Title Case with spaces.
|
|
80
|
+
|
|
81
|
+
9. **Write the file** to `<packageDir>/sharingRules/<ObjectName>.sharingRules-meta.xml`.
|
|
82
|
+
|
|
83
|
+
### Phase 4 — Verify
|
|
84
|
+
|
|
85
|
+
10. **Run the verification checklist** below before presenting output.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Verification Checklist
|
|
90
|
+
|
|
91
|
+
### Universal Checks
|
|
92
|
+
- [ ] Does the file have the XML declaration and `<SharingRules xmlns="http://soap.sforce.com/2006/04/metadata">` root?
|
|
93
|
+
- [ ] Is there exactly one file per object with all rules inside it?
|
|
94
|
+
- [ ] Does `<fullName>` use PascalCase with no spaces?
|
|
95
|
+
- [ ] Is `<label>` present and human-readable?
|
|
96
|
+
- [ ] Is `<accessLevel>` one of `Read` or `Edit`?
|
|
97
|
+
|
|
98
|
+
### Criteria Rule Checks
|
|
99
|
+
- [ ] Is `<includeRecordsOwnedByAll>` present (required boolean)?
|
|
100
|
+
- [ ] Does each `<criteriaItems>` have `<field>`, `<operation>`, and `<value>`?
|
|
101
|
+
- [ ] Are picklist values valid for the target org?
|
|
102
|
+
|
|
103
|
+
### Guest Rule Checks CRITICAL
|
|
104
|
+
- [ ] Does `<sharedTo>` use `<guestUser>` (NOT `<role>` or `<group>`)?
|
|
105
|
+
- [ ] Is `<includeHVUOwnedRecords>` present (required boolean)?
|
|
106
|
+
- [ ] Is `<includeRecordsOwnedByAll>` ABSENT (only for criteria rules, not guest rules)?
|
|
107
|
+
|
|
108
|
+
### Owner Rule Checks
|
|
109
|
+
- [ ] Does the rule have both `<sharedFrom>` and `<sharedTo>` elements?
|
|
110
|
+
- [ ] Do both use valid `<role>`, `<roleAndSubordinates>`, or `<group>` targets?
|
|
111
|
+
|
|
112
|
+
### Account-Specific Checks CRITICAL
|
|
113
|
+
- [ ] If object is Account, is `<accountSettings>` present with all three sub-elements?
|
|
114
|
+
- [ ] Are `<caseAccessLevel>`, `<contactAccessLevel>`, `<opportunityAccessLevel>` all set?
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## Rules / Constraints
|
|
119
|
+
|
|
120
|
+
| Constraint | Rationale |
|
|
121
|
+
|-----------|-----------|
|
|
122
|
+
| One `.sharingRules-meta.xml` file per object | Platform requirement — multiple files cause deployment errors |
|
|
123
|
+
| Guest rules must use `<guestUser>` in `sharedTo` | Using `<role>` or `<group>` causes: "Specify a guest user's nickname for the guestUser field" |
|
|
124
|
+
| Account rules require `<accountSettings>` | Without it: "AccountSettings is required for account sharing rules" |
|
|
125
|
+
| `includeRecordsOwnedByAll` is required on criteria rules | Missing it causes: "Required field is missing: sharingCriteriaRules" |
|
|
126
|
+
| `includeHVUOwnedRecords` is required on guest rules | Missing it causes deployment failure |
|
|
127
|
+
| Criteria field values must exist as picklist values on the org | Invalid values cause: "Picklist value does not exist" |
|
|
128
|
+
| Never hardcode file paths — resolve from `sfdx-project.json` | Customer projects use custom package directories |
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## Gotchas
|
|
133
|
+
|
|
134
|
+
| Issue | Resolution |
|
|
135
|
+
|-------|------------|
|
|
136
|
+
| Guest rule uses `<role>` instead of `<guestUser>` | Replace with `<guestUser>CommunityNickname</guestUser>` |
|
|
137
|
+
| Account rule missing `accountSettings` | Add `<accountSettings>` with all three access level sub-elements set to `None` |
|
|
138
|
+
| Criteria rule missing `includeRecordsOwnedByAll` | Add `<includeRecordsOwnedByAll>true</includeRecordsOwnedByAll>` |
|
|
139
|
+
| Picklist value mismatch | Query the org for valid values before generating criteria |
|
|
140
|
+
| Appending duplicates existing rule name | Check existing `<fullName>` values before writing |
|
|
141
|
+
| Guest user nickname not found | Query: `SELECT CommunityNickname FROM User WHERE UserType='Guest' AND IsActive=true` |
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## Output Expectations
|
|
146
|
+
|
|
147
|
+
Deliverables:
|
|
148
|
+
- `<packageDir>/sharingRules/<ObjectName>.sharingRules-meta.xml` — complete sharing rules file for the target object
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## Cross-Skill Integration
|
|
153
|
+
|
|
154
|
+
| Need | Delegate to |
|
|
155
|
+
|------|-------------|
|
|
156
|
+
| Permission set configuration | `platform-permission-set-generate` skill |
|
|
157
|
+
| Custom object creation (if target object doesn't exist) | `platform-custom-object-generate` skill |
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## Reference File Index
|
|
162
|
+
|
|
163
|
+
| File | When to read |
|
|
164
|
+
|------|-------------|
|
|
165
|
+
| `references/rule-types.md` | Phase 2 — before generating any rule, to get the complete XML schema for each rule type |
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# Sharing Rule Types — Complete XML Schema
|
|
2
|
+
|
|
3
|
+
Reference for all supported sharing rule types. Read this before generating any rule.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## File Structure
|
|
8
|
+
|
|
9
|
+
All sharing rules for a single object live in one file:
|
|
10
|
+
|
|
11
|
+
```xml
|
|
12
|
+
<packageDir>/sharingRules/<ObjectName>.sharingRules-meta.xml
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
The root element wraps all rule types:
|
|
16
|
+
|
|
17
|
+
```xml
|
|
18
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
19
|
+
<SharingRules xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
20
|
+
<!-- One or more rule elements of any type -->
|
|
21
|
+
</SharingRules>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Criteria-Based Rules (`sharingCriteriaRules`)
|
|
27
|
+
|
|
28
|
+
Share records that match specific field conditions with a target role, group, or portal role.
|
|
29
|
+
|
|
30
|
+
```xml
|
|
31
|
+
<sharingCriteriaRules>
|
|
32
|
+
<fullName>RuleApiName</fullName>
|
|
33
|
+
<accessLevel>Read</accessLevel>
|
|
34
|
+
<includeRecordsOwnedByAll>true</includeRecordsOwnedByAll>
|
|
35
|
+
<label>Human Readable Rule Name</label>
|
|
36
|
+
<sharedTo>
|
|
37
|
+
<role>RoleDeveloperName</role>
|
|
38
|
+
</sharedTo>
|
|
39
|
+
<criteriaItems>
|
|
40
|
+
<field>FieldApiName</field>
|
|
41
|
+
<operation>equals</operation>
|
|
42
|
+
<value>FieldValue</value>
|
|
43
|
+
</criteriaItems>
|
|
44
|
+
</sharingCriteriaRules>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Required Elements
|
|
48
|
+
|
|
49
|
+
| Element | Type | Notes |
|
|
50
|
+
|---------|------|-------|
|
|
51
|
+
| `fullName` | string | PascalCase API name, unique within the object's sharing rules |
|
|
52
|
+
| `accessLevel` | enum | `Read` or `Edit` |
|
|
53
|
+
| `includeRecordsOwnedByAll` | boolean | `true` = all records matching criteria; `false` = only records not owned by the sharedTo target |
|
|
54
|
+
| `label` | string | Human-readable name displayed in Setup |
|
|
55
|
+
| `sharedTo` | SharedTo | Target users/roles/groups (see SharedTo section below) |
|
|
56
|
+
| `criteriaItems` | FilterItem[] | One or more field criteria (see FilterItem section below) |
|
|
57
|
+
|
|
58
|
+
### Optional Elements
|
|
59
|
+
|
|
60
|
+
| Element | Type | Notes |
|
|
61
|
+
|---------|------|-------|
|
|
62
|
+
| `booleanFilter` | string | Custom logic for multiple criteria (e.g., `"1 AND (2 OR 3)"`) |
|
|
63
|
+
| `description` | string | Optional description |
|
|
64
|
+
| `accountSettings` | AccountSettings | **Required if object is Account** |
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Guest Rules (`sharingGuestRules`)
|
|
69
|
+
|
|
70
|
+
Share records with Experience Site guest (unauthenticated) users. The `sharedTo` MUST use `<guestUser>` — never `<role>` or `<group>`.
|
|
71
|
+
|
|
72
|
+
```xml
|
|
73
|
+
<sharingGuestRules>
|
|
74
|
+
<fullName>ShareRecordsWithSiteGuest</fullName>
|
|
75
|
+
<accessLevel>Read</accessLevel>
|
|
76
|
+
<includeHVUOwnedRecords>false</includeHVUOwnedRecords>
|
|
77
|
+
<label>Share Records With Site Guest</label>
|
|
78
|
+
<sharedTo>
|
|
79
|
+
<guestUser>Site Guest User CommunityNickname</guestUser>
|
|
80
|
+
</sharedTo>
|
|
81
|
+
<criteriaItems>
|
|
82
|
+
<field>Status__c</field>
|
|
83
|
+
<operation>equals</operation>
|
|
84
|
+
<value>Published</value>
|
|
85
|
+
</criteriaItems>
|
|
86
|
+
</sharingGuestRules>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Required Elements
|
|
90
|
+
|
|
91
|
+
| Element | Type | Notes |
|
|
92
|
+
|---------|------|-------|
|
|
93
|
+
| `fullName` | string | PascalCase API name |
|
|
94
|
+
| `accessLevel` | enum | `Read` or `Edit` |
|
|
95
|
+
| `includeHVUOwnedRecords` | boolean | Whether to include records owned by high-volume users |
|
|
96
|
+
| `label` | string | Human-readable name |
|
|
97
|
+
| `sharedTo` | SharedTo | Must contain `<guestUser>` with the CommunityNickname |
|
|
98
|
+
| `criteriaItems` | FilterItem[] | One or more field criteria |
|
|
99
|
+
|
|
100
|
+
### Finding the Guest User Nickname
|
|
101
|
+
|
|
102
|
+
Query the org to find the correct community nickname:
|
|
103
|
+
|
|
104
|
+
```sql
|
|
105
|
+
SELECT CommunityNickname, Name FROM User WHERE UserType = 'Guest' AND IsActive = true
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
The `CommunityNickname` value goes in the `<guestUser>` element.
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Owner Rules (`sharingOwnerRules`)
|
|
113
|
+
|
|
114
|
+
Share records based on record ownership — records owned by users in one role/group are shared with users in another role/group.
|
|
115
|
+
|
|
116
|
+
```xml
|
|
117
|
+
<sharingOwnerRules>
|
|
118
|
+
<fullName>ShareManagerRecordsWithTeam</fullName>
|
|
119
|
+
<accessLevel>Read</accessLevel>
|
|
120
|
+
<label>Share Manager Records With Team</label>
|
|
121
|
+
<sharedFrom>
|
|
122
|
+
<role>Manager</role>
|
|
123
|
+
</sharedFrom>
|
|
124
|
+
<sharedTo>
|
|
125
|
+
<roleAndSubordinates>TeamLead</roleAndSubordinates>
|
|
126
|
+
</sharedTo>
|
|
127
|
+
</sharingOwnerRules>
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Required Elements
|
|
131
|
+
|
|
132
|
+
| Element | Type | Notes |
|
|
133
|
+
|---------|------|-------|
|
|
134
|
+
| `fullName` | string | PascalCase API name |
|
|
135
|
+
| `accessLevel` | enum | `Read` or `Edit` |
|
|
136
|
+
| `label` | string | Human-readable name |
|
|
137
|
+
| `sharedFrom` | SharedTo | Source — whose records are being shared |
|
|
138
|
+
| `sharedTo` | SharedTo | Target — who gets access |
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## SharedTo Element
|
|
143
|
+
|
|
144
|
+
The `<sharedTo>` (and `<sharedFrom>` for owner rules) element specifies the target. Use exactly ONE of these child elements:
|
|
145
|
+
|
|
146
|
+
| Element | Use for |
|
|
147
|
+
|---------|---------|
|
|
148
|
+
| `<role>RoleDeveloperName</role>` | A specific role |
|
|
149
|
+
| `<roleAndSubordinates>RoleName</roleAndSubordinates>` | A role and all subordinates in the hierarchy |
|
|
150
|
+
| `<group>GroupDeveloperName</group>` | A public group |
|
|
151
|
+
| `<guestUser>CommunityNickname</guestUser>` | Experience Site guest user (guest rules only) |
|
|
152
|
+
| `<portalRole>PortalRoleName</portalRole>` | Portal user role |
|
|
153
|
+
| `<portalRoleAndSubordinates>PortalRoleName</portalRoleAndSubordinates>` | Portal role + subordinates |
|
|
154
|
+
| `<allInternalUsers>AllInternalUsers</allInternalUsers>` | All internal users |
|
|
155
|
+
| `<allCustomerPortalUsers>AllCustomerPortalUsers</allCustomerPortalUsers>` | All customer portal users |
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## FilterItem (criteriaItems)
|
|
160
|
+
|
|
161
|
+
Each `<criteriaItems>` element specifies one condition:
|
|
162
|
+
|
|
163
|
+
```xml
|
|
164
|
+
<criteriaItems>
|
|
165
|
+
<field>FieldApiName</field>
|
|
166
|
+
<operation>equals</operation>
|
|
167
|
+
<value>MatchValue</value>
|
|
168
|
+
</criteriaItems>
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
| Element | Required | Notes |
|
|
172
|
+
|---------|----------|-------|
|
|
173
|
+
| `field` | Yes | API name of the field (no object prefix) |
|
|
174
|
+
| `operation` | Yes | One of: `equals`, `notEqual`, `lessThan`, `greaterThan`, `lessOrEqual`, `greaterOrEqual`, `contains`, `notContain`, `startsWith` |
|
|
175
|
+
| `value` | Conditional | Required unless operation is a null check |
|
|
176
|
+
|
|
177
|
+
Multiple `<criteriaItems>` are ANDed by default. Use `<booleanFilter>` for custom logic.
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## AccountSettings (Account object only)
|
|
182
|
+
|
|
183
|
+
When creating sharing rules for the Account object, you MUST include `<accountSettings>`:
|
|
184
|
+
|
|
185
|
+
```xml
|
|
186
|
+
<accountSettings>
|
|
187
|
+
<caseAccessLevel>None</caseAccessLevel>
|
|
188
|
+
<contactAccessLevel>None</contactAccessLevel>
|
|
189
|
+
<opportunityAccessLevel>None</opportunityAccessLevel>
|
|
190
|
+
</accountSettings>
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
| Element | Valid Values | Notes |
|
|
194
|
+
|---------|-------------|-------|
|
|
195
|
+
| `caseAccessLevel` | `None`, `Read`, `Edit` | Access to related Cases |
|
|
196
|
+
| `contactAccessLevel` | `None`, `Read`, `Edit` | Access to related Contacts |
|
|
197
|
+
| `opportunityAccessLevel` | `None`, `Read`, `Edit` | Access to related Opportunities |
|
|
198
|
+
|
|
199
|
+
Place `<accountSettings>` inside the rule element, after `<accessLevel>`.
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: platform-tracing-agentforce-configure
|
|
3
|
+
description: "Generate AgentforcePlatformTracingSettings metadata to enable or disable Agentforce agent execution trace spans flowing to Data Cloud. Use this skill for any AgentforcePlatformTracingSettings metadata work. TRIGGER when: user mentions Agentforce tracing, agent trace spans, Data Cloud tracing, AgentforcePlatformTracingSettings, platform observability tracing, enable agent tracing, wants agent execution spans in Data Cloud, mentions .settings-meta.xml for AgentforcePlatformTracing, or asks about enabling observability for Agentforce agents. DO NOT TRIGGER when: user wants Platform Tracing for TraceSpanEvent (use platform-tracing-configure), wants to query or analyze existing agent trace data in Data Cloud (use agentforce-observe), wants Event Log Files or ELF configuration, wants Change Data Capture (use integration-eventing-cdc-configure), or wants ManagedEventSubscription (use integration-eventing-subscription-configure)."
|
|
4
|
+
metadata:
|
|
5
|
+
version: "1.0"
|
|
6
|
+
minApiVersion: "68.0"
|
|
7
|
+
relatedSkills: platform-tracing-configure
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Platform Tracing — Agentforce Configure
|
|
11
|
+
|
|
12
|
+
Generate AgentforcePlatformTracingSettings metadata to enable or disable forwarding of Agentforce agent execution trace spans to Data Cloud's ingestion pipeline. This is a singleton Settings type with one boolean field introduced in API v68.0 (Spring '25).
|
|
13
|
+
|
|
14
|
+
## Scope
|
|
15
|
+
|
|
16
|
+
- **In scope**: Generating `AgentforcePlatformTracing.settings-meta.xml` to enable or disable Agentforce agent tracing.
|
|
17
|
+
- **Out of scope**: Platform Tracing for TraceSpanEvent (use `platform-tracing-configure`). Event Log Files. Change Data Capture. Org permission provisioning. Data Cloud provisioning.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Prerequisites
|
|
22
|
+
|
|
23
|
+
Before generating, inform the user of these requirements. The skill cannot check org state, but deploying without these prerequisites means the setting has no effect:
|
|
24
|
+
|
|
25
|
+
1. **Data Cloud must be provisioned** in the org — trace spans are forwarded to Data Cloud's ingestion pipeline. Without Data Cloud, there is no destination for the spans.
|
|
26
|
+
2. **`PlatformObservability` org permission** must be active — this permission gates the feature. It is provisioned (not settable via metadata).
|
|
27
|
+
3. **API version 68.0+** — the `AgentforcePlatformTracingSettings` type was introduced in Spring '25. Orgs on older API versions will not recognize it.
|
|
28
|
+
|
|
29
|
+
If the user reports the setting isn't working after deploy, the most likely cause is a missing prerequisite above.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Clarifying Questions
|
|
34
|
+
|
|
35
|
+
Before generating, confirm with the user if not already clear:
|
|
36
|
+
|
|
37
|
+
- Enable or disable? (Which state do you want for Agentforce agent tracing?)
|
|
38
|
+
|
|
39
|
+
No other clarification needed — this is a singleton type with one boolean field.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Required Inputs
|
|
44
|
+
|
|
45
|
+
Gather or infer before proceeding:
|
|
46
|
+
|
|
47
|
+
- **Desired state**: `true` (enable) or `false` (disable)
|
|
48
|
+
|
|
49
|
+
Defaults unless specified:
|
|
50
|
+
- If user says "enable" or "turn on": set to `true`
|
|
51
|
+
- If user says "disable" or "turn off": set to `false`
|
|
52
|
+
|
|
53
|
+
If the user provides a clear request, generate immediately without unnecessary back-and-forth.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Workflow
|
|
58
|
+
|
|
59
|
+
1. **Warn about prerequisites** — inform the user that this feature requires Data Cloud and the `PlatformObservability` org permission.
|
|
60
|
+
|
|
61
|
+
2. **Read the template** — load `assets/AgentforcePlatformTracing-template.xml`.
|
|
62
|
+
|
|
63
|
+
3. **Generate the settings file** — replace `{ENABLED}` with `true` or `false` based on the user's desired state.
|
|
64
|
+
|
|
65
|
+
4. **Place the file** — output to `settings/AgentforcePlatformTracing.settings-meta.xml` in the project's source directory.
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Rules / Constraints
|
|
70
|
+
|
|
71
|
+
| Constraint | Rationale |
|
|
72
|
+
|---|---|
|
|
73
|
+
| Singleton — only one file per org, one boolean field | The metadata type has exactly one instance. Deploying the file sets the org-wide preference. |
|
|
74
|
+
| XML namespace must be `http://soap.sforce.com/2006/04/metadata` | Any other namespace causes deploy failure. |
|
|
75
|
+
| File must be named `AgentforcePlatformTracing.settings-meta.xml` | SFDX source format convention for this Settings type. |
|
|
76
|
+
| Only include `enableAgentforcePlatformTracing` field | No other fields exist on this type. |
|
|
77
|
+
| Requires API v68.0+ | Older orgs reject the metadata type entirely. |
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Gotchas
|
|
82
|
+
|
|
83
|
+
| Issue | Resolution |
|
|
84
|
+
|---|---|
|
|
85
|
+
| Deploy succeeds but tracing doesn't activate | Org lacks `PlatformObservability` permission or Data Cloud is not provisioned. These are provisioned, not settable via metadata. |
|
|
86
|
+
| `AgentforcePlatformTracingSettings` type not recognized | Org or tooling is on API version < 68.0. Update `sfdx-project.json` sourceApiVersion. |
|
|
87
|
+
| User confuses this with Platform Tracing (TraceSpanEvent) | Clarify: this sends Agentforce agent execution spans to Data Cloud. For TraceSpanEvent publishing, use the `platform-tracing-configure` skill. |
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Output Expectations
|
|
92
|
+
|
|
93
|
+
Deliverables:
|
|
94
|
+
- `settings/AgentforcePlatformTracing.settings-meta.xml`
|
|
95
|
+
|
|
96
|
+
Before delivering, verify:
|
|
97
|
+
- [ ] XML namespace is exactly `http://soap.sforce.com/2006/04/metadata`
|
|
98
|
+
- [ ] File is named `AgentforcePlatformTracing.settings-meta.xml`
|
|
99
|
+
- [ ] Only `enableAgentforcePlatformTracing` is present (no extra fields)
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Cross-Skill Integration
|
|
104
|
+
|
|
105
|
+
| Need | Delegate to |
|
|
106
|
+
|---|---|
|
|
107
|
+
| Enable TraceSpanEvent publishing (Platform Tracing) | `platform-tracing-configure` skill |
|
|
108
|
+
| Query or analyze existing Agentforce agent trace data in Data Cloud | `agentforce-observe` skill |
|
|
109
|
+
| Set up Change Data Capture | `integration-eventing-cdc-configure` skill |
|
|
110
|
+
| Configure ManagedEventSubscription | `integration-eventing-subscription-configure` skill |
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Reference File Index
|
|
115
|
+
|
|
116
|
+
| File | When to read |
|
|
117
|
+
|---|---|
|
|
118
|
+
| `assets/AgentforcePlatformTracing-template.xml` | Step 2 — template for generating the settings file |
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: platform-tracing-configure
|
|
3
|
+
description: "Generate EventSettings metadata to enable or disable Platform Tracing (TraceSpanEvent publishing) in Event Monitoring. Use this skill for any EventSettings enablePlatformTracing metadata work. TRIGGER when: user mentions Platform Tracing, TraceSpanEvent, enable tracing in Event Monitoring Settings, event monitoring tracing toggle, enablePlatformTracing, .settings-meta.xml for Event settings tracing, turn on trace span events, or stop publishing trace spans. DO NOT TRIGGER when: user wants Agentforce agent tracing to Data Cloud (use platform-tracing-agentforce-configure), wants Event Log Files or ELF generation, wants Change Data Capture (use integration-eventing-cdc-configure), or wants ManagedEventSubscription (use integration-eventing-subscription-configure)."
|
|
4
|
+
metadata:
|
|
5
|
+
version: "1.0"
|
|
6
|
+
minApiVersion: "68.0"
|
|
7
|
+
relatedSkills: platform-tracing-agentforce-configure
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Platform Tracing — Configure
|
|
11
|
+
|
|
12
|
+
Generate EventSettings metadata to enable or disable the Platform Tracing toggle, which controls whether TraceSpanEvent is published at a sample rate. This modifies a single field (`enablePlatformTracing`) within the existing EventSettings metadata type.
|
|
13
|
+
|
|
14
|
+
## Scope
|
|
15
|
+
|
|
16
|
+
- **In scope**: Generating `Event.settings-meta.xml` with the `enablePlatformTracing` field to enable or disable TraceSpanEvent publishing.
|
|
17
|
+
- **Out of scope**: Agentforce agent tracing to Data Cloud (use `platform-tracing-agentforce-configure`). Other EventSettings fields (`enableDeleteMonitoringData`, `enableLoginForensics`, etc.) owned by other teams. Event Log Files. Change Data Capture.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Prerequisites
|
|
22
|
+
|
|
23
|
+
Before generating, inform the user of these requirements:
|
|
24
|
+
|
|
25
|
+
1. **`PlatformTracing` org permission** must be active — this permission gates the feature. It is provisioned (not settable via metadata). Without it, the setting deploys but TraceSpanEvent is not published.
|
|
26
|
+
2. **API version 68.0+** — `enablePlatformTracing` on EventSettings was introduced in Spring '25. Orgs or tooling on older API versions will not recognize the field. Update `sfdx-project.json` `sourceApiVersion` to `68.0` or higher if on an older tooling version.
|
|
27
|
+
|
|
28
|
+
If the user reports the setting isn't working after deploy, the most likely cause is a missing prerequisite above.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Clarifying Questions
|
|
33
|
+
|
|
34
|
+
Before generating, confirm with the user if not already clear:
|
|
35
|
+
|
|
36
|
+
- Enable or disable? (Which state do you want for Platform Tracing / TraceSpanEvent?)
|
|
37
|
+
|
|
38
|
+
No other clarification needed — this controls a single boolean field.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Required Inputs
|
|
43
|
+
|
|
44
|
+
Gather or infer before proceeding:
|
|
45
|
+
|
|
46
|
+
- **Desired state**: `true` (enable) or `false` (disable)
|
|
47
|
+
|
|
48
|
+
Defaults unless specified:
|
|
49
|
+
- If user says "enable" or "turn on": set to `true`
|
|
50
|
+
- If user says "disable" or "turn off": set to `false`
|
|
51
|
+
|
|
52
|
+
If the user provides a clear request, generate immediately without unnecessary back-and-forth.
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Workflow
|
|
57
|
+
|
|
58
|
+
1. **Warn about prerequisites** — inform the user that this feature requires the `PlatformTracing` org permission and API version 68.0+.
|
|
59
|
+
|
|
60
|
+
2. **Read the template** — load `assets/EventSettings-template.xml`.
|
|
61
|
+
|
|
62
|
+
3. **Generate the settings file** — replace `{ENABLED}` with `true` or `false` based on the user's desired state.
|
|
63
|
+
|
|
64
|
+
4. **Place the file** — output to `settings/Event.settings-meta.xml` in the project's source directory.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Rules / Constraints
|
|
69
|
+
|
|
70
|
+
| Constraint | Rationale |
|
|
71
|
+
|---|---|
|
|
72
|
+
| Only include `enablePlatformTracing` in generated metadata | Other fields in EventSettings are owned by other teams. Including them risks overwriting unrelated settings during deploy. |
|
|
73
|
+
| XML namespace must be `http://soap.sforce.com/2006/04/metadata` | Any other namespace causes deploy failure. |
|
|
74
|
+
| File must be named `Event.settings-meta.xml` | SFDX source format convention — the type name prefix for EventSettings is `Event`. |
|
|
75
|
+
| Requires `PlatformTracing` org permission | Without this permission, the setting deploys but has no effect on TraceSpanEvent publishing. |
|
|
76
|
+
| Requires API v68.0+ | Older orgs/tooling reject the field entirely. |
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Gotchas
|
|
81
|
+
|
|
82
|
+
| Issue | Resolution |
|
|
83
|
+
|---|---|
|
|
84
|
+
| Deploy succeeds but TraceSpanEvent not published | Org lacks the `PlatformTracing` permission. This is provisioned, not settable via metadata. |
|
|
85
|
+
| `enablePlatformTracing` field not recognized by org/tooling | Tooling is on API version < 68.0. Update `sfdx-project.json` `sourceApiVersion` to `68.0` or higher. |
|
|
86
|
+
| User confuses this with Agentforce tracing | Clarify: this publishes TraceSpanEvent for platform operations. For Agentforce agent spans to Data Cloud, use the `platform-tracing-agentforce-configure` skill. |
|
|
87
|
+
| User wants to configure all Event Monitoring settings | Only `enablePlatformTracing` is in scope. Other EventSettings fields are owned by other teams and not managed by this skill. |
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Output Expectations
|
|
92
|
+
|
|
93
|
+
Deliverables:
|
|
94
|
+
- `settings/Event.settings-meta.xml`
|
|
95
|
+
|
|
96
|
+
Before delivering, verify:
|
|
97
|
+
- [ ] XML namespace is exactly `http://soap.sforce.com/2006/04/metadata`
|
|
98
|
+
- [ ] File is named `Event.settings-meta.xml`
|
|
99
|
+
- [ ] Only `enablePlatformTracing` is present (no other EventSettings fields)
|
|
100
|
+
- [ ] Project `sourceApiVersion` in `sfdx-project.json` is `68.0` or higher
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Cross-Skill Integration
|
|
105
|
+
|
|
106
|
+
| Need | Delegate to |
|
|
107
|
+
|---|---|
|
|
108
|
+
| Enable Agentforce agent tracing to Data Cloud | `platform-tracing-agentforce-configure` skill |
|
|
109
|
+
| Set up Change Data Capture | `integration-eventing-cdc-configure` skill |
|
|
110
|
+
| Configure ManagedEventSubscription | `integration-eventing-subscription-configure` skill |
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Reference File Index
|
|
115
|
+
|
|
116
|
+
| File | When to read |
|
|
117
|
+
|---|---|
|
|
118
|
+
| `assets/EventSettings-template.xml` | Step 2 — template for generating the settings file |
|