@salesforce/afv-skills 1.29.0 → 1.30.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 (205) hide show
  1. package/README.md +2 -0
  2. package/package.json +1 -1
  3. package/skills/agentforce-architecture-analyze/README.md +2 -8
  4. package/skills/agentforce-architecture-analyze/SKILL.md +2 -2
  5. package/skills/agentforce-architecture-analyze/references/contract.json +4 -4
  6. package/skills/agentforce-architecture-analyze/references/soql_fields.md +1 -1
  7. package/skills/data360-activate/README.md +0 -1
  8. package/skills/data360-activate/SKILL.md +0 -2
  9. package/skills/data360-connect/README.md +0 -2
  10. package/skills/data360-connect/SKILL.md +0 -2
  11. package/skills/data360-harmonize/SKILL.md +0 -1
  12. package/skills/data360-orchestrate/README.md +0 -7
  13. package/skills/data360-orchestrate/SKILL.md +0 -2
  14. package/skills/data360-prepare/README.md +0 -1
  15. package/skills/data360-prepare/SKILL.md +0 -1
  16. package/skills/data360-query/README.md +0 -1
  17. package/skills/data360-query/SKILL.md +0 -1
  18. package/skills/data360-segment/README.md +0 -1
  19. package/skills/data360-segment/SKILL.md +0 -2
  20. package/skills/experience-cms-brand-apply/SKILL.md +47 -16
  21. package/skills/experience-lwc-generate/README.md +3 -2
  22. package/skills/experience-lwc-generate/references/async-notification-patterns.md +1 -1
  23. package/skills/experience-lwc-generate/references/component-patterns.md +3 -3
  24. package/skills/experience-lwc-generate/references/flow-integration-guide.md +1 -1
  25. package/skills/experience-lwc-generate/references/lwc-best-practices.md +4 -4
  26. package/skills/experience-lwc-generate/references/scoring-and-testing.md +1 -1
  27. package/skills/experience-lwc-generate/references/state-management.md +2 -2
  28. package/skills/experience-lwc-generate/references/triangle-pattern.md +3 -3
  29. package/skills/experience-lwc-generate/scripts/post-tool-validate.py +2 -2
  30. package/skills/experience-lwc-generate/scripts/template_validator.py +1 -1
  31. package/skills/external-diagram-mermaid-generate/README.md +2 -2
  32. package/skills/external-diagram-mermaid-generate/SKILL.md +1 -3
  33. package/skills/external-diagram-mermaid-generate/assets/agentforce/agent-flow.md +4 -4
  34. package/skills/external-diagram-mermaid-generate/assets/architecture/system-landscape.md +1 -1
  35. package/skills/external-diagram-mermaid-generate/assets/datamodel/b2b-commerce-erd.md +3 -3
  36. package/skills/external-diagram-mermaid-generate/assets/datamodel/campaigns-erd.md +1 -1
  37. package/skills/external-diagram-mermaid-generate/assets/datamodel/consent-erd.md +2 -2
  38. package/skills/external-diagram-mermaid-generate/assets/datamodel/files-erd.md +2 -2
  39. package/skills/external-diagram-mermaid-generate/assets/datamodel/forecasting-erd.md +2 -2
  40. package/skills/external-diagram-mermaid-generate/assets/datamodel/fsl-erd.md +2 -2
  41. package/skills/external-diagram-mermaid-generate/assets/datamodel/party-model-erd.md +1 -1
  42. package/skills/external-diagram-mermaid-generate/assets/datamodel/quote-order-erd.md +3 -3
  43. package/skills/external-diagram-mermaid-generate/assets/datamodel/revenue-cloud-erd.md +2 -2
  44. package/skills/external-diagram-mermaid-generate/assets/datamodel/sales-cloud-erd.md +1 -1
  45. package/skills/external-diagram-mermaid-generate/assets/datamodel/salesforce-erd.md +1 -1
  46. package/skills/external-diagram-mermaid-generate/assets/datamodel/scheduler-erd.md +2 -2
  47. package/skills/external-diagram-mermaid-generate/assets/datamodel/service-cloud-erd.md +3 -3
  48. package/skills/external-diagram-mermaid-generate/assets/datamodel/territory-management-erd.md +1 -1
  49. package/skills/external-diagram-mermaid-generate/assets/integration/api-sequence.md +1 -1
  50. package/skills/external-diagram-mermaid-generate/assets/oauth/authorization-code-pkce.md +1 -1
  51. package/skills/external-diagram-mermaid-generate/assets/oauth/authorization-code.md +1 -1
  52. package/skills/external-diagram-mermaid-generate/assets/oauth/client-credentials.md +1 -1
  53. package/skills/external-diagram-mermaid-generate/assets/oauth/device-authorization.md +2 -2
  54. package/skills/external-diagram-mermaid-generate/assets/oauth/jwt-bearer.md +2 -2
  55. package/skills/external-diagram-mermaid-generate/assets/oauth/refresh-token.md +1 -1
  56. package/skills/external-diagram-mermaid-generate/assets/oauth/user-agent-social-sign-on.md +2 -2
  57. package/skills/external-diagram-mermaid-generate/assets/role-hierarchy/user-hierarchy.md +1 -1
  58. package/skills/external-diagram-mermaid-generate/references/color-palette.md +13 -13
  59. package/skills/external-diagram-mermaid-generate/references/diagram-conventions.md +5 -5
  60. package/skills/external-diagram-mermaid-generate/references/erd-conventions.md +1 -1
  61. package/skills/external-diagram-mermaid-generate/references/mermaid-styling.md +2 -2
  62. package/skills/external-diagram-mermaid-generate/references/preview-guide.md +1 -1
  63. package/skills/external-diagram-mermaid-generate/references/usage-examples.md +9 -9
  64. package/skills/external-diagram-mermaid-generate/scripts/README.md +1 -1
  65. package/skills/integration-connectivity-connected-app-configure/README.md +4 -5
  66. package/skills/integration-connectivity-connected-app-configure/SKILL.md +2 -2
  67. package/skills/integration-connectivity-connected-app-configure/references/example-usage.md +7 -7
  68. package/skills/integration-connectivity-connected-app-configure/references/migration-guide.md +1 -1
  69. package/skills/integration-connectivity-connected-app-configure/references/oauth-flows-reference.md +1 -1
  70. package/skills/integration-connectivity-connected-app-configure/references/testing-validation-guide.md +3 -3
  71. package/skills/integration-connectivity-generate/README.md +1 -1
  72. package/skills/integration-connectivity-generate/SKILL.md +6 -0
  73. package/skills/integration-connectivity-generate/assets/callouts/rest-queueable-callout.cls +1 -1
  74. package/skills/integration-connectivity-generate/assets/external-services/external-service-operations.md +1 -1
  75. package/skills/integration-connectivity-generate/assets/soap/wsdl2apex-guide.md +1 -1
  76. package/skills/integration-connectivity-generate/references/callout-patterns.md +4 -0
  77. package/skills/integration-connectivity-generate/references/cdc-guide.md +2 -2
  78. package/skills/integration-connectivity-generate/references/event-driven-architecture-guide.md +5 -5
  79. package/skills/integration-connectivity-generate/references/event-patterns.md +3 -2
  80. package/skills/integration-connectivity-generate/references/external-services-guide.md +4 -1
  81. package/skills/integration-connectivity-generate/references/messaging-api-v2.md +2 -2
  82. package/skills/integration-connectivity-generate/references/named-credentials-automation.md +1 -1
  83. package/skills/integration-connectivity-generate/references/named-credentials-guide.md +12 -2
  84. package/skills/integration-connectivity-generate/references/platform-events-guide.md +3 -3
  85. package/skills/integration-connectivity-generate/references/rest-callout-patterns.md +1 -1
  86. package/skills/integration-connectivity-generate/references/scoring-rubric.md +1 -1
  87. package/skills/integration-connectivity-generate/references/security-best-practices.md +5 -2
  88. package/skills/integration-connectivity-generate/scripts/configure-named-credential.sh +16 -5
  89. package/skills/integration-connectivity-generate/scripts/set-api-credential.sh +11 -2
  90. package/skills/integration-connectivity-generate/scripts/suggest_credential_setup.py +4 -3
  91. package/skills/integration-connectivity-generate/scripts/validate_integration.py +1 -1
  92. package/skills/omnistudio-callable-apex-generate/README.md +1 -5
  93. package/skills/omnistudio-callable-apex-generate/SKILL.md +14 -4
  94. package/skills/omnistudio-callable-apex-generate/assets/pattern_callable_vanilla.cls +8 -1
  95. package/skills/omnistudio-callable-apex-generate/examples/Test_VlocityOpenInterface2Conversion/TRANSCRIPT.md +1 -1
  96. package/skills/omnistudio-callable-apex-generate/examples/Test_VlocityOpenInterfaceConversion/TRANSCRIPT.md +1 -1
  97. package/skills/omnistudio-datamapper-generate/SKILL.md +1 -1
  98. package/skills/omnistudio-datamapper-generate/assets/completion-summary-template.md +2 -2
  99. package/skills/omnistudio-datamapper-generate/references/best-practices.md +9 -9
  100. package/skills/omnistudio-datamapper-generate/references/naming-conventions.md +6 -6
  101. package/skills/omnistudio-datapacks-deploy/README.md +1 -1
  102. package/skills/omnistudio-datapacks-deploy/examples/business-internet-plus-bundle/deploy-business-internet-plus-bundle.yaml +1 -1
  103. package/skills/omnistudio-dependencies-analyze/SKILL.md +12 -5
  104. package/skills/omnistudio-dependencies-analyze/references/dependency-patterns.md +9 -9
  105. package/skills/omnistudio-dependencies-analyze/references/namespace-guide.md +1 -1
  106. package/skills/omnistudio-epc-catalog-generate/README.md +1 -1
  107. package/skills/omnistudio-flexcard-generate/SKILL.md +11 -4
  108. package/skills/omnistudio-flexcard-generate/references/best-practices.md +6 -6
  109. package/skills/omnistudio-flexcard-generate/references/data-binding-guide.md +9 -9
  110. package/skills/omnistudio-integration-procedure-generate/SKILL.md +9 -1
  111. package/skills/omnistudio-integration-procedure-generate/references/element-types.md +3 -3
  112. package/skills/omnistudio-omniscript-generate/SKILL.md +2 -2
  113. package/skills/omnistudio-omniscript-generate/references/best-practices.md +1 -1
  114. package/skills/omnistudio-omniscript-generate/scripts/check-duplicate-omniscript.sh +8 -0
  115. package/skills/omnistudio-omniscript-generate/scripts/deploy-omniscript.sh +8 -0
  116. package/skills/platform-apex-logs-debug/README.md +2 -2
  117. package/skills/platform-apex-logs-debug/references/cli-commands.md +2 -2
  118. package/skills/platform-apex-logs-debug/references/debug-log-reference.md +16 -16
  119. package/skills/platform-apex-logs-debug/references/log-analysis-tools.md +2 -2
  120. package/skills/platform-apex-test-run/README.md +1 -1
  121. package/skills/platform-apex-test-run/references/test-fix-loop.md +2 -2
  122. package/skills/platform-apex-test-run/references/testing-best-practices.md +3 -3
  123. package/skills/platform-data-manage/README.md +4 -4
  124. package/skills/platform-data-manage/references/bulk-testing-example.md +1 -1
  125. package/skills/platform-data-manage/references/crud-workflow-example.md +2 -2
  126. package/skills/platform-data-manage/references/orchestration.md +6 -6
  127. package/skills/platform-flexipage-generate/SKILL.md +281 -346
  128. package/skills/platform-flexipage-generate/references/cli_commands.md +39 -0
  129. package/skills/platform-flexipage-generate/references/flexipage_fieldSection.md +162 -0
  130. package/skills/platform-flexipage-generate/references/flexipage_richText.md +84 -0
  131. package/skills/platform-flexipage-generate/references/identifiers_and_regions.md +167 -0
  132. package/skills/platform-flexipage-generate/references/mcp_action_examples.md +104 -0
  133. package/skills/platform-flexipage-generate/references/record_flexipage_dynamicHighlights.md +119 -0
  134. package/skills/platform-flexipage-generate/references/xml_rules.md +335 -0
  135. package/skills/platform-flexipage-generate/scripts/resolve-component-instructions.sh +42 -0
  136. package/skills/platform-flexipage-generate/scripts/scan-lwc-components.sh +113 -0
  137. package/skills/platform-metadata-deploy/README.md +2 -2
  138. package/skills/platform-metadata-deploy/references/agent-deployment-guide.md +2 -2
  139. package/skills/platform-metadata-deploy/references/deployment-workflows.md +16 -16
  140. package/skills/platform-metadata-deploy/references/orchestration.md +3 -3
  141. package/skills/platform-metadata-deploy/references/trigger-deployment-safety.md +2 -2
  142. package/skills/platform-models-api-configure/SKILL.md +140 -0
  143. package/skills/platform-models-api-configure/scripts/get-orgjwt.sh +48 -0
  144. package/skills/platform-policy-rule-generate/SKILL.md +260 -0
  145. package/skills/platform-policy-rule-generate/references/deploy-errors.md +54 -0
  146. package/skills/platform-policy-rule-generate/references/fixtures-index.md +29 -0
  147. package/skills/platform-policy-rule-generate/references/policy-schema-full.md +250 -0
  148. package/skills/platform-policy-rule-generate/references/templates-access.md +132 -0
  149. package/skills/platform-policy-rule-generate/references/templates-advanced.md +58 -0
  150. package/skills/platform-policy-rule-generate/references/templates-record.md +75 -0
  151. package/skills/platform-policy-rule-generate/references/templates-transform.md +70 -0
  152. package/skills/platform-policy-rule-generate/references/templates.md +10 -0
  153. package/skills/platform-policy-rule-generate/references/ui-compatibility.md +142 -0
  154. package/skills/platform-soql-query/README.md +1 -1
  155. package/skills/platform-soql-query/SKILL.md +1 -1
  156. package/skills/platform-soql-query/references/anti-patterns.md +1 -1
  157. package/skills/platform-soql-query/references/field-coverage-rules.md +1 -1
  158. package/skills/platform-soql-query/references/query-optimization.md +1 -1
  159. package/skills/platform-soql-query/scripts/post-tool-validate.py +3 -3
  160. package/skills/data360-activate/CREDITS.md +0 -5
  161. package/skills/data360-connect/CREDITS.md +0 -5
  162. package/skills/data360-harmonize/CREDITS.md +0 -3
  163. package/skills/data360-orchestrate/CREDITS.md +0 -15
  164. package/skills/data360-orchestrate/UPSTREAM.md +0 -45
  165. package/skills/data360-prepare/CREDITS.md +0 -7
  166. package/skills/data360-query/CREDITS.md +0 -7
  167. package/skills/data360-segment/CREDITS.md +0 -3
  168. package/skills/experience-lwc-generate/CREDITS.md +0 -5
  169. package/skills/external-diagram-mermaid-generate/CREDITS.md +0 -46
  170. package/skills/external-diagram-visual-generate/CREDITS.md +0 -80
  171. package/skills/external-diagram-visual-generate/README.md +0 -83
  172. package/skills/external-diagram-visual-generate/SKILL.md +0 -207
  173. package/skills/external-diagram-visual-generate/assets/architecture/integration-flow.md +0 -55
  174. package/skills/external-diagram-visual-generate/assets/erd/core-objects.md +0 -131
  175. package/skills/external-diagram-visual-generate/assets/erd/custom-objects.md +0 -60
  176. package/skills/external-diagram-visual-generate/assets/lwc/dashboard-card.md +0 -45
  177. package/skills/external-diagram-visual-generate/assets/lwc/data-table.md +0 -57
  178. package/skills/external-diagram-visual-generate/assets/lwc/record-form.md +0 -60
  179. package/skills/external-diagram-visual-generate/assets/review/apex-review.md +0 -57
  180. package/skills/external-diagram-visual-generate/assets/review/lwc-review.md +0 -48
  181. package/skills/external-diagram-visual-generate/references/architect-aesthetic-guide.md +0 -257
  182. package/skills/external-diagram-visual-generate/references/examples-index.md +0 -35
  183. package/skills/external-diagram-visual-generate/references/gemini-cli-setup.md +0 -65
  184. package/skills/external-diagram-visual-generate/references/interview-questions.md +0 -529
  185. package/skills/external-diagram-visual-generate/references/iteration-workflow.md +0 -173
  186. package/skills/external-diagram-visual-generate/scripts/check-prerequisites.sh +0 -101
  187. package/skills/external-diagram-visual-generate/scripts/generate_image.py +0 -243
  188. package/skills/integration-connectivity-connected-app-configure/CREDITS.md +0 -3
  189. package/skills/integration-connectivity-generate/CREDITS.md +0 -5
  190. package/skills/omnistudio-callable-apex-generate/CREDITS.md +0 -9
  191. package/skills/omnistudio-datamapper-generate/CREDITS.md +0 -5
  192. package/skills/omnistudio-datapacks-deploy/CREDITS.md +0 -5
  193. package/skills/omnistudio-dependencies-analyze/CREDITS.md +0 -5
  194. package/skills/omnistudio-epc-catalog-generate/CREDITS.md +0 -14
  195. package/skills/omnistudio-flexcard-generate/CREDITS.md +0 -5
  196. package/skills/omnistudio-integration-procedure-generate/CREDITS.md +0 -5
  197. package/skills/omnistudio-omniscript-generate/CREDITS.md +0 -5
  198. package/skills/platform-apex-generate/CREDITS.md +0 -5
  199. package/skills/platform-apex-logs-debug/CREDITS.md +0 -22
  200. package/skills/platform-apex-test-generate/CREDITS.md +0 -5
  201. package/skills/platform-apex-test-run/CREDITS.md +0 -22
  202. package/skills/platform-data-manage/CREDITS.md +0 -5
  203. package/skills/platform-metadata-deploy/CREDITS.md +0 -25
  204. package/skills/platform-soql-query/CREDITS.md +0 -21
  205. /package/skills/omnistudio-callable-apex-generate/examples/Test_VlocityOpenInterfaceConversion/{MyCustomVlocityOpenInterface2.cls → MyCustomClass.cls} +0 -0
