$npx -y skills add forcedotcom/sf-skills --skill experience-ui-bundle-site-generateMUST activate when the project contains a uiBundles/*/src/ directory and the task involves creating or configuring site infrastructure. Use this skill when creating or configuring a Salesforce Digital Experience Site for hosting a UI bundle. Activate when files matching digitalEx
| 1 | # Digital Experience Site for React UI Bundles |
| 2 | Create and configure Digital Experience Sites that host React UI bundles on Salesforce. This skill generates the minimum necessary site infrastructure — Network, CustomSite, DigitalExperienceConfig, DigitalExperienceBundle, and the `sfdc_cms__site` content type — so a React app can be served from Salesforce. |
| 3 | |
| 4 | React sites differ from standard LWR sites: they don't need routes, views, theme layouts, or branding sets. The site acts as a thin container (`appContainer: true`) that delegates rendering to the React UI bundle referenced by `appSpace`. |
| 5 | |
| 6 | ## Required Properties |
| 7 | Resolve all five properties before generating any metadata. Each has a fallback chain — work through each option in order until a value is found. |
| 8 | |
| 9 | | Property | Format | How to Resolve | |
| 10 | |----------|--------|----------------| |
| 11 | | **siteName** | `UpperCamelCase` (e.g., `MyCommunity`) | Ask user or derive from context | |
| 12 | | **siteUrlPathPrefix** | `All lowercase` (e.g., `mycommunity`) | User-provided, or convert siteName to all lowercase with alphanumeric characters only | |
| 13 | | **appNamespace** | String | `namespace` in `sfdx-project.json` → `sf data query -q "SELECT NamespacePrefix FROM Organization" --target-org ${usernameOrAlias}` → default `c` | |
| 14 | | **appDevName** | String | `UIBundle` metadata in the project → `sf data query -q "SELECT DeveloperName FROM UIBundle" --target-org ${usernameOrAlias}` → default to siteName | |
| 15 | | **enableGuestAccess** | Boolean | Ask user whether unauthenticated guest users can access site APIs → default `false` | |
| 16 | |
| 17 | The `appNamespace` and `appDevName` properties connect the site to the correct React application. Getting these wrong means the site deploys but shows a blank page, so take care to resolve them from real project data. |
| 18 | |
| 19 | ## Generation Workflow |
| 20 | ### Step 1: Resolve All Required Properties |
| 21 | Determine values for all five properties before constructing anything. Use the resolution strategies in the table above, falling through each option until a value is found. |
| 22 | |
| 23 | ### Step 2: Create the Project Structure |
| 24 | Use available Salesforce metadata schema and field context for `Network`, `CustomSite`, `DigitalExperienceConfig`, and `DigitalExperienceBundle` to ensure each file uses valid structure. |
| 25 | |
| 26 | Create any files and directories that don't already exist, using these paths: |
| 27 | |
| 28 | | Metadata Type | Path | |
| 29 | |--------------|------| |
| 30 | | Network | `networks/{siteName}.network-meta.xml` | |
| 31 | | CustomSite | `sites/{siteName}.site-meta.xml` | |
| 32 | | DigitalExperienceConfig | `digitalExperienceConfigs/{siteName}1.digitalExperienceConfig-meta.xml` | |
| 33 | | DigitalExperienceBundle | `digitalExperiences/site/{siteName}1/{siteName}1.digitalExperience-meta.xml` | |
| 34 | | DigitalExperience (sfdc_cms__site) | `digitalExperiences/site/{siteName}1/sfdc_cms__site/{siteName}1/*` | |
| 35 | |
| 36 | The DigitalExperience directory contains only `_meta.json` and `content.json`. Do not create any directories other than `sfdc_cms__site` inside the bundle. |
| 37 | |
| 38 | ### Step 3: Populate All Metadata Fields |
| 39 | Use the default templates in the docs below. Values in `{braces}` are resolved property references — substitute them with the actual values from Step 1. |
| 40 | |
| 41 | | Metadata Type | Template Reference | |
| 42 | |--------------|-------------------| |
| 43 | | Network | [configure-metadata-network.md](references/configure-metadata-network.md) | |
| 44 | | CustomSite | [configure-metadata-custom-site.md](references/configure-metadata-custom-site.md) | |
| 45 | | DigitalExperienceConfig | [configure-metadata-digital-experience-config.md](references/configure-metadata-digital-experience-config.md) | |
| 46 | | DigitalExperienceBundle | [configure-metadata-digital-experience-bundle.md](references/configure-metadata-digital-experience-bundle.md) | |
| 47 | | DigitalExperience (sfdc_cms__site) | [configure-metadata-digital-experience.md](references/configure-metadata-digital-experience.md) | |
| 48 | |
| 49 | For URL updates, see [update-site-urls.md](references/update-site-urls.md). |
| 50 | |
| 51 | ### Execution Note for Step 3: Load and use the docs |
| 52 | - Agents MUST read the full contents of each references/*.md file referenced in Step 3 before attempting to populate metadata fields. |
| 53 | - Use your platform's file-read tool (for example, `read_file`) to load these files in full, then perform placeholder substitution for values in `{braces}` using the resolved properties from Step 1. |
| 54 | - Files to load: |
| 55 | - `references/configure-metadata-network.md` |
| 56 | - `references/configure-metadata-custom-site.md` |
| 57 | - `references/configure-metadata-d |