@salesforce/afv-skills 1.67.0 → 1.69.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 (258) hide show
  1. package/README.md +55 -5
  2. package/package.json +1 -1
  3. package/skills/afcc-setup-coordinate/SKILL.md +348 -0
  4. package/skills/afcc-setup-coordinate/assets/console-app/AFCC_Service_Console.app-meta.xml +19 -0
  5. package/skills/afcc-setup-coordinate/assets/console-app/Admin.profile-meta.xml +8 -0
  6. package/skills/afcc-setup-coordinate/assets/console-app/Standard.profile-meta.xml +8 -0
  7. package/skills/afcc-setup-coordinate/assets/gap_report_template.md +35 -0
  8. package/skills/afcc-setup-coordinate/assets/org_profile_template.json +16 -0
  9. package/skills/afcc-setup-coordinate/references/gotchas.md +22 -0
  10. package/skills/afcc-setup-coordinate/scripts/audit_org.sh +159 -0
  11. package/skills/agentforce-bot-upgrade/SKILL.md +117 -66
  12. package/skills/agentforce-bot-upgrade/assets/_vendored/agent-spec-template.md +139 -0
  13. package/skills/agentforce-bot-upgrade/references/_vendored/agent-design-and-spec-creation.md +1211 -0
  14. package/skills/agentforce-bot-upgrade/references/_vendored/agent-script-core-language.md +1390 -0
  15. package/skills/agentforce-bot-upgrade/references/_vendored/agent-subagent-map-diagrams.md +341 -0
  16. package/skills/agentforce-bot-upgrade/references/_vendored/agent-user-setup.md +672 -0
  17. package/skills/agentforce-bot-upgrade/references/_vendored/agent-validation-and-debugging.md +904 -0
  18. package/skills/agentforce-bot-upgrade/references/_vendored/agentscript-toolchain.md +112 -0
  19. package/skills/agentforce-bot-upgrade/references/_vendored/architecture-patterns.md +277 -0
  20. package/skills/agentforce-bot-upgrade/references/_vendored/common-control-flow-pitfalls.md +255 -0
  21. package/skills/agentforce-bot-upgrade/references/_vendored/control-flow-actions-sequencing.md +198 -0
  22. package/skills/agentforce-bot-upgrade/references/_vendored/control-flow-lifecycle-side-effects.md +87 -0
  23. package/skills/agentforce-bot-upgrade/references/_vendored/data-library-reference.md +891 -0
  24. package/skills/agentforce-bot-upgrade/references/_vendored/instruction-resolution.md +658 -0
  25. package/skills/agentforce-bot-upgrade/references/_vendored/org-setup-for-adl.md +551 -0
  26. package/skills/agentforce-bot-upgrade/references/_vendored/patterns-by-requirement.md +88 -0
  27. package/skills/agentforce-bot-upgrade/references/_vendored/posture-and-determinism.md +215 -0
  28. package/skills/agentforce-bot-upgrade/references/extraction-blueprint.md +11 -4
  29. package/skills/agentforce-bot-upgrade/references/generate-agent-spec.md +19 -3
  30. package/skills/agentforce-bot-upgrade/references/handoff-output-format.md +82 -52
  31. package/skills/agentforce-bot-upgrade/references/input-contract.md +8 -8
  32. package/skills/agentforce-bot-upgrade/references/mapping-rules.md +19 -6
  33. package/skills/agentforce-bot-upgrade/references/post-conversion-enhancements-reference.md +65 -6
  34. package/skills/agentforce-bot-upgrade/references/quality-checklist.md +4 -4
  35. package/skills/agentforce-bot-upgrade/references/sf-cli-bot-reference.md +17 -3
  36. package/skills/agentforce-hyperclassifier-configure/README.md +24 -0
  37. package/skills/agentforce-hyperclassifier-configure/SKILL.md +111 -0
  38. package/skills/agentforce-hyperclassifier-configure/assets/customer-org.env.example +4 -0
  39. package/skills/agentforce-hyperclassifier-configure/assets/sample_descriptions.json +8 -0
  40. package/skills/agentforce-hyperclassifier-configure/assets/sample_evals.csv +17 -0
  41. package/skills/agentforce-hyperclassifier-configure/references/api-contract.md +41 -0
  42. package/skills/agentforce-hyperclassifier-configure/references/authentication.md +35 -0
  43. package/skills/agentforce-hyperclassifier-configure/references/evaluation.md +46 -0
  44. package/skills/agentforce-hyperclassifier-configure/references/installation.md +35 -0
  45. package/skills/agentforce-hyperclassifier-configure/references/onboarding.md +93 -0
  46. package/skills/agentforce-hyperclassifier-configure/scripts/hcopt/__init__.py +1 -0
  47. package/skills/agentforce-hyperclassifier-configure/scripts/hcopt/client.py +219 -0
  48. package/skills/agentforce-hyperclassifier-configure/scripts/hcopt/eca.py +178 -0
  49. package/skills/agentforce-hyperclassifier-configure/scripts/hcopt/evaluation.py +207 -0
  50. package/skills/agentforce-hyperclassifier-configure/scripts/hcopt/onboarding.py +191 -0
  51. package/skills/agentforce-hyperclassifier-configure/scripts/hcopt/optimizer.py +187 -0
  52. package/skills/agentforce-hyperclassifier-configure/scripts/hyperclassifier.py +111 -0
  53. package/skills/agentforce-hyperclassifier-configure/scripts/report_hyperclassifier.py +149 -0
  54. package/skills/agentforce-hyperclassifier-configure/scripts/setup_hyperclassifier.py +74 -0
  55. package/skills/agentforce-hyperclassifier-configure/scripts/tests/test_hyperclassifier_skill.py +887 -0
  56. package/skills/agentforce-offline-experimentation-run/SKILL.md +14 -22
  57. package/skills/agentforce-offline-experimentation-run/scripts/bt_compare.py +81 -0
  58. package/skills/agentforce-offline-experimentation-run/scripts/bt_fetch.py +358 -0
  59. package/skills/agentforce-offline-experimentation-run/scripts/bt_patch_agent.py +110 -0
  60. package/skills/agentforce-offline-experimentation-run/scripts/btlib/__init__.py +34 -0
  61. package/skills/agentforce-offline-experimentation-run/scripts/btlib/agentpatch.py +483 -0
  62. package/skills/agentforce-offline-experimentation-run/scripts/btlib/agentsrc.py +565 -0
  63. package/skills/agentforce-offline-experimentation-run/scripts/btlib/cache.py +95 -0
  64. package/skills/agentforce-offline-experimentation-run/scripts/btlib/compare.py +617 -0
  65. package/skills/agentforce-offline-experimentation-run/scripts/btlib/fetch.py +1012 -0
  66. package/skills/agentforce-offline-experimentation-run/scripts/btlib/judge.py +140 -0
  67. package/skills/agentforce-offline-experimentation-run/scripts/btlib/messages.py +93 -0
  68. package/skills/agentforce-offline-experimentation-run/scripts/btlib/patch.py +327 -0
  69. package/skills/agentforce-offline-experimentation-run/scripts/btlib/redact.py +40 -0
  70. package/skills/agentforce-offline-experimentation-run/scripts/btlib/results.py +288 -0
  71. package/skills/agentforce-offline-experimentation-run/scripts/btlib/scoring.py +340 -0
  72. package/skills/agentforce-offline-experimentation-run/scripts/btlib/sfap.py +354 -0
  73. package/skills/agentforce-offline-experimentation-run/scripts/btlib/splits.py +136 -0
  74. package/skills/agentforce-offline-experimentation-run/scripts/btlib/stdm.py +98 -0
  75. package/skills/agentforce-offline-experimentation-run/scripts/btlib/tokens.py +173 -0
  76. package/skills/agentforce-offline-experimentation-run/scripts/btlib/units.py +199 -0
  77. package/skills/agentforce-offline-experimentation-run/scripts/btlib/versions.py +194 -0
  78. package/skills/agentforce-offline-experimentation-run/scripts/build_report.py +367 -379
  79. package/skills/agentforce-offline-experimentation-run/scripts/resolve-token.sh +23 -6
  80. package/skills/agentforce-offline-experimentation-run/scripts/sfap_replay.py +483 -796
  81. package/skills/commerce-react-storefront-create/SKILL.md +54 -21
  82. package/skills/dx-lifecycle-center/SKILL.md +22 -13
  83. package/skills/dx-lifecycle-center/examples/workflows.md +54 -17
  84. package/skills/dx-lifecycle-center/references/connect-api.md +33 -4
  85. package/skills/dx-lifecycle-center/references/connect-org.md +62 -12
  86. package/skills/dx-lifecycle-center/references/deploy.md +3 -3
  87. package/skills/dx-lifecycle-center/references/hub-org.md +19 -3
  88. package/skills/dx-lifecycle-center/references/list-orgs.md +50 -24
  89. package/skills/dx-lifecycle-center/references/troubleshooting.md +22 -1
  90. package/skills/dx-lifecycle-center/scripts/hub-get.sh +41 -0
  91. package/skills/dx-lifecycle-center/scripts/resolve-environment.sh +151 -4
  92. package/skills/dx-org-devhub-configure/SKILL.md +85 -84
  93. package/skills/dx-org-devhub-configure/examples/status-output.md +25 -2
  94. package/skills/dx-org-devhub-configure/scripts/devhub.sh +265 -140
  95. package/skills/dx-org-devhub-configure/scripts/test-devhub.sh +100 -15
  96. package/skills/dx-packaging-convert-1gp-to-2gp-create/SKILL.md +63 -0
  97. package/skills/dx-packaging-convert-1gp-to-2gp-create/references/conversion-operations.md +252 -0
  98. package/skills/dx-packaging-move-to-2gp-migrate/SKILL.md +88 -0
  99. package/skills/dx-packaging-move-to-2gp-migrate/references/api-operations.md +167 -0
  100. package/skills/dx-packaging-push-upgrade-configure/README.md +47 -0
  101. package/skills/dx-packaging-push-upgrade-configure/SKILL.md +355 -0
  102. package/skills/dx-packaging-push-upgrade-configure/references/best-practices.md +61 -0
  103. package/skills/dx-packaging-push-upgrade-configure/references/cli-reference.md +148 -0
  104. package/skills/dx-packaging-push-upgrade-configure/references/objects.md +106 -0
  105. package/skills/dx-packaging-push-upgrade-configure/references/soql-recipes.md +144 -0
  106. package/skills/dx-scratch-def-configure/SKILL.md +163 -0
  107. package/skills/dx-scratch-def-configure/examples/confirm-card.md +53 -0
  108. package/skills/dx-scratch-def-configure/examples/report-recipes.md +100 -0
  109. package/skills/dx-scratch-def-configure/references/features.json +3270 -0
  110. package/skills/dx-scratch-def-configure/references/project-scratch-def.schema.json +1841 -0
  111. package/skills/dx-scratch-def-configure/references/settings-map.json +682 -0
  112. package/skills/dx-scratch-def-configure/scripts/lib_scratch_def.py +1306 -0
  113. package/skills/dx-scratch-def-configure/scripts/requirements.txt +3 -0
  114. package/skills/dx-scratch-def-configure/scripts/scrape_config_values.py +848 -0
  115. package/skills/education-cloud-domain-configure/SKILL.md +1 -1
  116. package/skills/education-cloud-multi-campus-configure/SKILL.md +1 -1
  117. package/skills/education-cloud-student-recruitment-agent-configure/SKILL.md +1 -1
  118. package/skills/experience-afv-analytics-query/SKILL.md +239 -0
  119. package/skills/experience-afv-analytics-query/references/references.md +176 -0
  120. package/skills/experience-app-mcp-delivery-generate/SKILL.md +142 -0
  121. package/skills/experience-app-mcp-delivery-generate/references/eca-consumer-key.md +26 -0
  122. package/skills/experience-app-mcp-delivery-generate/references/mcp-config-delivery.md +38 -0
  123. package/skills/experience-app-mcp-delivery-generate/references/plugin-format-and-publishing.md +80 -0
  124. package/skills/experience-app-mcp-delivery-generate/scripts/developer_name.mjs +9 -0
  125. package/skills/experience-app-mcp-delivery-generate/scripts/discover_mcp_context.mjs +114 -0
  126. package/skills/experience-app-mcp-delivery-generate/scripts/generate_mcp_config.mjs +27 -0
  127. package/skills/experience-app-mcp-delivery-generate/scripts/generate_plugin.mjs +184 -0
  128. package/skills/experience-app-mcp-delivery-generate/scripts/mcp_config.mjs +57 -0
  129. package/skills/experience-app-mcp-delivery-generate/scripts/preflight.mjs +109 -0
  130. package/skills/experience-app-mcp-delivery-generate/scripts/retrieve_eca_consumer_key.mjs +143 -0
  131. package/skills/experience-app-mcp-generate/SKILL.md +174 -0
  132. package/skills/experience-app-mcp-generate/assets/__ECA_NAME__.eca-meta.xml +7 -0
  133. package/skills/experience-app-mcp-generate/assets/__ECA_NAME__.ecaGlblOauth-meta.xml +15 -0
  134. package/skills/experience-app-mcp-generate/assets/__ECA_NAME__.ecaOauth-meta.xml +6 -0
  135. package/skills/experience-app-mcp-generate/assets/__ECA_NAME__.ecaOauthPlcy-meta.xml +12 -0
  136. package/skills/experience-app-mcp-generate/assets/__ECA_NAME___defaultPolicy.ecaPlcy-meta.xml +7 -0
  137. package/skills/experience-app-mcp-generate/assets/__MCP_SERVER_NAME__.mcpServerDefinition-meta.xml +5 -0
  138. package/skills/experience-app-mcp-generate/references/eca-fields.md +76 -0
  139. package/skills/experience-app-mcp-generate/references/mcp-objects.md +66 -0
  140. package/skills/experience-app-mcp-generate/references/tool-bindings.md +85 -0
  141. package/skills/experience-app-mcp-generate/references/troubleshooting.md +41 -0
  142. package/skills/experience-app-mcp-generate/references/ui-frameworks.md +19 -0
  143. package/skills/experience-app-mcp-generate/references/widget-resources.md +96 -0
  144. package/skills/experience-app-mcp-generate/scripts/activate_server.mjs +166 -0
  145. package/skills/experience-app-mcp-generate/scripts/check_setup_progress.mjs +212 -0
  146. package/skills/experience-app-mcp-generate/scripts/list_sites.mjs +211 -0
  147. package/skills/experience-app-mcp-generate/scripts/merge_tools.mjs +407 -0
  148. package/skills/experience-app-mcp-generate/scripts/preflight.mjs +127 -0
  149. package/skills/experience-app-mcp-generate/scripts/render_eca.mjs +144 -0
  150. package/skills/experience-app-mcp-generate/scripts/render_mcp_server.mjs +64 -0
  151. package/skills/experience-app-mcp-generate/scripts/retrieve_existing_prompts.mjs +145 -0
  152. package/skills/experience-app-mcp-generate/scripts/retrieve_existing_tools.mjs +72 -0
  153. package/skills/experience-app-mcp-generate/scripts/scan_tool_candidates.mjs +195 -0
  154. package/skills/experience-app-mcp-generate/scripts/utils/callback_url.mjs +36 -0
  155. package/skills/experience-app-mcp-generate/scripts/utils/developer_name.mjs +9 -0
  156. package/skills/experience-app-mcp-generate/scripts/utils/eca_check.mjs +156 -0
  157. package/skills/experience-app-mcp-generate/scripts/utils/metadata_path.mjs +13 -0
  158. package/skills/experience-app-mcp-generate/scripts/verify_server.mjs +118 -0
  159. package/skills/experience-cms-content-type-generate/SKILL.md +1 -1
  160. package/skills/experience-design-validate/SKILL.md +1 -1
  161. package/skills/experience-search-coordinate/SKILL.md +18 -12
  162. package/skills/experience-search-coordinate/references/content-route.md +79 -1
  163. package/skills/field-service-data-capture-migrate/SKILL.md +1 -1
  164. package/skills/nonprofit-fundraising-configure/SKILL.md +1 -1
  165. package/skills/nonprofit-fundraising-configure/references/mcp-invocation.md +52 -4
  166. package/skills/nonprofit-fundraising-configure/references/permission-targeting.md +19 -2
  167. package/skills/platform-apex-generate/SKILL.md +14 -11
  168. package/skills/platform-apex-test-generate/SKILL.md +2 -1
  169. package/skills/platform-custom-field-generate/SKILL.md +24 -16
  170. package/skills/platform-custom-metadata-type-generate/SKILL.md +1 -0
  171. package/skills/platform-custom-setting-generate/SKILL.md +1 -0
  172. package/skills/platform-datamask-run/SKILL.md +52 -71
  173. package/skills/platform-datamask-run/references/api-surface.md +10 -4
  174. package/skills/platform-datamask-run/references/policy-authoring.md +56 -7
  175. package/skills/platform-datamask-run/references/run-and-abort.md +17 -10
  176. package/skills/platform-datamask-run/scripts/poll-job.sh +15 -25
  177. package/skills/platform-dataspace-access-configure/SKILL.md +43 -10
  178. package/skills/platform-flexipage-generate/SKILL.md +7 -10
  179. package/skills/platform-flexipage-generate/references/mcp_action_examples.md +42 -38
  180. package/skills/platform-metadata-discovery-get/SKILL.md +185 -0
  181. package/skills/platform-metadata-discovery-get/references/api-map.md +25 -0
  182. package/skills/platform-metadata-discovery-get/references/h360-routes.md +30 -0
  183. package/skills/platform-metadata-discovery-get/references/scoped-soql.md +52 -0
  184. package/skills/platform-metadata-grounding-get/SKILL.md +170 -0
  185. package/skills/platform-policy-rule-generate/SKILL.md +85 -231
  186. package/skills/platform-policy-rule-generate/references/condition-model.md +47 -0
  187. package/skills/platform-policy-rule-generate/references/condition-templates.md +89 -0
  188. package/skills/platform-policy-rule-generate/references/conjunction-compiler.md +25 -0
  189. package/skills/platform-policy-rule-generate/references/conjunction-expression.md +30 -0
  190. package/skills/platform-policy-rule-generate/references/consumer-all.md +9 -0
  191. package/skills/platform-policy-rule-generate/references/consumer-datacloud-ui.md +99 -0
  192. package/skills/platform-policy-rule-generate/references/deploy-errors.md +24 -36
  193. package/skills/platform-policy-rule-generate/references/examples/ExistsJoinRLS/package.xml +12 -0
  194. package/skills/platform-policy-rule-generate/references/examples/ExistsJoinRLS/policyRuleDefinitionSets/ExistsJoinRLS.policyRuleDefinitionSet +5 -0
  195. package/skills/platform-policy-rule-generate/references/examples/ExistsJoinRLS/policyRuleDefinitions/ExistsJoinRLS_Rule_1.policyRuleDefinition +91 -0
  196. package/skills/platform-policy-rule-generate/references/examples/FieldReadDeny/package.xml +12 -0
  197. package/skills/platform-policy-rule-generate/references/examples/FieldReadDeny/policyRuleDefinitionSets/FieldReadDeny.policyRuleDefinitionSet +5 -0
  198. package/skills/platform-policy-rule-generate/references/examples/FieldReadDeny/policyRuleDefinitions/FieldReadDeny_Rule_1.policyRuleDefinition +72 -0
  199. package/skills/platform-policy-rule-generate/references/examples/LastCharactersFieldMasking/package.xml +12 -0
  200. package/skills/platform-policy-rule-generate/references/examples/LastCharactersFieldMasking/policyRuleDefinitionSets/LastCharactersFieldMasking.policyRuleDefinitionSet +5 -0
  201. package/skills/platform-policy-rule-generate/references/examples/LastCharactersFieldMasking/policyRuleDefinitions/LastCharactersFieldMasking_Rule_1.policyRuleDefinition +77 -0
  202. package/skills/platform-policy-rule-generate/references/examples/PrincipalFieldMatchRLS/package.xml +12 -0
  203. package/skills/platform-policy-rule-generate/references/examples/PrincipalFieldMatchRLS/policyRuleDefinitionSets/PrincipalFieldMatchRLS.policyRuleDefinitionSet +5 -0
  204. package/skills/platform-policy-rule-generate/references/examples/PrincipalFieldMatchRLS/policyRuleDefinitions/PrincipalFieldMatchRLS_Rule_1.policyRuleDefinition +77 -0
  205. package/skills/platform-policy-rule-generate/references/examples/TaggedObjectAccess/package.xml +12 -0
  206. package/skills/platform-policy-rule-generate/references/examples/TaggedObjectAccess/policyRuleDefinitionSets/TaggedObjectAccess.policyRuleDefinitionSet +5 -0
  207. package/skills/platform-policy-rule-generate/references/examples/TaggedObjectAccess/policyRuleDefinitions/TaggedObjectAccess_Rule_1.policyRuleDefinition +65 -0
  208. package/skills/platform-policy-rule-generate/references/headless-transport.md +87 -0
  209. package/skills/platform-policy-rule-generate/references/policy-schema-full.md +18 -11
  210. package/skills/platform-policy-rule-generate/references/policy-shapes.md +107 -0
  211. package/skills/platform-policy-rule-generate/references/principal-expression.md +31 -0
  212. package/skills/platform-policy-rule-generate/references/reference-resolution.md +51 -0
  213. package/skills/platform-policy-rule-generate/references/resource-expression.md +48 -0
  214. package/skills/platform-policy-rule-generate/references/runtime-context.md +9 -0
  215. package/skills/platform-policy-rule-generate/references/templates-access.md +11 -9
  216. package/skills/platform-policy-rule-generate/references/templates-advanced.md +5 -3
  217. package/skills/platform-policy-rule-generate/references/templates-record.md +37 -22
  218. package/skills/platform-policy-rule-generate/references/templates-transform.md +10 -8
  219. package/skills/platform-policy-rule-generate/references/templates.md +2 -2
  220. package/skills/platform-policy-rule-generate/references/ui-compatibility.md +36 -18
  221. package/skills/platform-report-generate/SKILL.md +29 -5
  222. package/skills/platform-report-generate/references/chart-types.md +26 -2
  223. package/skills/platform-report-generate/references/column-names.md +43 -0
  224. package/skills/platform-report-generate/references/errors-and-troubleshooting.md +1 -1
  225. package/skills/platform-report-generate/references/summary-formulas-sorting-limits.md +118 -0
  226. package/skills/platform-report-generate/references/verification-checklist.md +22 -2
  227. package/skills/service-digital-engagement-channel-configure/SKILL.md +49 -110
  228. package/skills/service-digital-engagement-channel-configure/assets/messaging_channel_template.xml +35 -0
  229. package/skills/service-digital-engagement-channel-configure/examples/asa_agent_channel.xml +2 -2
  230. package/skills/service-digital-engagement-channel-configure/examples/auth_queue_channel.xml +58 -0
  231. package/skills/service-digital-engagement-channel-configure/examples/omni_flow_channel.xml +2 -2
  232. package/skills/service-digital-engagement-channel-configure/examples/omni_queue_channel.xml +3 -3
  233. package/skills/service-digital-engagement-channel-configure/references/channel_settings.md +128 -28
  234. package/skills/service-digital-engagement-channel-configure/references/onboarding_contract.md +16 -20
  235. package/skills/service-digital-engagement-channel-configure/references/prechat_params.md +10 -0
  236. package/skills/service-digital-engagement-channel-configure/references/recaptcha_handoff.md +38 -0
  237. package/skills/service-digital-engagement-channel-configure/references/user_verification.md +9 -0
  238. package/skills/service-digital-engagement-channel-configure/scripts/check-api-version.sh +4 -4
  239. package/skills/service-digital-engagement-channel-configure/scripts/normalize-channel-name.sh +12 -7
  240. package/skills/service-e911-configure/SKILL.md +242 -0
  241. package/skills/service-itsm-agentic-setup-agent-runtime-access-assign/SKILL.md +1 -1
  242. package/skills/service-itsm-agentic-setup-agentforce-coordinate/SKILL.md +1 -1
  243. package/skills/service-itsm-agentic-setup-agentforce-studio-configure/SKILL.md +1 -1
  244. package/skills/service-itsm-agentic-setup-agentforce-studio-validate/SKILL.md +1 -1
  245. package/skills/service-itsm-agentic-setup-employee-agent-configure/SKILL.md +1 -1
  246. package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/SKILL.md +1 -1
  247. package/skills/service-itsm-agentic-setup-incident-management/SKILL.md +47 -44
  248. package/skills/service-itsm-agentic-setup-incident-management/examples/output-templates.md +110 -83
  249. package/skills/service-itsm-agentic-setup-incident-management/references/manage-incidents-with-ai.md +7 -3
  250. package/skills/service-itsm-agentic-setup-incident-management/references/priority-matrix.md +7 -5
  251. package/skills/service-itsm-agentic-setup-incident-management/references/sla-milestones.md +2 -2
  252. package/skills/service-itsm-agentic-setup-incident-management/references/status-checks.md +437 -0
  253. package/skills/service-itsm-agentic-setup-itsm-agentforce-permset-assign/SKILL.md +1 -1
  254. package/skills/agentforce-bot-upgrade/references/planner-workflow-reference.md +0 -78
  255. package/skills/experience-content-media-image-generate/SKILL.md +0 -83
  256. package/skills/experience-content-media-image-generate/scripts/download-image.sh +0 -84
  257. package/skills/experience-content-media-stock-image-search/SKILL.md +0 -193
  258. package/skills/experience-content-media-stock-image-search/scripts/download-stock-image.py +0 -102
