@salesforce/afv-skills 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/package.json +5 -4
  2. package/skills/accessing-webapp-data/SKILL.md +178 -0
  3. package/skills/building-webapp-data-visualization/SKILL.md +72 -0
  4. package/skills/building-webapp-data-visualization/implementation/bar-line-chart.md +316 -0
  5. package/skills/building-webapp-data-visualization/implementation/dashboard-layout.md +189 -0
  6. package/skills/building-webapp-data-visualization/implementation/donut-chart.md +181 -0
  7. package/skills/building-webapp-data-visualization/implementation/stat-card.md +150 -0
  8. package/skills/building-webapp-react-components/SKILL.md +96 -0
  9. package/skills/building-webapp-react-components/implementation/component.md +78 -0
  10. package/skills/building-webapp-react-components/implementation/header-footer.md +132 -0
  11. package/skills/building-webapp-react-components/implementation/page.md +93 -0
  12. package/skills/configuring-webapp-csp-trusted-sites/SKILL.md +90 -0
  13. package/skills/configuring-webapp-csp-trusted-sites/implementation/metadata-format.md +281 -0
  14. package/skills/configuring-webapp-metadata/SKILL.md +158 -0
  15. package/skills/creating-webapp/SKILL.md +141 -0
  16. package/skills/deploying-webapp-to-salesforce/SKILL.md +229 -0
  17. package/skills/exploring-webapp-graphql-schema/SKILL.md +149 -0
  18. package/skills/fetching-webapp-rest-api/SKILL.md +167 -0
  19. package/skills/{salesforce-custom-application → generating-custom-application}/SKILL.md +1 -2
  20. package/skills/{salesforce-custom-field → generating-custom-field}/SKILL.md +1 -1
  21. package/skills/{salesforce-custom-lightning-type → generating-custom-lightning-type}/SKILL.md +36 -2
  22. package/skills/{salesforce-custom-object → generating-custom-object}/SKILL.md +1 -1
  23. package/skills/{salesforce-custom-tab → generating-custom-tab}/SKILL.md +1 -1
  24. package/skills/{salesforce-experience-lwr-site → generating-experience-lwr-site}/SKILL.md +1 -1
  25. package/skills/{salesforce-experience-lwr-site → generating-experience-lwr-site}/docs/handle-ui-components.md +1 -1
  26. package/skills/generating-experience-react-site/SKILL.md +67 -0
  27. package/skills/generating-experience-react-site/docs/configure-metadata-custom-site.md +41 -0
  28. package/skills/generating-experience-react-site/docs/configure-metadata-digital-experience-bundle.md +17 -0
  29. package/skills/generating-experience-react-site/docs/configure-metadata-digital-experience-config.md +21 -0
  30. package/skills/generating-experience-react-site/docs/configure-metadata-digital-experience.md +38 -0
  31. package/skills/generating-experience-react-site/docs/configure-metadata-network.md +72 -0
  32. package/skills/{salesforce-flexipage → generating-flexipage}/SKILL.md +86 -9
  33. package/skills/{salesforce-flow → generating-flow}/SKILL.md +1 -1
  34. package/skills/{salesforce-fragment → generating-fragment}/SKILL.md +1 -1
  35. package/skills/generating-lightning-app/SKILL.md +423 -0
  36. package/skills/{salesforce-list-view → generating-list-view}/SKILL.md +1 -1
  37. package/skills/{generate-permission-set → generating-permission-set}/SKILL.md +1 -1
  38. package/skills/{salesforce-validation-rule → generating-validation-rule}/SKILL.md +1 -1
  39. package/skills/generating-webapp-graphql-mutation-query/SKILL.md +258 -0
  40. package/skills/generating-webapp-graphql-read-query/SKILL.md +253 -0
  41. package/skills/implementing-webapp-file-upload/SKILL.md +396 -0
  42. package/skills/installing-webapp-features/SKILL.md +210 -0
  43. package/skills/managing-webapp-agentforce-conversation-client/SKILL.md +186 -0
  44. package/skills/managing-webapp-agentforce-conversation-client/references/constraints.md +134 -0
  45. package/skills/managing-webapp-agentforce-conversation-client/references/examples.md +132 -0
  46. package/skills/managing-webapp-agentforce-conversation-client/references/style-tokens.md +101 -0
  47. package/skills/managing-webapp-agentforce-conversation-client/references/troubleshooting.md +57 -0
  48. package/skills/switching-org/SKILL.md +28 -0
  49. package/skills/using-webapp-graphql/SKILL.md +324 -0
  50. package/skills/using-webapp-graphql/shared-schema.graphqls +1150 -0
  51. package/skills/salesforce-lightning-app-build/SKILL.md +0 -346
  52. package/skills/salesforce-web-app-creating-records/SKILL.md +0 -84
  53. package/skills/salesforce-web-app-feature/SKILL.md +0 -70
  54. package/skills/salesforce-web-app-list-and-create-records/SKILL.md +0 -36
  55. package/skills/salesforce-web-application/SKILL.md +0 -34
  56. /package/skills/{salesforce-experience-lwr-site → generating-experience-lwr-site}/docs/bootstrap-template-byo-lwr.md +0 -0
  57. /package/skills/{salesforce-experience-lwr-site → generating-experience-lwr-site}/docs/configure-content-brandingSet.md +0 -0
  58. /package/skills/{salesforce-experience-lwr-site → generating-experience-lwr-site}/docs/configure-content-route.md +0 -0
  59. /package/skills/{salesforce-experience-lwr-site → generating-experience-lwr-site}/docs/configure-content-themeLayout.md +0 -0
  60. /package/skills/{salesforce-experience-lwr-site → generating-experience-lwr-site}/docs/configure-content-view.md +0 -0
  61. /package/skills/{salesforce-experience-lwr-site → generating-experience-lwr-site}/docs/configure-guest-sharing-rules.md +0 -0
  62. /package/skills/{salesforce-experience-lwr-site → generating-experience-lwr-site}/docs/handle-component-and-region-ids.md +0 -0
