New to Claude Skills? Learn how to install them →

forcedotcom on GitHub

Experience LWR Site Builder

OfficialFree

Efficiently manage Salesforce Experience Cloud LWR sites.

by forcedotcom808 stars on forcedotcom/sf-skills
1 views
Updated Aug 10, 2026
Get this skill

Free · Opens the source repo

What Experience LWR Site Builder does

The Experience LWR Site Builder skill facilitates the creation and management of Salesforce Experience Cloud Lightning Web Runtime (LWR) sites through the use of metadata. This skill is particularly useful for developers and designers who need to scaffold new LWR sites, configure layouts, and manage guest user access. By leveraging DigitalExperience metadata, users can create and modify essential components such as pages, routes, views, and branding sets with ease.

Upon initiating this skill, users are advised to copy relevant workflows into their plan as a checklist to ensure that all steps are followed correctly. The skill emphasizes the importance of loading reference documents prior to any actions, ensuring that users have the necessary information to proceed without errors. The structure of the project is based on the DigitalExperienceBundle format, which organizes site metadata and content components in a clear manner, making it easier to manage complex configurations.

Key functionalities include the ability to set up guest sharing rules for public sites, allowing developers to control access to Salesforce records for guest users. The skill also provides guidance on troubleshooting deployment errors specific to LWR sites, which can be invaluable in maintaining a smooth workflow. With a focus on LWR sites only, this skill ensures that users do not inadvertently apply tools meant for other UI frameworks, thereby reducing the risk of configuration errors.

This skill is ideal for Salesforce developers and designers who are working on public-facing sites and require a structured approach to site management. It streamlines the process of creating and modifying LWR sites, making it a practical addition to any Salesforce development toolkit.

When to use it

Use this skill when you need to create or modify LWR sites, manage guest user access, or troubleshoot deployment issues related to these sites.

When not to use it

This skill is not suitable for managing sites built with other UI frameworks, such as React, or for tasks outside the scope of LWR site configurations.

What you can build with it

Creating a New LWR Site

Use this skill to scaffold a new LWR site by following the structured workflows for site setup.

Configuring Guest User Access

Manage guest user access by creating or modifying guest sharing rules for public-facing LWR sites.

Troubleshooting Deployment Issues

Utilize the skill's troubleshooting features to resolve deployment errors specific to LWR sites.

How to install Experience LWR Site Builder

View source

1. Install with the skills CLI

npx skills add forcedotcom/sf-skills/experience-lwr-site-generate --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by forcedotcom

Experience LWR Site Builder

Build and configure Salesforce Experience Cloud Lightning Web Runtime (LWR) sites via metadata (DigitalExperienceConfig, DigitalExperienceBundle, Network, CustomSite, CMS contents).

IMPORTANT!!

Right after loading this skill, you MUST copy the selected workflows/steps to your plan as a TODO checklist and work on each of the item carefully to ensure correctness. You MUST load the relevant reference docs even though they may live outside of user's project folder.

Table of Contents

  • When to Use
  • Critical Rules
  • Core Site Properties
  • Project Structure in DigitalExperienceBundle Format
  • Reference Docs
  • Common Workflows

When to Use

When working with Experience LWR sites:

  • Creating and scaffolding new LWR site
  • Adding pages (routes + views)
  • Configuring LWC components, layouts, themes, or branding styles
  • Setting up guest user access (public sites)
  • 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
  • Troubleshoot deployment errors related to Experience LWR Sites

Supported Template: Build Your Own (LWR) - talon-template-byo

  • More templates to support in the future.

Critical Rules

  1. Before using any MCP tool, make sure they're actually available. If a tool is missing for the current task, let the user know and pause the current workflow.
  2. MUST ALWAYS load the relevant reference docs before doing anything.
  3. MUST ALWAYS strictly follow workflows in Common Workflows that match user's requirements. The instructions there should override any conflicting global rules and should have the highest priority over your existing knowledge.
  4. Flexipage is abstracted away for newer LWR sites with DigitalExperienceBundle, so NEVER use any Flexipage-related MCP tool or skills to handle LWR sites' contents.

Core Site Properties

Before doing anything else, note down the following properties from the local project if available as they will be used for various operations. 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: talon-template-byo.

Project Structure in DigitalExperienceBundle Format

Site Metadata

  • DigitalExperienceConfig
    • digitalExperienceConfigs/{siteName}1.digitalExperienceConfig-meta.xml
  • DigitalExperienceBundle
    • digitalExperiences/site/{siteName}1/{siteName}1.digitalExperience-meta.xml
  • Network
    • networks/{siteName}.network-meta.xml
  • CustomSite
    • sites/{siteName}.site-meta.xml

