@salesforce/afv-skills 1.6.0 → 1.6.2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/afv-skills",
3
- "version": "1.6.0",
3
+ "version": "1.6.2",
4
4
  "description": "Salesforce skills for Agentforce Vibes",
5
5
  "license": "CC-BY-NC-4.0",
6
6
  "files": [
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: generating-experience-lwr-site
3
- description: "Creates, modifies, or manages Salesforce Experience Cloud LWR sites via DigitalExperience metadata. Always trigger when users mention Experience sites, LWR sites, DigitalExperience, Experience Cloud, community sites, portals, creating pages, adding routes, views, theme layouts, branding sets, previewing sites, or any DigitalExperience bundle work. Also use when users mention specific content types like sfdc_cms__route, sfdc_cms__themeLayout, etc. or when troubleshooting site deployment."
3
+ description: "Creates, modifies, or manages Salesforce Experience Cloud LWR sites via DigitalExperience metadata. Always trigger when users mention Experience sites, LWR sites, DigitalExperience, Experience Cloud, community sites, portals, creating pages, adding routes, views, theme layouts, branding sets, previewing sites, or any DigitalExperience bundle work. Also use when users mention specific content types like sfdc_cms__route, sfdc_cms__themeLayout, etc. or when troubleshooting site deployment. ALWAYS trigger for ANY guest sharing rule (metadata type sharingGuestRules) creation/modification, guest user access, sharing records to guest users, or when user provides a guest user ID (15 or 18 characters starting with 005)"
4
4
  ---
5
5
 
6
6
  # Experience LWR Site Builder
@@ -29,6 +29,7 @@ When working with Experience LWR sites:
29
29
  - Adding pages (routes + views)
30
30
  - Configuring LWC components, layouts, themes, or branding styles
31
31
  - Setting up guest user access (public sites)
32
+ - Creating or modifying **guest sharing rules** (`sharingGuestRules`) for any Salesforce object (Account, Case, Contact, etc.) — including when the user refers to a "Site Guest User" username or any guest user by ID
32
33
  - Troubleshoot deployment errors related to Experience LWR Sites
33
34
 
34
35
  **Supported Template**: Build Your Own (LWR) - `talon-template-byo`
@@ -100,6 +101,7 @@ Before doing anything, you **MUST ALWAYS** load them first if they match user in
100
101
  - [configure-content-brandingSet.md](docs/configure-content-brandingSet.md) - Branding with color patterns/WCAG
101
102
  - [handle-component-and-region-ids.md](docs/handle-component-and-region-ids.md) - **UUID generation (CRITICAL)** for component and region ids used in views and themeLayout.
102
103
  - [handle-ui-components.md](docs/handle-ui-components.md) - Component discovery, schemas, insertion, configuration
104
+ - [configure-guest-sharing-rules.md](docs/configure-guest-sharing-rules.md) - **Guest sharing rules** (`sharingGuestRules`) for public sites — use for any request involving "guest sharing rule", "Site Guest User", or sharing object records with unauthenticated visitors
103
105
 
104
106
  ## Common Workflows
105
107
 
@@ -185,6 +187,10 @@ Before doing anything, you **MUST ALWAYS** load them first if they match user in
185
187
  }
186
188
  ```
187
189
 
190
+ ### Configuring Guest User Sharing Rules
191
+
192
+ - [ ] MUST read [configure-guest-sharing-rules.md](docs/configure-guest-sharing-rules.md) and follow all steps there.
193
+
188
194
  ### Retrieving Site Preview and Builder URLs After Deployment
189
195
 
190
196
  **Use when** user requests to preview a site, access a builder site, or after successfully deploying a site.
@@ -212,10 +218,16 @@ Use `sf` CLI to validate and deploy. Access help docs by attaching `--help`, e.g
212
218
  - `sf project deploy --help`
213
219
  - `sf project deploy validate --help`
214
220
 
215
- Note that metadata types are space-delimited.
221
+ Note that metadata types are space-delimited. **Never** wrap them in quotes or use commas. For example, `--metadata "DigitalExperienceBundle DigitalExperience"` is **incorrect** — always use `--metadata DigitalExperienceBundle DigitalExperience`.
216
222
 
217
223
  **Validate**:
218
- `sf project deploy validate --metadata DigitalExperienceBundle DigitalExperience DigitalExperienceConfig Network CustomSite --target-org ${usernameOrAlias}`
224
+
225
+ ```bash
226
+ sf project deploy validate --metadata DigitalExperienceBundle DigitalExperience DigitalExperienceConfig Network CustomSite --target-org ${usernameOrAlias}
227
+ ```
219
228
 
220
229
  **Deploy**:
221
- `sf project deploy start --metadata DigitalExperienceBundle DigitalExperience DigitalExperienceConfig Network CustomSite --target-org ${usernameOrAlias}`
230
+
231
+ ```bash
232
+ sf project deploy start --metadata DigitalExperienceBundle DigitalExperience DigitalExperienceConfig Network CustomSite --target-org ${usernameOrAlias}
233
+ ```
@@ -18,11 +18,66 @@ Ask user to choose:
18
18
 
19
19
  ### Option 1: Create in Org
20
20
 
21
+ **Step 1:** Run the create command:
22
+
23
+ ```bash
24
+ sf community create --name "{siteName}" --template-name 'Build Your Own (LWR)' --url-path-prefix "{prefix}" --target-org {usernameOrAlias} --json
25
+ ```
26
+
27
+ Site creation is an async job. As soon as the terminal returns output, capture the `jobId` and move on — do not wait for the shell command to fully exit.
28
+
29
+ **Step 2:** Ask the user: *"Would you like me to wait for the site creation to complete and then retrieve the metadata for you, or would you prefer to retrieve it yourself once it's ready?"*
30
+
31
+ **Stop here and wait for the user's response before proceeding.**
32
+
33
+ ---
34
+
35
+ **If the user wants to wait and retrieve:**
36
+
37
+ Poll the `BackgroundOperation` object using the following command, replacing `{jobId}` with the ID returned from the create command:
38
+
39
+ ```soql
40
+ SELECT Status FROM BackgroundOperation WHERE Id = '{jobId}'
41
+ ```
42
+
43
+ Use the MCP tool `run_soql_query` to run this query on the given target org. If the MCP tool is not available, run the following command instead, replacing `{jobId}` and `{usernameOrAlias}` with the appropriate values:
44
+
45
+ ```bash
46
+ sf data query --query "SELECT Status FROM BackgroundOperation WHERE Id = '{jobId}'" --target-org {usernameOrAlias} --json
47
+ ```
48
+
49
+ Repeat until `Status` is `Complete`. If the query does not return `Complete` after several attempts, ask the user to manually check their target org to confirm whether site creation has completed. **Stop here and do not proceed until the user confirms the site is ready.**
50
+
51
+ Once complete, run each of the following retrieval commands **one at a time**. Do not chain them together (e.g. do not use `&&`). Wait for each command to return output before running the next. Metadata types are space-delimited — **never** wrap them in quotes or use commas:
52
+
21
53
  ```bash
