From 1561f72d9949e4e4f49755c3d43953d1e359de96 Mon Sep 17 00:00:00 2001 From: Daily Dai Date: Wed, 1 Apr 2026 13:23:47 -0700 Subject: [PATCH] @W-21817314@ Improved lwr and ui bundle site's skill to identify what properties should be updated for when user request for site URL update Signed-off-by: Daily Dai --- .../generating-experience-lwr-site/SKILL.md | 92 +++++++++++++++++- skills/generating-ui-bundle-site/SKILL.md | 96 ++++++++++++++++++- 2 files changed, 185 insertions(+), 3 deletions(-) diff --git a/skills/generating-experience-lwr-site/SKILL.md b/skills/generating-experience-lwr-site/SKILL.md index 086a5bf..6149676 100644 --- a/skills/generating-experience-lwr-site/SKILL.md +++ b/skills/generating-experience-lwr-site/SKILL.md @@ -211,6 +211,96 @@ The site developer name can be found in the CustomSite filename (e.g., `sites/My If the site is not found, an error message will be returned indicating that the site may not be deployed. Ensure the site has been successfully deployed before calling this action. +### Updating Experience Site URLs + +Experience sites have a three-component architecture with two distinct URL patterns. Understanding this structure is critical when updating site URLs. + +#### Architecture Overview + +Every Salesforce Experience Site consists of three components: + +1. **Network** (metadata: `Network`) - Network configuration +2. **ChatterNetwork Site** (metadata: `CustomSite`) - Authentication endpoints and core site services +3. **ChatterNetworkPicasso Site** (metadata: `DigitalExperienceConfig` + `DigitalExperienceBundle`) - Customer-facing pages and content + +#### URL Pattern + +These three components use **two different URLs**: + +- **Primary URL** (ChatterNetworkPicasso): Used for customer-facing pages + - Defined in: `DigitalExperienceConfig` → `` + - Example: `mysite` + +- **Secondary URL** (Network + CustomSite): Used for authentication endpoints and other services + - Defined in: `Network` → `` AND `CustomSite` → `` + - Example: `mysitevforcesite` + - **Must be synchronized** - both files must have identical values + +By default, Salesforce differentiates these URLs by appending `vforcesite` suffix to the Network/CustomSite URL. + +#### URL Update Workflow + +When updating site URLs, follow this workflow: + +**Step 1: Discover All URL References** + +Use `search_files` to find all occurrences of `urlPathPrefix` in the project: + +```bash +search_files --path force-app/main/default --regex "urlPathPrefix" --file-pattern "*.xml" +``` + +**Step 2: Identify URL Groups** + +Determine which files belong to which URL group: + +- **Primary URL Group**: `DigitalExperienceConfig` +- **Secondary URL Group**: `Network` AND `CustomSite` + +**Step 3: Update URLs Consistently** + +Update the `` value in each file: + +- **DigitalExperienceConfig**: Update to new primary URL +- **Network**: Update to new secondary URL (typically primary URL + `vforcesite`) +- **CustomSite**: Update to **same value as Network** (must be synchronized) + +**Step 4: Validate Naming Convention** + +Ensure URL values follow best practices: +- Use lowercase letters only +- Avoid special characters except hyphens where appropriate +- Keep URLs concise and meaningful + +**Step 5: Verify Consistency** + +Before deploying, confirm: +- [ ] Primary URL in `DigitalExperienceConfig` is set correctly +- [ ] Secondary URL in `Network` matches `CustomSite` exactly +- [ ] URLs are properly differentiated (typically via suffix) +- [ ] All URL values follow naming conventions + +#### Example URL Configuration + +``` +ChatterNetworkPicasso Site (Primary): + DigitalExperienceConfig: bestsupport + +Network + ChatterNetwork Site (Secondary): + Network: bestsupportvforcesite + CustomSite: bestsupportvforcesite +``` + +#### Common Pitfalls to Avoid + +❌ **Don't** update only one or two files - all three must be updated +❌ **Don't** use different values in Network and CustomSite +❌ **Don't** use the same URL for both Primary and Secondary groups +❌ **Don't** skip the discovery step with `search_files` +✅ **Do** use `search_files` to find all occurrences first +✅ **Do** maintain URL differentiation between the two groups +✅ **Do** follow lowercase naming conventions + ### Validation & Deployment Use `sf` CLI to validate and deploy. Access help docs by attaching `--help`, e.g.: @@ -230,4 +320,4 @@ sf project deploy validate --metadata DigitalExperienceBundle DigitalExperience ```bash sf project deploy start --metadata DigitalExperienceBundle DigitalExperience DigitalExperienceConfig Network CustomSite --target-org ${usernameOrAlias} -``` +``` \ No newline at end of file diff --git a/skills/generating-ui-bundle-site/SKILL.md b/skills/generating-ui-bundle-site/SKILL.md index 75e2e43..f6547f6 100644 --- a/skills/generating-ui-bundle-site/SKILL.md +++ b/skills/generating-ui-bundle-site/SKILL.md @@ -1,5 +1,5 @@ --- -name: generating-ui-bundle-site +name: generating-experience-react-site description: "Use this skill when users need to create or configure a Salesforce Digital Experience Site specifically for hosting a React UI bundle. Trigger when users mention creating an Experience site for a React app, setting up a React site on Salesforce, configuring Network/CustomSite/DigitalExperience metadata for a UI bundle, or deploying site infrastructure for a React application. Also trigger when users mention site URL path prefixes, app namespaces, appDevName, guest access configuration, DigitalExperienceConfig, DigitalExperienceBundle, or sfdc_cms__site content types in the context of React apps. Always use this skill for any React UI bundle site creation or site infrastructure configuration work, even if the user just says \"create a site for my React app\" or \"set up the site for my UI bundle.\"" --- @@ -63,7 +63,7 @@ Use the default templates in the docs below. Values in `{braces}` are resolved p - Read entire file contents, replace placeholders (e.g. `{siteName}`) with the resolved values, then use the expanded templates to populate the metadata XML/JSON content. ### Step 4: Resolve Additional Configurations -Address any extra configurations the user requests. Use the metadata sections and field context identified in Step 2 to understand each field’s purpose and constraints, then update only the minimum necessary fields. +Address any extra configurations the user requests. Use the metadata sections and field context identified in Step 2 to understand each field's purpose and constraints, then update only the minimum necessary fields. ## Verification Checklist Before deploying, confirm: @@ -76,3 +76,95 @@ Before deploying, confirm: ```bash sf project deploy validate --metadata Network CustomSite DigitalExperienceConfig DigitalExperienceBundle DigitalExperience --target-org ${usernameOrAlias} ``` + +## Common Workflows + +### Updating Experience Site URLs + +Experience sites have a three-component architecture with two distinct URL patterns. Understanding this structure is critical when updating site URLs. + +#### Architecture Overview + +Every Salesforce Experience Site consists of three components: + +1. **Network** (metadata: `Network`) - Network configuration +2. **ChatterNetwork Site** (metadata: `CustomSite`) - Legacy site and proxy core site services +3. **ChatterNetworkPicasso Site** (metadata: `DigitalExperienceConfig` + `DigitalExperienceBundle`) - Customer-facing pages and content + +#### URL Pattern + +These three components use **two different URLs**: + +- **Primary URL** (ChatterNetworkPicasso): Used for customer-facing pages + - Defined in: `DigitalExperienceConfig` → `` + - Example: `mysite` + +- **Secondary URL** (Network + CustomSite): Used for legacy authentication endpoints and other services + - Defined in: `Network` → `` AND `CustomSite` → `` + - Example: `mysitevforcesite` + - **Must be synchronized** - both files must have identical values + +By default, Salesforce differentiates these URLs by appending `vforcesite` suffix to the Network/CustomSite URL. + +#### URL Update Workflow + +When updating site URLs, follow this workflow: + +**Step 1: Discover All URL References** + +Use `search_files` to find all occurrences of `urlPathPrefix` in the project: + +```bash +search_files --path force-app/main/default --regex "urlPathPrefix" --file-pattern "*.xml" +``` + +**Step 2: Identify URL Groups** + +Determine which files belong to which URL group: + +- **Primary URL Group**: `DigitalExperienceConfig` +- **Secondary URL Group**: `Network` AND `CustomSite` + +**Step 3: Update URLs Consistently** + +Update the `` value in each file: + +- **DigitalExperienceConfig**: Update to new primary URL +- **Network**: Update to new secondary URL (typically primary URL + `vforcesite`) +- **CustomSite**: Update to **same value as Network** (must be synchronized) + +**Step 4: Validate Naming Convention** + +Ensure URL values follow best practices: +- Use lowercase letters only +- Avoid special characters except hyphens where appropriate +- Keep URLs concise and meaningful + +**Step 5: Verify Consistency** + +Before deploying, confirm: +- [ ] Primary URL in `DigitalExperienceConfig` is set correctly +- [ ] Secondary URL in `Network` matches `CustomSite` exactly +- [ ] URLs are properly differentiated (typically via suffix) +- [ ] All URL values follow naming conventions + +#### Example URL Configuration + +``` +ChatterNetworkPicasso Site (Primary): + DigitalExperienceConfig: bestsupport + +Network + ChatterNetwork Site (Secondary): + Network: bestsupportvforcesite + CustomSite: bestsupportvforcesite +``` + +#### Common Pitfalls to Avoid + +❌ **Don't** update only one or two files - all three must be updated +❌ **Don't** use different values in Network and CustomSite +❌ **Don't** use the same URL for both Primary and Secondary groups +❌ **Don't** skip the discovery step with `search_files` +✅ **Do** use `search_files` to find all occurrences first +✅ **Do** maintain URL differentiation between the two groups +✅ **Do** follow lowercase naming conventions \ No newline at end of file