Experience Ui Bundle Custom App Generate

作者 forcedotcome5164d94d751無授權條款1K 個星標收錄於 2026年10月8日更新於 2026年10月8日儲存庫昨天更新

MUST activate when the project contains a uiBundles/*/src/ directory and the task involves creating or configuring a Custom Application for hosting a UI bundle in Lightning Experience. Use this skill when creating a CustomApplication metadata record to surface the UI bundle in the App Launcher. Activate when files matching applications/*.app-meta.xml exist and need modification, or when the user wants to expose their app via the Lightning App Launcher without a Digital Experience Site. Do NOT use platform-custom-application-generate for this — UI bundle apps do not use tabs, action overrides, or flexipages.

AI 產生的概覽

產生 Salesforce CustomApplication 中介資料,讓 React UI 套件組合顯示在 Lightning 應用程式啟動器中。

功能
此技能建立並設定 Salesforce CustomApplication 中介資料記錄,用於在 Lightning Experience 中裝載 React UI 套件組合,產出 applications/{appName}.app-meta.xml。它會解析 appName、appNamespace、appLabel 等屬性,查詢 API 內容以選擇符合版本的欄位,並在支援時就地編輯既有的 UIBundle 中介資料 XML 以加入 target 元素。最後執行部署驗證指令。
適用情境
當專案包含 uiBundles/*/src/ 目錄,且需要在不使用 Digital Experience Site 的情況下讓該 UI 套件組合出現在 Lightning 應用程式啟動器中時使用。也適用於 applications/*.app-meta.xml 檔案已存在且需要修改,或需要為 UI 套件組合建立 CustomApplication 記錄的情況。
執行需求
需要 Node.js 18 或更新版本、Salesforce CLI(sf)2.0 或更新版本,以及 salesforce-api-context MCP 工具 get_metadata_type_fields(無法使用時需有備援方案)。需要存取 Salesforce 組織以查詢命名空間並執行部署驗證,並附帶一個可執行指令碼 scripts/resolve-uibundle-path.mjs,透過 node 執行。

Custom Application for React UI Bundles

Create and configure a Salesforce Custom Application that hosts a React UI bundle in Lightning Experience. This skill generates the CustomApplication metadata so the app appears in the Lightning App Launcher and can be accessed by internal users.

Custom Applications differ from Experience Sites: they don't need Networks, CustomSite, DigitalExperienceConfig, or DigitalExperienceBundle metadata. The Custom Application acts as a thin launcher entry that delegates rendering to the React UI bundle referenced by uiBundle.

Required Properties

Resolve all properties before generating any metadata. Each has a fallback chain — work through each option in order until a value is found.

PropertyFormatHow to Resolve
appNamelowercamelcase (e.g., myInternalApp)The UI bundle name from uiBundles/<name>/ directory
appNamespaceStringnamespace in sfdx-project.json → sf data query -q "SELECT NamespacePrefix FROM Organization" --target-org ${usernameOrAlias} → default c
appLabelHuman-readable stringUser-provided, or derive from appName by converting camelCase to Title Case

The appNamespace and appName connect the Custom Application to the correct React UI bundle. In newer API versions this uses <uiBundle>{appNamespace}__{appName}</uiBundle>; in older versions it uses <webApplication>{appName}</webApplication>. Getting this wrong means the app launcher entry exists but shows a blank page. Step 2 of the workflow determines which field to use.

Generation Workflow

Step 1: Resolve All Required Properties

Determine values for all properties before constructing anything. Use the resolution strategies in the table above.

Step 2: Query API Context (Version-Aware Field Discovery)

Call salesforce-api-context MCP tools to discover which fields exist for the target org's API version. This ensures the generated metadata is compatible with the user's Salesforce version.

Required calls — use the metadataType parameter exactly as shown. Do not substitute a detail parameter or any other shape; metadataType is the only parameter this tool accepts:

  1. get_metadata_type_fields({ "metadataType": "CustomApplication" }) — check whether the uiBundle field exists in the response's field list
  2. get_metadata_type_fields({ "metadataType": "UIBundle" }) — check whether the target field exists in the response's field list

Field resolution based on API response:

Field CheckIf presentIf absent (older API version)
CustomApplication.uiBundleUse <uiBundle>{appNamespace}__{appName}</uiBundle>Use <webApplication>{appName}</webApplication> (no namespace)
UIBundle.targetUse <target>CustomApplication</target>Omit the <target> element entirely

If salesforce-api-context is unavailable after a real attempt, fall back to the newer field names (uiBundle + target).

Step 3: Create the Project Structure

Create any files and directories that don't already exist:

Metadata TypePath
CustomApplication<sourceDir>/applications/{appName}.app-meta.xml

Note: <sourceDir> is determined from sfdx-project.json. Read packageDirectories[] and use the entry where "default": true; the full source directory is <path>/main/default. If no default is set, use the first entry. Commonly force-app/main/default, but this path is configurable.

Step 4: Populate All Metadata Fields

Use the default template in the doc below. Values in {braces} are resolved property references — substitute them with the actual values from Step 1. Apply the field resolution from Step 2 to determine which XML elements to use.

Metadata TypeTemplate Reference
CustomApplicationconfigure-metadata-custom-application.md [blocked]

Execution Note for Step 4: Load and use the doc

  • Agents MUST read the full contents of the references/*.md file referenced in Step 4 before attempting to populate metadata fields.
  • Read the file in full, replace placeholders (e.g. {appName}) with the resolved values, then use the expanded template to populate the metadata XML content.
  • If Step 2 determined the older field names apply, substitute <uiBundle> with <webApplication> in the generated output.

Step 5: Update UI Bundle Meta XML

This step edits an existing file — it never creates a new one. UIBundle is a bundle-style metadata type: its meta XML normally lives inside its own folder at uiBundles/{appName}/{appName}.uibundle-meta.xml, alongside the bundle's other source files (e.g. index.html, src/). Some older or hand-authored projects may instead have it at the flat path uiBundles/{appName}.uibundle-meta.xml (no subfolder).

Run node scripts/resolve-uibundle-path.mjs "{appName}" — it prints the path of the existing meta XML (preferring the nested layout, falling back to the flat layout). Always invoke via node (never as a bare executable) so this works on Windows as well as macOS/Linux. Edit that exact file in place; do not create a second file at the other path or migrate it to a different layout as part of this skill.

If Step 2 confirmed the target field exists on UIBundle, add <target>CustomApplication</target> inside the existing <UIBundle> element of that file, preserving every other existing element and value untouched (skip this step entirely if the field doesn't exist in the org's API version — do not create the file or add <target> in that case).

Do NOT:

  • Create a new .uibundle-meta.xml file
  • Create a second .uibundle-meta.xml file at a different path when one already exists (nested or flat) — edit the existing one in place, wherever it is
  • Leave the original uiBundles/{appName}/{appName}.uibundle-meta.xml (or uiBundles/{appName}.uibundle-meta.xml, if that's the existing layout) unmodified while adding <target> somewhere else

The only files this skill produces or modifies are applications/{appName}.app-meta.xml (new) and the existing {appName}.uibundle-meta.xml (edited in place, only if <target> applies). Any other UI-bundle-related file appearing in the output is a bug.

Example of the fully updated file (at uiBundles/{appName}/{appName}.uibundle-meta.xml, or the flat path if that's the existing layout) — this illustrates the end state of the existing file, not a new file to create:

xml
<?xml version="1.0" encoding="UTF-8"?><UIBundle xmlns="http://soap.sforce.com/2006/04/metadata">    <masterLabel>{appName}</masterLabel>    <description>A Salesforce UI Bundle.</description>    <isActive>true</isActive>    <version>1</version>    <target>CustomApplication</target></UIBundle>

Step 6: Do Not Modify Non-Templated Properties

Do not modify any default property values for CustomApplication metadata that are not expressed as variables wrapped in {braces}.

Verification Checklist

Before deploying, confirm:

  • All required properties are resolved
  • API context was queried to determine available fields (Step 2)
  • applications/{appName}.app-meta.xml exists with correct content
  • The bundle reference field matches the org's API version (<uiBundle> or <webApplication>)
  • If target field is supported: the existing {appName}.uibundle-meta.xml (nested at uiBundles/{appName}/, or flat at uiBundles/, whichever already existed) has <target>CustomApplication</target>
  • No extra .uibundle-meta.xml file was created — exactly one {appName}.uibundle-meta.xml exists, at whichever path it already lived at
  • Deployment validates successfully:
bash
sf project deploy validate --metadata CustomApplication UIBundle --target-org ${usernameOrAlias}

來源與署名

來源:forcedotcom/sf-skills位於skills/experience-ui-bundle-custom-app-generate提交e5164d9

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架

更多來自 forcedotcom/sf-skills 的技能

Service Itsm Teams Itservice Configure

forcedotcom

Configure the "Set Up Salesforce IT Service" checklist for Microsoft Teams Employee Service (ITSM) — the employee side, covering app enablement, marketplace install guidance, user access assignment, and Digital Experience Site selection. Use this for: 'turn on Salesforce IT Service', 'set up IT Service on Teams', 'assign Teams for Employee permission set', 'give employees access to Teams for Employee Service', 'manage user access for Teams ITSM', 'grant users the permission sets needed for Teams Employee Service', 'select a digital experience site for Teams', 'install Salesforce IT Service app on Teams', or any request to complete the IT Service half of the Teams ITSM Go page checklist (including the Manage User Access step). DO NOT TRIGGER for the base Teams Salesforce Go page toggle or Azure/Entra app setup (service-itsm-teams-configure) or for the IT Desk/fulfiller half of the checklist (service-itsm-teams-itdesk-configure).

待分類1K昨天更新

Service Itsm Teams Coordinate

forcedotcom

End-to-end autopilot orchestrator for setting up Microsoft Teams integration in Salesforce Service Cloud ITSM — runs the whole flow (enable the Teams for Employee Service Go feature, register the Microsoft Entra app, populate Named Credentials, configure the IT Desk and IT Service checklists, turn on Swarming, and optionally embed the Agentforce agent) in one continuous pass, stopping only at the points a human must act. Use when the user asks to set up Microsoft Teams for ITSM end to end, 'set up teams for it service', 'do the whole teams itsm setup', 'configure microsoft teams for employee service', or wants a guided Teams ITSM walkthrough. Delegates each stage to a specialized child skill while driving the sequence itself. DO NOT TRIGGER when the user asks to enable Teams alone, configure just the IT Desk or IT Service checklist alone, or enable Swarming alone — delegate directly to the specific child skill in those cases.

待分類1K昨天更新

Service Itsm Teams Itdesk Configure

forcedotcom

Configure the "Set Up Salesforce IT Desk" checklist for Microsoft Teams Employee Service (ITSM) — the fulfiller/agent side, covering app enablement, marketplace install guidance, user access assignment, and Swarming collaboration-tool setup. Use this for: 'turn on Salesforce IT Desk', 'set up IT Desk on Teams', 'assign Teams for IT Desk permission set', 'set Teams as collaboration tool for swarming', 'install Salesforce IT Desk app on Teams', or any request to complete the IT Desk half of the Teams ITSM Go page checklist. DO NOT TRIGGER for the base Teams Salesforce Go page toggle or Azure/Entra app setup (service-itsm-teams-configure) or for the IT Service/employee half of the checklist (service-itsm-teams-itservice-configure).

待分類1K昨天更新

Service Itsm Teams Debug

forcedotcom

透過對 Salesforce 組織執行通過/失敗設定檢查清單,診斷 Microsoft Teams 員工服務(ITSM)設定失敗問題。

DevOps & Cloud1K昨天更新

Service Itsm Teams Employee Agent Configure

forcedotcom

Configure the embedded Agentforce Employee Agent so it replies inside the Microsoft Teams ITSM custom client ('Salesforce Employee Assist' / 'Ask AI Agent'). Use this for: 'set up employee agent in Teams', 'embed Agentforce agent in Teams', 'make the IT Service Employee Agent reply in Teams', 'Teams Ask AI Agent not responding', 'agent joins then leaves without replying', 'configure MIAW deployment for Teams employee agent', 'Teams embedded messaging agent setup'. Builds the whole stack headlessly (zero Setup-UI clicks): the Web messaging channel with User Verification ON, the Enhanced Chat User Verification Key Set (JWKS_URL) it requires, the Teams_AgentForce custom-client deployment, the routing flow to the agent, and the Agent Access permission set that lets the portal user reach the agent. DO NOT TRIGGER for enabling the Teams feature Salesforce Go page toggle (service-itsm-teams-configure) or for configuring notification preferences.

待分類1K昨天更新

Service Itsm Swarming Configure

forcedotcom

透過 Connect API 呼叫啟用 Salesforce Swarming ITSM 功能,並將協作工具設為 Teams。

DevOps & Cloud1K昨天更新