--- name: salesforce-experience-site description: Use this skill when users need to create, modify, or manage Salesforce Experience Cloud sites (LWR sites). Trigger when users mention Experience sites, LWR sites, DigitalExperience, Experience Cloud, community sites, portals, creating pages, adding routes, views, theme layouts, branding sets, or any DigitalExperience bundle work. Also use when users mention specific content types like sfdc_cms__route, sfdc_cms__view, sfdc_cms__themeLayout, or when troubleshooting site deployment. Always use this skill for any Experience Cloud or LWR site work. --- ## When to Use This Skill Use this skill when you need to: - Create Experience Cloud sites or communities - Build LWR (Lightning Web Runtime) sites - Set up site configuration and settings - Generate Experience Site metadata - Troubleshoot deployment errors related to Experience Sites ## Specification # Experience LWR Site Metadata Specification An LWR site can be represented by metadata DigitalExperienceConfig, DigitalExperienceBundle, Network, CustomSite, and CMS contents. Your purpose is to assist developers in creating and editing these metadata. ## Supported Template Types Template name - Template DevName - Build Your Own (LWR) - talon-template-byo ## Core Properties Before doing anything else, identify the following properties from the local project if available. Check with the user if any of the following is missing: - Site name: Required. (e.g., `'My Community'`). - URL path prefix: Optional. Alphanumeric characters only. Convert from site name if not provided (e.g., `'mycommunity'`) and verify with the user for the converted value. - Template type devName: Optional. Defaults to `talon-template-byo`. ## General Tips TIP 1. When available, the site developer name can be found in the CustomSite filename (e.g., `sites/MySite.site-meta.xml` → developer name is `MySite`). ## Project Structure in DigitalExperienceBundle Format ### Site Metadata - DigitalExperienceConfig - Path: `digitalExperienceConfigs/{siteName}1.digitalExperienceConfig-meta.xml` - DigitalExperienceBundle - Path: `digitalExperiences/site/{siteName}1/{siteName}1.digitalExperience-meta.xml` - Network - Path: `networks/{siteName}.network-meta.xml` - CustomSite - Path: `sites/{siteName}.site-meta.xml` ### DigitalExperience Contents - Path: `digitalExperiences/site/{siteName}1/sfdc_cms__*/{contentApiName}/*` - Description: These are the content components defining routes, views, theme layouts, etc. Each component must have a `_meta.json` and `content.json` file. #### Content Type Descriptions | Content Type | Description | When to Use | |-|-|-| | `sfdc_cms__site` | Root site configuration containing site-wide settings | Required for every site; one per site | | `sfdc_cms__appPage` | Application page container that groups routes and views | Required; defines the app shell | | `sfdc_cms__route` | URL routing definition mapping paths to views | Create one for each page/URL path | | `sfdc_cms__view` | Page layout and component structure | Create one for each route; defines page content. Also use to edit existing views (e.g., adding/removing components, updating theme layout) | | `sfdc_cms__brandingSet` | Brand colors, fonts, and styling tokens | Required; defines site-wide styling | | `sfdc_cms__languageSettings` | Language and localization configuration | Required; defines supported languages | | `sfdc_cms__mobilePublisherConfig` | Mobile app publishing settings | Required for mobile app deployment | | `sfdc_cms__theme` | Theme definition referencing layouts and branding | Required; one per site | | `sfdc_cms__themeLayout` | Page layout templates used by views | Create layouts for different page structures | **Important:** Creating any new pages require BOTH `sfdc_cms__route` AND `sfdc_cms__view`. ## CUD Operations on DigitalExperience Contents - Users can perform create, update, delete operations on DigitalExperience Contents. - **IMPORTANT:** Before ANY modification (create, update, or delete) to content, ALWAYS call `execute_metadata_action` first to get the schema, examples, and instructions for that content type. - **Call once per content type per user request**: If you're creating/modifying multiple items of the same content type (e.g., creating 3 routes), you only need to call `execute_metadata_action` ONCE for that content type. Reuse the schema and examples for all items of that type within the same user request. - For each unique content type you need to work with, call `execute_metadata_action` using the following: ```json { "metadataType": "ExperienceSite", "actionName": "getSiteContentMetadata", "parameters": { "contentType": "", "shouldIncludeExamples": true } } ``` - Do not call the `execute_metadata_action` MCP tool with any other site actionName unless specified in this knowledge doc/instructions. ## Retrieving Site URLs After Deployment After successfully deploying the site using `sf project deploy`, use the `execute_metadata_action` MCP tool to get the preview and builder URLs: ```json { "metadataType": "ExperienceSite", "actionName": "getSiteUrls", "parameters": { "siteDevName": "" } } ``` Refer to TIP 1 to get the site developer name. 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. ## Enhancement Rules - If need to understand how site metadata should be configured, use the `get_metadata_api_context` MCP tool to get the schemas. - Use MCP tool `execute_metadata_action` with `getSiteTemplateMetadata` to get the knowledge document about the template and its default configurations if needed. **IMPORTANT:** This MUST be used for new site: ```json { "metadataType": "ExperienceSite", "actionName": "getSiteTemplateMetadata", "parameters": { "templateDevName": "