@@ -0,0 +1,143 @@
1
+ #!/usr/bin/env node
2
+ // Retrieve the non-secret OAuth consumer key for a deployed ECA.
3
+ //
4
+ // Usage: node retrieve_eca_consumer_key.mjs <target-org-alias> <eca-developer-name> [oauth-consumer-id] [--json]
5
+ //
6
+ // Exit 0 with JSON `status`:
7
+ // not_found - the query succeeded and no ExternalClientApplication matched that DeveloperName.
8
+ // selection_required - more than one OAuth consumer; the caller must choose an id.
9
+ // With --json and a single consumer, prints the key object (no `status`); without --json, prints the bare key.
10
+ // Exit 1: lookup, API, or response validation failed. Do not infer that the ECA is absent.
11
+ import fs from "node:fs";
12
+ import { execFileSync } from "node:child_process";
13
+ import { isValidDeveloperName } from "./developer_name.mjs";
14
+
15
+ function fail(msg, code = 1) {
16
+ process.stderr.write(msg + "\n");
17
+ process.exit(code);
18
+ }
19
+
20
+ const jsonOutput = process.argv.slice(2).includes("--json");
21
+ const args = process.argv.slice(2).filter((arg) => arg !== "--json");
22
+ if (args.length < 2 || args.length > 3) {
23
+ fail("Usage: retrieve_eca_consumer_key.mjs <target-org-alias> <eca-developer-name> [oauth-consumer-id] [--json]");
24
+ }
25
+ const [targetOrg, ecaDeveloperName, oauthConsumerId = ""] = args;
26
+ if (!targetOrg || targetOrg.startsWith("-")) fail("ERROR: target org alias is invalid.");
27
+
28
+ let apiVersion;
29
+ try {
30
+ apiVersion = JSON.parse(fs.readFileSync("sfdx-project.json", "utf-8")).sourceApiVersion;
31
+ if (!/^\d{2,3}\.0$/.test(apiVersion)) throw new Error("Invalid sourceApiVersion");
32
+ } catch {
33
+ fail("ERROR: run from an SFDX project root with a valid sourceApiVersion.");
34
+ }
35
+ if (!isValidDeveloperName(ecaDeveloperName)) {
36
+ fail("ERROR: ECA developer name is invalid.");
37
+ }
38
+ if (oauthConsumerId && !/^[A-Za-z0-9]+$/.test(oauthConsumerId)) {
39
+ fail("ERROR: OAuth consumer ID is invalid.");
40
+ }
41
+
42
+ function requestJson(url, description) {
43
+ let body;
44
+ try {
45
+ body = execFileSync(
46
+ "sf",
47
+ ["api", "request", "rest", url, "--target-org", targetOrg, "--method", "GET"],
48
+ { encoding: "utf-8" },
49
+ );
50
+ } catch {
51
+ process.stderr.write(`ERROR: ${description} request failed.\n`);
52
+ return null;
53
+ }
54
+ try {
55
+ return JSON.parse(body);
56
+ } catch {
57
+ process.stderr.write(`ERROR: ${description} returned invalid JSON.\n`);
58
+ return null;
59
+ }
60
+ }
61
+
62
+ const ecaSoql = `SELECT Id FROM ExternalClientApplication WHERE DeveloperName = '${ecaDeveloperName}'`;
63
+ let ecaQueryRaw;
64
+ try {
65
+ ecaQueryRaw = execFileSync(
66
+ "sf",
67
+ ["data", "query", "--query", ecaSoql, "--target-org", targetOrg, "--api-version", apiVersion, "--json"],
68
+ { encoding: "utf-8" },
69
+ );
70
+ } catch {
71
+ fail("ERROR: ECA query failed.");
72
+ }
73
+ let ecaQuery;
74
+ try {
75
+ ecaQuery = JSON.parse(ecaQueryRaw);
76
+ } catch {
77
+ ecaQuery = null;
78
+ }
79
+ const ecaOk =
80
+ ecaQuery &&
81
+ ecaQuery.status === 0 &&
82
+ typeof ecaQuery.result?.totalSize === "number" &&
83
+ Array.isArray(ecaQuery.result?.records) &&
84
+ ecaQuery.result.totalSize === ecaQuery.result.records.length &&
85
+ ecaQuery.result.records.every((r) => typeof r.Id === "string");
86
+ if (!ecaOk) fail("ERROR: ECA query returned an unrecognized response.");
87
+
88
+ const matchCount = ecaQuery.result.totalSize;
89
+ // A successful query that proved absence is an answer (exit 0); anything inconclusive fails.
90
+ if (matchCount === 0) {
91
+ console.log(JSON.stringify({
92
+ status: "not_found",
93
+ message: `no deployed ECA matched developer name ${ecaDeveloperName}`,
94
+ ecaDeveloperName,
95
+ }));
96
+ process.exit(0);
97
+ }
98
+ if (matchCount !== 1) fail(`ERROR: multiple deployed ECAs matched developer name ${ecaDeveloperName}.`);
99
+
100
+ const ecaIdentifier = ecaQuery.result.records[0].Id;
101
+ if (!/^[A-Za-z0-9]+$/.test(ecaIdentifier)) fail("ERROR: ECA lookup returned an invalid identifier.");
102
+
103
+ const credentialsUrl = `/services/data/v${apiVersion}/apps/oauth/credentials/${ecaIdentifier}?part=key`;
104
+ const credentials = requestJson(credentialsUrl, "OAuth consumer lookup");
105
+ if (!credentials) process.exit(1);
106
+ const credsOk =
107
+ Array.isArray(credentials.consumers) &&
108
+ credentials.consumers.every(
109
+ (c) => typeof c.id === "string" && typeof c.name === "string" && typeof c.key === "string",
110
+ );
111
+ if (!credsOk) fail("ERROR: OAuth consumer lookup returned an unrecognized response.");
112
+
113
+ const consumerCount = credentials.consumers.length;
114
+ if (consumerCount === 0) fail("ERROR: deployed ECA has no OAuth consumers.");
115
+
116
+ let selected;
117
+ if (oauthConsumerId) {
118
+ selected = credentials.consumers.filter((c) => c.id === oauthConsumerId);
119
+ if (selected.length !== 1) {
120
+ fail(`ERROR: OAuth consumer ID ${oauthConsumerId} did not match exactly one consumer.`);
121
+ }
122
+ } else if (consumerCount === 1) {
123
+ selected = [credentials.consumers[0]];
124
+ } else {
125
+ console.log(
126
+ JSON.stringify({
127
+ status: "selection_required",
128
+ apiVersion,
129
+ eca: { developerName: ecaDeveloperName, identifier: ecaIdentifier },
130
+ consumerCandidates: credentials.consumers.map((c) => ({ id: c.id, name: c.name })),
131
+ }),
132
+ );
133
+ process.exit(0);
134
+ }
135
+
136
+ if (!selected[0].key.trim()) fail("ERROR: OAuth consumer key is empty.");
137
+ console.log(jsonOutput ? JSON.stringify({
138
+ apiVersion,
139
+ ecaDeveloperName,
140
+ ecaId: ecaIdentifier,
141
+ oauthConsumerId: selected[0].id,
142
+ clientId: selected[0].key,
143
+ }) : selected[0].key);
@@ -0,0 +1,174 @@
1
+ ---
2
+ name: experience-app-mcp-generate
3
+ description: "Create, extend, deploy, review readiness for, or activate an App MCP, a Salesforce custom hosted MCP server for an Aura Experience Site. Trigger when the user wants to expose an Experience UI or backend action to agents, create local ECA and server metadata, add eligible global invocable Apex or autolaunched Flow tools, add Prompt Builder templates as MCP prompts or tools, preview or perform server activation, deploy the existing MCP stack, or review its readiness. For server setup, offer optional HXL widgets for eligible Apex-backed tools through platform-mcp-tool-widget-coordinate. For a standalone request to generate Custom Lightning Types or widgets for an Apex-backed MCP tool, route directly to platform-mcp-tool-widget-coordinate; do not trigger this skill for HXL generation alone. Do not trigger for remote MCP registration or generic Apex and Flow work unrelated to Experience Site agent access."
4
+ metadata:
5
+ relatedSkills:
6
+ - experience-app-mcp-delivery-generate
7
+ - platform-apex-generate
8
+ - platform-mcp-tool-widget-coordinate
9
+ version: "1.0"
10
+ minApiVersion: "68.0"
11
+ domains:
12
+ - "Experience"
13
+ cliTools:
14
+ - tool:
15
+ - "node"
16
+ semver: ">=18.0.0"
17
+ - tool:
18
+ - "sf"
19
+ semver: ">=2.0.0"
20
+ ---
21
+
22
+ # Set Up Custom MCP for an Experience Site
23
+
24
+ End-to-end recipe: **ExternalClientApplication (ECA) → custom hosted MCP server → tools and prompts → deploy → optional HXL widgets + Custom Lightning Types + MCP widget resources → activate → verify → optional client delivery**. The Experience Site scopes naming and discovery; the MCP server is org-level.
25
+
26
+ Supports Aura Experience Sites with local ExperienceBundle source. The inventory checks the selected site's view components to determine source support.
27
+
28
+ ## Shared rules
29
+
30
+ - `<skill-dir>` means the absolute directory containing this `SKILL.md`. Keep the shell working directory at the SFDX project root, replace `<skill-dir>` before running bundled scripts, and resolve `references/...` links relative to this `SKILL.md`.
31
+ - Run Phase 0 before every entry path, including repair, resume, and preview/activate-only requests. Proceed only on `decision: continue`.
32
+ - Reconcile with existing state before creating or changing anything. Reuse compatible ECAs, servers, and tool bindings by default. On interruption, use [the progress check](#check-progress--after-phase-2-or-on-resume).
33
+ - `McpServerDefinition` and related runtime records are Tooling API objects. Query them with `sf data query --use-tooling-api` or `sf api request rest` against `/tooling/query`; the default `sf data query` endpoint does not support them.
34
+ - For authoring, create a missing `sfdx-project.json` with `packageDirectories` `[{"path": "force-app", "default": true}]` and `sourceApiVersion` `"68.0"`. Preserve existing configuration; review/deploy-only requests require an existing project.
35
+ - `<default-package>` is the `path` of the `packageDirectories` entry with `"default": true`, or the first entry when none is marked. Pass `<default-package>/main/default` as the metadata directory to the render scripts. Phase 1 still inspects every package directory for the site.
36
+ - Track the exact metadata files created or changed during the run. Phase 5 deploys only those MCP stack files or existing stack files selected for deployment; Phase 6 deploys only its generated artifacts and named server.
37
+ - Handle preflight results as specified in Phase 0. For later failures, stop and report what changed. Read the relevant section of `references/troubleshooting.md` before proposing recovery.
38
+
39
+ ## Review or deploy an existing stack
40
+
41
+ Run Phase 0, recover confirmed site/server/ECA identities, then use the progress check and [existing-stack review](references/mcp-objects.md#existing-stack-review). For readiness/review requests, inspect and report findings and unknowns only; do not create files, retrieve, repair, deploy, activate, or audit end-user permissions. For deployment requests, reconcile existing files and intended bindings, then continue at Phase 5 using applicable prior approvals; author only explicitly requested missing changes. Script success or file presence does not establish readiness.
42
+
43
+ ## Repair existing ECA or MCP metadata
44
+
45
+ For ECA files, run the renderer in read-only comparison mode:
46
+ ```bash
47
+ node "<skill-dir>/scripts/render_eca.mjs" <default-package>/main/default <ECA_DEV_NAME> --check
48
+ ```
49
+ Follow the report's field findings, `expectedValues`, and `nextActions`. To resolve `unverifiedFields`, rerun the Phase 2 render command with confirmed inputs plus `--check`. Differences are baseline findings, not automatic errors or permission to change intentional overrides. For field ownership, read [references/eca-fields.md](references/eca-fields.md).
50
+
51
+ For MCP repairs, read `assets/__MCP_SERVER_NAME__.mcpServerDefinition-meta.xml` and [references/mcp-objects.md](references/mcp-objects.md). Patch only approved root-field differences; preserve tools, prompts, resources, and relationships. Use `merge_tools.mjs` for binding changes.
52
+
53
+ ## Phase 0 — Preflight
54
+
55
+ IMPORTANT: Set `<skill-named>` to `true` only if the user's request explicitly names `experience-app-mcp-generate`; otherwise use `false`. Do not count the agent's own skill selection or messages.
56
+
57
+ ```bash
58
+ node "<skill-dir>/scripts/preflight.mjs" <target-org-alias> --skill-named <skill-named>
59
+ ```
60
+
61
+ Read the JSON `decision`:
62
+
63
+ - `continue`: follow the requested entry path; authoring starts at Phase 1. Proceed without mentioning preflight or explaining why it can't be skipped.
64
+ - `skip`: immediately exit this skill and pursue the original request another way. Say nothing about this skill, its check, or the result.
65
+ - `disabled`: say only the returned `userMessage`, without error details; exit this skill and pursue the original request another way.
66
+ - `needs_input` or `error`: show only `userMessage` and `nextAction`, obtain corrections and rerun preflight. Proceed only on `continue`; never infer entitlement from errors.
67
+
68
+ ## Phase 1 — Experience Site + naming
69
+
70
+ 1. **List local sites** from the SFDX project root:
71
+ ```bash
72
+ node "<skill-dir>/scripts/list_sites.mjs"
73
+ ```
74
+ Stop if the script fails. Report only each site's name and status, without framework, metadata/source-format labels, or extra discovery explanations. Match the user's site to an entry; if unclear, show the choices and ask the user to select one. The site scopes naming and UI review; the MCP server remains org-level.
75
+ 2. **Check the selected entry's status before continuing.** For `ready`, report **Ready** and continue with its supported Aura ExperienceBundle views. For `unsupported`, stop with a short report only: the site name and **Unsupported**, one sentence that this skill supports only Aura Experience Sites with local ExperienceBundle source, and that no ECA, MCP server, or tool bindings were created. Omit script output, framework details, file-by-file lists, and next steps unless asked; if you created `sfdx-project.json` only to run the scripts, mention it in one clause. For `metadata-incomplete`, report its `reason` when present and resolve the selected site's source errors or Network-to-bundle association; obtain its ExperienceBundle or DigitalExperienceBundle and Network metadata as needed, then rerun the inventory. Inspect the entry's metadata evidence for its Network name and `<urlPathPrefix>`. For `ui-not-found`, or a requested site absent from the inventory, ask the user to confirm the site and provide its ExperienceBundle source location or authorize retrieval, then rerun the inventory. Continue with a `ready` entry and usable UI source. Problems with unselected sites do not block this workflow.
76
+ 3. List deployed Experience Sites in the target org:
77
+ ```sql
78
+ SELECT Name, UrlPathPrefix FROM Network
79
+ ```
80
+ (via `sf data query` or Tooling REST.)
81
+ Reconcile the local and org results:
82
+ - If the site exists in both and the names and path prefixes agree, continue.
83
+ - If it exists only locally, treat it as a valid planned site and continue the local MCP generation workflow. The MCP server is org-level, so an undeployed Network does not block local MCP authoring. Report that the site is not deployed; do not claim there is no site or that nothing can be bound. Before Phase 5 deployment or Phase 7 activation, confirm that the site has been deployed by its owning workflow. Do not add unchanged site metadata to this skill's targeted deployment.
84
+ - If it exists only in the org, obtain its local site metadata as required by step 2 and rerun the inventory to determine source support before continuing.
85
+ - If local and org definitions conflict, show the mismatch and ask which definition is authoritative before continuing.
86
+ - Only report that the site must be created first when neither the local project nor the org contains it.
87
+ 4. Derive a `McpServerDefinition.DeveloperName` from the site name and let the user know. The MCP server name must contain 2–60 alphanumeric characters; remove spaces, punctuation, and other symbols. Check for a collision by querying existing MCP servers using tooling API:
88
+ ```bash
89
+ sf data query --use-tooling-api --target-org <target-org-alias> --query "SELECT Id, DeveloperName FROM McpServerDefinition" --json
90
+ ```
91
+ If a matching MCP Server already exists, then check with the user if it can be reused.
92
+ 5. Report to the user on whether we're creating a new MCP server with the derived name or if we're going to use an existing one.
93
+
94
+ ## Phase 2 — ECA (reuse-or-create)
95
+
96
+ When reviewing rendered ECA metadata or changing its settings after rendering, read `references/eca-fields.md` to locate the owning metadata component and field. Treat callback URLs, OAuth scopes, permitted-user policy, and refresh-token policy as client-affecting settings: show the proposed diff and confirm before changing them. For a new ECA, read `references/eca-fields.md` to review permitted-user policy choices before rendering. Default to admin preauthorization; suggest self-authorization for all authenticated site users and apply it only if chosen.
97
+
98
+ 1. Confirm the ECA DeveloperName, then check for an existing ECA matching it:
99
+ ```sql
100
+ SELECT Id, DeveloperName FROM ExternalClientApplication
101
+ ```
102
+ Confirm its OAuth scopes include `MCP` and `RefreshToken`, and that its callback URLs cover the confirmed MCP clients. If the clients or their callback URLs aren't known yet, ask before deciding that the ECA is compatible.
103
+ 2. **If a compatible ECA is found: reuse it, read-only.** Report what it is and where it points. Do not touch it unless the user explicitly asks for a change — and even then, show the diff and warn about breaking live clients before writing.
104
+ 3. **If absent:** If local ECA files exist, run the comparison above, reuse compatible files, and create only confirmed missing components from its named templates. Review differences before changing files; never delete files or bypass overwrite protection to rerender a partial set. If no local files exist, confirm the MCP clients and their exact OAuth redirect URIs, show the planned files, confirm the local write, then render:
105
+ ```bash
106
+ node "<skill-dir>/scripts/render_eca.mjs" <default-package>/main/default <ECA_DEV_NAME> <ECA_LABEL> <ECA_DESC> <CONTACT_EMAIL> "<callback-urls>"
107
+ ```
108
+ Run the ECA comparison above on rendered or reused local files and review its findings before proposing a diff. If the permitted-user and refresh-token policies were not already reviewed in the conversation, ask the user to review them because they control who may authorize and how long refresh tokens remain valid.
109
+
110
+ ## Check progress — after Phase 2 or on resume
111
+
112
+ For new setups, run this after Phase 1 selects the site/server and Phase 2 confirms the ECA name. On resume, run Phase 0 first, recover those identifiers from the conversation or workspace, and ask only for missing or ambiguous choices. Include the optional confirmed site bundle for local readiness checks.
113
+
114
+ ```bash
115
+ node "<skill-dir>/scripts/check_setup_progress.mjs" <target-org-alias> <SERVER_DEV_NAME> <ECA_DEV_NAME> [--site <SITE_BUNDLE>]
116
+ ```
117
+
118
+ Present its `checks` and follow `nextAction`, `pendingVerification`, and `resumeRules`. Exit `0` means the audit ran, not setup completion; `auditStatus: partial` leaves affected reads unknown. Retain existing confirmation rules and resolve unknowns before dependent writes.
119
+
120
+ ## Phase 3 — Custom MCP server (render inactive, via Metadata API)
121
+
122
+ 1. Before reconciling existing state, read the object model and metadata invariants in `references/mcp-objects.md`. Query `McpServerDefinition` by the confirmed DeveloperName. If absent and a local server definition exists, inspect and reconcile it against the bundled template and confirmed inputs using [Repair existing ECA or MCP metadata](#repair-existing-eca-or-mcp-metadata); preserve its bindings, reuse the repaired component, and continue remaining binding review. Local metadata is not deployed state. Continue to step 2 only when the local component is missing. If the org component is partial, retrieve it and merge into it; re-rendering would drop tools, prompts, or resources that the scan did not reconstruct. Before retrieval, identify any destination file that already exists and confirm whether it may be overwritten, then retrieve the existing `McpServerDefinition:<name>` metadata so that a local `<default-package>/main/default/mcpServerDefinitions/<name>.mcpServerDefinition-meta.xml` file exists for Phase 4 to merge into. Phase 4 uses `merge_tools.mjs` to preserve existing bindings while adding approved tools and prompts. If the server is complete, reuse it and ask before changing its bindings. For a new setup or requested extension, do not skip Phase 4 merely because the server has bindings; during an interrupted setup, skip only when the intended bindings are confirmed from prior user decisions and verified complete locally and in the org.
123
+ 2. When the local server component is missing, show the destination file and confirm the local write, then render the metadata component into the same SFDX project (no bindings yet). `<SERVER_LABEL>` must be human-readable (e.g. "Support Automation MCP") — never the bare DeveloperName repeated as the label:
124
+ ```bash
125
+ node "<skill-dir>/scripts/render_mcp_server.mjs" <default-package>/main/default <SERVER_DEV_NAME> <SERVER_LABEL> <SERVER_DESC>
126
+ ```
127
+
128
+ ## Phase 4 — Tools and prompts
129
+
130
+ Before discovery and binding, read [references/tool-bindings.md](references/tool-bindings.md). For new setups and requested extensions, complete all four passes in order: site UI, local Apex/Flow, org Apex/Flow, and Prompt Builder. Inventory every UI CRUD operation before scanning for backings, then suggest a tool for each one after deduplicating at the end of 4c. Record each pass's result and evidence separately before 4e. On resume, repeat only incomplete or changed passes and preserve confirmed choices. Then continue with Phase 4e below.
131
+
132
+ **4e. Author and bind approved tools and prompts — applies to candidates from 4a–4d.**
133
+
134
+ Ask add-or-skip per eligible candidate and whether a selected template should be a prompt, tool, or both. Before authoring or exposing custom Apex actions, load `platform-apex-generate` and apply the reference's runtime input-validation and explicit user-mode requirements. **Always use `merge_tools.mjs`; never edit `<tools>` or `<prompts>` XML directly for Phase 4 binding.** The Phase 6 widget linkage exception permits only the scoped resource relationships in [references/widget-resources.md](references/widget-resources.md), not tool or prompt authoring.
135
+
136
+ ## Phase 5 — Deploy the MCP stack
137
+
138
+ Only after the ECA, server, backing actions/templates, and bindings are ready:
139
+
140
+ 1. Show the exact metadata files changed during this workflow or selected from the existing stack for deployment. This normally includes the rendered ECA files, implemented Apex classes and their companion metadata or Flows, and the MCP server definition. **Ask the user to confirm deployment**, unless an applicable prior approval covers the same target, files, and actions, then deploy exactly those tracked metadata files using the two-wave ECA exception below. Keep the remaining stack deployment multi-file and atomic across metadata types. Do not deploy the package directory or a whole metadata-type directory.
141
+
142
+ **ECA deploy order — two waves required.** If the tracked files include ECA metadata, deploy the `ExternalClientApplication` parent file alone in a first deploy, then deploy the other child types in a second deploy. Deploying all ECA files in one call fails silently or leaves children undeployed.
143
+
144
+ When resuming after a verified parent deployment, reuse that wave. If successful deployment evidence for any child component is unavailable, report its deployed state as unknown and propose a narrow retry of the exact tracked child files under the applicable deployment approval. Exclude the verified parent and reused components outside this run's approved changes; keep child deployment incomplete until the retry succeeds.
145
+
146
+ Stop if deployment fails. Do not activate a partially deployed server.
147
+ 2. Confirm that the deployed `McpServerDefinition` contains every approved tool and prompt. Verify that the backing actions/templates deployed successfully; widget generation requires the real deployed Apex action contract, not stale local source.
148
+
149
+ ## Phase 6 — Generate and attach MCP tool widgets
150
+
151
+ After Phase 5 succeeds and before loading `platform-mcp-tool-widget-coordinate`, establish whether the user wants HXL widgets for eligible Apex-backed tools. Reuse an explicit HXL request or prior approval; otherwise ask once whether to generate the widgets and prepare their local resource links. If the user declines, mark Phase 6 skipped and continue to Phase 7. If accepted, read [references/widget-resources.md](references/widget-resources.md) and execute its full procedure. It covers eligible `aa:apex-` tools only and delegates generation and its existing gates to `platform-mcp-tool-widget-coordinate`. This skill then checks the complete response bundle, prepares the narrow deployment checklist from the validated artifacts, retrieves the authoritative server with prior overwrite consent, and attaches and verifies widget resources. Flow-backed and prompt-backed tools and MCP prompts are skipped, not reinterpreted as Apex actions. Stop on any generation, gate, deployment, retrieval, or linkage failure; report partial files and do not activate.
152
+
153
+ ## Phase 7 — Activate and verify
154
+
155
+ Continue after Phase 6 succeeds or is skipped. For an explicit preview/activate-only request for an already-deployed named server, start at step 1; skip earlier phases and preserve existing bindings and resources.
156
+
157
+ 1. Activation uses Tooling writes because `McpServerAccess` has no metadata type. Preview first: without flags, `activate_server.mjs` queries the server and prints `plannedRequest` (method, URL and body) without writing. Show it and ask before using `--confirm`, which writes and re-queries the state. Use authenticated `sf` requests for activation and verification, never direct `curl`.
158
+ ```bash
159
+ node "<skill-dir>/scripts/activate_server.mjs" <target-org-alias> <SERVER_DEV_NAME>
160
+ node "<skill-dir>/scripts/activate_server.mjs" <target-org-alias> <SERVER_DEV_NAME> --confirm
161
+ ```
162
+ An authentication failure means the target org must be reauthenticated before retrying; it does not mean Tooling activation is unavailable. Ask the user to use Setup only when the Tooling operation itself is unavailable.
163
+ 2. Verify the definition, approved tools and prompts, Phase 6 widget-resource relationships when applicable, and active state. For tool-bearing servers, the read-only script reports `status: ready` only when the server is active and has at least one tool (otherwise `not_found`, `inactive` or `no_tools`, still exit 0); it does not verify widget relationships, which require Phase 6's metadata read-back:
164
+ ```bash
165
+ node "<skill-dir>/scripts/verify_server.mjs" <target-org-alias> <SERVER_DEV_NAME> [--json]
166
+ ```
167
+ For a prompt-only server, confirm active state with the activation script's read-only preview and inspect the deployed `McpServerDefinition` for the expected `<prompts>` entries; `verify_server.mjs` currently requires a tool and is not a prompt-only verifier. Test `prompts/list` in a compatible connected client when available.
168
+ For client readiness, also fetch the OAuth protected-resource document associated with the final serving URL and confirm that `scopes_supported` includes `mcp_api`. This is an integration check outside `verify_server.mjs`; derive the document URL from authoritative routing information for the target environment rather than inventing a portal URL.
169
+ 3. Report deployment/activation results, serving URL, bound tools/prompts, widget resources/URIs, HXL/Custom Lightning Type files/FQNs, and widget validation results. Keep preflight disclosure within Phase 0's rules. On a failed write, report existing records and offer reverse-order teardown; deactivate before deleting. Client connection is manual. Until the user confirms the deployed bindings and renditions in their client, mark connection, tool/prompt parity and widget rendering as pending integration verification.
170
+ 4. Before client testing, remind the admin to verify end users' `API Enabled`, Apex Class Access, Flow access/`Run Flows`, required object CRUD, field permissions, record access/sharing, and tool-specific permissions. This skill does not audit, configure, or grant end-user permissions.
171
+
172
+ ## Phase 8 — Deliver the MCP connection
173
+
174
+ After successful deployment, activation and verification, offer an MCP configuration or Claude plugin through **`experience-app-mcp-delivery-generate`**. Invoke it when the user requests delivery or accepts the offer; reuse an earlier request or acceptance. If the user declines, finish with the Phase 7 results. For a preview-only, activation-only or metadata-only request, finish at that request's boundary unless delivery was also requested.
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ExternalClientApplication xmlns="http://soap.sforce.com/2006/04/metadata">
3
+ <contactEmail>__ECA_CONTACT_EMAIL__</contactEmail>
4
+ <description>__ECA_DESC__</description>
5
+ <distributionState>Local</distributionState>
6
+ <label>__ECA_LABEL__</label>
7
+ </ExternalClientApplication>
@@ -0,0 +1,15 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ExtlClntAppGlobalOauthSettings xmlns="http://soap.sforce.com/2006/04/metadata">
3
+ <callbackUrl>__ECA_CALLBACK_URLS__</callbackUrl>
4
+ <externalClientApplication>__ECA_NAME__</externalClientApplication>
5
+ <isClientCredentialsFlowEnabled>false</isClientCredentialsFlowEnabled>
6
+ <isConsumerSecretOptional>true</isConsumerSecretOptional>
7
+ <isDeviceFlowEnabled>false</isDeviceFlowEnabled>
8
+ <isNamedUserJwtEnabled>true</isNamedUserJwtEnabled>
9
+ <isPkceRequired>true</isPkceRequired>
10
+ <isRefreshTokenRotationEnabled>true</isRefreshTokenRotationEnabled>
11
+ <isSecretRequiredForRefreshToken>false</isSecretRequiredForRefreshToken>
12
+ <isSecretRequiredForTokenExchange>true</isSecretRequiredForTokenExchange>
13
+ <isTokenExchangeEnabled>false</isTokenExchangeEnabled>
14
+ <label>__ECA_LABEL__ Global OAuth</label>
15
+ </ExtlClntAppGlobalOauthSettings>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ExtlClntAppOauthSettings xmlns="http://soap.sforce.com/2006/04/metadata">
3
+ <commaSeparatedOauthScopes>MCP, RefreshToken</commaSeparatedOauthScopes>
4
+ <externalClientApplication>__ECA_NAME__</externalClientApplication>
5
+ <label>__ECA_LABEL__ OAuth</label>
6
+ </ExtlClntAppOauthSettings>
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ExtlClntAppOauthConfigurablePolicies xmlns="http://soap.sforce.com/2006/04/metadata">
3
+ <externalClientApplication>__ECA_NAME__</externalClientApplication>
4
+ <ipRelaxationPolicyType>Enforce</ipRelaxationPolicyType>
5
+ <label>__ECA_LABEL__ OAuth Policies</label>
6
+ <namedUserJwtSessionTimeoutType>UserSession</namedUserJwtSessionTimeoutType>
7
+ <permittedUsersPolicyType>AdminApprovedPreAuthorized</permittedUsersPolicyType>
8
+ <refreshTokenPolicyType>SpecificLifetime</refreshTokenPolicyType>
9
+ <refreshTokenValidityPeriod>30</refreshTokenValidityPeriod>
10
+ <refreshTokenValidityUnit>Days</refreshTokenValidityUnit>
11
+ <requiredSessionLevel>STANDARD</requiredSessionLevel>
12
+ </ExtlClntAppOauthConfigurablePolicies>
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ExtlClntAppConfigurablePolicies xmlns="http://soap.sforce.com/2006/04/metadata">
3
+ <externalClientApplication>__ECA_NAME__</externalClientApplication>
4
+ <isEnabled>true</isEnabled>
5
+ <isOauthPluginEnabled>true</isOauthPluginEnabled>
6
+ <label>__ECA_NAME___defaultPolicy</label>
7
+ </ExtlClntAppConfigurablePolicies>
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <McpServerDefinition xmlns="http://soap.sforce.com/2006/04/metadata">
3
+ <description>__MCP_SERVER_DESC__</description>
4
+ <masterLabel>__MCP_SERVER_LABEL__</masterLabel>
5
+ </McpServerDefinition>
@@ -0,0 +1,76 @@
1
+ # External Client Application Field Map
2
+
3
+ Read this reference when reviewing or changing ECA metadata produced by `render_eca.mjs`. Paths below are under `<default-package>/main/default` and use the ECA DeveloperName as `<name>`.
4
+
5
+ ## Generated files
6
+
7
+ ### `externalClientApps/<name>.eca-meta.xml`
8
+
9
+ Full path: `<default-package>/main/default/externalClientApps/<name>.eca-meta.xml`
10
+
11
+ | Field | Controls |
12
+ |---|---|
13
+ | `<label>` | Display label |
14
+ | `<description>` | Description |
15
+ | `<contactEmail>` | Contact email |
16
+
17
+ ### `extlClntAppGlobalOauthSets/<name>.ecaGlblOauth-meta.xml`
18
+
19
+ Full path: `<default-package>/main/default/extlClntAppGlobalOauthSets/<name>.ecaGlblOauth-meta.xml`
20
+
21
+ | Field | Controls |
22
+ |---|---|
23
+ | `<callbackUrl>` | OAuth callback URLs |
24
+ | `<isPkceRequired>` | PKCE requirement |
25
+ | `<isRefreshTokenRotationEnabled>` | Refresh-token rotation |
26
+ | `<isNamedUserJwtEnabled>` | Named-user JWT |
27
+ | `<label>` | Global OAuth settings label |
28
+
29
+ ### `extlClntAppOauthSettings/<name>.ecaOauth-meta.xml`
30
+
31
+ Full path: `<default-package>/main/default/extlClntAppOauthSettings/<name>.ecaOauth-meta.xml`
32
+
33
+ | Field | Controls |
34
+ |---|---|
35
+ | `<commaSeparatedOauthScopes>` | OAuth scopes |
36
+ | `<label>` | OAuth settings label |
37
+
38
+ ### `extlClntAppOauthPolicies/<name>.ecaOauthPlcy-meta.xml`
39
+
40
+ Full path: `<default-package>/main/default/extlClntAppOauthPolicies/<name>.ecaOauthPlcy-meta.xml`
41
+
42
+ | Field | Controls |
43
+ |---|---|
44
+ | `<permittedUsersPolicyType>` | Permitted users |
45
+ | `<refreshTokenPolicyType>` | Refresh-token policy |
46
+ | `<refreshTokenValidityPeriod>` | Refresh-token lifetime value |
47
+ | `<refreshTokenValidityUnit>` | Refresh-token lifetime unit |
48
+ | `<ipRelaxationPolicyType>` | IP relaxation |
49
+ | `<requiredSessionLevel>` | Required session level |
50
+ | `<label>` | OAuth policy label |
51
+
52
+ ### `extlClntAppPolicies/<name>_defaultPolicy.ecaPlcy-meta.xml`
53
+
54
+ Full path: `<default-package>/main/default/extlClntAppPolicies/<name>_defaultPolicy.ecaPlcy-meta.xml`
55
+
56
+ | Field | Controls |
57
+ |---|---|
58
+ | `<isEnabled>` | Application availability |
59
+ | `<isOauthPluginEnabled>` | OAuth plugin availability |
60
+ | `<label>` | Default policy label |
61
+
62
+ ## Permitted users
63
+
64
+ Default new ECAs to `AdminApprovedPreAuthorized`: the admin grants ECA access through associated profiles or permission sets; those users do not individually consent. This is not limited to administrator users. Remind the admin to arrange preauthorization; this skill does not manage end-user permissions.
65
+
66
+ If the MCP server is intended for all authenticated site users, suggest `AllSelfAuthorized`: eligible authenticated users authorize the ECA themselves without individual admin preauthorization. Apply it only after an explicit choice. ECA authorization does not replace site, tool, or data access controls.
67
+
68
+ Pass `--permitted-users-policy <AdminApprovedPreAuthorized|AllSelfAuthorized>` to `render_eca.mjs` for generation and `--check` with the confirmed choice; omission uses the admin-preauthorized baseline. Preserve intentional existing policies. A baseline difference is a review finding, not authorization to change a live ECA.
69
+
70
+ ## Editing invariants
71
+
72
+ - Store all client-specific OAuth redirect URIs as newline-separated values inside the single `<callbackUrl>` element. Each value must be an absolute redirect URI with an allowed scheme and host. Do not invent a default callback URL, and do not write an empty `<callbackUrl>`.
73
+ - Keep the `MCP` and `RefreshToken` OAuth scopes unless the user explicitly changes the supported authorization flow.
74
+ - Refresh-token lifetime is controlled by the policy type, period, and unit in the OAuth policy component.
75
+ - Keep every `<externalClientApplication>` value aligned with the ECA DeveloperName. A rename requires coordinated file-name and cross-component reference changes, not an isolated field edit.
76
+ - The renderer derives labels across the related components. When changing the display label, review the labels in the global OAuth, OAuth settings, and OAuth policy components for consistency.
@@ -0,0 +1,66 @@
1
+ # Custom Hosted MCP Object and Binding Reference
2
+
3
+ Read this reference during Phase 3 when reconciling a server and during Phase 4 before binding tools. The scripts and assets remain authoritative for rendering, API requests, activation, and verification.
4
+
5
+ ## Object model
6
+
7
+ The server, tools, and prompts deploy as one Metadata API component with nested `<tools>` and `<prompts>` blocks. Activation is a separate Tooling API record.
8
+
9
+ | Concept | Runtime/Tooling object | Metadata representation |
10
+ |---|---|---|
11
+ | Server | `McpServerDefinition` | Root `<McpServerDefinition>`; file name is the DeveloperName |
12
+ | Tool | `McpServerToolDefinition` | One `<tools>` block |
13
+ | Tool backing | `McpServerToolApiDefinition` | `<apiDefinition>` inside `<tools>` |
14
+ | Prompt | — | One `<prompts>` block with `promptTemplateName` |
15
+ | Activation | `McpServerAccess` | No metadata type; separate Tooling write |
16
+
17
+ Deploy the Salesforce-hosted component at `<default-package>/main/default/mcpServerDefinitions/<DeveloperName>.mcpServerDefinition-meta.xml`.
18
+
19
+ ## Metadata invariants
20
+
21
+ - Use the bundled server asset and `merge_tools.mjs`; do not hand-build or directly edit `<tools>` or `<prompts>` XML.
22
+ - Omit `Language`; it isn't a `McpServerDefinition` metadata field.
23
+ - Preserve root content such as prompts and resources when adding tools.
24
+ - Canonical tool element order is `apiDefinition`, `descriptionOverride`, `destructive`, `idempotent`, `openWorld`, `readOnly`, `returnDirect`, `toolName`, `toolTitle`.
25
+ - Canonical `<apiDefinition>` order is `apiIdentifier`, `apiSource`, `operation`.
26
+ - Set the five behavior booleans from the action's real behavior; do not blindly default them.
27
+ - Every newly authored tool must have a meaningful `descriptionOverride` and `toolTitle`; every prompt needs `descriptionOverride` and `promptTitle`.
28
+ - The emitted tool XML must contain `operation` and `toolName`. For `aa:apex-`, `fa:flow-`, and `pr:` JSON specs, `merge_tools.mjs` derives both from `apiIdentifier` when omitted.
29
+ - Canonical prompt element order is `descriptionOverride`, `promptName`, `promptTemplateName`, `promptTitle`.
30
+
31
+ ## Existing-stack review
32
+
33
+ Run preflight and recover the confirmed site, server, ECA/client callbacks, intended bindings/widgets, and prior approvals. Ask only for missing or ambiguous choices. Use `check_setup_progress.mjs` for observations, not proof of setup completion. Read-only review stops with findings and unresolved checks; creation, retrieval, repairs, deployment, activation, and permission audits are outside that path.
34
+
35
+ - Compare local ECA files with `render_eca.mjs --check` using confirmed inputs and policy choice; read `eca-fields.md` for scopes, callbacks, policies, and cross-component ownership. Verify deployed settings separately through read-only org queries where available; inaccessible settings remain unknown.
36
+ - Inspect the actual local server XML against the bundled asset and confirmed intent, preserving intentional overrides. Compare with deployed state through read-only queries where available. Local files and activation alone do not establish deployed configuration or client readiness.
37
+ - Compare every intended tool/prompt with the authoritative available metadata and action/template contracts. Read `tool-bindings.md` to review existing behavior flags as well as new ones. Follow `widget-resources.md` for applicable dependencies/links. Report missing, contradictory, stale, or unverifiable settings; permission setup remains an admin reminder.
38
+ - For deployment requests, show the exact stack files and unresolved dependencies before Phase 5. Reuse prior approvals only for the same target, files, and actions. Keep client testing pending until verified.
39
+
40
+ ## Supported tool backings
41
+
42
+ The supported tool bindings serialize with `apiSource=API_CATALOG`.
43
+
44
+ | Backing implementation | `apiIdentifier` | Availability pattern | Appropriate use |
45
+ |---|---|---|---|
46
+ | Global Apex `@InvocableMethod` | `aa:apex-<ClassName>` | Live/virtual | New custom logic; primary path |
47
+ | Autolaunched Flow with input and output variables | `fa:flow-<FlowName>` | Live/virtual | Declarative or admin-owned logic |
48
+ | Available Prompt Builder template action | `pr:<TemplateApiName>` | Runtime prompt-template action | Agent-invoked server-side generation |
49
+
50
+ Preserve every existing binding during reconciliation. Add new bindings from the supported implementations in this table.
51
+
52
+ Active, published Flex Prompt Builder templates can be MCP prompts under `<prompts>`. An available prompt-template action can also be a `pr:` MCP tool under `<tools>`; the same template may appear in both forms. MCP prompts are selected by people in compatible clients, while prompt-backed tools execute server-side when called by an agent.
53
+
54
+ ## Availability patterns
55
+
56
+ Invocable Apex and autolaunched Flows are live sources. Confirm that the action exists in the org's runtime invocable-action catalog, then compose its `aa:` or `fa:` identifier.
57
+
58
+ `retrieve_existing_tools.mjs` reads `/actions/custom/apex` and `/actions/custom/flow` and doesn't write to the SFDX project. `retrieve_existing_prompts.mjs` pages through active templates at `/einstein/prompt-templates`, lists custom `GenAiPromptTemplate` metadata, reads custom template versions by API name, and lists or describes `/actions/custom/generatePromptResponse` actions. It reports active published custom Flex templates as MCP prompt candidates, inactive published custom Flex templates separately, active standard Flex templates with unverified MCP prompt eligibility, and actions backed by published custom or active standard Flex or Global templates as MCP tool candidates; `inventoryCounts` retains the broader API totals. The list responses provide candidate names and describe URLs. Describe only candidates relevant to the site's purpose; the candidate-specific response supplies the description and parameter schemas needed for review. Runtime discovery can include namespaced installed-package actions whose source isn't locally retrievable. An unavailable endpoint is not evidence that a template does not exist.
59
+
60
+ ## Prompt Builder eligibility
61
+
62
+ A custom template can have a published version while `IsActive` is false; do not infer MCP prompt eligibility from publication, type, or a runtime action alone. For inactive or unverified Flex candidates, confirm they appear in Setup's Add Prompts picker or verify both active and published status before proposing a prompt binding.
63
+
64
+ Compare candidate API names with existing `<prompts>` and `pr:` `<tools>` bindings. Inspect plausible template metadata and GET the returned action `url` when present to review its description and inputs. Offer an eligible Flex template as an MCP prompt for client selection, a runtime-available `pr:<template API name>` action as an agent-invoked tool, or both when justified.
65
+
66
+ A non-zero exit means incomplete discovery, not absence; report it and continue the independent Apex/Flow and UI passes. Read [discovery troubleshooting](troubleshooting.md#tool-discovery-and-binding) before retrying.