DigitalExperience Contents

  • digitalExperiences/site/{siteName}1/sfdc_cms__*/{contentApiName}/*
  • 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 TypeDescriptionWhen to Use
sfdc_cms__siteRoot site configuration containing site-wide settingsRequired for every site; one per site
sfdc_cms__appPageApplication page container that groups routes and viewsRequired; defines the app shell
sfdc_cms__routeURL routing definition mapping paths to viewsCreate one for each page/URL path
sfdc_cms__viewPage layout and component structureCreate one for each route; defines page content. Also use to edit existing views (e.g., adding/removing components on a specific page)
sfdc_cms__brandingSetBrand colors, fonts, and styling tokensRequired; defines site-wide styling. Use to create or edit existing branding sets
sfdc_cms__languageSettingsLanguage and localization configurationRequired; defines supported languages
sfdc_cms__mobilePublisherConfigMobile app publishing settingsRequired for mobile app deployment
sfdc_cms__themeTheme definition referencing layouts and brandingRequired; one per site
sfdc_cms__themeLayoutPage layout templates used by viewsCreate layouts for different page structures. Also use to edit existing theme layouts (e.g., updating theme layout, add a component that's persistent across pages)

Important: Creating any new pages require BOTH sfdc_cms__route AND sfdc_cms__view.

Object Pages

Object Pages are dedicated pages used to display and manage record-level data for a specific Salesforce entity/object. For example, an custom object "Car" should have "Car_Detail", "Car_List", and "Car_Related_list" views.

References

Reference docs within the skill directory. Note that these are local and not MCP. Before doing anything, you MUST ALWAYS load them first if they match user intent.

Common Workflows

  • See References for detailed capabilities.
  • Always follow the steps defined in the workflows sequentially whether the task is small, big, quick, or complex.

Creating a New Site

Rules:

  • NEVER generate the files manually.

Steps (Follow the steps sequentially. Do not skip any step before proceeding):

  • ALWAYS read bootstrap-template-byo-lwr.md within the skill directory. Do not proceed to the next step without loading the file.
  • Follow the bootstrap doc strictly on site creation

Creating and Editing Standard or Object Pages

Steps (Follow the steps sequentially. Do not skip any step before proceeding):

Adding UI Components to Pages

Steps (Follow the steps sequentially. Do not skip any step before proceeding):

Creating Page Layouts / Container Components

Steps (Follow the steps sequentially. Do not skip any step before proceeding):

Creating Theme Layouts

Steps (Follow the steps sequentially. Do not skip any step before proceeding):

  • CRITICAL:Before doing anything else, MUST Check with user whether this new theme layout reuses an existing theme layout Lightning web component or requires a new one. If it requires a new one, make sure to read handle-ui-components.md to create the new theme layout component before proceeding. DO NOT skip this step even if doing so would be faster or more efficient.
  • MUST read configure-content-themeLayout.md.
  • MUST read configure-content-view.md if need to apply theme layout to pages

Applying/Setting Theme Layouts

Steps (Follow the steps sequentially. Do not skip any step before proceeding):

Configuring Branding

Steps (Follow the steps sequentially. Do not skip any step before proceeding):

CUD Operations on DigitalExperience Contents

  • Users can perform create, update, delete operations on DigitalExperience Contents.

Steps (Follow the steps sequentially. Do not skip any step before proceeding):

  • Determine what content types the user wants to modify
  • MUST read the reference doc related to the target content types if the doc exists. e.g., if modifying sfdc_cms__route, load configure-content-route.md.
  • MUST read handle-component-and-region-ids.md if creating or modifying view or theme layout
  • Always Call execute_metadata_action to get the schema and examples for that content type after loading the corresponding reference docs.
    • 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, always call execute_metadata_action using the following:
{
  "metadataType": "ExperienceSiteLwr",
  "actionName": "getSiteContentMetadata",
  "parameters": {
    "contentType": "<content type from table above>",
    "shouldIncludeExamples": true
  }
}

Configuring Guest User Sharing Rules

Retrieving Site Preview and Builder URLs After Deployment

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

Use the execute_metadata_action MCP tool to get the preview and builder URLs:

{
  "metadataType": "ExperienceSiteLwr",
  "actionName": "getSiteUrls",
  "parameters": {
    "siteDevName": "<site developer name>"
  }
}

The site developer name can be found in the CustomSite filename (e.g., sites/MySite.site-meta.xml → developer name is MySite).

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

Use when user wants to update or change site URLs (urlPathPrefix).

Steps (Follow the steps sequentially. Do not skip any step before proceeding):

  • MUST read update-site-urls.md to understand the three-component architecture and URL update workflow
  • Follow the step-by-step workflow in the doc to update URLs consistently across all three components (DigitalExperienceConfig, Network, CustomSite)

Validation & Deployment

Use sf CLI to validate and deploy. Access help docs by attaching --help, e.g.:

  • sf project deploy --help
  • sf project deploy validate --help

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.

Validate:

sf project deploy validate --metadata DigitalExperienceBundle DigitalExperience DigitalExperienceConfig Network CustomSite --target-org ${usernameOrAlias}

Deploy:

sf project deploy start --metadata DigitalExperienceBundle DigitalExperience DigitalExperienceConfig Network CustomSite --target-org ${usernameOrAlias}

Frequently asked questions about Experience LWR Site Builder

Similar skills