@salesforce/afv-skills 1.1.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 (150) hide show
  1. package/package.json +6 -5
  2. package/skills/accessing-webapp-data/SKILL.md +178 -0
  3. package/skills/agentforce-development/SKILL.md +427 -0
  4. package/skills/agentforce-development/assets/README-legacy.md +89 -0
  5. package/skills/agentforce-development/assets/agent-spec-template.md +90 -0
  6. package/skills/agentforce-development/assets/agents/README.md +45 -0
  7. package/skills/agentforce-development/assets/agents/hello-world.agent +60 -0
  8. package/skills/agentforce-development/assets/agents/multi-topic.agent +105 -0
  9. package/skills/agentforce-development/assets/agents/production-faq.agent +101 -0
  10. package/skills/agentforce-development/assets/agents/production-faq.bundle-meta.xml +4 -0
  11. package/skills/agentforce-development/assets/agents/simple-qa.agent +72 -0
  12. package/skills/agentforce-development/assets/apex/models-api-queueable.cls +225 -0
  13. package/skills/agentforce-development/assets/bundle-meta.xml +23 -0
  14. package/skills/agentforce-development/assets/components/apex-action.agent +52 -0
  15. package/skills/agentforce-development/assets/components/error-handling.agent +58 -0
  16. package/skills/agentforce-development/assets/components/escalation-setup.agent +169 -0
  17. package/skills/agentforce-development/assets/components/flow-action.agent +66 -0
  18. package/skills/agentforce-development/assets/components/n-ary-conditions.agent +110 -0
  19. package/skills/agentforce-development/assets/components/topic-with-actions.agent +40 -0
  20. package/skills/agentforce-development/assets/deterministic-routing.agent +166 -0
  21. package/skills/agentforce-development/assets/escalation-pattern.agent +209 -0
  22. package/skills/agentforce-development/assets/flow-action-lookup.agent +115 -0
  23. package/skills/agentforce-development/assets/hub-and-spoke.agent +104 -0
  24. package/skills/agentforce-development/assets/invocable-apex-template.cls +187 -0
  25. package/skills/agentforce-development/assets/local-info-agent-annotated.agent +355 -0
  26. package/skills/agentforce-development/assets/metadata/basic-prompt-template.promptTemplate-meta.xml +109 -0
  27. package/skills/agentforce-development/assets/metadata/genai-function-apex.xml +92 -0
  28. package/skills/agentforce-development/assets/metadata/genai-function-flow.xml +57 -0
  29. package/skills/agentforce-development/assets/metadata/genai-plugin.xml +72 -0
  30. package/skills/agentforce-development/assets/metadata/http-callout-flow.flow-meta.xml +348 -0
  31. package/skills/agentforce-development/assets/metadata/record-grounded-prompt.promptTemplate-meta.xml +136 -0
  32. package/skills/agentforce-development/assets/minimal-starter.agent +42 -0
  33. package/skills/agentforce-development/assets/patterns/README.md +254 -0
  34. package/skills/agentforce-development/assets/patterns/action-callbacks.agent +178 -0
  35. package/skills/agentforce-development/assets/patterns/advanced-input-bindings.agent +141 -0
  36. package/skills/agentforce-development/assets/patterns/bidirectional-routing.agent +156 -0
  37. package/skills/agentforce-development/assets/patterns/critical-input-collection.agent +244 -0
  38. package/skills/agentforce-development/assets/patterns/delegation-routing.agent +89 -0
  39. package/skills/agentforce-development/assets/patterns/lifecycle-events.agent +127 -0
  40. package/skills/agentforce-development/assets/patterns/llm-controlled-actions.agent +184 -0
  41. package/skills/agentforce-development/assets/patterns/multi-step-workflow.agent +282 -0
  42. package/skills/agentforce-development/assets/patterns/open-gate-routing.agent +286 -0
  43. package/skills/agentforce-development/assets/patterns/procedural-instructions.agent +273 -0
  44. package/skills/agentforce-development/assets/patterns/prompt-template-action.agent +188 -0
  45. package/skills/agentforce-development/assets/patterns/system-instruction-overrides.agent +293 -0
  46. package/skills/agentforce-development/assets/prompt-rag-search.agent +131 -0
  47. package/skills/agentforce-development/assets/template-multi-topic.agent +160 -0
  48. package/skills/agentforce-development/assets/template-single-topic.agent +81 -0
  49. package/skills/agentforce-development/assets/verification-gate.agent +208 -0
  50. package/skills/agentforce-development/references/action-prompt-templates.md +164 -0
  51. package/skills/agentforce-development/references/actions-reference.md +592 -0
  52. package/skills/agentforce-development/references/agent-access-guide.md +72 -0
  53. package/skills/agentforce-development/references/agent-design-and-spec-creation.md +1010 -0
  54. package/skills/agentforce-development/references/agent-metadata-and-lifecycle.md +575 -0
  55. package/skills/agentforce-development/references/agent-script-core-language.md +1218 -0
  56. package/skills/agentforce-development/references/agent-topic-map-diagrams.md +323 -0
  57. package/skills/agentforce-development/references/agent-user-setup.md +526 -0
  58. package/skills/agentforce-development/references/agent-validation-and-debugging.md +803 -0
  59. package/skills/agentforce-development/references/known-issues.md +353 -0
  60. package/skills/agentforce-development/references/minimal-examples.md +67 -0
  61. package/skills/agentforce-development/references/production-gotchas.md +279 -0
  62. package/skills/agentforce-development/references/salesforce-cli-for-agents.md +393 -0
  63. package/skills/agentforce-development/references/version-history.md +23 -0
  64. package/skills/building-webapp-data-visualization/SKILL.md +72 -0
  65. package/skills/building-webapp-data-visualization/implementation/bar-line-chart.md +316 -0
  66. package/skills/building-webapp-data-visualization/implementation/dashboard-layout.md +189 -0
  67. package/skills/building-webapp-data-visualization/implementation/donut-chart.md +181 -0
  68. package/skills/building-webapp-data-visualization/implementation/stat-card.md +150 -0
  69. package/skills/building-webapp-react-components/SKILL.md +96 -0
  70. package/skills/building-webapp-react-components/implementation/component.md +78 -0
  71. package/skills/building-webapp-react-components/implementation/header-footer.md +132 -0
  72. package/skills/building-webapp-react-components/implementation/page.md +93 -0
  73. package/skills/configuring-webapp-csp-trusted-sites/SKILL.md +90 -0
  74. package/skills/configuring-webapp-csp-trusted-sites/implementation/metadata-format.md +281 -0
  75. package/skills/configuring-webapp-metadata/SKILL.md +158 -0
  76. package/skills/creating-webapp/SKILL.md +141 -0
  77. package/skills/deploying-webapp-to-salesforce/SKILL.md +229 -0
  78. package/skills/exploring-webapp-graphql-schema/SKILL.md +149 -0
  79. package/skills/fetching-webapp-rest-api/SKILL.md +167 -0
  80. package/skills/{salesforce-custom-application → generating-custom-application}/SKILL.md +2 -4
  81. package/skills/{salesforce-custom-field → generating-custom-field}/SKILL.md +1 -5
  82. package/skills/{salesforce-custom-lightning-type → generating-custom-lightning-type}/SKILL.md +36 -2
  83. package/skills/{salesforce-custom-object → generating-custom-object}/SKILL.md +1 -1
  84. package/skills/generating-custom-tab/SKILL.md +154 -0
  85. package/skills/generating-experience-lwr-site/SKILL.md +196 -0
  86. package/skills/generating-experience-lwr-site/docs/bootstrap-template-byo-lwr.md +224 -0
  87. package/skills/generating-experience-lwr-site/docs/configure-content-brandingSet.md +131 -0
  88. package/skills/generating-experience-lwr-site/docs/configure-content-route.md +232 -0
  89. package/skills/generating-experience-lwr-site/docs/configure-content-themeLayout.md +141 -0
  90. package/skills/generating-experience-lwr-site/docs/configure-content-view.md +233 -0
  91. package/skills/generating-experience-lwr-site/docs/configure-guest-sharing-rules.md +42 -0
  92. package/skills/generating-experience-lwr-site/docs/handle-component-and-region-ids.md +27 -0
  93. package/skills/generating-experience-lwr-site/docs/handle-ui-components.md +215 -0
  94. package/skills/generating-experience-react-site/SKILL.md +67 -0
  95. package/skills/generating-experience-react-site/docs/configure-metadata-custom-site.md +41 -0
  96. package/skills/generating-experience-react-site/docs/configure-metadata-digital-experience-bundle.md +17 -0
  97. package/skills/generating-experience-react-site/docs/configure-metadata-digital-experience-config.md +21 -0
  98. package/skills/generating-experience-react-site/docs/configure-metadata-digital-experience.md +38 -0
  99. package/skills/generating-experience-react-site/docs/configure-metadata-network.md +72 -0
  100. package/skills/{salesforce-flexipage → generating-flexipage}/SKILL.md +86 -9
  101. package/skills/{salesforce-flow → generating-flow}/SKILL.md +3 -3
  102. package/skills/generating-fragment/SKILL.md +117 -0
  103. package/skills/generating-lightning-app/SKILL.md +423 -0
  104. package/skills/{salesforce-list-view → generating-list-view}/SKILL.md +1 -1
  105. package/skills/generating-permission-set/SKILL.md +174 -0
  106. package/skills/{salesforce-validation-rule → generating-validation-rule}/SKILL.md +1 -1
  107. package/skills/generating-webapp-graphql-mutation-query/SKILL.md +258 -0
  108. package/skills/generating-webapp-graphql-read-query/SKILL.md +253 -0
  109. package/skills/implementing-webapp-file-upload/SKILL.md +396 -0
  110. package/skills/installing-webapp-features/SKILL.md +210 -0
  111. package/skills/managing-webapp-agentforce-conversation-client/SKILL.md +186 -0
  112. package/skills/managing-webapp-agentforce-conversation-client/references/constraints.md +134 -0
  113. package/skills/managing-webapp-agentforce-conversation-client/references/examples.md +132 -0
  114. package/skills/managing-webapp-agentforce-conversation-client/references/style-tokens.md +101 -0
  115. package/skills/managing-webapp-agentforce-conversation-client/references/troubleshooting.md +57 -0
  116. package/skills/switching-org/SKILL.md +28 -0
  117. package/skills/using-webapp-graphql/SKILL.md +324 -0
  118. package/skills/using-webapp-graphql/shared-schema.graphqls +1150 -0
  119. package/skills/apex-class/SKILL.md +0 -253
  120. package/skills/apex-class/examples/AccountDeduplicationBatch.cls +0 -148
  121. package/skills/apex-class/examples/AccountSelector.cls +0 -193
  122. package/skills/apex-class/examples/AccountService.cls +0 -201
  123. package/skills/apex-class/templates/abstract.cls +0 -128
  124. package/skills/apex-class/templates/batch.cls +0 -125
  125. package/skills/apex-class/templates/domain.cls +0 -102
  126. package/skills/apex-class/templates/dto.cls +0 -108
  127. package/skills/apex-class/templates/exception.cls +0 -51
  128. package/skills/apex-class/templates/interface.cls +0 -25
  129. package/skills/apex-class/templates/queueable.cls +0 -92
  130. package/skills/apex-class/templates/schedulable.cls +0 -75
  131. package/skills/apex-class/templates/selector.cls +0 -92
  132. package/skills/apex-class/templates/service.cls +0 -69
  133. package/skills/apex-class/templates/utility.cls +0 -97
  134. package/skills/apex-test-class/SKILL.md +0 -101
  135. package/skills/apex-test-class/references/assertion-patterns.md +0 -209
  136. package/skills/apex-test-class/references/async-testing.md +0 -276
  137. package/skills/apex-test-class/references/mocking-patterns.md +0 -219
  138. package/skills/apex-test-class/references/test-data-factory.md +0 -176
  139. package/skills/deployment-readiness-check/SKILL.md +0 -257
  140. package/skills/deployment-readiness-check/assets/deployment_checklist.md +0 -286
  141. package/skills/deployment-readiness-check/references/rollback_procedures.md +0 -308
  142. package/skills/deployment-readiness-check/scripts/check_metadata.sh +0 -207
  143. package/skills/salesforce-custom-tab/SKILL.md +0 -78
  144. package/skills/salesforce-experience-site/SKILL.md +0 -178
  145. package/skills/salesforce-fragment/SKILL.md +0 -42
  146. package/skills/salesforce-lightning-app-build/SKILL.md +0 -254
  147. package/skills/salesforce-web-app-creating-records/SKILL.md +0 -84
  148. package/skills/salesforce-web-app-feature/SKILL.md +0 -70
  149. package/skills/salesforce-web-app-list-and-create-records/SKILL.md +0 -36
  150. package/skills/salesforce-web-application/SKILL.md +0 -34