@@ -0,0 +1,167 @@
1
+ ---
2
+ name: fetching-webapp-rest-api
3
+ description: REST API usage via the Data SDK fetch method. Use when implementing Chatter, Connect REST, Apex REST, UI API REST, or Einstein LLM calls — only when GraphQL is not sufficient.
4
+ paths:
5
+ - "**/*.ts"
6
+ - "**/*.tsx"
7
+ - "**/*.graphql"
8
+ ---
9
+
10
+ # Salesforce REST API via Data SDK Fetch
11
+
12
+ Use `sdk.fetch` from the Data SDK when GraphQL is not sufficient. The SDK applies authentication, CSRF handling, and base URL resolution. **Always use optional chaining** (`sdk.fetch?.()`) and handle the case where `fetch` is not available.
13
+
14
+ Invoke this skill when you need to call Chatter, Connect REST, Apex REST, UI API REST, or Einstein LLM endpoints.
15
+
16
+ ## API Version
17
+
18
+ Use the project's API version. It is typically injected as `__SF_API_VERSION__`; fallback to `"65.0"`:
19
+
20
+ ```typescript
21
+ declare const __SF_API_VERSION__: string;
22
+ const API_VERSION = typeof __SF_API_VERSION__ !== "undefined" ? __SF_API_VERSION__ : "65.0";
23
+ ```
24
+
25
+ ## Base Path
26
+
27
+ URLs are relative to the Salesforce API base. The SDK prepends the correct base path. Use paths starting with `/services/...`.
28
+
29
+ ---
30
+
31
+ ## Chatter API
32
+
33
+ User and collaboration data. No GraphQL equivalent.
34
+
35
+ | Endpoint | Method | Purpose |
36
+ | -------- | ------ | ------- |
37
+ | `/services/data/v{version}/chatter/users/me` | GET | Current user (id, name, email, username) |
38
+
39
+ ```typescript
40
+ const sdk = await createDataSDK();
41
+ const response = await sdk.fetch?.(`/services/data/v${API_VERSION}/chatter/users/me`);
42
+
43
+ if (!response?.ok) throw new Error(`HTTP ${response?.status}`);
44
+ const data = await response.json();
45
+ return { id: data.id, name: data.name };
46
+ ```
47
+
48
+ ---
49
+
50
+ ## Connect REST API
51
+
52
+ File and content operations.
53
+
54
+ | Endpoint | Method | Purpose |
55
+ | -------- | ------ | ------- |
56
+ | `/services/data/v{version}/connect/file/upload/config` | GET | Upload config (token, uploadUrl) for file uploads |
57
+
58
+ ```typescript
59
+ const sdk = await createDataSDK();
60
+ const configRes = await sdk.fetch?.(`/services/data/v${API_VERSION}/connect/file/upload/config`, {
61
+ method: "GET",
62
+ });
63
+
64
+ if (!configRes?.ok) throw new Error(`Failed to get upload config: ${configRes?.status}`);
65
+ const config = await configRes.json();
66
+ const { token, uploadUrl } = config;
67
+ ```
68
+
69
+ ---
70
+
71
+ ## Apex REST
72
+
73
+ Custom Apex REST resources. Requires corresponding Apex classes in the org. CSRF protection is applied automatically for `services/apexrest` URLs.
74
+
75
+ | Endpoint | Method | Purpose |
76
+ | -------- | ------ | ------- |
77
+ | `/services/apexrest/auth/login` | POST | User login |
78
+ | `/services/apexrest/auth/register` | POST | User registration |
79
+ | `/services/apexrest/auth/forgot-password` | POST | Request password reset |
80
+ | `/services/apexrest/auth/reset-password` | POST | Reset password with token |
81
+ | `/services/apexrest/auth/change-password` | POST | Change password (authenticated) |
82
+ | `/services/apexrest/{resource}` | GET/POST | Custom Apex REST resources |
83
+
84
+ **Example (login):**
85
+
86
+ ```typescript
87
+ const sdk = await createDataSDK();
88
+ const response = await sdk.fetch?.("/services/apexrest/auth/login", {
89
+ method: "POST",
90
+ body: JSON.stringify({ email, password, startUrl: "/" }),
91
+ headers: { "Content-Type": "application/json", Accept: "application/json" },
92
+ });
93
+ ```
94
+
95
+ Apex REST paths do not include the API version.
96
+
97
+ ---
98
+
99
+ ## UI API (REST)
100
+
101
+ When GraphQL cannot cover the use case. **Prefer GraphQL** when possible.
102
+
103
+ | Endpoint | Method | Purpose |
104
+ | -------- | ------ | ------- |
105
+ | `/services/data/v{version}/ui-api/records/{recordId}` | GET | Fetch a single record |
106
+
107
+ ```typescript
108
+ const sdk = await createDataSDK();
109
+ const response = await sdk.fetch?.(`/services/data/v${API_VERSION}/ui-api/records/${recordId}`);
110
+ ```
111
+
112
+ ---
113
+
114
+ ## Einstein LLM Gateway
115
+
116
+ AI features. Requires Einstein API setup.
117
+
118
+ | Endpoint | Method | Purpose |
119
+ | -------- | ------ | ------- |
120
+ | `/services/data/v{version}/einstein/llm/prompt/generations` | POST | Generate text from Einstein LLM |
121
+
122
+ ```typescript
123
+ const sdk = await createDataSDK();
124
+ const response = await sdk.fetch?.(`/services/data/v${API_VERSION}/einstein/llm/prompt/generations`, {
125
+ method: "POST",
126
+ headers: { "Content-Type": "application/json" },
127
+ body: JSON.stringify({
128
+ additionalConfig: { applicationName: "PromptTemplateGenerationsInvocable" },
129
+ promptTextorId: prompt,
130
+ }),
131
+ });
132
+
133
+ if (!response?.ok) throw new Error(`Einstein LLM failed (${response?.status})`);
134
+ const data = await response.json();
135
+ return data?.generations?.[0]?.text ?? "";
136
+ ```
137
+
138
+ ---
139
+
140
+ ## General Pattern
141
+
142
+ ```typescript
143
+ import { createDataSDK } from "@salesforce/sdk-data";
144
+
145
+ const sdk = await createDataSDK();
146
+
147
+ if (!sdk.fetch) {
148
+ throw new Error("Data SDK fetch is not available in this context");
149
+ }
150
+
151
+ const response = await sdk.fetch(url, {
152
+ method: "GET", // or POST, PUT, PATCH, DELETE
153
+ headers: { "Content-Type": "application/json", Accept: "application/json" },
154
+ body: method !== "GET" ? JSON.stringify(payload) : undefined,
155
+ });
156
+
157
+ if (!response.ok) throw new Error(`HTTP ${response.status}`);
158
+ const data = await response.json();
159
+ ```
160
+
161
+ ---
162
+
163
+ ## Reference
164
+
165
+ - Parent: `accessing-data` — enforces Data SDK usage for all Salesforce data fetches
166
+ - GraphQL: `using-graphql` — use for record queries and mutations when possible
167
+ - `createRecord` from `@salesforce/webapp-experimental/api` for UI API record creation (uses SDK internally)
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: salesforce-custom-application
2
+ name: generating-custom-application
3
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.
4
4
  ---
