From 3689f14af7eeb1dd8ea80ae206437f3483d37938 Mon Sep 17 00:00:00 2001 From: Hemant Singh Bisht Date: Fri, 6 Mar 2026 21:20:17 +0530 Subject: [PATCH] feat: add metadata type skills --- skills/lex-app-solution/SKILL.md | 76 ++++++ .../salesforce-custom-application/SKILL.md | 7 +- .../salesforce-custom-field/SKILL.md | 8 +- .../salesforce-custom-lightning-type/SKILL.md | 157 +++++++++++++ .../salesforce-custom-object/SKILL.md | 4 +- .../salesforce-custom-tab/SKILL.md | 2 +- skills/salesforce-experience-site/SKILL.md | 178 +++++++++++++++ .../salesforce-flexipage/SKILL.md | 3 +- .../salesforce-flow/SKILL.md | 2 +- skills/salesforce-fragment/SKILL.md | 42 ++++ skills/salesforce-list-view/SKILL.md | 216 ++++++++++++++++++ .../salesforce-experience-site/SKILL.md | 186 --------------- .../salesforce-validation-rule/SKILL.md | 2 +- .../SKILL.md | 84 +++++++ skills/salesforce-web-app-feature/SKILL.md | 70 ++++++ .../SKILL.md | 36 +++ skills/salesforce-web-application/SKILL.md | 34 +++ skills/solution/lex-app-solution/SKILL.md | 67 ------ 18 files changed, 909 insertions(+), 265 deletions(-) create mode 100644 skills/lex-app-solution/SKILL.md rename skills/{salesforce-metadata-experts => }/salesforce-custom-application/SKILL.md (97%) rename skills/{salesforce-metadata-experts => }/salesforce-custom-field/SKILL.md (96%) create mode 100644 skills/salesforce-custom-lightning-type/SKILL.md rename skills/{salesforce-metadata-experts => }/salesforce-custom-object/SKILL.md (93%) rename skills/{salesforce-metadata-experts => }/salesforce-custom-tab/SKILL.md (85%) create mode 100644 skills/salesforce-experience-site/SKILL.md rename skills/{salesforce-metadata-experts => }/salesforce-flexipage/SKILL.md (95%) rename skills/{salesforce-metadata-experts => }/salesforce-flow/SKILL.md (96%) create mode 100644 skills/salesforce-fragment/SKILL.md create mode 100644 skills/salesforce-list-view/SKILL.md delete mode 100644 skills/salesforce-metadata-experts/salesforce-experience-site/SKILL.md rename skills/{salesforce-metadata-experts => }/salesforce-validation-rule/SKILL.md (88%) create mode 100644 skills/salesforce-web-app-creating-records/SKILL.md create mode 100644 skills/salesforce-web-app-feature/SKILL.md create mode 100644 skills/salesforce-web-app-list-and-create-records/SKILL.md create mode 100644 skills/salesforce-web-application/SKILL.md delete mode 100644 skills/solution/lex-app-solution/SKILL.md diff --git a/skills/lex-app-solution/SKILL.md b/skills/lex-app-solution/SKILL.md new file mode 100644 index 0000000..be90a7b --- /dev/null +++ b/skills/lex-app-solution/SKILL.md @@ -0,0 +1,76 @@ +--- +name: lex-app-solution +description: Use this skill to build and orchestrate complete Salesforce Lightning Applications (LEX Apps), custom projects, or end-to-end business solutions from a natural language scenario. Triggers when a user requests a "custom app", a "business solution", or describes any scenario requiring multiple interconnected Salesforce components to be built together into a complete Lightning Experience (LEX) Application. Orchestrates the sequenced creation of Custom Objects, Relationships, Fields, Lightning Record Pages, Custom Tabs, Custom Applications, Permission Sets, and OPTIONALLY Flows and Validation Rules. +--- + +# Salesforce Lightning Application (LEX App) Builder + +## Overview + +Build and orchestrate complete Salesforce Lightning Applications (LEX Apps) from natural language scenarios. This skill coordinates the sequenced creation of multiple interconnected Salesforce components—Custom Objects, Fields, Lightning Record Pages, Custom Tabs, Custom Applications, Permission Sets, and optionally Flows and Validation Rules—by invoking specialized metadata expert skills in the correct order. + +## When to Use This Skill + +Use this skill when you need to: +- Build or enhance a complete Lightning Application (LEX App) from a single user prompt. +- Create end-to-end solutions requiring multiple metadata types working together within the Lightning Experience. +- Ensure proper sequencing of metadata creation (Objects → Fields → Tabs → Pages → Apps → Security). + +**Do not use this skill for:** +- Creating individual metadata components (use specific metadata expert skills instead). +- Troubleshooting or fixing deployment errors. +- Building Salesforce Classic applications or off-platform integrations. + +## Specification + +# Salesforce Lightning Application Development Requirements + +You are a highly experienced and certified Salesforce Architect. Your purpose is to autonomously orchestrate the generation of a complete Salesforce Lightning application based on the user's requirements. + +## Specialized Skill Invocation Requirement + +**CRITICAL:** You **MUST NOT** generate raw metadata or XML directly. You **MUST** invoke the specialized metadata expert skill for each component type. + +### MANDATORY Skill Mapping (Always Evaluate & Invoke): +- **Custom Objects** → `salesforce-custom-object` +- **Custom Fields** → `salesforce-custom-field` +- **Custom Tabs** → `salesforce-custom-tab` +- **FlexiPages** → `salesforce-flexipage` +- **Custom Applications** → `salesforce-custom-application` (Ensure this generates a LEX CustomApplication, not Classic) +- **Permission Sets** → `salesforce-permission-set` (Create at least one baseline permission set for app access if specific personas aren't requested) + +### OPTIONAL Skill Mapping (Strictly Conditional): +*DO NOT invoke these unless the user's prompt explicitly asks for or clearly describes requirements for them (e.g., "enforce that...", "automate the...").* +- **Validation Rules** → `salesforce-validation-rule` +- **Flows** → `salesforce-flow` + +--- + +## Autonomous Execution Sequence + +Execute the following steps sequentially in a single response. Do not stop and ask the user for permission to proceed unless their initial prompt lacks the basic information needed to start building. + +### STEP 1: The Pre-Flight Checklist (Planning) +Before invoking any skills, you must analyze the user's request and output a bulleted "Build Plan". +- Explicitly list every Custom Object, Field, Tab, FlexiPage, LEX Application, and Permission Set you are about to create. +- **Evaluate Optional Metadata:** Actively scan the prompt for automation or validation requirements. If found, add them to the plan. If NOT found, explicitly state: *"No optional Flows or Validation Rules requested. Skipping."* +- Explicitly state which metadata skill you will invoke for each planned item. + +### STEP 2: The Build Sequence (Skill Invocations) +Immediately after outputting the Pre-Flight Checklist, begin invoking the specialized skills strictly in this order: +1. **Data Model (Mandatory):** Invoke skills for Custom Objects first, followed immediately by Custom Fields. +2. **Business Logic (Optional):** Invoke skills for Validation Rules and Flows **ONLY IF** they were explicitly included in your Pre-Flight Checklist. Otherwise, skip this step entirely. +3. **User Experience (Mandatory):** Invoke skills for Custom Tabs. Then, invoke skills for FlexiPages (only for objects that received tabs, ensuring you include requested components like Highlights Panels). +4. **App Assembly (Mandatory):** Invoke the skill for the Custom Application to create the Lightning App, adding the newly created tabs. +5. **Security (Mandatory):** Invoke the skill for Permission Sets to grant access to the newly created LEX App, Objects, and Fields. + +### STEP 3: Skill Invocation Summary +Once all invocations are complete, output a final summary confirming: +- The complete Lightning application has been orchestrated. +- A list of any errors, warnings, or constraints encountered during the skill invocations. + +--- + +### Error Handling & Constraints +- If a specialized skill invocation fails, note it in your internal sequence, skip that specific component, and attempt to continue building the rest of the application. +- Only pause and ask the user for intervention if a critical failure occurs (e.g., a primary Custom Object fails to generate). \ No newline at end of file diff --git a/skills/salesforce-metadata-experts/salesforce-custom-application/SKILL.md b/skills/salesforce-custom-application/SKILL.md similarity index 97% rename from skills/salesforce-metadata-experts/salesforce-custom-application/SKILL.md rename to skills/salesforce-custom-application/SKILL.md index b8303c2..8bffe53 100644 --- a/skills/salesforce-metadata-experts/salesforce-custom-application/SKILL.md +++ b/skills/salesforce-custom-application/SKILL.md @@ -1,6 +1,6 @@ --- name: salesforce-custom-application -description: Generate CustomApplication (Lightning App) metadata with proper navigation types, branding, and action overrides. Use when creating Lightning applications for specific user workflows. +description: Use this skill when users need to create or configure Salesforce Custom Applications. Trigger when users mention custom apps, application metadata, app navigation, or organizing tabs into applications. Use when users want to create app containers for tabs and pages. Always use this skill for custom application work. --- ## When to Use This Skill @@ -12,11 +12,10 @@ Use this skill when you need to: - Set up custom page layouts for objects - Troubleshoot deployment errors related to custom applications -## Specification - # CustomApplication (Lightning App) Metadata Specification -## 📋 Overview +## Overview + Custom applications (Lightning Apps) that group tabs and functionality to provide a focused user experience for specific business processes. Always configured for Lightning Experience. ## 🎯 Purpose diff --git a/skills/salesforce-metadata-experts/salesforce-custom-field/SKILL.md b/skills/salesforce-custom-field/SKILL.md similarity index 96% rename from skills/salesforce-metadata-experts/salesforce-custom-field/SKILL.md rename to skills/salesforce-custom-field/SKILL.md index 7f26cc0..a063d2d 100644 --- a/skills/salesforce-metadata-experts/salesforce-custom-field/SKILL.md +++ b/skills/salesforce-custom-field/SKILL.md @@ -1,6 +1,6 @@ --- name: salesforce-custom-field -description: Generate CustomField metadata XML with proper type handling, relationship rules, and formula syntax. Handles Master-Detail, Lookup, Roll-Up Summary, and Formula fields correctly. Use when creating or modifying custom fields. +description: Use this skill when users need to create, generate, or validate Salesforce Custom Field metadata. Trigger when users mention custom fields, field types, Roll-up Summary fields, Master-Detail relationships, Lookup relationships, formula fields, picklists, or field metadata. Also use when users encounter field deployment errors, especially around Roll-up Summary format, Master-Detail constraints, or formula issues. Always use this skill for any custom field metadata work, field generation, or field troubleshooting. --- ## When to Use This Skill @@ -12,6 +12,12 @@ Use this skill when you need to: - Create formula or roll-up summary fields - Troubleshoot deployment errors related to custom fields +# Salesforce Custom Field Generator and Validator + +## Overview + +Generate and validate Salesforce Custom Field metadata with mandatory constraints to prevent deployment errors. This skill has special focus on the **highest-failure-rate field types**: Roll-up Summary and Master-Detail relationships. + ## Specification ## 1. Purpose diff --git a/skills/salesforce-custom-lightning-type/SKILL.md b/skills/salesforce-custom-lightning-type/SKILL.md new file mode 100644 index 0000000..720f4a0 --- /dev/null +++ b/skills/salesforce-custom-lightning-type/SKILL.md @@ -0,0 +1,157 @@ +--- +name: salesforce-custom-lightning-type +description: Use this skill when users need to create Custom Lightning Types (CLTs) for Einstein Agent actions or structured input/output schemas. Trigger when users mention CLT, Custom Lightning Types, JSON schemas for agents, type definitions, lightning__objectType, or editor/renderer configurations. This is complex - always use this skill for CLT work. +--- + +## When to Use This Skill + +Use this skill when you need to: +- Create Custom Lightning Types (CLTs) for structured inputs/outputs +- Generate JSON Schema-based type definitions for Lightning Platform +- Configure CLTs for Einstein Agent actions +- Set up editor and renderer configurations for custom UI +- Troubleshoot deployment errors related to Custom Lightning Types + +## Specification + +# CustomLightningType Metadata Specification + +## Overview & Purpose +Custom Lightning Types (CLTs) are JSON Schema-based type definitions used by the Lightning Platform (including Einstein Agent actions) to describe structured inputs/outputs and drive editor/renderer experiences. + +## Configuration +- **Choose standard Lightning types** when the structure is simple and can be expressed with properties and supported primitive `lightning:type` identifiers. +- **Choose Apex class types** (`@apexClassType/...`) when the structure already exists server-side and you want the Apex class to define the shape. +- **Include editor/renderer config** only when you need custom UI behavior (custom LWC input/output components). Otherwise, omit. + +## Critical Rules (Read First) +- **Root object schemas MUST include**: + - `"type": "object"` + - `"title"` + - `"lightning:type": "lightning__objectType"` + - `"unevaluatedProperties": false` +- `"unevaluatedProperties"` is enforced as `false` by the CLT metaschema. Do not set it to `true`. +- **Root object schemas MUST NOT include** `"examples"` when `"unevaluatedProperties": false` is set. +- **Nested objects (inside `properties`) MUST NOT set** `"lightning:type": "lightning__objectType"`. + - Nested objects should be plain JSON Schema objects (`type`, `properties`, optional `required`, optional `unevaluatedProperties`). +- **List/array properties are highly restricted by the CLT metaschema**: + - **CRITICAL LIMITATION**: the CLT metaschema may reject the `items` keyword entirely. Treat `items` as **disallowed by default**. + - **Root-level arrays** (direct children of the root `properties`): + - **MUST include** `"lightning:type": "lightning__listType"` + - **MUST NOT include** `"items"` + - **OPTIONAL** `"type": "array"` + - **Nested arrays** (arrays inside nested objects) are the most common failure: + - **MUST include** `"type": "array"` + - **MUST NOT include** `"lightning:type": "lightning__listType"` + - **MUST NOT include** `"items"` +- **When `"unevaluatedProperties": false` is set, any unknown keyword will fail validation**. Prefer removing keywords over relaxing strictness. +- **Apex class CLTs are minimal**: + - Include **only** `title`, `description` (optional), and `lightning:type` set to `@apexClassType/...`. + - Do **not** add `type`, `properties`, `required`, or `unevaluatedProperties`. + +## Additional CLT Metaschema Validations +- **Org namespace validation**: titles/descriptions and other string fields may be validated to ensure you are not using an org namespace in places that are disallowed. +- **Lightning type validation**: CLTs are validated to prevent referencing internal namespaces (for example, disallowing types from internal namespaces like `sfdc_cms` where not permitted). +- **Object type validation**: the CLT root is validated to ensure `lightning:type` is exactly `lightning__objectType`. + +## Primitive Types & Constraints +- `lightning__textType` + - Max length 255 +- `lightning__multilineTextType` + - Max length 2000 +- `lightning__richTextType` + - Max length 100000 +- `lightning__urlType` + - Max length 2000 + - Optional `lightning:allowedUrlSchemes` enum values: `https`, `http`, `relative`, `mailto`, `tel` +- `lightning__dateType` + - Data pattern: YYYY-MM-DD +- `lightning__timeType` + - Data pattern: HH:MM:SS.sssZ +- `lightning__dateTimeType` + - Data shape is an object with required `dateTime` and optional `timeZone` +- `lightning__numberType` + - Decimal numbers; optional `maximum`, `minimum`, `multipleOf` +- `lightning__integerType` + - Whole numbers only; optional `maximum`, `minimum` +- `lightning__booleanType` + - true/false + +## Allowed Property-Level Keywords +When strict validation is enabled (`unevaluatedProperties: false`), keep each property minimal and prefer only keywords known to be allowed: +- `title`, `description`, `einstein:description` +- `type` (when used, ensure it matches the chosen `lightning:type`) +- `lightning:type` +- `maximum`, `minimum`, `multipleOf` (numeric) +- `maxLength`, `minLength` (string) +- `const`, `enum` +- `lightning:textIndexed`, `lightning:supportsPersonalization`, `lightning:localizable` +- `lightning:uiOptions`, `lightning:allowedUrlSchemes` +- `lightning:tags` (metaschema restricts values; currently `flow` is the only known allowed tag) + +## Generation Workflow +1. **Confirm the CLT approach** + - If referencing Apex: capture the exact class reference (`@apexClassType/namespace__ClassName$InnerClass`). + - If using standard primitives: list the fields, their Lightning primitive types, and which fields are required. +2. **Draft `schema.json`** + - Start with the root object structure (required root fields). + - Add `properties` using valid primitive `lightning:type` identifiers. + - For nested objects: omit `lightning:type` and keep keywords minimal. + - For arrays: follow the strict list rules (avoid `items`; avoid `lightning:type` on nested arrays). +3. **(Optional) Draft `editor.json`** (only if custom UI is required) + - **Supported shape:** Top-level `editor` object with `editor.componentOverrides` and `editor.layout`. + - Top-level `editor` object. + - Use `editor.componentOverrides` for component overrides. + - Use `editor.layout` for layout. + - **Root override pattern** (most common for fully custom editing UI): + - `editor.componentOverrides["$"] = { "definition": "c/", "attributes": { ... } }` + - When passing schema data into a custom LWC, use attribute mapping with the `{!$attrs.}` syntax: e.g. `"attributes": { "myField": "{!$attrs.value}" }` so the runtime binds schema values to your component's attributes. + - **Property-level override pattern** (for individual fields): + - `editor.componentOverrides[""] = { "definition": "es_property_editors/<...>" }` + - **Valid editor components** (examples): `es_property_editors/inputText`, `es_property_editors/inputNumber`, `es_property_editors/inputRichText`, `es_property_editors/inputImage`, `es_property_editors/inputTextarea`. **Do not use** `es_property_editors/inputList`. + - **Collection editor** (for root-level `lightning__listType` properties): Use a collection-level override so the list is edited by a custom component: `collection.editor.componentOverrides["$"] = { "definition": "c/" }`. Alternatively, use `editor.layout` with `lightning/propertyLayout` and `attributes.property = ""` for default list editing. + - **Layout pattern**: + - `editor.layout.definition = "lightning/verticalLayout"` + - `editor.layout.children[*].definition = "lightning/propertyLayout"` with `attributes.property = ""` + - **Avoid known-invalid patterns**: + - Do not use `es_property_editors/inputList`. + - Do not use `itemSchema` attributes. +4. **(Optional) Draft `renderer.json`** (only if custom UI is required) + - **Supported shape:** Top-level `renderer` object with `renderer.componentOverrides` and `renderer.layout`. + - Top-level `renderer` object. + - Use `renderer.componentOverrides` for component overrides. + - Use `renderer.layout` for layout. + - **Root override pattern** (most common for fully custom rendering UI): + - `renderer.componentOverrides["$"] = { "definition": "c/", "attributes": { ... } }` + - Use `{!$attrs.}` in attribute mappings when binding schema data to custom renderer component attributes. + - **Property-level override pattern**: + - `renderer.componentOverrides[""] = { "definition": "es_property_editors/outputText" | "es_property_editors/outputNumber" | "es_property_editors/outputImage" | ... }`. **Valid renderer components** (examples): `es_property_editors/outputText`, `es_property_editors/outputNumber`, `es_property_editors/outputImage`. Avoid input-style components in the renderer. + - **Collection renderer** (for root-level `lightning__listType` properties): Use `collection.renderer.componentOverrides["$"] = { "definition": "c/" }` or `es_property_editors/genericListTypeRenderer` to render the list. +5. **Place files in the correct bundle structure** + - `lightningTypes//schema.json` + - (Optional) `lightningTypes//lightningDesktopGenAi/editor.json` + - (Optional) `lightningTypes//lightningDesktopGenAi/renderer.json` + - For Gen AI / Copilot the standard path is `lightningDesktopGenAi/`. Other targets (e.g. Experience Builder, Mobile Copilot, Enhanced Web Chat) use different subfolders when supported: `experienceBuilder/`, `lightningMobileGenAi/`, `enhancedWebChat/`. +6. **Deploy and validate** + - Deploy the bundle using your org's standard metadata deployment flow (e.g. Salesforce CLI or IDE). The MCP client or tooling in use should provide or integrate with the appropriate deploy/retrieve commands for Lightning Type bundles. + - Validate incrementally: if deployment fails, remove disallowed keywords first (especially `examples`, `items`, nested `lightning:type`). + +## Common Deployment Errors +| Error / Symptom | Likely Cause | Fix | +|---|---|---| +| Schema validation fails due to unknown keyword | `unevaluatedProperties: false` + disallowed keyword (commonly `examples`, `items`) | Remove the offending keyword; keep schema minimal | +| Nested object validation failure | Nested object includes `lightning:type: lightning__objectType` | Remove `lightning:type` from nested objects | +| Array property rejected | Use of `items` (or `lightning:type` in nested arrays) rejected by validator | For nested arrays: keep only `type: "array"`. For root arrays: use minimal structure; remove `items` if rejected | +| Apex-based CLT rejected | Extra fields added (e.g., `type`, `properties`) | Use only `title`, optional `description`, and `lightning:type` | +| Editor config rejected | Use of invalid patterns (`es_property_editors/inputList`, `itemSchema`) or unrecognized top-level keys | Use `editor.componentOverrides` and `editor.layout`; keep config minimal | + +## Verification Checklist +- [ ] Root schema has `type: "object"`, `title`, `lightning:type: "lightning__objectType"`, and `unevaluatedProperties: false` +- [ ] Root schema does not include `examples` when strict validation is enabled +- [ ] No nested object includes `lightning:type: "lightning__objectType"` +- [ ] Arrays are defined minimally (especially nested arrays) +- [ ] Only supported primitive `lightning:type` identifiers are used for leaf properties +- [ ] Apex class CLTs contain only `title`/`description` and `lightning:type: "@apexClassType/..."` +- [ ] Bundle structure and filenames match Lightning Types requirements +- [ ] Editor config uses only allowed patterns (no `es_property_editors/inputList`, no `itemSchema`); use valid components (e.g. `es_property_editors/inputText`, `es_property_editors/inputNumber`) or custom `c/` components +- [ ] Renderer config uses output-style components (e.g. `es_property_editors/outputText`, `es_property_editors/outputNumber`) where applicable, not input editors diff --git a/skills/salesforce-metadata-experts/salesforce-custom-object/SKILL.md b/skills/salesforce-custom-object/SKILL.md similarity index 93% rename from skills/salesforce-metadata-experts/salesforce-custom-object/SKILL.md rename to skills/salesforce-custom-object/SKILL.md index ddcc2b6..00cf22d 100644 --- a/skills/salesforce-metadata-experts/salesforce-custom-object/SKILL.md +++ b/skills/salesforce-custom-object/SKILL.md @@ -1,6 +1,6 @@ --- name: salesforce-custom-object -description: Generate CustomObject metadata XML following Salesforce best practices. Ensures correct sharing models, name fields, and required elements. Use when creating new custom objects or modifying existing object metadata. +description: Use this skill when users need to create, generate, or validate Salesforce Custom Object metadata. Trigger when users mention custom objects, creating objects, object metadata, .object files, sharing models, name fields, or validation rules on objects. Also use when users say things like "create a custom object", "generate object metadata", "set up an object for...", or when they're troubleshooting object deployment errors especially around sharing models and Master-Detail relationships. Always use this skill for any custom object metadata work. --- ## When to Use This Skill @@ -14,7 +14,7 @@ Use this skill when you need to: ## Specification -## 1. Purpose +## 1. Overview and Purpose This document defines the mandatory constraints for generating CustomObject metadata XML (`.object` file). The agent must verify these constraints before outputting XML to prevent Metadata API deployment errors. diff --git a/skills/salesforce-metadata-experts/salesforce-custom-tab/SKILL.md b/skills/salesforce-custom-tab/SKILL.md similarity index 85% rename from skills/salesforce-metadata-experts/salesforce-custom-tab/SKILL.md rename to skills/salesforce-custom-tab/SKILL.md index 17ff024..d10861f 100644 --- a/skills/salesforce-metadata-experts/salesforce-custom-tab/SKILL.md +++ b/skills/salesforce-custom-tab/SKILL.md @@ -1,6 +1,6 @@ --- name: salesforce-custom-tab -description: Generate CustomTab metadata XML for object tabs, web tabs, or Visualforce tabs. Use when adding navigation tabs to Salesforce applications. +description: Use this skill when users need to create or configure Salesforce Custom Tabs. Trigger when users mention tabs, navigation tabs, object tabs, web tabs, Visualforce tabs, Lightning component tabs, app page tabs, or tab configuration. Also use when users want to add navigation to custom objects, create tabs for external content, or set up Lightning page tabs. Always use this skill for any custom tab work. --- ## When to Use This Skill diff --git a/skills/salesforce-experience-site/SKILL.md b/skills/salesforce-experience-site/SKILL.md new file mode 100644 index 0000000..b3219ab --- /dev/null +++ b/skills/salesforce-experience-site/SKILL.md @@ -0,0 +1,178 @@ +--- +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": "