@@ -0,0 +1,215 @@
1
+ # UI Component Handling
2
+
3
+ **Use when** adding/configuring components to be used in Experience site.
4
+
5
+ ## Component Insertion
6
+
7
+ Insert custom Lightning Web Components (LWC) into views.
8
+
9
+ ### What is a Custom Component?
10
+
11
+ Any LWC in `c` namespace (e.g., `c:heroBanner`). Distinct from OOTB components (e.g., `community_builder:htmlEditor`).
12
+
13
+ ### Prerequisites for Custom LWC
14
+
15
+ **js-meta.xml Requirements**:
16
+
17
+ - `<isExposed>true</isExposed>`
18
+ - Targets: `lightningCommunity__Page`, `lightningCommunity__Default`
19
+
20
+ **Property Type Constraints (MANDATORY GATE)**:
21
+
22
+ 1. **Supported**: String, Integer, Boolean, Color, Picklist
23
+ 2. **Unsupported**: Any other type → **STOP immediately**
24
+ - Do NOT delete, comment, or auto-correct
25
+ - Advise user to set up Custom Property Editor (CPE) or Custom Property Type
26
+ 3. **Type Mismatch**: `type="Number"` → change to `type="Integer"` in js-meta.xml
27
+
28
+ **Do not proceed** until LWC files are compliant or user advised on CPE/CPT.
29
+
30
+ ### Placement Hierarchy
31
+
32
+ **NEVER** place components directly in top-level regions. Must nest inside `community_layout:section` → column region.
33
+
34
+ ```
35
+ community_layout:sldsFlexibleLayout (root)
36
+ └── region (content/header/footer)
37
+ └── community_layout:section
38
+ └── region (column: col1/col2)
39
+ └── component(s)
40
+ ```
41
+
42
+ ### Column Width & Layout
43
+
44
+ **12-unit grid**: Column widths sum to 12 per section.
45
+
46
+ **Width Formats**:
47
+
48
+ - Grid units: 8 + 4
49
+ - Percentages: 66% + 33% → 8 + 4; 50% + 50% → 6 + 6
50
+ - Ratios: 2:1 → 8 + 4; 1:1 → 6 + 6; equal thirds → 4 + 4 + 4
51
+
52
+ **Layout Rules**:
53
+
54
+ - One section = one horizontal row
55
+ - Multiple rows = multiple sections (siblings)
56
+ - Multiple components in column = vertical stack
57
+
58
+ **Set width in** `sectionConfig` (JSON string attribute on section component).
59
+
60
+ ### sectionConfig Structure
61
+
62
+ **Top-level** (when parsed):
63
+
64
+ - `UUID`: Section ID (matches section component's `id`)
65
+ - `columns`: Array of column definitions
66
+
67
+ **Each column**:
68
+
69
+ - `UUID`: Column ID (matches column region's `id`)
70
+ - `columnKey`: Column identifier (e.g., `col1`, `col2`) - matches column region's `name`
71
+ - `columnName`: Display name (e.g., "Column 1")
72
+ - `columnWidth`: String from `"1"` to `"12"` (must sum to 12)
73
+ - `seedComponents`: Array or `null` (typically `[]` or `null`)
74
+
75
+ **Example** (serialized as JSON string in `sectionConfig` attribute):
76
+
77
+ ```json
78
+ {
79
+ "UUID": "295e6a8b-fd94-485b-af9d-7ccf5b3048ee",
80
+ "columns": [
81
+ {
82
+ "UUID": "7e1f7e33-5ba8-4fef-8494-6ea3e90b22a0",
83
+ "columnKey": "col1",
84
+ "columnName": "Column 1",
85
+ "columnWidth": "12",
86
+ "seedComponents": null
87
+ }
88
+ ]
89
+ }
90
+ ```
91
+
92
+ ### Named Region Creation
93
+ In order to create a component with drag-n-droppable region/slot that can be used in Experience Builder sites and persist across views, there are multiple steps needed.
94
+
95
+ Page layout components should add the lightningCommunity__Page_Layout target in js-meta.xml.
96
+ Theme layout components should add the lightningCommunity__Theme_Layout target in js-meta.xml.
97
+ Add lightningCommunity__Page as a target for page layouts and any component with slots that is not explicitly defined as a theme layout.
98
+
99
+ The js file in LWC need to declare named slots:
100
+ ```js
101
+ /**
102
+ * @slot header
103
+ * @slot footer
104
+ */
105
+ export default class YourComponentName extends LightningElement {}
106
+ ```
107
+
108
+ Do not add any other comments in the declaration comment block. The named @slot annotations must be the last comments
109
+ in the block before the class declaration.
110
+
111
+ In html, named slots are needed. <slot name="header"> and <slot name="footer"> in the above example.
112
+
113
+ For theme layout component, a <slot> with no name is the main content region, a slot with name is a sticky region that doesn't change from page to page that uses the same theme layout component.
114
+
115
+ No need to declare target config properties for the slots/regions.
116
+ See the example below for adding a component with named slots into a view.
117
+
118
+ ### Component Structure
119
+
120
+ ```json
121
+ {
122
+ "id": "[UNIQUE_UUID]",
123
+ "type": "component",
124
+ "definition": "[NAMESPACE]:[COMPONENT_NAME]",
125
+ "attributes": {
126
+ "[ATTRIBUTE_NAME]": "[ATTRIBUTE_VALUE]"
127
+ }
128
+ }
129
+ ```
130
+
131
+ **Field Definitions**:
132
+
133
+ - `id`: Unique UUID (see `handle-component-and-region-ids.md`)
134
+ - `type`: Always `"component"`
135
+ - `definition`:
136
+ - Custom LWC: `c:[componentName]` (e.g., `c:heroBanner`)
137
+ - OOTB: `[namespace]:[componentName]` (e.g., `community_builder:richTextEditor`)
138
+ - `attributes`: Component properties
139
+ - **Omit if no attributes** (don't include empty object)
140
+ - Custom LWC: Only `@api` properties in `targetConfigs` (with `lightningCommunity__Default` target)
141
+ - OOTB: Only exposed schema properties
142
+
143
+ ### Complete Examples
144
+
145
+ **Example 1: Overall structure**
146
+ Correct nesting: `content` region → section → column region → components
147
+
148
+ ```json
149
+ {
150
+ "type": "region",
151
+ "name": "content",
152
+ "children": [
153
+ {
154
+ "attributes": {
155
+ "sectionConfig": "{\"UUID\":\"295e6a8b-fd94-485b-af9d-7ccf5b3048ee\",\"columns\":[{\"UUID\":\"7e1f7e33-5ba8-4fef-8494-6ea3e90b22a0\",\"columnName\":\"Column 1\",\"columnKey\":\"col1\",\"columnWidth\":\"12\",\"seedComponents\":null}]}"
156
+ },
157
+ "children": [
158
+ {
159
+ "children": [
160
+ {
161
+ "definition": "c:testComponent",
162
+ "id": "2ae498bd-2871-487d-8fb1-b186376cee3b",
163
+ "type": "component"
164
+ },
165
+ {
166
+ "id": "7c7d3b6a-1e2f-4a33-9c1e-8b2a6d5f4e3b",
167
+ "type": "component",
168
+ "definition": "c:helloWorld",
169
+ "attributes": {
170
+ "title": "Hello"
171
+ }
172
+ }
173
+ ],
174
+ "id": "7e1f7e33-5ba8-4fef-8494-6ea3e90b22a0",
175
+ "name": "col1",
176
+ "title": "Column 1",
177
+ "type": "region"
178
+ }
179
+ ],
180
+ "definition": "community_layout:section",
181
+ "id": "295e6a8b-fd94-485b-af9d-7ccf5b3048ee",
182
+ "type": "component"
183
+ }
184
+ ]
185
+ }
186
+ ```
187
+
188
+ **CRITICAL**: Follow UUID generation process (`handle-component-and-region-ids.md`) when inserting components.
189
+
190
+ **Example 2: Representing slots**
191
+ If a component with slots (i.e. @slot annotation) is inserted, slots must appear as named regions.
192
+ In this example the component threeColumn has 3 slots, named left, center, and right.
193
+ ```json
194
+ {
195
+ "attributes" : { },
196
+ "children" : [ {
197
+ "id" : "4c6148c7-c07e-4245-ae50-ac07891046f2",
198
+ "name" : "left",
199
+ "title" : "left",
200
+ "type" : "region"
201
+ }, {
202
+ "id" : "f362e789-7f09-40b4-a59f-03f76ea73401",
203
+ "name" : "center",
204
+ "title" : "center",
205
+ "type" : "region"
206
+ }, {
207
+ "id" : "2678ddd4-a1a4-41c4-bf5a-1a3e55891eb2",
208
+ "name" : "right",
209
+ "title" : "right",
210
+ "type" : "region"
211
+ } ],
212
+ "definition" : "c:threeColumn",
213
+ "id" : "b9e517c5-90ac-49e9-91b7-3730512c95a3",
214
+ "type" : "component"
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
+ ```
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: salesforce-flexipage
2
+ name: generating-flexipage
3
3
  description: Use this skill when users need to create, generate, modify, or validate Salesforce Lightning pages (FlexiPages). Trigger when users mention RecordPage, AppPage, HomePage, Lightning pages, page layouts, adding components to pages, or page customization. Also use when users say things like "create a Lightning page", "add a component to a page", "customize the record page", "generate a FlexiPage", or when they're working with FlexiPage XML files and need help with components, regions, or deployment errors. Always use this skill for any FlexiPage-related work, even if they just mention "page" in the context of Salesforce.
4
4
  ---
5
5
 
@@ -149,6 +149,68 @@ Every fieldInstance requires:
149
149
  - Must have `fieldInstanceProperties` with `uiBehavior`
150
150
  - Use `Record.{Field}` format
151
151
 
152
+ ### 5. Unique Identifiers and Region Names (CRITICAL - PREVENTS DUPLICATE ERRORS)
153
+
154
+ **EVERY identifier and region/facet name MUST be unique across the entire FlexiPage file.**
155
+
156
+ **Critical Rules:**
157
+ - ❌ **NEVER create two `<flexiPageRegions>` blocks with the same `<name>`**
158
+ - ✅ **If multiple components belong to same facet, combine them in ONE region with multiple `<itemInstances>`**
159
+ - ❌ **NEVER reuse the same `<identifier>` value**
160
+ - ✅ **Always read entire file first and extract ALL existing identifiers and names**
161
+
162
+ **Wrong - This WILL FAIL with duplicate name error:**
163
+ ```xml
164
+ <!-- First field section in detail tab -->
165
+ <flexiPageRegions>
166
+ <itemInstances>
167
+ <componentInstance>
168
+ <identifier>flexipage_property_details_fieldSection</identifier>
169
+ ...
170
+ </componentInstance>
171
+ </itemInstances>
172
+ <name>detailTabContent</name> <!-- ❌ DUPLICATE NAME -->
173
+ <type>Facet</type>
174
+ </flexiPageRegions>
175
+
176
+ <!-- Second field section in detail tab -->
177
+ <flexiPageRegions>
178
+ <itemInstances>
179
+ <componentInstance>
180
+ <identifier>flexipage_pricing_fieldSection</identifier>
181
+ ...
182
+ </componentInstance>
183
+ </itemInstances>
184
+ <name>detailTabContent</name> <!-- ❌ DUPLICATE NAME - DEPLOYMENT FAILS -->
185
+ <type>Facet</type>
186
+ </flexiPageRegions>
187
+ ```
188
+
189
+ **Correct - Combine itemInstances in ONE region:**
190
+ ```xml
191
+ <!-- Both field sections in same detail tab facet -->
192
+ <flexiPageRegions>
193
+ <itemInstances>
194
+ <componentInstance>
195
+ <identifier>flexipage_property_details_fieldSection</identifier>
196
+ ...
197
+ </componentInstance>
198
+ </itemInstances>
199
+ <itemInstances>
200
+ <componentInstance>
201
+ <identifier>flexipage_pricing_fieldSection</identifier>
202
+ ...
203
+ </componentInstance>
204
+ </itemInstances>
205
+ <name>detailTabContent</name> <!-- ✅ ONE REGION, MULTIPLE COMPONENTS -->
206
+ <type>Facet</type>
207
+ </flexiPageRegions>
208
+ ```
209
+
210
+ **When to combine vs separate:**
211
+ - **Combine**: Components that logically belong to same tab/section (e.g., multiple field sections in detail tab)
212
+ - **Separate**: Components that belong to different tabs/sections (e.g., `detailTabContent` vs `relatedTabContent`)
213
+
152
214
  ---
153
215
 
154
216
  ## Common Deployment Errors
@@ -178,7 +240,7 @@ Every fieldInstance requires:
178
240
  **Fix:** Use "Volunteer_Record_Page" not "Volunteer__c_Record_Page"
179
241
 
180
242
  ### "Region specifies mode that parent doesn't support"
181
- **Cause:** Added `<mode>` tag to region
243
+ **Cause:** Added `<mode>` tag to region
182
244
  **Fix:** Remove `<mode>` tags - they're not needed for standard regions
183
245
 
184
246
  ---
@@ -211,21 +273,28 @@ When user provides an existing FlexiPage file path:
211
273
 
212
274
  1. **Read the file** using native file I/O
213
275
  2. **Parse XML** to extract:
214
- - Existing component identifiers
276
+ - **ALL existing component identifiers** (search for all `<identifier>` tags)
277
+ - **ALL existing region/facet names** (search for all `<name>` tags in `<flexiPageRegions>`)
215
278
  - Available regions (parse from file, don't assume names)
216
279
  - Existing facets
217
- 3. **Generate component XML** (apply all rules from "Critical XML Rules" section)
218
- 4. **Insert** into appropriate region
219
- 5. **Write** modified XML back to file
220
- 6. **Deploy**: `sf project deploy start --source-dir force-app/...`
280
+ 3. **Verify uniqueness** - ensure your new identifiers and names don't conflict with ANY existing ones
281
+ 4. **Check if target facet exists** - if adding to a named facet like `detailTabContent` that already exists:
282
+ - **Add new `<itemInstances>` to existing region** (don't create duplicate region)
283
+ - **Insert before the closing `</flexiPageRegions>` tag of that region**
284
+ 5. **Generate component XML** (apply all rules from "Critical XML Rules" section)
285
+ 6. **Insert** into appropriate region or add itemInstances to existing facet
286
+ 7. **Write** modified XML back to file
287
+ 8. **Deploy**: `sf project deploy start --source-dir force-app/...`
221
288
 
222
289
  ---
223
290
 
224
291
  ### Generating Unique Identifiers
225
292
 
226
- **Algorithm**:
293
+ **CRITICAL: Before generating ANY new identifier or facet name, follow the rules in section 5 of "Critical XML Rules" above.**
294
+
295
+ **Identifier Generation Algorithm**:
227
296
  ```
228
- 1. Extract all existing <identifier> values from XML
297
+ 1. Extract ALL existing <identifier> AND <name> values from XML
229
298
  2. Generate base name: {componentType}_{context}
230
299
  Examples: "relatedList_contacts", "richText_header", "tabs_main"
231
300
  3. Find first available number:
@@ -253,6 +322,11 @@ When user provides an existing FlexiPage file path:
253
322
  - Example: `Facet-66d5a4b3-bf14-4665-ba75-1ceaa71b2cde`
254
323
  - Use for field section columns, nested containers, anonymous slots
255
324
 
325
+ **When adding components to existing files:**
326
+ - Check if target facet name already exists
327
+ - If exists: Add new `<itemInstances>` to that existing region (see section 5 above for details)
328
+ - If doesn't exist: Create new region with unique name
329
+
256
330
  ---
257
331
 
258
332
  ### Region Selection
@@ -401,6 +475,9 @@ Identifier Pattern: flexipage_richText or flexipage_richText_{sequence}
401
475
 
402
476
  Before deploying:
403
477
  - [ ] Used CLI to bootstrap (don't start from scratch)
478
+ - [ ] **ALL identifiers are unique** - no duplicate `<identifier>` values anywhere in file
479
+ - [ ] **ALL region/facet names are unique** - no duplicate `<name>` values in `<flexiPageRegions>`
480
+ - [ ] **Multiple components in same facet are combined** - ONE region with multiple `<itemInstances>`, NOT separate regions with same name
404
481
  - [ ] All field references use `Record.{Field}` format
405
482
  - [ ] Each fieldInstance has `fieldInstanceProperties` with `uiBehavior`
406
483
  - [ ] Each fieldInstance in own `<itemInstances>` wrapper
@@ -1,6 +1,6 @@
1
1
  ---
2
- name: salesforce-flow
3
- description: Generate Salesforce Flows using the MCP tool execute_metadata_action. Use when the user asks to create, build, or generate a flow — including Screen, Autolaunched, Record-Triggered (before/after-save), Scheduled, or Platform Event-Triggered Flows. Also trigger for flow-like requests such as "when a record is created", "trigger daily at", "send an email when", "update the field when", "automate", "workflow", or "flow XML/metadata". This is the only skill for Salesforce Flow generation.
2
+ name: generating-flow
3
+ description: Generate Salesforce Flows using the MCP tool execute_metadata_action. Use when the user asks to create, build, or generate a flow — including Screen, Autolaunched, Record-Triggered (before/after-save), Scheduled. Also trigger for flow-like requests such as "when a record is created", "trigger daily at", "send an email when", "update the field when", "automate", "workflow", or "flow XML/metadata". This is the only skill for Salesforce Flow generation.
4
4
  ---
5
5
 
6
6
  ## Goal
@@ -21,7 +21,7 @@ Use this skill when you need to:
21
21
  # Flow Metadata Specification
22
22
 
23
23
  ## Overview
24
- Salesforce Flows are powerful automation tools that enable complex business process automation without code. Flows can collect and process data through interactive screens, execute logic and calculations, manipulate records, call external services, and trigger based on various events. Flow types include Screen Flows (user-guided), Autolaunched Flows (background processing), Record-Triggered Flows (database events), Scheduled Flows (time-based), and Platform Event-Triggered Flows (event-driven).
24
+ Salesforce Flows are powerful automation tools that enable complex business process automation without code. Flows can collect and process data through interactive screens, execute logic and calculations, manipulate records, call external services, and trigger based on various events. Flow types include Screen Flows (user-guided), Autolaunched Flows (background processing), Record-Triggered Flows (database events) and Scheduled Flows (time-based).
25
25
 
26
26
  ## Purpose
27
27
  - Automate complex business processes with declarative logic and branching