5
5
 
@@ -11,7 +11,6 @@ Use this skill when you need to:
11
11
  - Configure application navigation and branding
12
12
  - Set up custom page layouts for objects
13
13
  - Troubleshoot deployment errors related to custom applications
14
-
15
14
  # CustomApplication (Lightning App) Metadata Specification
16
15
 
17
16
  ## Overview
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: salesforce-custom-field
2
+ name: generating-custom-field
3
3
  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.
4
4
  ---
5
5
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: salesforce-custom-lightning-type
2
+ name: generating-custom-lightning-type
3
3
  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.
4
4
  ---
5
5
 
@@ -103,9 +103,11 @@ When strict validation is enabled (`unevaluatedProperties: false`), keep each pr
103
103
  - Top-level `editor` object.
104
104
  - Use `editor.componentOverrides` for component overrides.
105
105
  - Use `editor.layout` for layout.
106
+ - **DEPRECATED**: Do NOT use `propertyRenderers` or `view` — these are legacy keys. Always use `componentOverrides` and `layout` instead.
106
107
  - **Root override pattern** (most common for fully custom editing UI):
107
108
  - `editor.componentOverrides["$"] = { "definition": "c/<yourEditorComponent>", "attributes": { ... } }`
108
109
  - When passing schema data into a custom LWC, use attribute mapping with the `{!$attrs.<name>}` syntax: e.g. `"attributes": { "myField": "{!$attrs.value}" }` so the runtime binds schema values to your component's attributes.
110
+ - **CRITICAL**: The `<name>` in `{!$attrs.<name>}` must be a property defined in your type schema. For example, if your schema has a property called `temperature`, use `{!$attrs.temperature}`, not `{!$attrs.value}` unless `value` is an actual property.
109
111
  - **Property-level override pattern** (for individual fields):
110
112
  - `editor.componentOverrides["<propertyName>"] = { "definition": "es_property_editors/<...>" }`