22
- sf community create --name "{siteName}" --template-name 'Build Your Own (LWR)' --url-path-prefix "{prefix}"
54
+ sf project retrieve start --metadata DigitalExperienceBundle --target-org {usernameOrAlias} --json
23
55
  ```
24
56
 
25
- After creation, retrieve metadata using sf CLI.
57
+ ```bash
58
+ sf project retrieve start --metadata DigitalExperienceConfig --target-org {usernameOrAlias} --json
59
+ ```
60
+
61
+ ```bash
62
+ sf project retrieve start --metadata Network --target-org {usernameOrAlias} --json
63
+ ```
64
+
65
+ ```bash
66
+ sf project retrieve start --metadata CustomSite --target-org {usernameOrAlias} --json
67
+ ```
68
+
69
+ ---
70
+
71
+ **If the user wants to retrieve themselves:**
72
+
73
+ Provide them with the retrieval command to run once the site is ready. Metadata types are space-delimited — **never** wrap them in quotes or use commas:
74
+
75
+ ```bash
76
+ sf project retrieve start --metadata DigitalExperienceBundle DigitalExperienceConfig Network CustomSite --target-org {usernameOrAlias} --json
77
+ ```
78
+
79
+ ---
80
+
26
81
 
27
82
  ### Option 2: Scaffold Locally
28
83
 
@@ -1,7 +1,14 @@
1
1
  # Guest User Sharing Rules (Public Sites Only)
2
2
 
3
- **Use when** the user explicitly wants to make the site **public** (accessible to unauthenticated visitors). If the site is private/login-required, guest sharing rules are not needed.
4
- If sharingRules metadata is not available locally in force-app/main/default/sharingRules, retrieve it from the org before creating new rules.
3
+ **Use when** the user asks to create or modify a guest sharing rule, mentions a username containing "Guest User" or "Site Guest User" (e.g. "ZenLease Site Guest User"), or wants to share object records with unauthenticated visitors.
4
+
5
+ ## Steps
6
+
7
+ 1. **Resolve the guest user identity**: If the user provides a username like "ZenLease Site Guest User", use it directly as the `<guestUser>` value (`CommunityNickname`). If a user ID is provided (e.g. `005AAC00003f8EP`), query the org to get the `CommunityNickname` first.
8
+ 2. **Check for existing file**: Look for `sharingRules/{ObjectName}.sharingRules-meta.xml` locally. If missing, retrieve it from the org before editing.
9
+ 3. **Generate the rule**: Follow the XML example and critical requirements below. Never use `sharingCriteriaRules` or `<role>`/`<group>` for guest rules.
10
+
11
+ If `sharingRules` metadata is not available locally in `force-app/main/default/sharingRules`, retrieve it from the org before creating new rules.
5
12
 
6
13
  ## Retrieve Full SharingRules Schema
7
14
 
@@ -154,6 +154,21 @@ Specify license requirements and record type visibility:
154
154
  <default>true</default>
155
155
  </recordTypeVisibilities>
156
156
  ```
157
+ ## Step 8: Set Agent Access (Optional)
158
+
159
+ Enable access to Agentforce Employee Agents for users assigned to this permission set:
160
+
161
+ <agentAccesses>
162
+ <agentName>Sales_Assistant_Agent</agentName>
163
+ <enabled>true</enabled>
164
+ </agentAccesses>
165
+
166
+ Field requirements:
167
+ - agentName (Required): The developer name of the employee agent
168
+ - enabled (Required): Set to true to grant access, false to deny
169
+
170
+ Important:
171
+ - Agent names must match existing Agentforce Employee Agent developer names
157
172
 
158
173
  ## Validation Checklist
159
174