用途:在已有 SFDX 项目中新增 React 或 Angular 前端 UI Bundle,并配置 UI Bundle 元数据与配置文件。
主要能力:强制使用 sf template generate ui-bundle 生成新应用,禁止用 create-react-app、Vite、Angular CLI 或手写元数据替代;通过 node <skill_dir>/scripts/detect-framework.mjs [<ROOT>] 检测框架(react/angular/ambiguous/unknown);用 node <skill_dir>/scripts/verify-bundle-location.mjs <BundleName> [<CustomOutputDir>] [<framework>] 校验位置及 package.json、src/、入口 index.html;用 node <skill_dir>/scripts/check-api-version.mjs 确保 sourceApiVersion 为 67.0 或更高;替换默认样板、填充首页内容、配置托管 target 与 CSP 受信站点。
使用方式:Bundle 必须位于 force-app/main/default/uiBundles/<AppName>/,目录名与 <AppName>.uibundle-meta.xml 一致,并含构建输出目录(默认 dist/)。元数据必填 masterLabel、version(最多 20 字符)、isActive;可选 description(最多 255 字符)、target。target 取 Experience(外部站点)或 CustomApplication(内部 App Launcher),无 target 则不可见,需配合 experience-ui-bundle-site-generate 或 experience-ui-bundle-custom-app-generate。ui-bundle.json 可选,顶层键限 outputDir、routing、headers,须为合法 UTF-8 JSON、最大 100 KB、根为非空对象,路径需安全。外部域名须在 force-app/main/default/cspTrustedSites/ 注册 CSP 受信站点。
限制:框架支持范围仅限 references/ 下 <framework>-metadata-generate.md 所列;名称仅限字母数字;运行脚本前须先安装依赖。其余细节暂未提供。