Skip to content

Commit d7c6531

Browse files
committed
feat: release 3 new skills: generating-ui-bundle-custom-app, reviewing-lwc-mobile-offline, using-mobile-native-capabilities @W-22808637@
1 parent 9a07125 commit d7c6531

27 files changed

Lines changed: 2834 additions & 10 deletions

File tree

skills/building-ui-bundle-app/SKILL.md

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: building-ui-bundle-app
33
description: "MUST activate when the user wants to build, create, or generate a React application, React app, web application, single-page application (SPA), or frontend application — even if no project files exist yet. MUST also activate when the project contains a uiBundles/*/src/ directory or sfdx-project.json and the prompt says create, build, construct, or generate a new app, site, or page from scratch — even if the prompt also describes visual styling. MUST also activate when the task spans more than one ui-bundle skill. Use this skill when building a complete app end-to-end. This is the orchestrator that coordinates scaffolding, features, data access, frontend UI, integrations, and deployment in the correct dependency order. Without it, phases execute out of order and the app breaks. Do NOT use for Lightning Experience apps with custom objects (use generating-lightning-app). Do NOT use for single-concern edits to an existing page (use building-ui-bundle-frontend)."
44
metadata:
55
version: "1.0"
6-
related-skills: generating-ui-bundle-metadata, generating-ui-bundle-features, using-ui-bundle-salesforce-data, building-ui-bundle-frontend, implementing-ui-bundle-agentforce-conversation-client, implementing-ui-bundle-file-upload, deploying-ui-bundle, generating-ui-bundle-site
6+
related-skills: generating-ui-bundle-metadata, generating-ui-bundle-features, using-ui-bundle-salesforce-data, building-ui-bundle-frontend, implementing-ui-bundle-agentforce-conversation-client, implementing-ui-bundle-file-upload, deploying-ui-bundle, generating-ui-bundle-site, generating-ui-bundle-custom-app
77
---
88

99
# Building a UI Bundle App
@@ -126,7 +126,11 @@ Final UI bundle build (rebuilds with the deployed schema)
126126

127127
Follows the canonical 7-step deployment sequence. Must deploy metadata before fetching schema. Must assign permissions before schema fetch.
128128

129-
### Phase 7: Experience Site (Optional)
129+
### Phase 7: Hosting Target
130+
131+
Choose **one** of the following based on the app's audience:
132+
133+
#### Phase 7a: Experience Site (External)
130134

131135
```
132136
Resolve site properties (siteName, appDevName, etc.)
@@ -136,7 +140,21 @@ Generate site metadata (Network, CustomSite, DigitalExperience)
136140
Deploy site infrastructure
137141
```
138142

139-
Creates the Digital Experience site that hosts the UI bundle. Only needed when the user wants a public-facing or authenticated site URL.
143+
Creates the Digital Experience site that hosts the UI bundle. Use when the user wants a public-facing or authenticated site URL for external users.
144+
145+
#### Phase 7b: Custom Application (Internal)
146+
147+
```
148+
Resolve app properties (appName, appNamespace, appLabel)
149+
v
150+
Generate CustomApplication metadata (applications/*.app-meta.xml)
151+
v
152+
Add <target>CustomApplication</target> to .uibundle-meta.xml
153+
v
154+
Deploy custom application
155+
```
156+
157+
Creates a Custom Application entry in the Lightning App Launcher. Use when the app is for internal users accessing it within Lightning Experience.
140158

141159
---
142160

