Skip to content

Commit 878ee49

Browse files
fix: ensure skill load for guest sharing rule (#127)
fix(generating-experience-lwr-site): ensure skill load for guest sharing rule Made-with: Cursor Co-authored-by: Hemant Singh Bisht <hsinghbisht@salesforce.com>
1 parent 09a26be commit 878ee49

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

skills/generating-experience-lwr-site/SKILL.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
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)"
44
---
55

66
# Experience LWR Site Builder
@@ -29,6 +29,7 @@ When working with Experience LWR sites:
2929
- Adding pages (routes + views)
3030
- Configuring LWC components, layouts, themes, or branding styles
3131
- 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
3233
- Troubleshoot deployment errors related to Experience LWR Sites
3334

3435
**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
100101
- [configure-content-brandingSet.md](docs/configure-content-brandingSet.md) - Branding with color patterns/WCAG
101102
- [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.
102103
- [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
103105

104106
## Common Workflows
105107

@@ -185,6 +187,10 @@ Before doing anything, you **MUST ALWAYS** load them first if they match user in
185187
}
186188
```
187189

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+
188194
### Retrieving Site Preview and Builder URLs After Deployment
189195

190196
**Use when** user requests to preview a site, access a builder site, or after successfully deploying a site.

skills/generating-experience-lwr-site/docs/configure-guest-sharing-rules.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
# Guest User Sharing Rules (Public Sites Only)
22

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.
512

613
## Retrieve Full SharingRules Schema
714

0 commit comments

Comments
 (0)