
experience-lwr-site-generate
Creates, modifies, or manages Salesforce Experience Cloud LWR sites via DigitalExperience metadata. Always trigger when the tasks involve LWR sites configurations, e.g. creating/modifying pages/routes/views/theme layouts/branding sets, previewing sites, or creating/modifying guest sharing rule (metadata type sharingGuestRules)/guest user access/sharing records to guest users, or when user provides a guest user ID (15 or 18 characters starting with 005). NEVER trigger for React or any other ui bundle framework. LWR sites ONLY.
- Installs
- 2.7K
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/forcedotcom/sf-skills --skill experience-lwr-site-generate- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads experience-lwr-site-generate automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
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
- 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.
- MUST ALWAYS load the relevant reference docs before doing anything.
- 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.
- 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.jsonandcontent.jsonfile.
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 on a specific page) |
sfdc_cms__brandingSet | Brand colors, fonts, and styling tokens | Required; defines site-wide styling. Use to create or edit existing branding sets |
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. 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.
- bootstrap-template-byo-lwr.md - Site creation, template defaults
- configure-content-route.md - Route creation (custom/object pages)
- configure-content-view.md - View creation/editing (custom/object pages)
- configure-content-themeLayout.md - Theme layout creation + theme sync
- configure-content-brandingSet.md - Branding with color patterns/WCAG
- handle-component-and-region-ids.md - UUID generation (CRITICAL) for component and region ids used in views and themeLayout.
- handle-ui-components.md - Component discovery, schemas, insertion, configuration
- 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 - update-site-urls.md - Updating site URLs - URL architecture, workflow for updating
urlPathPrefixin DigitalExperienceConfig, Network, and CustomSite
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):
- MUST read configure-content-route.md
- MUST read configure-content-view.md
- MUST read handle-component-and-region-ids.md
Adding UI Components to Pages
Steps (Follow the steps sequentially. Do not skip any step before proceeding):
- MUST read handle-ui-components.md to add LWCs to LWR sites.
- MUST read handle-component-and-region-ids.md to handle id generation
- MUST read configure-content-themeLayout.md if a component has one of the following requirements:
- needs to be "sticky" and persistent across pages
- is used as a theme layout
Creating Page Layouts / Container Components
Steps (Follow the steps sequentially. Do not skip any step before proceeding):
- MUST read handle-ui-components.md
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):
- MUST read configure-content-view.md
Configuring Branding
Steps (Follow the steps sequentially. Do not skip any step before proceeding):
- MUST read configure-content-brandingSet.md to configure background colors, foreground colors, button colors, and other branding colors that affect all pages.
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_actionto 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_actionONCE 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_actionusing the following:
- 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
{
"metadataType": "ExperienceSiteLwr",
"actionName": "getSiteContentMetadata",
"parameters": {
"contentType": "<content type from table above>",
"shouldIncludeExamples": true
}
}
Configuring Guest User Sharing Rules
- MUST read configure-guest-sharing-rules.md and follow all steps there.
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 --helpsf 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}
FAQ
What does the experience-lwr-site-generate skill do?
Creates, modifies, or manages Salesforce Experience Cloud LWR sites via DigitalExperience metadata. Always trigger when the tasks involve LWR sites configurations, e.g. creating/modifying pages/routes/views/theme layouts/branding sets, previewing sites, or creating/modifying guest sharing rule (metadata type sharingGuestRules)/guest user access/sharing records to guest users, or when user provides a guest user ID (15 or 18 characters starting with 005). NEVER trigger for React or any other ui bundle framework. LWR sites ONLY.
How do I install experience-lwr-site-generate?
Run npx skills add https://github.com/forcedotcom/sf-skills --skill experience-lwr-site-generate in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/experience-lwr-site-generate/ (personal) or .claude/skills/experience-lwr-site-generate/ (project).
Which AI agents can use experience-lwr-site-generate?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is experience-lwr-site-generate safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains experience-lwr-site-generate?
It is published by forcedotcom in forcedotcom/sf-skills. It has 2,664 recorded installs.
More from forcedotcom/sf-skills
platform-apex-generate
forcedotcom/sf-skills
Primary Apex authoring skill for class generation, refactoring, and review. ALWAYS ACTIVATE when the user mentions Apex, .cls, triggers, or asks to create/refactor a class (service, selector, domain, batch, queueable, schedulable, invocable, DTO, utility, interface, abstract, exception, REST resource). Use this skill for requests involving SObject CRUD, mapping collections, fetching related records, scheduled jobs, batch jobs, trigger design, @AuraEnabled controllers, @RestResource endpoints, custom REST APIs, or code review of existing Apex.
platform-apex-test-generate
forcedotcom/sf-skills
Use to generate and validate Apex test classes with TestDataFactory patterns, bulk testing (251+ records), mocking, assertions, and disciplined test-fix loops. Use when creating Apex test classes (for triggers, services, controllers, batch jobs, queueables, and callouts), improving coverage, debugging or fixing failing Apex tests, or running test/coverage analysis. Triggers on Test.cls files, sf apex run test, coverage reports. Do NOT trigger for production Apex (use platform-apex-generate) or Jest/LWC tests.
platform-apex-test-run
forcedotcom/sf-skills
Apex test execution, coverage analysis, and test-fix loops with 120-point scoring. Use when the user runs Apex tests, checks code coverage, fixes failing tests, or touches Test.cls / Test.cls files. DO NOT TRIGGER when writing Apex production code (use platform-apex-generate), Agentforce agent testing (use agentforce-test), or Jest/LWC tests (use experience-lwc-generate).
platform-apex-logs-debug
forcedotcom/sf-skills
Salesforce debug log analysis and troubleshooting with 100-point scoring. TRIGGER when: user analyzes debug logs, hits governor limits, reads stack traces, or touches .log files from Salesforce orgs. DO NOT TRIGGER when: running Apex tests (use platform-apex-test-run), generating or fixing Apex code (use platform-apex-generate), or Agentforce session tracing (use agentforce-observe).
platform-soql-query
forcedotcom/sf-skills
Use when the user needs SOQL/SOSL authoring or optimization: natural-language-to-query generation, relationship queries, aggregates, query-plan/selectivity analysis, and performance or safety improvements. TRIGGER when the user writes, optimizes, or debugs SOQL/SOSL, touches .soql files, or asks about relationship queries, aggregates, or query performance. DO NOT TRIGGER for bulk data operations (use platform-data-manage), Apex DML logic (use platform-apex-generate), or report/dashboard queries.
platform-metadata-deploy
forcedotcom/sf-skills
Salesforce DevOps automation using sf CLI v2. TRIGGER when: user deploys metadata, validates a deploy or does a dry-run, deploys to a Production org, quick-deploys a validated job ID, ships/promotes to prod, creates/manages scratch orgs or sandboxes, sets up CI/CD pipelines, or troubleshoots deployment errors with sf project deploy. DO NOT TRIGGER when: writing Apex code, building LWC components (use experience-lwc-generate), creating metadata definitions (use platform-custom-object-generate), deleting metadata from an org (use platform-destructive-deploy), or querying org data (use platform-data-manage).
Popular frontend & design skills
setup-matt-pocock-skills
mattpocock/skills
Configure this repo for the engineering skills: set up its issue tracker, triage label vocabulary, and domain doc layout. Run once before first use of the other engineering skills.
frontend-design
anthropics/skills
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.
hyperframes-animation
heygen-com/hyperframes
All animation knowledge for HyperFrames — atomic motion rules, multi-phase scene blueprints, scene transitions, broader motion-design techniques, AND the seven runtime adapters (GSAP default, plus Lottie, Three.js, Anime.js, CSS keyframes, Web Animations API, TypeGPU). Use for any motion or animation task: pick 2-4 rules and compose, or load a blueprint, or look up runtime-specific API (e.g. GSAP eases / Lottie player / Three.js mixer). Also covers auditing an existing composition's choreography (animation map) and 24 named text-animation effects. HyperFrames-native: single paused timeline, seek-safe, deterministic.
prototype
mattpocock/skills
Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.
hyperframes-core
heygen-com/hyperframes
The HyperFrames composition contract — build one renderable project. Use for composition structure, the data- timing attributes, class="clip", tracks, sub-compositions, variables, framework-owned media playback, deterministic-render rules, and validation. Read before writing composition HTML.
vercel-react-best-practices
vercel-labs/agent-skills
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.