@@ -184,7 +202,7 @@ INTEGRATIONS (if applicable):
184202
185203
DEPLOYMENT:
186204
- Target org: [org alias if known]
187-
- Experience Site: [yes/no, site name if applicable]
205+
- Hosting target: [Experience Site / Custom Application / none]
188206
189207
SKILL LOAD ORDER:
190208
1. generating-ui-bundle-metadata
@@ -194,7 +212,8 @@ SKILL LOAD ORDER:
194212
5a. implementing-ui-bundle-agentforce-conversation-client (if chat requested)
195213
5b. implementing-ui-bundle-file-upload (if file upload requested)
196214
6. deploying-ui-bundle
197-
7. generating-experience-react-site (if site requested)
215+
7a. generating-ui-bundle-site (if Experience Site requested -- external users)
216+
7b. generating-ui-bundle-custom-app (if Custom Application requested -- internal users)
198217
```
199218

200219
### STEP 2: Per-Phase Execution
@@ -248,12 +267,18 @@ Execute each phase sequentially. Complete all steps within a phase before moving
248267
- 3. Verify: Confirm deployment succeeds and app is accessible
249268
- 4. Checkpoint: App deployed -- proceed to Phase 7 if needed
250269

251-
**Phase 7 -- Experience Site** (skip if not requested)
252-
- 1. Load skill: Invoke `generating-experience-react-site`
270+
**Phase 7a -- Experience Site** (skip if not requested or if Custom Application chosen)
271+
- 1. Load skill: Invoke `generating-ui-bundle-site`
253272
- 2. Execute: Resolve properties, generate site metadata, deploy
254273
- 3. Verify: Confirm site URL is accessible
255274
- 4. Checkpoint: Site live -- build complete
256275

276+
**Phase 7b -- Custom Application** (skip if not requested or if Experience Site chosen)
277+
- 1. Load skill: Invoke `generating-ui-bundle-custom-app`
278+
- 2. Execute: Resolve app properties, generate CustomApplication metadata, add CustomApplication target to meta XML
279+
- 3. Verify: Confirm app appears in App Launcher
280+
- 4. Checkpoint: App registered -- build complete
281+
257282
### STEP 3: Final Summary
258283

259284
After all phases complete, present a build summary:
@@ -268,7 +293,7 @@ PHASES COMPLETED:
268293
[x] Phase 4: UI -- [count] pages, [count] components
269294
[x] Phase 5: Integrations -- [list or "none"]
270295
[x] Phase 6: Deployment -- deployed to [org]
271-
[x] Phase 7: Experience Site -- [site URL or "skipped"]
296+
[x] Phase 7: Hosting Target -- [Experience Site URL / Custom Application name / "skipped"]
272297
273298
FILES GENERATED:
274299
[list key files and their paths]

skills/generating-custom-application/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: generating-custom-application
3-
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."
3+
description: "Use this skill when users need to create or configure tab-based Salesforce Custom Applications with navigation, branding, and action overrides. 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. Do NOT use when the goal is hosting a React UI bundle in the App Launcher — use generating-ui-bundle-custom-app for that case."
44
metadata:
55
version: "1.0"
66
---
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
---
2+
name: generating-ui-bundle-custom-app
3+
description: "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 generating-custom-application for this — UI bundle apps do not use tabs, action overrides, or flexipages."
4+
metadata:
5+
version: "1.0"
6+
---
7+
8+
# Custom Application for React UI Bundles
9+
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.
10+
11+
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`.
12+
13+
## Required Properties
14+
Resolve all properties before generating any metadata. Each has a fallback chain — work through each option in order until a value is found.
15+
16+
| Property | Format | How to Resolve |
17+
|----------|--------|----------------|
18+
| **appName** | `lowercamelcase` (e.g., `myInternalApp`) | The UI bundle name from `uiBundles/<name>/` directory |
19+
| **appNamespace** | String | `namespace` in `sfdx-project.json``sf data query -q "SELECT NamespacePrefix FROM Organization" --target-org ${usernameOrAlias}` → default `c` |
20+
| **appLabel** | Human-readable string | User-provided, or derive from appName by converting camelCase to Title Case |
21+
22+
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.
23+
24+
## Generation Workflow
25+
### Step 1: Resolve All Required Properties
26+
Determine values for all properties before constructing anything. Use the resolution strategies in the table above.
27+
28+
### Step 2: Query API Context (Version-Aware Field Discovery)
29+
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.
30+
31+
**Required calls:**
32+
1. Call `get_metadata_type_fields` for `CustomApplication` — check whether the `uiBundle` field exists
33+
2. Call `get_metadata_type_fields` for `UIBundle` — check whether the `target` field exists
34+
35+
**Field resolution based on API response:**
36+
37+
| Field Check | If present | If absent (older API version) |
38+
|-------------|-----------|-------------------------------|
39+
| `CustomApplication.uiBundle` | Use `<uiBundle>{appNamespace}__{appName}</uiBundle>` | Use `<webApplication>{appName}</webApplication>` (no namespace) |
40+
| `UIBundle.target` | Use `<target>CustomApplication</target>` | Omit the `<target>` element entirely |
41+
42+
If `salesforce-api-context` is unavailable after a real attempt, fall back to the newer field names (`uiBundle` + `target`).
43+
44+
### Step 3: Create the Project Structure
45+
Create any files and directories that don't already exist:
46+
47+
| Metadata Type | Path |
48+
|--------------|------|
49+
| CustomApplication | `<sourceDir>/applications/{appName}.app-meta.xml` |
50+
51+
**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.
52+
53+
### Step 4: Populate All Metadata Fields
54+
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.
55+
56+
| Metadata Type | Template Reference |
57+
|--------------|-------------------|
58+
| CustomApplication | [configure-metadata-custom-application.md](docs/configure-metadata-custom-application.md) |
59+
60+
### Execution Note for Step 4: Load and use the doc
61+
- Agents MUST read the full contents of the docs/*.md file referenced in Step 4 before attempting to populate metadata fields.
62+
- 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.
63+
- If Step 2 determined the older field names apply, substitute `<uiBundle>` with `<webApplication>` in the generated output.
64+
65+
### Step 5: Update UI Bundle Meta XML
66+
If Step 2 confirmed the `target` field exists on `UIBundle`, add `<target>CustomApplication</target>` to the `.uibundle-meta.xml` file (skip if the field doesn't exist in the org's API version):
67+
68+
```xml
69+
<?xml version="1.0" encoding="UTF-8"?>
70+
<UIBundle xmlns="http://soap.sforce.com/2006/04/metadata">
71+
<masterLabel>{appName}</masterLabel>
72+
<description>A Salesforce UI Bundle.</description>
73+
<isActive>true</isActive>
74+
<version>1</version>
75+
<target>CustomApplication</target>
76+
</UIBundle>
77+
```
78+
79+
### Step 6: Do Not Modify Non-Templated Properties
80+
Do not modify any default property values for `CustomApplication` metadata that are not expressed as variables wrapped in `{braces}`.
81+
82+
## Verification Checklist
83+
Before deploying, confirm:
84+
85+
- [ ] All required properties are resolved
86+
- [ ] API context was queried to determine available fields (Step 2)
87+
- [ ] `applications/{appName}.app-meta.xml` exists with correct content
88+
- [ ] The bundle reference field matches the org's API version (`<uiBundle>` or `<webApplication>`)
89+
- [ ] If `target` field is supported: `.uibundle-meta.xml` has `<target>CustomApplication</target>`
90+
- [ ] Deployment validates successfully:
91+
```bash
92+
sf project deploy validate --metadata CustomApplication UIBundle --target-org ${usernameOrAlias}
93+
```
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Configure Metadata: CustomApplication
2+
3+
## Purpose
4+
This configuration file creates a **net-new, default** CustomApplication metadata record for a Lightning Experience app that hosts a React UI bundle. It is not intended to edit or modify an existing CustomApplication record. Use this template only when provisioning a brand-new Custom Application for a UI bundle.
5+
6+
## File Location
7+
```
8+
<sourceDir>/applications/{appName}.app-meta.xml
9+
```
10+
11+
**Note:** Determine `<sourceDir>` from `sfdx-project.json``packageDirectories[]` → find the entry with `"default": true` → use its `path` value + `/main/default`. Commonly `force-app/main/default`, but this is configurable.
12+
13+
## Default Template (newer API versions — `uiBundle` field available)
14+
```xml
15+
<?xml version="1.0" encoding="UTF-8"?>
16+
<CustomApplication xmlns="http://soap.sforce.com/2006/04/metadata">
17+
<brand>
18+
<headerColor>#0070D2</headerColor>
19+
<shouldOverrideOrgTheme>false</shouldOverrideOrgTheme>
20+
</brand>
21+
<formFactors>Small</formFactors>
22+
<formFactors>Large</formFactors>
23+
<isNavAutoTempTabsDisabled>false</isNavAutoTempTabsDisabled>
24+
<isNavPersonalizationDisabled>false</isNavPersonalizationDisabled>
25+
<isNavTabPersistenceDisabled>false</isNavTabPersistenceDisabled>
26+
<isOmniPinnedViewEnabled>false</isOmniPinnedViewEnabled>
27+
<label>{appLabel}</label>
28+
<navType>Standard</navType>
29+
<uiBundle>{appNamespace}__{appName}</uiBundle>
30+
<uiType>Lightning</uiType>
31+
</CustomApplication>
32+
```
33+
34+
## Fallback Template (older API versions — `uiBundle` field NOT available)
35+
```xml
36+
<?xml version="1.0" encoding="UTF-8"?>
37+
<CustomApplication xmlns="http://soap.sforce.com/2006/04/metadata">
38+
<brand>
39+
<headerColor>#0070D2</headerColor>
40+
<shouldOverrideOrgTheme>false</shouldOverrideOrgTheme>
41+
</brand>
42+
<formFactors>Small</formFactors>
43+
<formFactors>Large</formFactors>
44+
<isNavAutoTempTabsDisabled>false</isNavAutoTempTabsDisabled>
45+
<isNavPersonalizationDisabled>false</isNavPersonalizationDisabled>
46+
<isNavTabPersistenceDisabled>false</isNavTabPersistenceDisabled>
47+
<isOmniPinnedViewEnabled>false</isOmniPinnedViewEnabled>
48+
<label>{appLabel}</label>
49+
<navType>Standard</navType>
50+
<webApplication>{appName}</webApplication>
51+
<uiType>Lightning</uiType>
52+
</CustomApplication>
53+
```
54+
55+
## Field Reference
56+
57+
| Field | Required | Version | Description |
58+
|-------|----------|---------|-------------|
59+
| `brand.headerColor` | Yes | All | Hex color for the app header bar in Lightning Experience. Default: `#0070D2` (Salesforce blue). |
60+
| `brand.shouldOverrideOrgTheme` | Yes | All | Whether this app's branding overrides the org theme. Default: `false`. |
61+
| `formFactors` | Yes | All | Supported form factors. Include both `Small` (mobile) and `Large` (desktop) for full coverage. |
62+
| `isNavAutoTempTabsDisabled` | Yes | All | Disable auto-creation of temporary tabs. Default: `false`. |
63+
| `isNavPersonalizationDisabled` | Yes | All | Disable user personalization of navigation. Default: `false`. |
64+
| `isNavTabPersistenceDisabled` | Yes | All | Disable persistence of nav tabs across sessions. Default: `false`. |
65+
| `isOmniPinnedViewEnabled` | Yes | All | Enable Omni-channel pinned view. Default: `false`. |
66+
| `label` | Yes | All | Human-readable label shown in the App Launcher and app switcher. |
67+
| `navType` | Yes | All | Navigation type. Use `Standard` for standard Lightning navigation. |
68+
| `uiBundle` | Conditional | Newer | Namespace-qualified developer name of the UI bundle (`{appNamespace}__{appName}`). Use when `get_metadata_type_fields` confirms this field exists on `CustomApplication`. |
69+
| `webApplication` | Conditional | Older | Developer name of the UI bundle (`{appName}`, no namespace). Use when `uiBundle` field is not available. |
70+
| `uiType` | Yes | All | UI framework type. Must be `Lightning` for UI bundle apps. |

skills/generating-ui-bundle-metadata/SKILL.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ After generation:
2424
1. Replace all default boilerplate — "React App", "Vite + React", default `<title>`, placeholder text
2525
2. Populate the home page with real content (landing section, banners, hero, navigation)
2626
3. Update navigation and placeholders (see the `building-ui-bundle-frontend` skill)
27+
4. **Configure a hosting target** — a UI bundle without a `<target>` in its meta XML will not be visible in the org. Use `generating-ui-bundle-custom-app` for internal (App Launcher) apps or `generating-ui-bundle-site` for external (Experience Site) apps.
2728

2829
Always install dependencies before running any scripts in the UI bundle directory.
2930

@@ -39,7 +40,44 @@ A UIBundle bundle lives under `uiBundles/<AppName>/` and must contain:
3940
### Meta XML
4041

4142
Required fields: `masterLabel`, `version` (max 20 chars), `isActive` (boolean).
42-
Optional: `description` (max 255 chars).
43+
Optional: `description` (max 255 chars), `target`.
44+
45+
#### Target Field
46+
47+
The `<target>` element specifies where the UI bundle is hosted:
48+
49+
| Value | Use Case | Companion Metadata |
50+
|-------|----------|-------------------|
51+
| `Experience` | External-facing site via Digital Experience | Network, CustomSite, DigitalExperienceConfig, DigitalExperienceBundle |
52+
| `CustomApplication` | Internal app via Lightning App Launcher | CustomApplication (`applications/*.app-meta.xml`) |
53+
54+
A `<target>` is **required** for the app to be accessible in a Salesforce org. A UI bundle deployed without a target will not appear anywhere — no App Launcher entry, no Experience Site URL. Always pair the bundle with one of:
55+
- `generating-ui-bundle-site` (for `Experience` target)
56+
- `generating-ui-bundle-custom-app` (for `CustomApplication` target)
57+
58+
**Example with Experience target:**
59+
```xml
60+
<?xml version="1.0" encoding="UTF-8"?>
61+
<UIBundle xmlns="http://soap.sforce.com/2006/04/metadata">
62+
<masterLabel>propertyrentalapp</masterLabel>
63+
<description>A Salesforce UI Bundle.</description>
64+
<isActive>true</isActive>
65+
<version>1</version>
66+
<target>Experience</target>
67+
</UIBundle>
68+
```
69+
70+
**Example with CustomApplication target:**
71+
```xml
72+
<?xml version="1.0" encoding="UTF-8"?>
73+
<UIBundle xmlns="http://soap.sforce.com/2006/04/metadata">
74+
<masterLabel>propertymanagementapp</masterLabel>
75+
<description>A Salesforce UI Bundle.</description>
76+
<isActive>true</isActive>
77+
<version>1</version>
78+
<target>CustomApplication</target>
79+
</UIBundle>
80+
```
4381

4482
### ui-bundle.json
4583

0 commit comments

Comments
 (0)