111
113
  - **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`.
@@ -113,6 +115,7 @@ When strict validation is enabled (`unevaluatedProperties: false`), keep each pr
113
115
  - **Layout pattern**:
114
116
  - `editor.layout.definition = "lightning/verticalLayout"`
115
117
  - `editor.layout.children[*].definition = "lightning/propertyLayout"` with `attributes.property = "<propertyName>"`
118
+ - **CRITICAL**: `lightning/propertyLayout` only accepts the `property` attribute. Do NOT add `label`, `title`, or any other attributes — these will fail validation with `additionalProperties: false` errors.
116
119
  - **Avoid known-invalid patterns**:
117
120
  - Do not use `es_property_editors/inputList`.
118
121
  - Do not use `itemSchema` attributes.
@@ -121,18 +124,41 @@ When strict validation is enabled (`unevaluatedProperties: false`), keep each pr
121
124
  - Top-level `renderer` object.
122
125
  - Use `renderer.componentOverrides` for component overrides.
123
126
  - Use `renderer.layout` for layout.
127
+ - **DEPRECATED**: Do NOT use `propertyRenderers` or `view` — these are legacy keys. Always use `componentOverrides` and `layout` instead.
124
128
  - **Root override pattern** (most common for fully custom rendering UI):
125
129
  - `renderer.componentOverrides["$"] = { "definition": "c/<yourRendererComponent>", "attributes": { ... } }`
126
130
  - Use `{!$attrs.<name>}` in attribute mappings when binding schema data to custom renderer component attributes.
131
+ - **CRITICAL**: Attribute mappings like `{!$attrs.propertyName}` must reference properties that **actually exist** in your type schema. Referencing non-existent properties will fail validation.
132
+ - **Type matching**: Attribute values must match the expected type for the component. For example, if a component expects a string attribute, passing an integer will fail validation.
127
133
  - **Property-level override pattern**:
128
134
  - `renderer.componentOverrides["<propertyName>"] = { "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.
135
+ - **Layout pattern for renderer**:
136
+ - `renderer.layout.definition = "lightning/verticalLayout"`
137
+ - `renderer.layout.children[*].definition = "lightning/propertyLayout"` with `attributes.property = "<propertyName>"`
138
+ - **CRITICAL**: Same as editor layouts, `lightning/propertyLayout` only accepts the `property` attribute. Do NOT add `label`, `title`, or any other attributes.
129
139
  - **Collection renderer** (for root-level `lightning__listType` properties): Use `collection.renderer.componentOverrides["$"] = { "definition": "c/<yourListRendererComponent>" }` or `es_property_editors/genericListTypeRenderer` to render the list.
130
140
  5. **Place files in the correct bundle structure**
131
141
  - `lightningTypes/<TypeName>/schema.json`
132
142
  - (Optional) `lightningTypes/<TypeName>/lightningDesktopGenAi/editor.json`
133
143
  - (Optional) `lightningTypes/<TypeName>/lightningDesktopGenAi/renderer.json`
134
144
  - 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/`.
135
- 6. **Deploy and validate**
145
+ 6. **Configure custom LWC components (if using custom components)**
146
+ - **CRITICAL**: Custom LWC components referenced in editor/renderer configs MUST have the correct target configuration in their `-meta.xml` files:
147
+ - **For editor components** (`c/<componentName>` used in `editor.json`): The LWC's `-meta.xml` file must include `<target>lightning__AgentforceInput</target>`
148
+ - **For renderer components** (`c/<componentName>` used in `renderer.json`): The LWC's `-meta.xml` file must include `<target>lightning__AgentforceOutput</target>`
149
+ - Without the correct target, deployment will fail with: `Invalid target configuration. To use 'c/componentName' as a renderer/editor, your js-meta.xml file must include valid target 'lightning__AgentforceOutput/Input'.`
150
+ - Example `-meta.xml` for a renderer component:
151
+ ```xml
152
+ <?xml version="1.0" encoding="UTF-8"?>
153
+ <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
154
+ <apiVersion>60.0</apiVersion>
155
+ <isExposed>true</isExposed>
156
+ <targets>
157
+ <target>lightning__AgentforceOutput</target>
158
+ </targets>
159
+ </LightningComponentBundle>
160
+ ```
161
+ 7. **Deploy and validate**
136
162
  - 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.
137
163
  - Validate incrementally: if deployment fails, remove disallowed keywords first (especially `examples`, `items`, nested `lightning:type`).
138
164
 
@@ -144,6 +170,11 @@ When strict validation is enabled (`unevaluatedProperties: false`), keep each pr
144
170
  | 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 |
145
171
  | Apex-based CLT rejected | Extra fields added (e.g., `type`, `properties`) | Use only `title`, optional `description`, and `lightning:type` |
146
172
  | 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 |
173
+ | `additionalProperties` error on layout attributes | Adding `label` or other attributes to `lightning/propertyLayout` | Only use `property` attribute in `lightning/propertyLayout`. Remove `label`, `title`, or any other attributes |
174
+ | Invalid target configuration for custom LWC | Custom LWC component's `-meta.xml` missing required target (`lightning__AgentforceInput` or `lightning__AgentforceOutput`) | Add correct target to LWC's `-meta.xml`: use `lightning__AgentforceInput` for editors, `lightning__AgentforceOutput` for renderers |
175
+ | Attribute mapping doesn't exist in type schema | Using `{!$attrs.propertyName}` where `propertyName` is not defined in schema | Ensure all attribute mappings reference actual properties in your type schema's `properties` section |
176
+ | `additionalProperties` error with deprecated keys | Using `propertyRenderers` or `view` in editor/renderer config | Replace deprecated `propertyRenderers` with `componentOverrides` and `view` with `layout` |
177
+ | Type mismatch in component attributes | Passing wrong type for component attribute (e.g., integer instead of string) | Ensure attribute values match the expected type defined by the component |
147
178
 
148
179
  ## Verification Checklist
149
180
  - [ ] Root schema has `type: "object"`, `title`, `lightning:type: "lightning__objectType"`, and `unevaluatedProperties: false`
@@ -155,3 +186,6 @@ When strict validation is enabled (`unevaluatedProperties: false`), keep each pr
155
186
  - [ ] Bundle structure and filenames match Lightning Types requirements
156
187
  - [ ] 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
157
188
  - [ ] Renderer config uses output-style components (e.g. `es_property_editors/outputText`, `es_property_editors/outputNumber`) where applicable, not input editors
189
+ - [ ] Layout configurations use `lightning/propertyLayout` with ONLY the `property` attribute (no `label`, `title`, or other attributes)
190
+ - [ ] All attribute mappings (`{!$attrs.propertyName}`) reference properties that exist in the type schema
191
+ - [ ] Custom LWC components have correct targets in `-meta.xml`: `lightning__AgentforceInput` for editors, `lightning__AgentforceOutput` for renderers
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: salesforce-custom-object
2
+ name: generating-custom-object
3
3
  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.
4
4
  ---
5
5
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: salesforce-custom-tab
2
+ name: generating-custom-tab
3
3
  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.
4
4
  ---
5
5
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: salesforce-experience-lwr-site
2
+ name: generating-experience-lwr-site
3
3
  description: Creates, modifies, or manages Salesforce Experience Cloud LWR sites via DigitalExperience metadata. Always trigger when users mention Experience sites, LWR sites, DigitalExperience, Experience Cloud, community sites, portals, creating pages, adding routes, views, theme layouts, branding sets, previewing sites, or any DigitalExperience bundle work. Also use when users mention specific content types like sfdc_cms__route, sfdc_cms__themeLayout, etc. or when troubleshooting site deployment.
4
4
  ---
5
5
 
@@ -212,4 +212,4 @@ In this example the component threeColumn has 3 slots, named left, center, and r
212
212
  "definition" : "c:threeColumn",
213
213
  "id" : "b9e517c5-90ac-49e9-91b7-3730512c95a3",
214
214
  "type" : "component"
215
- }
215
+ }
@@ -0,0 +1,67 @@
1
+ ---
2
+ name: generating-experience-react-site
3
+ description: Use this skill when users need to create or configure a Salesforce Digital Experience Site specifically for hosting a React web application. Trigger when users mention creating an Experience site for a React app, setting up a React site on Salesforce, configuring Network/CustomSite/DigitalExperience metadata for a web app, or deploying site infrastructure for a React application. Also trigger when users mention site URL path prefixes, app namespaces, appDevName, guest access configuration, DigitalExperienceConfig, DigitalExperienceBundle, or sfdc_cms__site content types in the context of React apps. Always use this skill for any React web application site creation or site infrastructure configuration work, even if the user just says "create a site for my React app" or "set up the site for my web application."
4
+ ---
5
+
6
+ # Digital Experience Site for React Web Applications
7
+ Create and configure Digital Experience Sites that host React web applications on Salesforce. This skill generates the minimum necessary site infrastructure — Network, CustomSite, DigitalExperienceConfig, DigitalExperienceBundle, and the `sfdc_cms__site` content type — so a React app can be served from Salesforce.
8
+
9
+ React sites differ from standard LWR sites: they don't need routes, views, theme layouts, or branding sets. The site acts as a thin container (`appContainer: true`) that delegates rendering to the React application referenced by `appSpace`.
10
+
11
+ ## Required Properties
12
+ Resolve all five properties before generating any metadata. Each has a fallback chain — work through each option in order until a value is found.
13
+
14
+ | Property | Format | How to Resolve |
15
+ |----------|--------|----------------|
16
+ | **siteName** | `UpperCamelCase` (e.g., `MyCommunity`) | Ask user or derive from context |
17
+ | **siteUrlPathPrefix** | `kebab-case` (e.g., `my-community`) | User-provided, or convert siteName to kebab-case |
18
+ | **appNamespace** | String | `namespace` in `sfdx-project.json` → `sf data query -q "SELECT NamespacePrefix FROM Organization" --target-org ${usernameOrAlias}` → default `c` |
19
+ | **appDevName** | String | `webApplication` metadata in the project → `sf data query -q "SELECT DeveloperName FROM WebApplication" --target-org ${usernameOrAlias}` → default to siteName |
20
+ | **enableGuestAccess** | Boolean | Ask user whether unauthenticated guest users can access site APIs → default `false` |
21
+
22
+ The `appNamespace` and `appDevName` properties connect the site to the correct React application. Getting these wrong means the site deploys but shows a blank page, so take care to resolve them from real project data.
23
+
24
+ ## Generation Workflow
25
+ ### Step 1: Resolve All Required Properties
26
+ Determine values for all five properties before constructing anything. Use the resolution strategies in the table above, falling through each option until a value is found.
27
+
28
+ ### Step 2: Create the Project Structure
29
+ Call the `get_metadata_api_context` MCP tool to retrieve schemas for `Network`, `CustomSite`, `DigitalExperienceConfig`, and `DigitalExperienceBundle` metadata types. These schemas define the valid XML structure for each file.
30
+
31
+ Create any files and directories that don't already exist, using these paths:
32
+
33
+ | Metadata Type | Path |
34
+ |--------------|------|
35
+ | Network | `networks/{siteName}.network-meta.xml` |
36
+ | CustomSite | `sites/{siteName}.site-meta.xml` |
37
+ | DigitalExperienceConfig | `digitalExperienceConfigs/{siteName}1.digitalExperienceConfig-meta.xml` |
38
+ | DigitalExperienceBundle | `digitalExperiences/site/{siteName}1/{siteName}1.digitalExperience-meta.xml` |
39
+ | DigitalExperience (sfdc_cms__site) | `digitalExperiences/site/{siteName}1/sfdc_cms__site/{siteName}1/*` |
40
+
41
+ The DigitalExperience directory contains only `_meta.json` and `content.json`. Do not create any directories other than `sfdc_cms__site` inside the bundle.
42
+
43
+ ### Step 3: Populate All Metadata Fields
44
+ Use the default templates in the docs below. Values in `{braces}` are resolved property references — substitute them with the actual values from Step 1.
45
+
46
+ | Metadata Type | Template Reference |
47
+ |--------------|-------------------|
48
+ | Network | [configure-metadata-network.md](docs/configure-metadata-network.md) |
49
+ | CustomSite | [configure-metadata-custom-site.md](docs/configure-metadata-custom-site.md) |
50
+ | DigitalExperienceConfig | [configure-metadata-digital-experience-config.md](docs/configure-metadata-digital-experience-config.md) |
51
+ | DigitalExperienceBundle | [configure-metadata-digital-experience-bundle.md](docs/configure-metadata-digital-experience-bundle.md) |
52
+ | DigitalExperience (sfdc_cms__site) | [configure-metadata-digital-experience.md](docs/configure-metadata-digital-experience.md) |
53
+
54
+ ### Step 4: Resolve Additional Configurations
55
+ Address any extra configurations the user requests. Use the schemas returned by `get_metadata_api_context` in Step 2 to understand each field's purpose, and update only the minimum necessary fields.
56
+
57
+ ## Verification Checklist
58
+ Before deploying, confirm:
59
+
60
+ - [ ] All five required properties are resolved
61
+ - [ ] All metadata directories and files exist per the project structure
62
+ - [ ] All metadata fields are populated per the templates and user requests
63
+ - [ ] `appSpace` in `content.json` matches an existing `WebApplication` metadata record
64
+ - [ ] Deployment validates successfully:
65
+ ```bash
66
+ sf project deploy validate --metadata Network CustomSite DigitalExperienceConfig DigitalExperienceBundle DigitalExperience --target-org ${usernameOrAlias}
67
+ ```
@@ -0,0 +1,41 @@
1
+ # Configure Metadata: CustomSite
2
+
3
+ ## Purpose
4
+ This configuration file creates a **net-new, default** CustomSite metadata record for a Digital Experience React Site. It is not intended to edit or modify an existing CustomSite record. Use this template only when provisioning a brand-new React site.
5
+
6
+ ## File Location
7
+ ```
8
+ sites/{siteName}.site-meta.xml
9
+ ```
10
+
11
+ ## Default Template
12
+ ```xml
13
+ <?xml version="1.0" encoding="UTF-8"?>
14
+ <CustomSite xmlns="http://soap.sforce.com/2006/04/metadata">
15
+ <active>true</active>
16
+ <allowGuestPaymentsApi>false</allowGuestPaymentsApi>
17
+ <allowHomePage>false</allowHomePage>
18
+ <allowStandardAnswersPages>false</allowStandardAnswersPages>
19
+ <allowStandardIdeasPages>false</allowStandardIdeasPages>
20
+ <allowStandardLookups>false</allowStandardLookups>
21
+ <allowStandardPortalPages>true</allowStandardPortalPages>
22
+ <allowStandardSearch>false</allowStandardSearch>
23
+ <authorizationRequiredPage>CommunitiesLogin</authorizationRequiredPage>
24
+ <bandwidthExceededPage>BandwidthExceeded</bandwidthExceededPage>
25
+ <browserXssProtection>true</browserXssProtection>
26
+ <cachePublicVisualforcePagesInProxyServers>true</cachePublicVisualforcePagesInProxyServers>
27
+ <clickjackProtectionLevel>SameOriginOnly</clickjackProtectionLevel>
28
+ <contentSniffingProtection>true</contentSniffingProtection>
29
+ <enableAuraRequests>true</enableAuraRequests>
30
+ <fileNotFoundPage>FileNotFound</fileNotFoundPage>
31
+ <genericErrorPage>Exception</genericErrorPage>
32
+ <inMaintenancePage>InMaintenance</inMaintenancePage>
33
+ <indexPage>CommunitiesLanding</indexPage>
34
+ <masterLabel>{siteName}</masterLabel>
35
+ <redirectToCustomDomain>false</redirectToCustomDomain>
36
+ <referrerPolicyOriginWhenCrossOrigin>true</referrerPolicyOriginWhenCrossOrigin>
37
+ <selfRegPage>CommunitiesSelfReg</selfRegPage>
38
+ <siteType>ChatterNetwork</siteType>
39
+ <urlPathPrefix>{siteUrlPathPrefix}vforcesite</urlPathPrefix>
40
+ </CustomSite>
41
+ ```
@@ -0,0 +1,17 @@
1
+ # Configure Metadata: DigitalExperienceBundle
2
+
3
+ ## Purpose
4
+ This configuration file creates a **net-new, default** DigitalExperienceBundle metadata record for a Digital Experience React Site. It is not intended to edit or modify an existing DigitalExperienceBundle record. Use this template only when provisioning a brand-new React site.
5
+
6
+ ## File Location
7
+ ```
8
+ digitalExperiences/site/{siteName}1/{siteName}1.digitalExperience-meta.xml
9
+ ```
10
+
11
+ ## Default Template
12
+ ```xml
13
+ <?xml version="1.0" encoding="UTF-8"?>
14
+ <DigitalExperienceBundle xmlns="http://soap.sforce.com/2006/04/metadata">
15
+ <label>{siteName}1</label>
16
+ </DigitalExperienceBundle>
17
+ ```
@@ -0,0 +1,21 @@
1
+ # Configure Metadata: DigitalExperienceConfig
2
+
3
+ ## Purpose
4
+ This configuration file creates a **net-new, default** DigitalExperienceConfig metadata record for a Digital Experience React Site. It is not intended to edit or modify an existing DigitalExperienceConfig record. Use this template only when provisioning a brand-new React site.
5
+
6
+ ## File Location
7
+ ```
8
+ digitalExperienceConfigs/{siteName}1.digitalExperienceConfig-meta.xml
9
+ ```
10
+
11
+ ## Default Template
12
+ ```xml
13
+ <?xml version="1.0" encoding="UTF-8"?>
14
+ <DigitalExperienceConfig xmlns="http://soap.sforce.com/2006/04/metadata">
15
+ <label>{siteName}</label>
16
+ <site>
17
+ <urlPathPrefix>{siteUrlPathPrefix}</urlPathPrefix>
18
+ </site>
19
+ <space>site/{siteName}1</space>
20
+ </DigitalExperienceConfig>
21
+ ```
@@ -0,0 +1,38 @@
1
+ # Configure Metadata: DigitalExperience (sfdc_cms__site)
2
+
3
+ ## Purpose
4
+ These configuration files create **net-new, default** DigitalExperience content records (`sfdc_cms__site` type) for a Digital Experience React Site. They are not intended to edit or modify existing DigitalExperience content. Use these templates only when provisioning a brand-new React site.
5
+
6
+ The `appContainer: true` and `appSpace` fields in `content.json` are what make this a React site rather than a standard LWR site. The `appSpace` value follows the format `{namespace}__{developerName}` and must match a deployed `WebApplication` metadata record.
7
+
8
+ ## File Location
9
+ The DigitalExperience directory contains only `_meta.json` and `content.json`. Do not create any directories other than `sfdc_cms__site` inside the bundle.
10
+
11
+ ```
12
+ digitalExperiences/site/{siteName}1/sfdc_cms__site/{siteName}1/_meta.json
13
+ digitalExperiences/site/{siteName}1/sfdc_cms__site/{siteName}1/content.json
14
+ ```
15
+
16
+ ## Default Templates
17
+ ### `_meta.json`
18
+ ```json
19
+ {
20
+ "apiName": "{siteName}1",
21
+ "path": "",
22
+ "type": "sfdc_cms__site"
23
+ }
24
+ ```
25
+
26
+ ### `content.json`
27
+ ```json
28
+ {
29
+ "type": "sfdc_cms__site",
30
+ "title": "{siteName}",
31
+ "urlName": "{siteUrlPathPrefix}",
32
+ "contentBody": {
33
+ "authenticationType": "AUTHENTICATED_WITH_PUBLIC_ACCESS_ENABLED",
34
+ "appContainer": true,
35
+ "appSpace": "{appNamespace}__{appDevName}"
36
+ }
37
+ }
38
+ ```
@@ -0,0 +1,72 @@
1
+ # Configure Metadata: Network
2
+
3
+ ## Purpose
4
+ This configuration file creates a **net-new, default** Network metadata record for a Digital Experience React Site. It is not intended to edit or modify an existing Network record. Use this template only when provisioning a brand-new React site.
5
+
6
+ ## File Location
7
+ ```
8
+ networks/{siteName}.network-meta.xml
9
+ ```
10
+
11
+ ## Default Template
12
+ ```xml
13
+ <?xml version="1.0" encoding="UTF-8"?>
14
+ <Network xmlns="http://soap.sforce.com/2006/04/metadata">
15
+ <allowInternalUserLogin>false</allowInternalUserLogin>
16
+ <allowMembersToFlag>false</allowMembersToFlag>
17
+ <changePasswordTemplate>unfiled$public/CommunityChangePasswordEmailTemplate</changePasswordTemplate>
18
+ <disableReputationRecordConversations>true</disableReputationRecordConversations>
19
+ <emailSenderAddress>admin@company.com</emailSenderAddress>
20
+ <emailSenderName>{siteName}</emailSenderName>
21
+ <embeddedLoginEnabled>false</embeddedLoginEnabled>
22
+ <enableApexCDNCaching>true</enableApexCDNCaching>
23
+ <enableCustomVFErrorPageOverrides>false</enableCustomVFErrorPageOverrides>
24
+ <enableDirectMessages>true</enableDirectMessages>
25
+ <enableExpFriendlyUrlsAsDefault>false</enableExpFriendlyUrlsAsDefault>
26
+ <enableExperienceBundleBasedSnaOverrideEnabled>true</enableExperienceBundleBasedSnaOverrideEnabled>
27
+ <enableGuestChatter>{enableGuestAccess}</enableGuestChatter>
28
+ <enableGuestFileAccess>false</enableGuestFileAccess>
29
+ <enableGuestMemberVisibility>false</enableGuestMemberVisibility>
30
+ <enableImageOptimizationCDN>true</enableImageOptimizationCDN>
31
+ <enableInvitation>false</enableInvitation>
32
+ <enableKnowledgeable>false</enableKnowledgeable>
33
+ <enableLWRExperienceConnectedApp>false</enableLWRExperienceConnectedApp>
34
+ <enableMemberVisibility>false</enableMemberVisibility>
35
+ <enableNicknameDisplay>true</enableNicknameDisplay>
36
+ <enablePrivateMessages>false</enablePrivateMessages>
37
+ <enableReputation>false</enableReputation>
38
+ <enableShowAllNetworkSettings>false</enableShowAllNetworkSettings>
39
+ <enableSiteAsContainer>true</enableSiteAsContainer>
40
+ <enableTalkingAboutStats>true</enableTalkingAboutStats>
41
+ <enableTopicAssignmentRules>true</enableTopicAssignmentRules>
42
+ <enableTopicSuggestions>false</enableTopicSuggestions>
43
+ <enableUpDownVote>false</enableUpDownVote>
44
+ <forgotPasswordTemplate>unfiled$public/CommunityForgotPasswordEmailTemplate</forgotPasswordTemplate>
45
+ <gatherCustomerSentimentData>false</gatherCustomerSentimentData>
46
+ <headlessForgotPasswordTemplate>unfiled$public/CommunityHeadlessForgotPasswordTemplate</headlessForgotPasswordTemplate>
47
+ <headlessRegistrationTemplate>unfiled$public/CommunityHeadlessRegistrationTemplate</headlessRegistrationTemplate>
48
+ <networkMemberGroups>
49
+ <profile>admin</profile>
50
+ </networkMemberGroups>
51
+ <networkPageOverrides>
52
+ <changePasswordPageOverrideSetting>Standard</changePasswordPageOverrideSetting>
53
+ <forgotPasswordPageOverrideSetting>Designer</forgotPasswordPageOverrideSetting>
54
+ <homePageOverrideSetting>Designer</homePageOverrideSetting>
55
+ <loginPageOverrideSetting>Designer</loginPageOverrideSetting>
56
+ <selfRegProfilePageOverrideSetting>Designer</selfRegProfilePageOverrideSetting>
57
+ </networkPageOverrides>
58
+ <newSenderAddress>admin@company.com</newSenderAddress>
59
+ <picassoSite>{siteName}1</picassoSite>
60
+ <selfRegistration>false</selfRegistration>
61
+ <sendWelcomeEmail>true</sendWelcomeEmail>
62
+ <site>{siteName}</site>
63
+ <siteArchiveStatus>NotArchived</siteArchiveStatus>
64
+ <status>Live</status>
65
+ <tabs>
66
+ <defaultTab>home</defaultTab>
67
+ <standardTab>Chatter</standardTab>
68
+ </tabs>
69
+ <urlPathPrefix>{siteUrlPathPrefix}vforcesite</urlPathPrefix>
70
+ <welcomeTemplate>unfiled$public/CommunityWelcomeEmailTemplate</welcomeTemplate>
71
+ </Network>
72
+ ```