@@ -0,0 +1,335 @@
1
+ # Critical XML Rules & Deployment Errors
2
+
3
+ ## Contents
4
+
5
+ 0. [STOP — Read Before Writing ANY componentInstance](#stop--read-before-writing-any-componentinstance)
6
+ 1. [Property Value Encoding](#1-property-value-encoding-most-common-error)
7
+ 2. [Field References](#2-field-references)
8
+ 3. [Region vs Facet Types](#3-region-vs-facet-types)
9
+ 4. [itemInstances — ONE Child Per Wrapper](#4-iteminstances--one-child-per-wrapper-critical)
10
+ 5. [Unique Identifiers and Region Names](#5-unique-identifiers-and-region-names-critical---prevents-duplicate-errors)
11
+ 6. [Correct Element Names](#6-correct-element-names-critical--prevents-invalid-xml-errors)
12
+ 7. [Common Deployment Errors](#common-deployment-errors)
13
+
14
+ ---
15
+
16
+ ## STOP — Read Before Writing ANY componentInstance
17
+
18
+ **The element name is `<componentInstanceProperties>`, NEVER `<properties>`.**
19
+
20
+ ```xml
21
+ <!-- WRONG — WILL FAIL DEPLOYMENT -->
22
+ <componentInstance>
23
+ <properties>
24
+ <name>label</name>
25
+ <value>Hello</value>
26
+ </properties>
27
+ <componentName>flexipage:fieldSection</componentName>
28
+ <identifier>id1</identifier>
29
+ </componentInstance>
30
+
31
+ <!-- CORRECT — the ONLY valid element name -->
32
+ <componentInstance>
33
+ <componentInstanceProperties>
34
+ <name>label</name>
35
+ <value>Hello</value>
36
+ </componentInstanceProperties>
37
+ <componentName>flexipage:fieldSection</componentName>
38
+ <identifier>id1</identifier>
39
+ </componentInstance>
40
+ ```
41
+
42
+ **There is no `<properties>` element in FlexiPage XML. It does not exist. Every time you write a property inside `<componentInstance>`, you MUST write `<componentInstanceProperties>`. If you find yourself typing `<properties>`, STOP and correct it to `<componentInstanceProperties>`.**
43
+
44
+ ---
45
+
46
+ ## 1. Property Value Encoding (MOST COMMON ERROR)
47
+
48
+ **Any property value with HTML/XML characters MUST be manually encoded in the following order** (wrong order causes double-encoding corruption):
49
+
50
+ ```text
51
+ 1. & → &amp; (FIRST! Encode this before others)
52
+ 2. < → &lt;
53
+ 3. > → &gt;
54
+ 4. " → &quot;
55
+ 5. ' → &apos;
56
+ ```
57
+
58
+ **Wrong:**
59
+ ```xml
60
+ <value><b>Important</b> text</value>
61
+ ```
62
+
63
+ **Correct:**
64
+ ```xml
65
+ <value>&lt;b&gt;Important&lt;/b&gt; text</value>
66
+ ```
67
+
68
+ **Check your XML:** Search for `<value>` tags - they should never contain raw `<` or `>` characters.
69
+
70
+ ## 2. Field References
71
+
72
+ Use `Record.{FieldApiName}` — never `{ObjectName}.{FieldApiName}` (Salesforce resolves from Record, not object name).
73
+
74
+ ```xml
75
+ <!-- Correct -->
76
+ <fieldItem>Record.Name</fieldItem>
77
+
78
+ <!-- Wrong -->
79
+ <fieldItem>Account.Name</fieldItem>
80
+ ```
81
+
82
+ ## 3. Region vs Facet Types
83
+
84
+ **Template Regions** (header, main, sidebar):
85
+ ```xml
86
+ <name>header</name>
87
+ <type>Region</type>
88
+ ```
89
+
90
+ **Component Facets** (internal slots like fieldSection columns):
91
+ ```xml
92
+ <name>Facet-12345</name>
93
+ <type>Facet</type>
94
+ ```
95
+
96
+ **Rule:** If it's a template region name → `Region`. If it's a component slot → `Facet`.
97
+
98
+ ## 4. itemInstances — ONE Child Per Wrapper (CRITICAL)
99
+
100
+ **Each `<itemInstances>` can contain exactly ONE child element** — either one `<componentInstance>` OR one `<fieldInstance>`. Never put multiple children inside a single `<itemInstances>`.
101
+
102
+ ```xml
103
+ <!-- WRONG — multiple componentInstance in one itemInstances -->
104
+ <itemInstances>
105
+ <componentInstance>
106
+ <componentName>flexipage:field</componentName>
107
+ <identifier>field1</identifier>
108
+ </componentInstance>
109
+ <componentInstance>
110
+ <componentName>flexipage:field</componentName>
111
+ <identifier>field2</identifier>
112
+ </componentInstance>
113
+ </itemInstances>
114
+
115
+ <!-- CORRECT — each componentInstance in its own itemInstances -->
116
+ <itemInstances>
117
+ <componentInstance>
118
+ <componentName>flexipage:field</componentName>
119
+ <identifier>field1</identifier>
120
+ </componentInstance>
121
+ </itemInstances>
122
+ <itemInstances>
123
+ <componentInstance>
124
+ <componentName>flexipage:field</componentName>
125
+ <identifier>field2</identifier>
126
+ </componentInstance>
127
+ </itemInstances>
128
+ ```
129
+
130
+ ### fieldInstance Structure
131
+
132
+ Every fieldInstance requires:
133
+ ```xml
134
+ <itemInstances>
135
+ <fieldInstance>
136
+ <fieldInstanceProperties>
137
+ <name>uiBehavior</name>
138
+ <value>none</value> <!-- none|readonly|required -->
139
+ </fieldInstanceProperties>
140
+ <fieldItem>Record.FieldName__c</fieldItem>
141
+ <identifier>RecordFieldName_cField</identifier>
142
+ </fieldInstance>
143
+ </itemInstances>
144
+ ```
145
+
146
+ **Valid `uiBehavior` values (lowercase only):**
147
+
148
+ | Value | Meaning |
149
+ |-------|---------|
150
+ | `none` | Field respects standard editability settings (default) |
151
+ | `readonly` | Field is permanently locked on this page |
152
+ | `required` | Field must be filled out before saving on this page |
153
+
154
+ **Rules:**
155
+ - Each `<itemInstances>` gets exactly ONE child (`<componentInstance>` or `<fieldInstance>`)
156
+ - fieldInstance must have `fieldInstanceProperties` with `uiBehavior`
157
+ - Use `Record.{Field}` format
158
+ - There is NO `edit` value — use `none` for standard editable fields
159
+
160
+ ## 5. Unique Identifiers and Region Names (CRITICAL - PREVENTS DUPLICATE ERRORS)
161
+
162
+ **EVERY identifier and region/facet name MUST be unique across the entire FlexiPage file.**
163
+
164
+ - **NEVER create two `<flexiPageRegions>` blocks with the same `<name>`**
165
+ - **If multiple components belong to same facet, combine them in ONE region with multiple `<itemInstances>`**
166
+ - **NEVER reuse the same `<identifier>` value**
167
+ - **Always read entire file first and extract ALL existing identifiers and names**
168
+ - **Element order inside `<flexiPageRegions>`**: `<itemInstances>` FIRST, then `<mode>` (if needed), then `<name>`, then `<type>` — NEVER put `<name>`/`<type>` before `<itemInstances>`
169
+
170
+ **Wrong - This WILL FAIL with duplicate name error:**
171
+ ```xml
172
+ <!-- First field section in detail tab -->
173
+ <flexiPageRegions>
174
+ <itemInstances>
175
+ <componentInstance>
176
+ <identifier>flexipage_property_details_fieldSection</identifier>
177
+ ...
178
+ </componentInstance>
179
+ </itemInstances>
180
+ <name>detailTabContent</name> <!-- WRONG: DUPLICATE NAME -->
181
+ <type>Facet</type>
182
+ </flexiPageRegions>
183
+
184
+ <!-- Second field section in detail tab -->
185
+ <flexiPageRegions>
186
+ <itemInstances>
187
+ <componentInstance>
188
+ <identifier>flexipage_pricing_fieldSection</identifier>
189
+ ...
190
+ </componentInstance>
191
+ </itemInstances>
192
+ <name>detailTabContent</name> <!-- WRONG: DUPLICATE NAME - DEPLOYMENT FAILS -->
193
+ <type>Facet</type>
194
+ </flexiPageRegions>
195
+ ```
196
+
197
+ **Correct - Combine itemInstances in ONE region:**
198
+ ```xml
199
+ <!-- Both field sections in same detail tab facet -->
200
+ <flexiPageRegions>
201
+ <itemInstances>
202
+ <componentInstance>
203
+ <identifier>flexipage_property_details_fieldSection</identifier>
204
+ ...
205
+ </componentInstance>
206
+ </itemInstances>
207
+ <itemInstances>
208
+ <componentInstance>
209
+ <identifier>flexipage_pricing_fieldSection</identifier>
210
+ ...
211
+ </componentInstance>
212
+ </itemInstances>
213
+ <name>detailTabContent</name> <!-- CORRECT: ONE REGION, MULTIPLE COMPONENTS -->
214
+ <type>Facet</type>
215
+ </flexiPageRegions>
216
+ ```
217
+
218
+ **When to combine vs separate:**
219
+ - **Combine**: Components that logically belong to same tab/section (e.g., multiple field sections in detail tab)
220
+ - **Separate**: Components that belong to different tabs/sections (e.g., `detailTabContent` vs `relatedTabContent`)
221
+
222
+ ---
223
+
224
+ ## 6. Correct Element Names (CRITICAL — PREVENTS INVALID XML ERRORS)
225
+
226
+ **FlexiPage XML uses specific element names. Common LLM hallucinations use WRONG names that cause deployment failures.**
227
+
228
+ | WRONG (do NOT use) | CORRECT |
229
+ |---|---|
230
+ | `<entityType>` | `<sobjectType>` |
231
+ | `<properties>` | `<componentInstanceProperties>` |
232
+ | `<regions>` | `<flexiPageRegions>` |
233
+ | `<components>` | `<itemInstances>` |
234
+ | `<innerComponents>` | (does not exist — use facets for nesting) |
235
+ | `<fieldItems>` | `<itemInstances>` containing `<fieldInstance>` |
236
+ | `<template>value</template>` | `<template><name>value</name></template>` |
237
+ | `<parentFlexiPage>flexipage:templateName</parentFlexiPage>` | `<parentFlexiPage>flexipage__default_rec_L</parentFlexiPage>` |
238
+
239
+ **Do NOT invent elements or component names:**
240
+
241
+ Only use component names discovered through the 3-tier discovery process or present in the template from CLI. Do NOT add any XML element that is not present in the template structure from the CLI template. If a component name did not come from discovery or the CLI template.
242
+
243
+ | WRONG (do NOT use) | Why / What to use instead |
244
+ |---|---|
245
+ | `<apiVersion>` | Not a FlexiPage element — API version lives in `sfdx-project.json` |
246
+ | `<description>` | Not a FlexiPage element — use `<masterLabel>` for the page name |
247
+ | `flexipage:tabs` | Does not exist — use `flexipage:tabset` + `flexipage:tab` in facets |
248
+ | `flexipage:tabset2` | Does not exist — correct name is `flexipage:tabset` |
249
+ | `flexipage:facet` | Does not exist — use `flexipage:column` with `body` property |
250
+ | `flexipage:fields` | Does not exist — use individual `fieldInstance` elements in a field facet |
251
+ | `<type>String</type>` inside `componentInstanceProperties` | Remove — only valid `<type>` value is `decorator`, and only for UtilityBar pages |
252
+
253
+ **Correct top-level FlexiPage structure (element order):**
254
+ ```xml
255
+ <?xml version="1.0" encoding="UTF-8"?>
256
+ <FlexiPage xmlns="http://soap.sforce.com/2006/04/metadata">
257
+ <flexiPageRegions>...</flexiPageRegions>
258
+ <masterLabel>Page Name</masterLabel>
259
+ <parentFlexiPage>flexipage__default_rec_L</parentFlexiPage>
260
+ <sobjectType>Account</sobjectType>
261
+ <template>
262
+ <name>flexipage:recordHomeTemplateDesktop</name>
263
+ </template>
264
+ <type>RecordPage</type>
265
+ </FlexiPage>
266
+ ```
267
+
268
+ **Correct componentInstance structure:**
269
+ ```xml
270
+ <componentInstance>
271
+ <componentInstanceProperties>
272
+ <name>propertyName</name>
273
+ <value>propertyValue</value>
274
+ </componentInstanceProperties>
275
+ <componentName>lightning:card</componentName>
276
+ <identifier>unique_id_1</identifier>
277
+ </componentInstance>
278
+ ```
279
+
280
+ **`<componentInstanceProperties>` children — `<name>`, `<value>`, and optionally `<type>`:**
281
+
282
+ ```xml
283
+ <!-- WRONG — "String", "Facet", etc. are NOT valid <type> values -->
284
+ <componentInstanceProperties>
285
+ <name>fieldApiName</name>
286
+ <type>String</type>
287
+ <value>Record.Name</value>
288
+ </componentInstanceProperties>
289
+
290
+ <!-- CORRECT — omit <type> for standard properties (most cases) -->
291
+ <componentInstanceProperties>
292
+ <name>fieldApiName</name>
293
+ <value>Record.Name</value>
294
+ </componentInstanceProperties>
295
+
296
+ <!-- CORRECT — <type>decorator</type> ONLY for UtilityBar component decorators -->
297
+ <componentInstanceProperties>
298
+ <name>panelHeight</name>
299
+ <type>decorator</type>
300
+ <value>480</value>
301
+ </componentInstanceProperties>
302
+ ```
303
+
304
+ **`<type>` rules:**
305
+ - If omitted (default): the property applies to the Lightning component itself
306
+ - If `decorator`: the property applies to the **component decorator** (a wrapper that adds capabilities like height/width when opened)
307
+ - The ONLY valid value is `decorator` — never `String`, `Facet`, `Integer`, etc.
308
+ - Component decorators are ONLY supported on **UtilityBar** page types — do NOT use `<type>decorator</type>` on RecordPage, AppPage, or HomePage
309
+
310
+ **Nesting is done via facets, NOT via inner elements.** Components that contain other components reference a facet name in their properties; the facet is a sibling `<flexiPageRegions>` with `<type>Facet</type>`.
311
+
312
+ | Error | Cause | Fix |
313
+ |-------|-------|-----|
314
+ | "Element regions invalid in FlexiPage" | Used `<regions>` instead of `<flexiPageRegions>` | Replace with `<flexiPageRegions>` |
315
+ | "Element components invalid in FlexiPageRegion" | Used `<components>` instead of `<itemInstances>` | Replace with `<itemInstances>` |
316
+ | "couldn't retrieve design time component information" | Used hallucinated component name (`flexipage:tabs`, `flexipage:tabset2`) | Use `flexipage:tabset` — see `identifiers_and_regions.md` for the full 3-layer tab pattern |
317
+
318
+ ---
319
+
320
+ ## Common Deployment Errors
321
+
322
+ | Error | Cause | Fix |
323
+ |-------|-------|-----|
324
+ | "We couldn't retrieve or load the information on the field" | Invalid field API name — field doesn't exist or has incorrect spelling | Use MCP tools or describe commands to discover valid fields |
325
+ | "Invalid field reference" | Used `ObjectName.Field` instead of `Record.Field` | Change to `Record.{FieldApiName}` |
326
+ | "Element componentInstance is duplicated at this location in type ItemInstance" | Multiple `<componentInstance>` in one `<itemInstances>` | Each `<componentInstance>` needs its own `<itemInstances>` wrapper |
327
+ | "Element fieldInstance is duplicated" | Multiple fieldInstances in one `<itemInstances>` | Each fieldInstance needs its own `<itemInstances>` wrapper |
328
+ | "Missing fieldInstanceProperties" | No uiBehavior specified | Add `fieldInstanceProperties` with `uiBehavior` |
329
+ | "Unused Facet" | Facet defined but not referenced by any component | Remove Facet or reference it in a component property |
330
+ | "XML parsing error" | Unencoded HTML/XML in property values | Encode `<`, `>`, `&`, `"`, `'` in all `<value>` tags |
331
+ | "Cannot create component with namespace" | Invalid page name (used `__c` suffix) | Use `Volunteer_Record_Page` not `Volunteer__c_Record_Page` |
332
+ | "Region specifies mode that parent doesn't support" | Added `<mode>` to a region that doesn't support it | Only use `<mode>` where required (e.g., `<mode>Replace</mode>` in `detailTabContent` for Dynamic Forms) |
333
+ | "We couldn't retrieve the design time component information for component X" | Hallucinated component name (e.g., `flexipage:tabs`, `flexipage:tabset2`) | Use correct component name — see Section 6 table and `identifiers_and_regions.md` for valid patterns |
334
+ | "'String' is not a valid value for the enum 'ComponentInstancePropertyTypeEnum'" | Used invalid `<type>` value (e.g., `String`, `Facet`, `Integer`) inside `<componentInstanceProperties>` | Remove `<type>` entirely — the only valid value is `decorator`, and only for UtilityBar page types |
335
+ | "Element apiVersion invalid at this location in type FlexiPage" | Added `<apiVersion>` to FlexiPage XML | Remove — API version belongs in `sfdx-project.json`, not in FlexiPage metadata |
@@ -0,0 +1,42 @@
1
+ #!/bin/bash
2
+ # resolve-component-instructions.sh — Resolve the instructions file path for a component.
3
+ #
4
+ # Usage: scripts/resolve-component-instructions.sh <componentDefinition>
5
+ #
6
+ # Arguments:
7
+ # componentDefinition — Component FQN in colon format (e.g., "flexipage:fieldSection")
8
+ #
9
+ # Output: The path to the instructions file if it exists, or empty string if not found.
10
+ #
11
+ # Examples:
12
+ # scripts/resolve-component-instructions.sh "record_flexipage:dynamicHighlights"
13
+ # → references/record_flexipage_dynamicHighlights.md
14
+ #
15
+ # scripts/resolve-component-instructions.sh "flexipage:fieldSection"
16
+ # → references/flexipage_fieldSection.md
17
+ #
18
+ # scripts/resolve-component-instructions.sh "c:expenseTracker"
19
+ # → (empty — file does not exist)
20
+
21
+ set -euo pipefail
22
+
23
+ COMPONENT="${1:-}"
24
+
25
+ if [ -z "$COMPONENT" ]; then
26
+ echo "Usage: $0 <componentDefinition>" >&2
27
+ exit 1
28
+ fi
29
+
30
+ # Derive filename: replace ':' with '_', append .md
31
+ FILENAME=$(echo "$COMPONENT" | sed 's/:/_/g').md
32
+
33
+ # Resolve path relative to the skill directory
34
+ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
35
+ SKILL_DIR="$(dirname "$SCRIPT_DIR")"
36
+ FILEPATH="$SKILL_DIR/references/$FILENAME"
37
+
38
+ if [ -f "$FILEPATH" ]; then
39
+ echo "references/$FILENAME"
40
+ else
41
+ echo ""
42
+ fi
@@ -0,0 +1,113 @@
1
+ #!/bin/bash
2
+ # scan-lwc-components.sh — Scan local SFDX project for LWC components matching a query.
3
+ #
4
+ # Usage: scripts/scan-lwc-components.sh <query> [packageDirectory]
5
+ #
6
+ # Arguments:
7
+ # query — User intent keywords (e.g., "expense tracker")
8
+ # packageDirectory — SFDX package directory path (default: read from sfdx-project.json)
9
+ #
10
+ # Output: Ranked JSON array of matches with confidence scores.
11
+ # [{"name": "expenseTracker", "score": 75, "confidence": "high"}]
12
+ #
13
+ # Confidence tiers:
14
+ # high (≥70%): auto-select, confirm with user
15
+ # medium (40-69%): present ranked list for user selection
16
+ # low (<40%): skip, proceed to Tier 2
17
+
18
+ set -euo pipefail
19
+
20
+ QUERY="${1:-}"
21
+ PKG_DIR="${2:-}"
22
+
23
+ if [ -z "$QUERY" ]; then
24
+ echo "Usage: $0 <query> [packageDirectory]" >&2
25
+ exit 1
26
+ fi
27
+
28
+ # Resolve package directory from sfdx-project.json if not provided
29
+ if [ -z "$PKG_DIR" ]; then
30
+ if [ -f "sfdx-project.json" ]; then
31
+ PKG_DIR=$(python3 -c "
32
+ import json, sys
33
+ with open('sfdx-project.json') as f:
34
+ data = json.load(f)
35
+ dirs = data.get('packageDirectories', [])
36
+ if dirs:
37
+ print(dirs[0].get('path', 'force-app'))
38
+ else:
39
+ print('force-app')
40
+ " 2>/dev/null || echo "force-app")
41
+ else
42
+ PKG_DIR="force-app"
43
+ fi
44
+ fi
45
+
46
+ # Check if package directory exists
47
+ if [ ! -d "$PKG_DIR" ]; then
48
+ echo "[]"
49
+ exit 0
50
+ fi
51
+
52
+ # Tokenize query: lowercase, split on spaces
53
+ IFS=' ' read -ra QUERY_TOKENS <<< "$(echo "$QUERY" | tr '[:upper:]' '[:lower:]')"
54
+
55
+ # Find all LWC component directories
56
+ RESULTS="["
57
+ FIRST=true
58
+
59
+ while IFS= read -r dir; do
60
+ COMP_NAME=$(basename "$dir")
61
+
62
+ # Tokenize camelCase component name: split on uppercase boundaries → lowercase
63
+ COMP_TOKENS=$(echo "$COMP_NAME" | sed 's/\([a-z]\)\([A-Z]\)/\1 \2/g' | tr '[:upper:]' '[:lower:]')
64
+ IFS=' ' read -ra TOKENS <<< "$COMP_TOKENS"
65
+ TOTAL=${#TOKENS[@]}
66
+
67
+ if [ "$TOTAL" -eq 0 ]; then
68
+ continue
69
+ fi
70
+
71
+ # Count matched tokens
72
+ MATCHED=0
73
+ for qt in "${QUERY_TOKENS[@]}"; do
74
+ for ct in "${TOKENS[@]}"; do
75
+ if [ "$qt" = "$ct" ]; then
76
+ MATCHED=$((MATCHED + 1))
77
+ break
78
+ fi
79
+ done
80
+ done
81
+
82
+ # Calculate score
83
+ SCORE=$(( (MATCHED * 100) / TOTAL ))
84
+
85
+ # Determine confidence tier
86
+ if [ "$SCORE" -ge 70 ]; then
87
+ CONFIDENCE="high"
88
+ elif [ "$SCORE" -ge 40 ]; then
89
+ CONFIDENCE="medium"
90
+ else
91
+ CONFIDENCE="low"
92
+ fi
93
+
94
+ # Only include medium and high confidence matches
95
+ if [ "$SCORE" -ge 40 ]; then
96
+ if [ "$FIRST" = true ]; then
97
+ FIRST=false
98
+ else
99
+ RESULTS+=","
100
+ fi
101
+ RESULTS+="{\"name\":\"$COMP_NAME\",\"score\":$SCORE,\"confidence\":\"$CONFIDENCE\"}"
102
+ fi
103
+ done < <(find "$PKG_DIR" -path "*/lwc/*" -type d -maxdepth 5 | grep -v "__tests__")
104
+
105
+ RESULTS+="]"
106
+
107
+ # Sort by score descending (using python for JSON sorting)
108
+ echo "$RESULTS" | python3 -c "
109
+ import json, sys
110
+ data = json.load(sys.stdin)
111
+ data.sort(key=lambda x: x['score'], reverse=True)
112
+ print(json.dumps(data, indent=2))
113
+ " 2>/dev/null || echo "$RESULTS"
@@ -16,7 +16,7 @@ Comprehensive Salesforce DevOps automation using sf CLI v2. Validate, deploy, ve
16
16
 
17
17
  ### 1. Invoke the skill
18
18
 
19
- ```
19
+ ```text
20
20
  Skill: platform-metadata-deploy
21
21
  Request: "Deploy all changes to org dev with validation"
22
22
  ```
@@ -61,7 +61,7 @@ After a successful dry run, guide the user to the next safe step:
61
61
 
62
62
  ## Orchestration Order
63
63
 
64
- ```
64
+ ```text
65
65
  platform-custom-object-generate/automation-flow-generate → platform-metadata-deploy → platform-data-manage
66
66
  ```
67
67
 
@@ -31,7 +31,7 @@ Agentforce agents consist of multiple metadata components:
31
31
 
32
32
  ### Metadata Hierarchy
33
33
 
34
- ```
34
+ ```text
35
35
  Bot (Agent Definition)
36
36
  └── BotVersion (Version Config)
37
37
  └── GenAiPlannerBundle (Reasoning Engine)
@@ -365,7 +365,7 @@ Pass the BotVersion number you intend to activate as the third argument.
365
365
 
366
366
  **Critical:** Dependencies must be deployed BEFORE the agent.
367
367
 
368
- ```
368
+ ```text
369
369
  1. Custom Objects/Fields (platform-custom-object-generate, platform-custom-field-generate)
370
370
 
371
371
  2. Apex Classes (platform-apex-generate)
@@ -6,7 +6,7 @@ This file contains practical examples of common Salesforce deployment scenarios
6
6
  ## Example 1: Basic Production Deployment
7
7
 
8
8
  ### User Request:
9
- ```
9
+ ```text
10
10
  "Deploy my changes to production with full test coverage"
11
11
  ```
12
12
 
@@ -19,7 +19,7 @@ This file contains practical examples of common Salesforce deployment scenarios
19
19
  ```
20
20
 
21
21
  2. **Validation output**
22
- ```
22
+ ```text
23
23
  ✓ Deployment validation succeeded
24
24
  ✓ Tests passed: 145/145 (92% coverage)
25
25
  ✓ Components validated: 23
@@ -31,7 +31,7 @@ This file contains practical examples of common Salesforce deployment scenarios
31
31
  ```
32
32
 
33
33
  4. **Final output**
34
- ```
34
+ ```text
35
35
  ## Salesforce Deployment Report
36
36
 
37
37
  ✓ Status: Succeeded
@@ -50,7 +50,7 @@ This file contains practical examples of common Salesforce deployment scenarios
50
50
  ## Example 2: Selective Component Deployment
51
51
 
52
52
  ### User Request:
53
- ```
53
+ ```text
54
54
  "Deploy only the new Lightning Web Components to sandbox"
55
55
  ```
56
56
 
@@ -72,7 +72,7 @@ This file contains practical examples of common Salesforce deployment scenarios
72
72
  ```
73
73
 
74
74
  3. **Output**
75
- ```
75
+ ```text
76
76
  ✓ Deployment succeeded
77
77
  ✓ Components Deployed:
78
78
  - accountCard (LWC)
@@ -85,7 +85,7 @@ This file contains practical examples of common Salesforce deployment scenarios
85
85
  ## Example 3: Hotfix Deployment
86
86
 
87
87
  ### User Request:
88
- ```
88
+ ```text
89
89
  "I need to deploy an urgent bug fix in AccountController to production"
90
90
  ```
91
91
 
@@ -124,7 +124,7 @@ This file contains practical examples of common Salesforce deployment scenarios
124
124
  ## Example 4: Manifest-Based Deployment
125
125
 
126
126
  ### User Request:
127
- ```
127
+ ```text
128
128
  "Deploy using the package.xml manifest for release v2.3"
129
129
  ```
130
130
 
@@ -155,7 +155,7 @@ This file contains practical examples of common Salesforce deployment scenarios
155
155
  ## Example 5: Scratch Org Development Workflow
156
156
 
157
157
  ### User Request:
158
- ```
158
+ ```text
159
159
  "Create a scratch org and deploy my feature branch"
160
160
  ```
161
161
 
@@ -195,7 +195,7 @@ This file contains practical examples of common Salesforce deployment scenarios
195
195
  ## Example 6: Deployment Rollback
196
196
 
197
197
  ### User Request:
198
- ```
198
+ ```text
199
199
  "The deployment failed, I need to rollback to the previous version"
200
200
  ```
201
201
 
@@ -232,7 +232,7 @@ This file contains practical examples of common Salesforce deployment scenarios
232
232
  ## Example 7: Destructive Changes
233
233
 
234
234
  ### User Request:
235
- ```
235
+ ```text
236
236
  "Remove the deprecated CustomObject__c and old Apex classes"
237
237
  ```
238
238
 
@@ -272,7 +272,7 @@ This file contains practical examples of common Salesforce deployment scenarios
272
272
  ## Example 8: Multi-Environment Deployment
273
273
 
274
274
  ### User Request:
275
- ```
275
+ ```text
276
276
  "Deploy to dev, then staging, then production after each passes validation"
277
277
  ```
278
278
 
@@ -303,7 +303,7 @@ This file contains practical examples of common Salesforce deployment scenarios
303
303
  ## Example 9: Code Coverage Analysis
304
304
 
305
305
  ### User Request:
306
- ```
306
+ ```text
307
307
  "Check my code coverage and identify classes that need more tests"
308
308
  ```
309
309
 
@@ -320,7 +320,7 @@ This file contains practical examples of common Salesforce deployment scenarios
320
320
  ```
321
321
 
322
322
  2. **Analyze coverage report**
323
- ```
323
+ ```text
324
324
  Overall Code Coverage: 87%
325
325
 
326
326
  Classes with <75% coverage:
@@ -339,14 +339,14 @@ This file contains practical examples of common Salesforce deployment scenarios
339
339
  ## Example 10: Deployment Error Recovery
340
340
 
341
341
  ### User Request:
342
- ```
342
+ ```text
343
343
  "Deployment failed with 'INVALID_CROSS_REFERENCE_KEY' error"
344
344
  ```
345
345
 
346
346
  ### Skill Execution:
347
347
 
348
348
  1. **Analyze error**
349
- ```
349
+ ```text
350
350
  Error: INVALID_CROSS_REFERENCE_KEY
351
351
  Component: CustomObject__c.SomeLookupField__c
352
352
  Message: Field references non-existent object
@@ -358,7 +358,7 @@ This file contains practical examples of common Salesforce deployment scenarios
358
358
  ```
359
359
 
360
360
  3. **Solution provided**
361
- ```
361
+ ```text
362
362
  The error indicates that SomeLookupField__c references an object
363
363
  that doesn't exist in the target org.
364
364