@salesforce/afv-skills 1.46.0 → 1.48.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 (317) hide show
  1. package/package.json +1 -1
  2. package/skills/agentforce-observe/SKILL.md +32 -4
  3. package/skills/agentforce-observe/references/ahm-alerts.md +719 -0
  4. package/skills/consumer-goods-promotion-bo-api-deploy/SKILL.md +275 -0
  5. package/skills/consumer-goods-promotion-bo-api-deploy/assets/set-comment-value/README.md +32 -0
  6. package/skills/consumer-goods-promotion-bo-api-deploy/assets/set-comment-value/SetCommentValue.cls +75 -0
  7. package/skills/consumer-goods-promotion-bo-api-deploy/assets/set-comment-value/SetCommentValue.cls-meta.xml +5 -0
  8. package/skills/consumer-goods-promotion-bo-api-deploy/assets/set-comment-value/interview-answers.json +13 -0
  9. package/skills/consumer-goods-promotion-bo-api-deploy/assets/set-comment-value/payloads/copy.json +10 -0
  10. package/skills/consumer-goods-promotion-bo-api-deploy/assets/set-comment-value/payloads/create.json +20 -0
  11. package/skills/consumer-goods-promotion-bo-api-deploy/assets/set-comment-value/payloads/update.json +16 -0
  12. package/skills/consumer-goods-promotion-bo-api-deploy/references/conventions-and-payload-rules.md +273 -0
  13. package/skills/consumer-goods-promotion-bo-api-deploy/references/generate-and-wire.md +236 -0
  14. package/skills/consumer-goods-promotion-bo-api-deploy/references/reference-example-set-comment-value.md +132 -0
  15. package/skills/consumer-goods-promotion-bo-api-deploy/references/smoke-and-verify.md +211 -0
  16. package/skills/dx-devops-project-manage/SKILL.md +197 -0
  17. package/skills/dx-devops-project-manage/examples/common-workflows.md +197 -0
  18. package/skills/dx-devops-project-manage/references/cli-commands.md +295 -0
  19. package/skills/dx-devops-project-manage/scripts/create-project.sh +48 -0
  20. package/skills/dx-devops-project-manage/scripts/list-projects.sh +51 -0
  21. package/skills/dx-devops-project-manage/scripts/update-project.sh +96 -0
  22. package/skills/education-cloud-academic-calendar-generate/SKILL.md +225 -0
  23. package/skills/education-cloud-academic-calendar-generate/examples/quarter-calendar.json +47 -0
  24. package/skills/education-cloud-academic-calendar-generate/examples/sample-output.md +57 -0
  25. package/skills/education-cloud-academic-calendar-generate/examples/semester-calendar.json +54 -0
  26. package/skills/education-cloud-academic-calendar-generate/references/calendar-systems.md +127 -0
  27. package/skills/education-cloud-academic-calendar-generate/references/date-validation.md +222 -0
  28. package/skills/education-cloud-academic-calendar-generate/references/foundation_prerequisites.md +40 -0
  29. package/skills/education-cloud-academic-calendar-generate/scripts/validate_calendar_dates.py +143 -0
  30. package/skills/education-cloud-course-catalog-migrate/SKILL.md +321 -0
  31. package/skills/education-cloud-course-catalog-migrate/references/gotchas-detail.md +16 -0
  32. package/skills/education-cloud-course-catalog-migrate/references/gotchas.md +16 -0
  33. package/skills/education-cloud-course-catalog-migrate/references/large-catalog-handling.md +42 -0
  34. package/skills/education-cloud-course-catalog-migrate/scripts/batch_courses.py +36 -0
  35. package/skills/education-cloud-course-catalog-migrate/scripts/detect_linked_courses.py +51 -0
  36. package/skills/education-cloud-course-catalog-migrate/scripts/detect_modality_variants.py +48 -0
  37. package/skills/education-cloud-course-catalog-migrate/scripts/resolve_api_version.py +43 -0
  38. package/skills/education-cloud-course-catalog-migrate/scripts/split_course_code.py +39 -0
  39. package/skills/education-cloud-course-catalog-migrate/scripts/validate_completeness.py +54 -0
  40. package/skills/education-cloud-domain-configure/SKILL.md +234 -0
  41. package/skills/education-cloud-domain-configure/references/dependent-features.md +198 -0
  42. package/skills/education-cloud-domain-configure/references/domain-features/academic-operations.md +386 -0
  43. package/skills/education-cloud-domain-configure/references/domain-features/alumni-relations.md +155 -0
  44. package/skills/education-cloud-domain-configure/references/domain-features/cross-domain-dependencies.md +18 -0
  45. package/skills/education-cloud-domain-configure/references/domain-features/industriessettings-toggle-reference.md +43 -0
  46. package/skills/education-cloud-domain-configure/references/domain-features/mentoring.md +198 -0
  47. package/skills/education-cloud-domain-configure/references/domain-features/recruitment-admissions.md +315 -0
  48. package/skills/education-cloud-domain-configure/references/domain-features/student-management.md +155 -0
  49. package/skills/education-cloud-domain-configure/references/domain-features/student-success.md +249 -0
  50. package/skills/education-cloud-domain-configure/references/domain-features.md +27 -0
  51. package/skills/education-cloud-domain-configure/references/gotchas-extended.md +23 -0
  52. package/skills/education-cloud-domain-configure/references/toggle-write-path.md +67 -0
  53. package/skills/education-cloud-domain-configure/scripts/check_license_provisioned.py +62 -0
  54. package/skills/education-cloud-domain-configure/scripts/check_org_edition.py +44 -0
  55. package/skills/education-cloud-domain-configure/scripts/check_permission_assigned.py +39 -0
  56. package/skills/education-cloud-multi-campus-configure/SKILL.md +7 -0
  57. package/skills/education-cloud-multi-campus-configure/references/foundation_prerequisites.md +1 -2
  58. package/skills/education-cloud-student-recruitment-agent-configure/SKILL.md +177 -0
  59. package/skills/education-cloud-student-recruitment-agent-configure/references/agent-and-subagents.md +151 -0
  60. package/skills/education-cloud-student-recruitment-agent-configure/references/customer-narration.md +34 -0
  61. package/skills/education-cloud-student-recruitment-agent-configure/references/execution-model.md +54 -0
  62. package/skills/education-cloud-student-recruitment-agent-configure/references/flows.md +82 -0
  63. package/skills/education-cloud-student-recruitment-agent-configure/references/grounding.md +199 -0
  64. package/skills/education-cloud-student-recruitment-agent-configure/references/permissions.md +183 -0
  65. package/skills/education-cloud-student-recruitment-agent-configure/references/platform-enablement.md +82 -0
  66. package/skills/education-cloud-student-recruitment-agent-configure/references/prerequisites.md +158 -0
  67. package/skills/education-cloud-student-recruitment-agent-configure/references/routing.md +141 -0
  68. package/skills/experience-cms-brand-apply/SKILL.md +5 -5
  69. package/skills/experience-cms-brand-create/SKILL.md +2 -2
  70. package/skills/experience-cms-content-generate/SKILL.md +1 -0
  71. package/skills/experience-cms-content-render/SKILL.md +173 -0
  72. package/skills/experience-cms-content-render/assets/angular/DetailPage.component.ts +25 -0
  73. package/skills/experience-cms-content-render/assets/angular/MediaRenderer.component.ts +133 -0
  74. package/skills/experience-cms-content-render/assets/angular/TypeList.component.ts +38 -0
  75. package/skills/experience-cms-content-render/assets/angular/TypeRenderer.component.ts +90 -0
  76. package/skills/experience-cms-content-render/assets/angular/cms-content.component.ts +248 -0
  77. package/skills/experience-cms-content-render/assets/angular/cms-item.service.ts +100 -0
  78. package/skills/experience-cms-content-render/assets/react/DetailPage.tsx +20 -0
  79. package/skills/experience-cms-content-render/assets/react/MediaRenderer.tsx +129 -0
  80. package/skills/experience-cms-content-render/assets/react/TypeList.tsx +40 -0
  81. package/skills/experience-cms-content-render/assets/react/TypeRenderer.tsx +64 -0
  82. package/skills/experience-cms-content-render/assets/react/heuristicRenderer.tsx +310 -0
  83. package/skills/experience-cms-content-render/assets/react/useCmsItem.ts +129 -0
  84. package/skills/experience-cms-content-render/assets/shared/cmsContentType.ts +49 -0
  85. package/skills/experience-cms-content-render/assets/shared/cmsCore.types.ts +96 -0
  86. package/skills/experience-cms-content-render/assets/shared/externalRefs.ts +55 -0
  87. package/skills/experience-cms-content-render/references/bulk-loading.md +60 -0
  88. package/skills/experience-cms-content-render/references/codegen-guardrails.md +111 -0
  89. package/skills/experience-cms-content-render/references/detail-pages.md +87 -0
  90. package/skills/experience-cms-content-render/references/embed-recipes.md +127 -0
  91. package/skills/experience-cms-content-render/references/failure-modes.md +96 -0
  92. package/skills/experience-cms-content-render/references/heuristic-render-rules.md +131 -0
  93. package/skills/experience-cms-content-render/references/init-scaffold.md +122 -0
  94. package/skills/experience-cms-content-render/references/interaction-model.md +173 -0
  95. package/skills/experience-cms-content-render/references/package-api.md +106 -0
  96. package/skills/experience-cms-content-render/references/schema-sync.md +114 -0
  97. package/skills/experience-cms-content-render/references/styling-scopes.md +65 -0
  98. package/skills/experience-cms-content-render/references/verify.md +49 -0
  99. package/skills/experience-cms-content-type-generate/SKILL.md +2 -2
  100. package/skills/experience-content-media-stock-image-search/SKILL.md +5 -4
  101. package/skills/experience-search-coordinate/SKILL.md +198 -0
  102. package/skills/experience-search-coordinate/assets/search-payload-template.json +25 -0
  103. package/skills/experience-search-coordinate/references/content-route.md +313 -0
  104. package/skills/experience-search-coordinate/references/content-type-discovery.md +57 -0
  105. package/skills/experience-search-coordinate/references/media-route.md +172 -0
  106. package/skills/experience-search-coordinate/references/scope-resolution.md +14 -0
  107. package/skills/experience-ui-bundle-localize/SKILL.md +1 -1
  108. package/skills/experience-ui-bundle-localize/references/i18n-setup.md +5 -3
  109. package/skills/experience-ui-bundle-project-generate/SKILL.md +18 -14
  110. package/skills/experience-ui-bundle-project-generate/references/angular-project-generate.md +22 -0
  111. package/skills/experience-ui-bundle-project-generate/references/react-project-generate.md +20 -0
  112. package/skills/experience-ui-bundle-salesforce-data-access/SKILL.md +58 -54
  113. package/skills/experience-ui-bundle-salesforce-data-access/references/caching.md +6 -0
  114. package/skills/experience-ui-bundle-salesforce-data-access/references/graphiti-cli.md +2 -2
  115. package/skills/experience-ui-bundle-salesforce-data-access/references/migration.md +6 -0
  116. package/skills/experience-ui-bundle-salesforce-data-access/references/rest-and-integration.md +2 -1
  117. package/skills/experience-ui-bundle-salesforce-data-access/references/sdk-api.md +6 -0
  118. package/skills/experience-ui-bundle-site-generate/SKILL.md +59 -8
  119. package/skills/experience-ui-bundle-site-generate/references/configure-metadata-digital-experience.md +8 -3
  120. package/skills/experience-ui-bundle-site-generate/references/configure-metadata-language-settings.md +120 -0
  121. package/skills/life-sciences-fieldsalesrep-coordinate/SKILL.md +336 -0
  122. package/skills/life-sciences-fieldsalesrep-coordinate/references/orchestration-flow.md +143 -0
  123. package/skills/life-sciences-fieldsalesrep-coordinate/references/stage-2-starter-config-application-flexipage-mapping.md +127 -0
  124. package/skills/life-sciences-fieldsalesrep-coordinate/references/stage-2-starter-config-deploy-commands.md +116 -0
  125. package/skills/life-sciences-fieldsalesrep-coordinate/references/stage-2-starter-config-lifesci-metadata-deploy.md +111 -0
  126. package/skills/life-sciences-fieldsalesrep-coordinate/references/stage-2-starter-config-overview.md +312 -0
  127. package/skills/life-sciences-fieldsalesrep-coordinate/references/stage-2-starter-config-profile-layout-assignments.md +171 -0
  128. package/skills/life-sciences-fieldsalesrep-coordinate/references/stage-2-starter-config-state-tracking.md +64 -0
  129. package/skills/life-sciences-fieldsalesrep-coordinate/references/stage-2-starter-config-trigger-handlers.md +122 -0
  130. package/skills/life-sciences-fieldsalesrep-coordinate/references/stage-4-user-provisioning-overview.md +335 -0
  131. package/skills/life-sciences-fieldsalesrep-coordinate/references/stage-4-user-provisioning-user-provisioning-details.md +140 -0
  132. package/skills/life-sciences-fieldsalesrep-coordinate/references/stage-5-visit-creation-execution-state-and-recovery.md +196 -0
  133. package/skills/life-sciences-fieldsalesrep-coordinate/references/stage-5-visit-creation-metadata-cache-generation.md +155 -0
  134. package/skills/life-sciences-fieldsalesrep-coordinate/references/stage-5-visit-creation-overview.md +307 -0
  135. package/skills/life-sciences-fieldsalesrep-coordinate/references/stage-5-visit-creation-visit-creation-data.md +211 -0
  136. package/skills/life-sciences-fieldsalesrep-coordinate/references/state-machine-and-changes.md +108 -0
  137. package/skills/life-sciences-kam-coordinate/SKILL.md +241 -0
  138. package/skills/life-sciences-kam-coordinate/references/orchestration-flow.md +152 -0
  139. package/skills/life-sciences-kam-coordinate/references/stage-2-starter-config-application-flexipage-mapping.md +79 -0
  140. package/skills/life-sciences-kam-coordinate/references/stage-2-starter-config-deploy-commands.md +131 -0
  141. package/skills/life-sciences-kam-coordinate/references/stage-2-starter-config-kam-config-records.md +85 -0
  142. package/skills/life-sciences-kam-coordinate/references/stage-2-starter-config-lifesci-metadata-deploy.md +112 -0
  143. package/skills/life-sciences-kam-coordinate/references/stage-2-starter-config-overview.md +202 -0
  144. package/skills/life-sciences-kam-coordinate/references/stage-2-starter-config-profile-layout-assignments.md +67 -0
  145. package/skills/life-sciences-kam-coordinate/references/stage-2-starter-config-state-tracking.md +65 -0
  146. package/skills/life-sciences-kam-coordinate/references/stage-2-starter-config-trigger-handlers.md +123 -0
  147. package/skills/life-sciences-kam-coordinate/references/stage-4-participant-role-and-sprint.md +89 -0
  148. package/skills/life-sciences-kam-coordinate/references/stage-5-data-and-plan-templates-overview.md +337 -0
  149. package/skills/life-sciences-kam-coordinate/references/stage-5-data-creation-data.md +248 -0
  150. package/skills/life-sciences-kam-coordinate/references/stage-6-ipad-validation-script.md +35 -0
  151. package/skills/life-sciences-kam-coordinate/references/stage-6-metadata-cache-generation.md +155 -0
  152. package/skills/life-sciences-kam-coordinate/references/stage-6-user-provisioning-details.md +146 -0
  153. package/skills/life-sciences-kam-coordinate/references/stage-6-user-provisioning-overview.md +89 -0
  154. package/skills/life-sciences-kam-coordinate/references/state-machine-and-changes.md +114 -0
  155. package/skills/life-sciences-prerequisites-validate/SKILL.md +138 -0
  156. package/skills/life-sciences-prerequisites-validate/references/checks-org-settings.md +190 -0
  157. package/skills/life-sciences-prerequisites-validate/references/checks-user-and-package.md +211 -0
  158. package/skills/life-sciences-territory-configure/SKILL.md +217 -0
  159. package/skills/life-sciences-territory-configure/references/territory-metadata.md +262 -0
  160. package/skills/platform-dsar-policy-manage/SKILL.md +272 -0
  161. package/skills/platform-dsar-policy-manage/references/configure.md +106 -0
  162. package/skills/platform-dsar-policy-manage/references/export-and-history.md +123 -0
  163. package/skills/platform-dsar-policy-manage/references/gap-analysis-guide.md +150 -0
  164. package/skills/platform-dsar-policy-manage/references/gap-scan.md +129 -0
  165. package/skills/platform-dsar-policy-manage/references/headless-sor.md +59 -0
  166. package/skills/platform-dsar-policy-manage/references/report-format.md +59 -0
  167. package/skills/platform-dsar-policy-manage/scripts/tests/__init__.py +0 -0
  168. package/skills/platform-dsar-policy-manage/scripts/tests/test_validate_policy_tree.py +76 -0
  169. package/skills/platform-dsar-policy-manage/scripts/validate-policy-tree.py +130 -0
  170. package/skills/platform-salesforce-connect-adapter-generate/SKILL.md +359 -0
  171. package/skills/platform-salesforce-connect-adapter-generate/references/official-examples.md +69 -0
  172. package/skills/platform-salesforce-connect-adapter-generate/references/scenarios.md +187 -0
  173. package/skills/service-agentforce-channel-configure/SKILL.md +33 -28
  174. package/skills/service-agentforce-human-escalation-configure/SKILL.md +205 -0
  175. package/skills/service-agentforce-human-escalation-configure/assets/escalation-thresholds.instructions.md +37 -0
  176. package/skills/service-agentforce-human-escalation-configure/assets/force-app/main/default/flows/Human_Escalation_Outbound_Flow.flow-meta.xml +173 -0
  177. package/skills/service-agentforce-human-escalation-configure/assets/package.xml +8 -0
  178. package/skills/service-agentforce-human-escalation-configure/assets/sfdx-project.json +5 -0
  179. package/skills/service-agentforce-human-escalation-configure/references/classifier-contracts.md +103 -0
  180. package/skills/service-agentforce-human-escalation-configure/references/escalation-mechanism.md +63 -0
  181. package/skills/service-agentforce-human-escalation-configure/references/failure-policy.md +44 -0
  182. package/skills/service-agentforce-human-escalation-configure/references/nga-escalation.md +57 -0
  183. package/skills/service-agentforce-human-escalation-configure/references/runtime-verification.md +72 -0
  184. package/skills/service-agentforce-human-escalation-configure/scripts/classify-agent-active.mjs +49 -0
  185. package/skills/service-agentforce-human-escalation-configure/scripts/classify-nga-escalation.mjs +166 -0
  186. package/skills/service-agentforce-human-escalation-configure/scripts/extract-outbound-route.mjs +67 -0
  187. package/skills/service-agentforce-human-escalation-configure/scripts/patch-escalation-surfaces.mjs +131 -0
  188. package/skills/service-agentforce-human-escalation-configure/scripts/tests/__init__.py +0 -0
  189. package/skills/service-agentforce-human-escalation-configure/scripts/tests/_bootstrap.py +249 -0
  190. package/skills/service-agentforce-human-escalation-configure/scripts/tests/test_escalation_contracts.py +899 -0
  191. package/skills/service-agentforce-human-escalation-configure/scripts/verify-and-configure.sh +705 -0
  192. package/skills/service-agentforce-human-escalation-configure/scripts/verify-escalation-config.mjs +89 -0
  193. package/skills/service-de-channel-routing-configure/SKILL.md +13 -5
  194. package/skills/service-de-channel-routing-configure/scripts/tests/test_skill_contract.py +25 -0
  195. package/skills/service-itsm-agentic-setup-agentforce-coordinate/SKILL.md +23 -10
  196. package/skills/service-itsm-agentic-setup-agentforce-coordinate/examples/output-templates.md +63 -48
  197. package/skills/service-itsm-agentic-setup-agentforce-coordinate/scripts/verify-child-verdict.mjs +6 -2
  198. package/skills/service-itsm-agentic-setup-cmdb-coordinate/SKILL.md +20 -27
  199. package/skills/service-native-voice-recording-transcription-configure/SKILL.md +47 -27
  200. package/skills/service-native-voice-recording-transcription-configure/references/thunderbird-voice-settings.md +13 -9
  201. package/skills/service-native-voice-recording-transcription-configure/scripts/enable-recording-transcription.sh +104 -45
  202. package/skills/service-omni-agent-users-create/SKILL.md +96 -0
  203. package/skills/service-omni-agent-users-create/assets/create-users.apex.template +80 -0
  204. package/skills/service-omni-agent-users-create/references/apex-patterns.md +135 -0
  205. package/skills/service-omni-agent-users-create/references/apex-template-notes.md +40 -0
  206. package/skills/service-omni-agent-users-create/scripts/detect-and-create.sh +206 -0
  207. package/skills/service-omni-agent-users-create/scripts/detect-existing.sh +122 -0
  208. package/skills/service-omni-agent-users-create/scripts/run-create.sh +298 -0
  209. package/skills/service-omni-agent-users-create/scripts/tests/test_user_create_security.py +171 -0
  210. package/skills/service-omni-agent-work-sharing-configure/SKILL.md +78 -0
  211. package/skills/service-omni-agent-work-sharing-configure/references/api-notes.md +31 -0
  212. package/skills/service-omni-agent-work-sharing-configure/scripts/configure-and-report.sh +186 -0
  213. package/skills/service-omni-agent-work-sharing-configure/scripts/tests/_bootstrap.py +120 -0
  214. package/skills/service-omni-agent-work-sharing-configure/scripts/tests/test_agent_work_sharing_contracts.py +93 -0
  215. package/skills/service-omni-base-settings-configure/SKILL.md +77 -0
  216. package/skills/service-omni-base-settings-configure/assets/force-app/main/default/settings/OmniChannel.settings-meta.xml +8 -0
  217. package/skills/service-omni-base-settings-configure/assets/package.xml +8 -0
  218. package/skills/service-omni-base-settings-configure/assets/sfdx-project.json +12 -0
  219. package/skills/service-omni-base-settings-configure/references/api-notes.md +121 -0
  220. package/skills/service-omni-base-settings-configure/scripts/configure-and-report.sh +164 -0
  221. package/skills/service-omni-base-settings-configure/scripts/detect-existing.sh +69 -0
  222. package/skills/service-omni-channel-setup-coordinate/SKILL.md +168 -0
  223. package/skills/service-omni-channel-setup-coordinate/examples/output-templates.md +161 -0
  224. package/skills/service-omni-channel-setup-coordinate/references/gap-catalog.md +99 -0
  225. package/skills/service-omni-channel-setup-coordinate/scripts/integration-driver.sh +1542 -0
  226. package/skills/service-omni-channel-setup-coordinate/scripts/tests/__init__.py +0 -0
  227. package/skills/service-omni-channel-setup-coordinate/scripts/tests/_bootstrap.py +223 -0
  228. package/skills/service-omni-channel-setup-coordinate/scripts/tests/test_omni_contracts.py +804 -0
  229. package/skills/service-omni-command-center-analyze/SKILL.md +84 -0
  230. package/skills/service-omni-command-center-analyze/references/api-notes.md +54 -0
  231. package/skills/service-omni-command-center-analyze/scripts/analyze.sh +198 -0
  232. package/skills/service-omni-command-center-analyze/scripts/tests/_bootstrap.py +115 -0
  233. package/skills/service-omni-command-center-analyze/scripts/tests/test_command_center_analyze_contracts.py +165 -0
  234. package/skills/service-omni-permission-set-assign/SKILL.md +88 -0
  235. package/skills/service-omni-permission-set-assign/assets/package.xml +8 -0
  236. package/skills/service-omni-permission-set-assign/references/api-notes.md +143 -0
  237. package/skills/service-omni-permission-set-assign/scripts/verify-and-assign.sh +397 -0
  238. package/skills/service-omni-presence-status-deploy/SKILL.md +87 -0
  239. package/skills/service-omni-presence-status-deploy/assets/package.xml +12 -0
  240. package/skills/service-omni-presence-status-deploy/references/api-notes.md +115 -0
  241. package/skills/service-omni-presence-status-deploy/scripts/deploy-and-report.sh +422 -0
  242. package/skills/service-omni-presence-user-config-deploy/SKILL.md +80 -0
  243. package/skills/service-omni-presence-user-config-deploy/references/api-notes.md +60 -0
  244. package/skills/service-omni-presence-user-config-deploy/scripts/deploy-and-report.sh +261 -0
  245. package/skills/service-omni-presence-user-config-deploy/scripts/tests/_bootstrap.py +106 -0
  246. package/skills/service-omni-presence-user-config-deploy/scripts/tests/test_presence_user_config_contracts.py +142 -0
  247. package/skills/service-omni-queue-deploy/SKILL.md +91 -0
  248. package/skills/service-omni-queue-deploy/references/api-notes.md +140 -0
  249. package/skills/service-omni-queue-deploy/scripts/verify-and-align.sh +470 -0
  250. package/skills/service-omni-queue-members-assign/SKILL.md +93 -0
  251. package/skills/service-omni-queue-members-assign/references/api-notes.md +144 -0
  252. package/skills/service-omni-queue-members-assign/scripts/tests/_bootstrap.py +67 -0
  253. package/skills/service-omni-queue-members-assign/scripts/tests/test_queue_members_contracts.py +73 -0
  254. package/skills/service-omni-queue-members-assign/scripts/verify-and-bind.sh +362 -0
  255. package/skills/service-omni-queue-routing-config-deploy/SKILL.md +101 -0
  256. package/skills/service-omni-queue-routing-config-deploy/references/api-notes.md +127 -0
  257. package/skills/service-omni-queue-routing-config-deploy/scripts/tests/_bootstrap.py +90 -0
  258. package/skills/service-omni-queue-routing-config-deploy/scripts/tests/test_queue_routing_config_contracts.py +70 -0
  259. package/skills/service-omni-queue-routing-config-deploy/scripts/upsert-and-report.sh +538 -0
  260. package/skills/service-omni-routing-flow-deploy/SKILL.md +111 -0
  261. package/skills/service-omni-routing-flow-deploy/assets/force-app/main/default/flows/Omni_Route_Case_Trigger.SkillsBased.flow-meta.xml +94 -0
  262. package/skills/service-omni-routing-flow-deploy/assets/force-app/main/default/flows/Omni_Route_Case_Trigger.flow-meta.xml +88 -0
  263. package/skills/service-omni-routing-flow-deploy/assets/force-app/main/default/flows/Omni_Route_Cases.flow-meta.xml +144 -0
  264. package/skills/service-omni-routing-flow-deploy/assets/force-app/main/default/flows/Omni_Route_VoiceCall_Trigger.SkillsBased.flow-meta.xml +94 -0
  265. package/skills/service-omni-routing-flow-deploy/assets/force-app/main/default/flows/Omni_Route_VoiceCall_Trigger.flow-meta.xml +88 -0
  266. package/skills/service-omni-routing-flow-deploy/assets/force-app/main/default/flows/Omni_Route_VoiceCalls.flow-meta.xml +144 -0
  267. package/skills/service-omni-routing-flow-deploy/assets/package.xml +11 -0
  268. package/skills/service-omni-routing-flow-deploy/assets/sfdx-project.json +11 -0
  269. package/skills/service-omni-routing-flow-deploy/references/api-notes.md +265 -0
  270. package/skills/service-omni-routing-flow-deploy/scripts/deploy-and-report.sh +684 -0
  271. package/skills/service-omni-service-channel-configure/SKILL.md +83 -0
  272. package/skills/service-omni-service-channel-configure/assets/force-app/main/default/serviceChannels/Cases.serviceChannel-meta.xml +9 -0
  273. package/skills/service-omni-service-channel-configure/assets/force-app/main/default/serviceChannels/Incidents.serviceChannel-meta.xml +9 -0
  274. package/skills/service-omni-service-channel-configure/assets/force-app/main/default/serviceChannels/MessagingSessions.serviceChannel-meta.xml +9 -0
  275. package/skills/service-omni-service-channel-configure/assets/force-app/main/default/serviceChannels/VoiceCalls.serviceChannel-meta.xml +9 -0
  276. package/skills/service-omni-service-channel-configure/assets/package.xml +11 -0
  277. package/skills/service-omni-service-channel-configure/assets/sfdx-project.json +12 -0
  278. package/skills/service-omni-service-channel-configure/references/api-notes.md +84 -0
  279. package/skills/service-omni-service-channel-configure/scripts/deploy-and-report.sh +383 -0
  280. package/skills/service-omni-sidebar-configure/SKILL.md +77 -0
  281. package/skills/service-omni-sidebar-configure/references/api-notes.md +51 -0
  282. package/skills/service-omni-sidebar-configure/scripts/enable-and-report.sh +315 -0
  283. package/skills/service-omni-sidebar-configure/scripts/tests/_bootstrap.py +142 -0
  284. package/skills/service-omni-sidebar-configure/scripts/tests/test_sidebar_contracts.py +139 -0
  285. package/skills/service-omni-skills-based-routing-configure/SKILL.md +81 -0
  286. package/skills/service-omni-skills-based-routing-configure/references/api-notes.md +50 -0
  287. package/skills/service-omni-skills-based-routing-configure/scripts/configure-and-report.sh +270 -0
  288. package/skills/service-omni-skills-based-routing-configure/scripts/tests/_bootstrap.py +120 -0
  289. package/skills/service-omni-skills-based-routing-configure/scripts/tests/test_sbr_contracts.py +129 -0
  290. package/skills/service-omni-supervisor-config-deploy/SKILL.md +97 -0
  291. package/skills/service-omni-supervisor-config-deploy/assets/force-app/main/default/omniSupervisorConfigs/Omni_Supervisor.omniSupervisorConfig-meta.xml +9 -0
  292. package/skills/service-omni-supervisor-config-deploy/assets/package.xml +8 -0
  293. package/skills/service-omni-supervisor-config-deploy/assets/sfdx-project.json +12 -0
  294. package/skills/service-omni-supervisor-config-deploy/references/api-notes.md +205 -0
  295. package/skills/service-omni-supervisor-config-deploy/scripts/deploy-and-report.sh +586 -0
  296. package/skills/service-omni-supervisor-config-deploy/scripts/tests/_bootstrap.py +153 -0
  297. package/skills/service-omni-supervisor-config-deploy/scripts/tests/test_supervisor_config_contracts.py +116 -0
  298. package/skills/service-omni-supervisor-permset-assign/SKILL.md +88 -0
  299. package/skills/service-omni-supervisor-permset-assign/references/api-notes.md +48 -0
  300. package/skills/service-omni-supervisor-permset-assign/scripts/verify-and-assign.sh +316 -0
  301. package/skills/service-omni-supervisor-surface-deploy/SKILL.md +85 -0
  302. package/skills/service-omni-supervisor-surface-deploy/references/api-notes.md +47 -0
  303. package/skills/service-omni-supervisor-surface-deploy/scripts/deploy-and-report.sh +216 -0
  304. package/skills/service-omni-supervisor-surface-deploy/scripts/tests/_bootstrap.py +95 -0
  305. package/skills/service-omni-supervisor-surface-deploy/scripts/tests/test_supervisor_surface_contracts.py +154 -0
  306. package/skills/service-omni-supervisor-users-create/SKILL.md +92 -0
  307. package/skills/service-omni-supervisor-users-create/assets/create-supervisors.apex.template +72 -0
  308. package/skills/service-omni-supervisor-users-create/references/apex-patterns.md +73 -0
  309. package/skills/service-omni-supervisor-users-create/references/apex-template-notes.md +41 -0
  310. package/skills/service-omni-supervisor-users-create/scripts/detect-and-create.sh +197 -0
  311. package/skills/service-omni-supervisor-users-create/scripts/detect-existing.sh +112 -0
  312. package/skills/service-omni-supervisor-users-create/scripts/run-create.sh +296 -0
  313. package/skills/service-omni-work-skill-routing-configure/SKILL.md +80 -0
  314. package/skills/service-omni-work-skill-routing-configure/references/api-notes.md +67 -0
  315. package/skills/service-omni-work-skill-routing-configure/scripts/configure-and-report.sh +262 -0
  316. package/skills/service-omni-work-skill-routing-configure/scripts/tests/_bootstrap.py +121 -0
  317. package/skills/service-omni-work-skill-routing-configure/scripts/tests/test_work_skill_routing_contracts.py +161 -0
@@ -0,0 +1,359 @@
1
+ ---
2
+ name: platform-salesforce-connect-adapter-generate
3
+ description: "Custom Apex adapter generation for Salesforce Connect — connects any external REST API to Salesforce as live, queryable External Objects without ETL or data copying. TRIGGER when: user wants to connect a non-standard external API to Salesforce, asks to write a DataSource.Provider or DataSource.Connection, wants to surface external data as Salesforce records, says \"connect my API to Salesforce without copying data\", or asks whether custom Apex is the right approach for any system. Also trigger on: \"custom adapter\", \"ExternalId field\", \"DataSource namespace\". DO NOT TRIGGER when: user is configuring a standard adapter they already have and is NOT asking about custom Apex (e.g., OData endpoint setup, Snowflake connector config). DO NOT TRIGGER when: user wants to copy or bulk-sync data — use platform-data-manage. DO NOT TRIGGER for Apex callouts outside Connect — use platform-apex-generate or integration-connectivity-generate."
4
+ metadata:
5
+ version: "1.0"
6
+ minApiVersion: "66.0"
7
+ accessCheck:
8
+ - type: license
9
+ value: SalesforceConnect
10
+ domains:
11
+ - Platform
12
+ relatedSkills:
13
+ - integration-connectivity-generate
14
+ - platform-apex-generate
15
+ - platform-data-manage
16
+ cliTools:
17
+ - tool: ["sf"]
18
+ semver: ">=2.0.0"
19
+ ---
20
+
21
+ # Salesforce Connect — Custom Apex Adapter
22
+
23
+ Route the user through building a complete custom Salesforce Connect Apex adapter: two Apex classes, metadata deployment, and registration. Do not guess at the user's API shape — ask before generating.
24
+
25
+ ## Scope
26
+
27
+ **In scope:** Generating `DataSource.Connection` and `DataSource.Provider` Apex classes, Named Credential metadata, deployment via sf CLI, and step-by-step Setup registration guidance for any REST API.
28
+
29
+ **Out of scope:** Configuring standard adapters (OData, Snowflake, GraphQL — those have their own flows). Generating the External Data Source metadata file (not deployable via sf CLI — must be registered manually in Setup). Writing Apex that calls external APIs outside the Salesforce Connect framework (use [platform-apex-generate](../platform-apex-generate/SKILL.md) or [integration-connectivity-generate](../integration-connectivity-generate/SKILL.md)).
30
+
31
+ ## Before starting
32
+
33
+ Confirm two things. If either is missing, ask before proceeding.
34
+
35
+ **1. Is this actually a Salesforce Connect use case?**
36
+
37
+ | The user wants to… | Right tool |
38
+ |---|---|
39
+ | Query external data live without copying it — read-only or read-write, appears as Salesforce records | **This skill** |
40
+ | Copy or sync data into Salesforce on a schedule | [platform-data-manage](../platform-data-manage/SKILL.md) |
41
+ | Connect to OData, GraphQL, DynamoDB, Athena, or Cross-Org | Standard adapter setup — no Apex needed, different flow |
42
+ | Connect to Snowflake via Salesforce's native Snowflake adapter (direct Snowflake protocol) | Built-in Snowflake adapter — no Apex needed |
43
+ | Access Snowflake (or any database) data via a REST or HTTP API | **This skill** — Snowflake REST endpoint → custom Apex adapter |
44
+ | Call an external API from Apex or Flow logic | [platform-apex-generate](../platform-apex-generate/SKILL.md) or [integration-connectivity-generate](../integration-connectivity-generate/SKILL.md) |
45
+ | Expose Salesforce data to an external system | [integration-connectivity-generate](../integration-connectivity-generate/SKILL.md) |
46
+ | Receive real-time pushed data or subscribe to external events | Not Salesforce Connect — Connect is pull-only. Use Platform Events or Change Data Capture instead |
47
+ | Sync or copy data for analytics or bulk processing | Data Cloud or ETL — Connect is zero-copy virtualization only |
48
+
49
+ If the user has a standard adapter available, tell them — writing a custom adapter when a standard one fits is unnecessary work.
50
+
51
+ **2. Do they have a Salesforce Connect license?**
52
+
53
+ A custom adapter requires a Salesforce Connect license (one license per External Data Source). Without it, the External Data Source menu won't show the Apex option. If the user doesn't have one, tell them before going further.
54
+
55
+ ---
56
+
57
+ ## Default org context (when running locally)
58
+
59
+ If the user does not specify an org alias, use `demo-org`.
60
+ If the user does not specify an SFDX project path, use `~/salesforce-connect-apex-skill/sfconnect-demo/`.
61
+ These are the defaults for local testing — always override if the user specifies their own.
62
+
63
+ ---
64
+
65
+ ## Collect inputs before generating
66
+
67
+ Never generate code without these. If any are missing, ask:
68
+
69
+ | Input | Why it matters |
70
+ |---|---|
71
+ | API name and what it does | Names the classes and sets context for field mapping |
72
+ | Base URL | Becomes the Named Credential endpoint |
73
+ | Auth type | Determines Named Credential setup and `getAuthenticationMode()` |
74
+ | Key GET endpoint(s) + sample response | Defines the External Object schema — field names, types, nesting |
75
+ | Write support needed? | Determines whether to implement `upsertRows()` and `deleteRows()` |
76
+ | Org type (DE, scratch, sandbox) | Sets `apiVersion` in `.cls-meta.xml` |
77
+
78
+ If the user provides an OpenAPI spec, extract:
79
+ - All GET endpoints returning arrays → each becomes a `DataSource.Table`
80
+ - Response object properties → `DataSource.Column` entries
81
+ - `id` / `uuid` / primary key → map to `ExternalId`
82
+ - Property types → use the field type mapping table below
83
+
84
+ ---
85
+
86
+ ## What to build
87
+
88
+ Every custom Salesforce Connect adapter is exactly two Apex classes.
89
+
90
+ ### DataSource.Connection
91
+ Handles communication with the external API. Exact signatures:
92
+
93
+ ```apex
94
+ override global DataSource.TableResult query(DataSource.QueryContext context)
95
+ override global List<DataSource.TableResult> search(DataSource.SearchContext context)
96
+
97
+ // Write support — only if API supports it:
98
+ global override List<DataSource.UpsertResult> upsertRows(DataSource.UpsertContext context)
99
+ global override List<DataSource.DeleteResult> deleteRows(DataSource.DeleteContext context)
100
+ ```
101
+
102
+ Key distinction: `query()` always operates on **one** table (`QueryContext` has a single `TableSelection`). `search()` can operate on **multiple** tables simultaneously (`SearchContext` has multiple `TableSelection` instances) — handle each in a loop and return a result per table.
103
+
104
+ ### DataSource.Provider
105
+ Declares the adapter's capabilities and schema to Salesforce. Required methods:
106
+
107
+ - `getAuthenticationMode()` — return `ANONYMOUS` for public APIs; `NAMED_PRINCIPAL` or `PER_USER` for authenticated APIs
108
+ - `getCapabilities()` — declare `QUERY`, `SEARCH`; add `ROW_CREATE`, `ROW_UPDATE`, `ROW_DELETE` only if implementing writes
109
+ - `getConnection(ConnectionParams params)` — return `new YourConnection(params)`
110
+ - `sync()` — called when the user clicks "Validate and Sync" in Setup; returns `List<DataSource.Table>` defining the External Object schema and columns
111
+
112
+ The Provider class appears in Salesforce Setup as **`Custom-[ClassName]`** under the External Data Source type dropdown.
113
+
114
+ **Critical:** whenever you edit the Connection class, you must resave the Provider class too — even with no changes. Otherwise the adapter disappears from the Type picklist and existing External Object tabs break.
115
+
116
+ ---
117
+
118
+ ## Field type mapping
119
+
120
+ | External API type | Use this |
121
+ |---|---|
122
+ | string / text | `DataSource.DataType.TEXT_TYPE` |
123
+ | number / integer / decimal | `DataSource.DataType.NUMBER_TYPE` |
124
+ | boolean | `DataSource.DataType.BOOLEAN_TYPE` |
125
+ | date (ISO 8601) | `DataSource.DataType.DATE_TYPE` |
126
+ | datetime / timestamp | `DataSource.DataType.DATETIME_TYPE` |
127
+ | URL | `DataSource.DataType.URL_TYPE` |
128
+ | email | `DataSource.DataType.EMAIL_TYPE` |
129
+ | phone | `DataSource.DataType.PHONE_TYPE` |
130
+ | enum / picklist | `TEXT_TYPE` — map enum values as strings |
131
+ | nested object / JSON blob | Flatten to scalar fields, or `TEXT_TYPE` and parse in `query()` |
132
+ | array | Derive a count field (`NUMBER_TYPE`), or flatten first-element fields |
133
+ | string > 255 chars | Long text area — do not truncate; Salesforce maps it automatically |
134
+
135
+ Every `DataSource.Table` **must** include these columns:
136
+ ```apex
137
+ DataSource.Column.text('ExternalId', 255) // unique key from external system — REQUIRED
138
+ DataSource.Column.text('Name', 255) // display label shown in Salesforce UI — REQUIRED
139
+ DataSource.Column.url('DisplayUrl') // link to the record in the external system — recommended
140
+ ```
141
+ Missing `ExternalId` is the most common reason an adapter deploys but records don't appear.
142
+ `DisplayUrl` enables the clickable link icon in list views — populate it with the external record's URL.
143
+
144
+ ---
145
+
146
+ ## Scenarios
147
+
148
+ Four scenarios: (1) public read-only, (2) authenticated API key/OAuth, (3) read-write with upsert/delete, (4) paginated API. Full code patterns for each are in [`references/scenarios.md`](references/scenarios.md).
149
+
150
+ **Key differences by scenario:**
151
+
152
+ | Scenario | Auth mode | Extra capabilities | Named Credential |
153
+ |----------|-----------|-------------------|-----------------|
154
+ | Public read-only | `ANONYMOUS` | `QUERY`, `SEARCH` | Deploy as metadata |
155
+ | Authenticated | `NAMED_PRINCIPAL` or `PER_USER` | `QUERY`, `SEARCH` | Create manually in Setup — never deploy credentials as metadata |
156
+ | Read-write | `ANONYMOUS` or auth | Add `ROW_CREATE`, `ROW_UPDATE`, `ROW_DELETE` | Per above |
157
+ | Paginated | Any | Any | Use `context.tableSelection.numberOfRows` (default 500 if null); no automatic `queryMore` |
158
+
159
+ ---
160
+
161
+ ## How to verify the adapter is working
162
+
163
+ ### Option 1 — SOQL via sf CLI (fastest, no UI needed)
164
+ ```bash
165
+ sf data query \
166
+ --query "SELECT ExternalId, Name__c FROM [YourObject]__x LIMIT 5" \
167
+ --target-org [org-alias]
168
+ ```
169
+ If rows come back, the adapter is working. If 0 rows, check the troubleshooting steps below.
170
+
171
+ ### Option 2 — Visualforce page (best for demos, works on any org)
172
+
173
+ Deploy a Visualforce page + Apex controller that queries `[Object]__x` and renders rows in an `apex:pageBlockTable`. Open at `[orgUrl]/apex/[PageName]`. More reliable than list views for testing — bypasses tab requirements, deployment status, and filter issues. See [`references/scenarios.md`](references/scenarios.md) for the standard template.
174
+
175
+ ### Option 3 — List view (standard UI, but requires extra steps)
176
+
177
+ For the list view to show records, all four of these must be true:
178
+ 1. External Object Deployment Status = **Deployed** (Object Manager → Edit)
179
+ 2. A tab exists for the External Object (Setup → Tabs → Custom Object Tabs → New)
180
+ 3. List view filter is set to **All** (not "Recently Viewed")
181
+ 4. Remote Site Setting exists for the external API URL
182
+
183
+ ### Troubleshooting: 0 records with no error
184
+
185
+ | Symptom | Cause | Fix |
186
+ |---------|-------|-----|
187
+ | SOQL returns 0 | Remote Site Setting missing | Setup → Remote Site Settings → New |
188
+ | SOQL returns 0 | Named Credential not found | Setup → Named Credentials → confirm `callout:` name matches exactly |
189
+ | SOQL returns 0 | Org proxy blocks external URLs | Use loopback pattern or switch to an external DE org |
190
+ | List view shows 0 | Deployment Status = In Development | Object Manager → [Object]__x → Edit → Deployed |
191
+ | List view shows 0 | Filter is "Recently Viewed" | Change filter to "All" |
192
+ | App Launcher shows nothing | No tab created | Setup → Tabs → Custom Object Tabs → New |
193
+
194
+ ---
195
+
196
+ ## What the agent deploys vs. what the developer does manually
197
+
198
+ ### Agent deploys (one `sf project deploy start` command)
199
+
200
+ | File | Notes |
201
+ |---|---|
202
+ | `classes/[API]DataSourceConnection.cls` + meta | Always |
203
+ | `classes/[API]DataSourceProvider.cls` + meta | Always |
204
+ | `namedCredentials/[API].namedCredential-meta.xml` | **Public APIs only** — skip for any API requiring credentials |
205
+
206
+ **Do NOT generate `externalDataSources/[API].externalDataSource-meta.xml`.** The External Data Source must be registered manually in Setup after deploying the Apex classes. The `sf project deploy start` command cannot deploy custom Apex External Data Sources — the sf CLI will error with "Could not infer a metadata type." Tell the user to go to Setup → External Data Sources → New after deployment.
207
+
208
+ Correct NamedCredential XML format (no `<name>` element — the API name comes from the filename):
209
+ ```xml
210
+ <?xml version="1.0" encoding="UTF-8"?>
211
+ <NamedCredential xmlns="http://soap.sforce.com/2006/04/metadata">
212
+ <label>My API</label>
213
+ <endpoint>https://api.example.com</endpoint>
214
+ <allowMergeFieldsInBody>false</allowMergeFieldsInBody>
215
+ <allowMergeFieldsInHeader>false</allowMergeFieldsInHeader>
216
+ <generateAuthorizationHeader>false</generateAuthorizationHeader>
217
+ <principalType>Anonymous</principalType>
218
+ <protocol>NoAuthentication</protocol>
219
+ </NamedCredential>
220
+ ```
221
+
222
+ Deploy command:
223
+ ```bash
224
+ sf project deploy start \
225
+ --source-dir force-app/main/default/ \
226
+ --target-org [org-alias]
227
+ ```
228
+
229
+ ### Developer does manually (always — no metadata equivalent exists)
230
+
231
+ **Validate and Sync** triggers a live call to the external API to discover its schema and create External Object definitions. This cannot be scripted.
232
+
233
+ ```text
234
+ Setup → External Data Sources → [your data source] → Validate and Sync
235
+ Check the box next to each External Object → Sync
236
+ App Launcher → search [External Object name] → confirm records appear
237
+ ```
238
+
239
+ Always end with: "Deployment complete. One step left: open the External Data Source in Salesforce Setup and click Validate and Sync."
240
+
241
+ ---
242
+
243
+ ## Error handling rules
244
+
245
+ Never let an exception propagate uncaught out of `query()` — Salesforce shows a generic error to the user with no context.
246
+
247
+ | Situation | Handle it by |
248
+ |---|---|
249
+ | HTTP 401 | `throw new DataSource.OAuthTokenExpiredException()` |
250
+ | HTTP 429 / rate limit | Return empty rows; log via `System.debug()` |
251
+ | HTTP 500 or network error | Return empty rows; do not rethrow |
252
+ | Null field in response | `record.get('field') != null ? (String) record.get('field') : ''` |
253
+ | Nested JSON that won't flatten | Return raw JSON string as a TEXT_TYPE field rather than failing the whole query |
254
+
255
+ ---
256
+
257
+ ## Governor limits
258
+
259
+ - Max 100 HTTP callouts per transaction — each `query()` call is one transaction
260
+ - Heap limit 6 MB (synchronous) — don't deserialize massive payloads; use server-side pagination
261
+ - CPU limit 10 seconds — avoid nested loops over large response arrays
262
+
263
+ ---
264
+
265
+ ## Setup prerequisites — in this exact order
266
+
267
+ ### 1. Deploy Apex classes first
268
+ The `Salesforce Connect: Custom (Developed with Apex)` type only appears in the External Data Source type dropdown **after** at least one `DataSource.Provider` subclass is deployed in the org.
269
+
270
+ This is not a permissions issue. It is a dependency — Salesforce discovers available Provider classes at runtime. No deployed Provider = no option in the dropdown.
271
+
272
+ **Correct sequence — always:**
273
+ 1. Deploy Apex classes first (`sf project deploy start`)
274
+ 2. Then go to Setup → External Data Sources → New → the Custom Apex type will appear
275
+
276
+ If the user says "I don't see the Custom Apex option in the dropdown", the answer is: deploy the classes first, then come back to Setup.
277
+
278
+ ### 2. Add Remote Site Setting before testing
279
+
280
+ The external API's base URL must be whitelisted or callouts fail silently — `query()` returns empty rows with no exception, no error message. Deploy as metadata or add at Setup → Remote Site Settings → New.
281
+
282
+ ### 3. After Validate and Sync — set Deployment Status to Deployed
283
+
284
+ After Validate and Sync, Salesforce creates the External Object with status **"In Development"**. Records return 0 results in list views and SOQL until this is changed. No error is shown — another silent failure.
285
+
286
+ ```text
287
+ Setup → Object Manager → [YourObject]__x → Edit
288
+ Deployment Status → Deployed → Save
289
+ ```
290
+
291
+ Always tell the user this step after Validate and Sync completes.
292
+
293
+ ### 4. Create a tab to surface the External Object in App Launcher
294
+
295
+ External Objects are invisible in the UI without a tab. Create one at:
296
+ ```text
297
+ Setup → Tabs → Custom Object Tabs → New → select [YourObject]__x → Save
298
+ ```
299
+
300
+ ### Also required
301
+ - **Salesforce Connect license** — without it, all Connect adapter types including OData are hidden. If the user sees OData and Cross-Org in the dropdown, the license is already active.
302
+
303
+ ---
304
+
305
+ ## Anti-patterns
306
+
307
+ | Don't | Why | Do |
308
+ |---|---|---|
309
+ | Generate code without knowing the API shape | Wrong field types, wrong ExternalId mapping, broken adapter | Ask for API name, base URL, auth type, sample response first |
310
+ | Deploy ExternalDataSource as metadata | Not a deployable metadata type — sf CLI will error | Register the External Data Source manually in Setup after deploying the Apex classes |
311
+ | Use `upsertRow()` or `deleteRow()` (singular) | These methods don't exist — compile error | Use `upsertRows()` and `deleteRows()` (plural) |
312
+ | Put `sync()` only on Provider | On some API versions `sync()` must be on Connection — compiler will tell you | Implement `sync()` on Connection; remove from Provider if it errors |
313
+ | Hardcode the API URL in Apex | Credentials exposed in source, callout blocked | Always use `callout:NamedCredentialName` |
314
+ | Return a single `DataSource.TableResult` from `search()` | `search()` returns `List<DataSource.TableResult>` — compile error | Loop over `context.tableSelections` and return one result per table |
315
+ | Skip COUNT handling in `query()` | List views fire COUNT queries; without detection they return wrong results | Check `columnsSelected[0].aggregation == DataSource.QueryAggregation.COUNT` |
316
+ | Leave External Object in "In Development" | Records return 0 with no error — invisible to the user | After Validate and Sync: Object Manager → [Object]__x → Edit → Deployed |
317
+ | Skip the Remote Site Setting | Callout fires silently, returns empty rows, no exception | Deploy `remoteSiteSettings/[API].remoteSite-meta.xml` or add manually in Setup |
318
+
319
+ ---
320
+
321
+ ## Before shipping
322
+
323
+ Confirm: inputs collected (API name, URL, auth, sample response, write support) → code has `sync()` + `query()` + `search()` on Connection, `getCapabilities()` + `getConnection()` on Provider, `ExternalId` and `nameColumn` on every table, COUNT handling in `query()`, mock data for tests, `callout:` prefix on all endpoints → both `.cls-meta.xml` files generated → deploy command given → post-deploy steps communicated (Named Credential setup, Remote Site Setting, External Data Source registered, Validate and Sync, Deployment Status → Deployed, tab created).
324
+
325
+ ---
326
+
327
+ ## Reference examples
328
+
329
+ See [`references/official-examples.md`](references/official-examples.md) for annotated study of the official Salesforce Connect adapter examples — GitHub Issues (full DML, picklist, cross-table relationships), Google Drive (OAuth + test mock), Google Books (pagination), StackOverflow (multiple tables), and Loopback (filter translation). Read before generating for a new user.
330
+
331
+ ---
332
+
333
+ ## Project setup — if the developer has no SFDX project yet
334
+
335
+ Before deploying, they need a project structure. If one doesn't exist, generate it first:
336
+
337
+ ```bash
338
+ sf project generate --name my-adapter --output-dir .
339
+ cd my-adapter
340
+ ```
341
+
342
+ This creates `force-app/main/default/classes/` and the required `sfdx-project.json`. All generated files go into this structure. The developer does not need VS Code, Agentforce Vibes, or any Salesforce IDE — just `sf` CLI installed and an org authenticated via `sf org login web --alias my-org`.
343
+
344
+ This skill works with **any coding agent** that can read a context file — Claude Code, Cursor, Windsurf, GitHub Copilot, or any agent with the SKILL.md loaded. No Salesforce MCP server, no Agentforce Vibes, no internal Salesforce tooling required.
345
+
346
+ ---
347
+
348
+ ## Output format
349
+
350
+ Generate files in this order, then give the deploy command:
351
+
352
+ 1. `force-app/main/default/classes/[API]DataSourceConnection.cls`
353
+ 2. `force-app/main/default/classes/[API]DataSourceProvider.cls`
354
+ 3. `force-app/main/default/classes/[API]DataSourceConnection.cls-meta.xml`
355
+ 4. `force-app/main/default/classes/[API]DataSourceProvider.cls-meta.xml`
356
+ 5. `force-app/main/default/namedCredentials/[API].namedCredential-meta.xml` — public APIs only
357
+
358
+ One-line comment at top of each Apex class: `// Salesforce Connect custom adapter for [API name]`
359
+ No other inline comments unless a logic choice is non-obvious.
@@ -0,0 +1,69 @@
1
+ # Official Salesforce Connect Adapter Examples
2
+
3
+ Study these before generating code for a user. Each example demonstrates distinct patterns — don't generate from memory alone.
4
+
5
+ ## GitHub Issues adapter — read this one first
6
+
7
+ The most complete example, built by the Salesforce Connect team as the definitive reference. It is the only official example with:
8
+ - Full DML: create, update, delete (`upsertRows` + `deleteRows`)
9
+ - Date fields and picklist / multi-picklist fields
10
+ - Two related external object tables (Issues + Comments) with cross-table relationships
11
+ - `DataSource.Column.externalLookup()` and `DataSource.Column.indirectLookup()`
12
+ - `DataSource.QueryUtils.process(context, rows)` — handles ORDER BY and LIMIT automatically; use this instead of manual sorting
13
+
14
+ Read it: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_connector_example_github_issues.htm
15
+
16
+ Key patterns to bring forward:
17
+
18
+ ```apex
19
+ // Let QueryUtils handle sorting and limiting — don't do it manually
20
+ return DataSource.TableResult.get(context,
21
+ DataSource.QueryUtils.process(context, rows));
22
+
23
+ // Cross-object relationship to another external object
24
+ DataSource.Column.externalLookup('issue_number', 'GithubIssues__x')
25
+
26
+ // Indirect lookup — link external object to a standard Salesforce object
27
+ DataSource.Column.indirectLookup('repository_url', 'Product2', 'Repository__c')
28
+
29
+ // Picklist column
30
+ DataSource.Column.picklist('State', new List<String>{'Open', 'Closed'})
31
+ ```
32
+
33
+ ## Other official examples — each demonstrates one specific feature
34
+
35
+ | Example | The one thing it's best for | Unique pattern |
36
+ |---------|----------------------------|----------------|
37
+ | **GitHub (users)** | Indirect lookup to a standard object | `DataSource.Column.indirectLookup('login', 'Contact', 'github_username__c')` — links external records to Contact via a custom external ID field |
38
+ | **Google Drive** | OAuth per-user auth + test mock pattern | `System.Test.isRunningTest()` returns static `mockResponse` to avoid real callouts in tests; `'Authorization', 'Bearer '+ connectionInfo.oauthToken` for OAuth |
39
+ | **Google Books** | Pagination against an API with a hard page-size cap | Explicit loop accumulating batches: `data.addAll(getData(url + startIndex))` incrementing offset by 40; `column.sortable = false` for non-sortable fields |
40
+ | **StackOverflow** | Multiple tables with external lookup between them | `DataSource.Column.externalLookup('owner_id', 'stackoverflowUser__x')` linking child posts to parent user external object |
41
+ | **Loopback** | Filter translation from `DataSource.Filter` to SOQL | `getSoqlFilter()` recursively maps all `FilterType` values (EQUALS, LESS_THAN, STARTS_WITH, AND_, OR_, NOT_ etc.) to SOQL operators — use this when the user's API supports server-side filtering |
42
+ | **GitHub Issues** | Full DML + picklist + date + two related tables | See primary reference above |
43
+
44
+ Base URL: `https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/`
45
+
46
+ ## Test mock pattern (from Google Drive)
47
+
48
+ Use this in all generated adapters to make them testable:
49
+
50
+ ```apex
51
+ if (System.Test.isRunningTest()) {
52
+ return mockResponse; // return static test data
53
+ }
54
+ Http http = new Http();
55
+ // ... real callout
56
+ ```
57
+
58
+ ## Filter translation pattern (from Loopback)
59
+
60
+ Use this when pushing WHERE clause conditions to the external API:
61
+
62
+ ```apex
63
+ // Access filter from query context
64
+ DataSource.Filter filter = context.tableSelection.filter;
65
+ // filter.type is one of: EQUALS, NOT_EQUALS, LESS_THAN, GREATER_THAN,
66
+ // LESS_THAN_OR_EQUAL_TO, GREATER_THAN_OR_EQUAL_TO, STARTS_WITH, ENDS_WITH,
67
+ // LIKE_, AND_, OR_, NOT_
68
+ // filter.columnName, filter.columnValue, filter.subfilters (for compound)
69
+ ```
@@ -0,0 +1,187 @@
1
+ # Adapter Scenarios — Code Patterns
2
+
3
+ ## Scenario 1 — Public REST API, read-only
4
+
5
+ **What to generate:**
6
+ - `[API]DataSourceConnection.cls` — `query()` and `search()`, no upsert/delete
7
+ - `[API]DataSourceProvider.cls` — `ANONYMOUS` auth, `QUERY` + `SEARCH` capabilities
8
+ - `[API].namedCredential-meta.xml` — `NoAuthentication`, anonymous principal
9
+
10
+ Do NOT generate `externalDataSources/[API].externalDataSource-meta.xml` — register the External Data Source manually in Setup after deploying the Apex classes.
11
+
12
+ **search() pattern** — must return `List<DataSource.TableResult>`, one result per table:
13
+ ```apex
14
+ override global List<DataSource.TableResult> search(DataSource.SearchContext context) {
15
+ List<DataSource.TableResult> results = new List<DataSource.TableResult>();
16
+ for (DataSource.TableSelection tableSelection : context.tableSelections) {
17
+ results.add(queryTable(tableSelection));
18
+ }
19
+ return results;
20
+ }
21
+ ```
22
+
23
+ **query() pattern:**
24
+ ```apex
25
+ // Handle COUNT() — return count without fetching all rows
26
+ if (!context.tableSelection.columnsSelected.isEmpty() &&
27
+ context.tableSelection.columnsSelected[0].aggregation == DataSource.QueryAggregation.COUNT) {
28
+ List<Map<String, Object>> countRow = new List<Map<String, Object>>();
29
+ countRow.add(new Map<String, Object>{ 'count' => 0 }); // replace 0 with real count
30
+ return DataSource.TableResult.get(context, countRow);
31
+ }
32
+
33
+ Http http = new Http();
34
+ HttpRequest req = new HttpRequest();
35
+ Integer pageSize = context.tableSelection.numberOfRows != null
36
+ ? context.tableSelection.numberOfRows : 500;
37
+ req.setEndpoint('callout:YourNamedCredential/path?limit=' + pageSize);
38
+ req.setMethod('GET');
39
+ req.setTimeout(10000);
40
+ HttpResponse res = http.send(req);
41
+
42
+ if (res.getStatusCode() == 200) {
43
+ List<Object> items = (List<Object>) JSON.deserializeUntyped(res.getBody());
44
+ List<Map<String, Object>> rows = new List<Map<String, Object>>();
45
+ for (Object item : items) {
46
+ Map<String, Object> record = (Map<String, Object>) item;
47
+ Map<String, Object> row = new Map<String, Object>();
48
+ row.put('ExternalId', (String) record.get('id'));
49
+ row.put('Name', (String) record.get('name'));
50
+ rows.add(row);
51
+ }
52
+ return DataSource.TableResult.get(context, rows);
53
+ }
54
+ return DataSource.TableResult.get(context, new List<Map<String, Object>>());
55
+ ```
56
+
57
+ ## Scenario 2 — Authenticated API (API key or OAuth)
58
+
59
+ **Difference from Scenario 1:** The Named Credential cannot be deployed as metadata — credentials must never live in source files. Tell the user:
60
+
61
+ > "Before deploying, create the Named Credential manually in Setup. Go to Setup → Named Credentials → New Legacy, set the URL, and enter your API key or OAuth credentials there. Then run the deploy command — skip the `.namedCredential-meta.xml` file."
62
+
63
+ `getAuthenticationMode()` returns:
64
+ - `NAMED_PRINCIPAL` — all users share one credential (most common for API keys)
65
+ - `PER_USER` — each Salesforce user authenticates separately (OAuth per-user)
66
+
67
+ The API key is passed via a request header in `query()`:
68
+ ```apex
69
+ req.setHeader('Authorization', 'Bearer {!$Credential.OAuthToken}');
70
+ // or for API key:
71
+ req.setHeader('X-API-Key', '{!$Credential.Password}');
72
+ ```
73
+
74
+ ## Scenario 3 — Read-write adapter
75
+
76
+ Add to `getCapabilities()`:
77
+ ```apex
78
+ DataSource.Capability.ROW_CREATE,
79
+ DataSource.Capability.ROW_UPDATE,
80
+ DataSource.Capability.ROW_DELETE
81
+ ```
82
+
83
+ `upsertRows()` pattern — note plural, returns a List:
84
+ ```apex
85
+ global override List<DataSource.UpsertResult> upsertRows(DataSource.UpsertContext context) {
86
+ List<DataSource.UpsertResult> results = new List<DataSource.UpsertResult>();
87
+ for (Map<String, Object> record : context.rows) {
88
+ String externalId = (String) record.get('ExternalId');
89
+ String method = (externalId != null) ? 'PATCH' : 'POST';
90
+ String path = (externalId != null) ? '/items/' + externalId : '/items';
91
+ // build request, call API
92
+ results.add(DataSource.UpsertResult.success(externalId));
93
+ }
94
+ return results;
95
+ }
96
+ ```
97
+
98
+ ## Scenario 4 — Paginated API
99
+
100
+ There is **no automatic paging** in the Apex Connector Framework. Two options:
101
+
102
+ - **Server-driven paging** — pass `numberOfRows` and an offset/cursor to the API, return one page
103
+ - **Client-driven paging** — fetch all records and let Salesforce slice them (risky for large datasets due to heap limit)
104
+
105
+ Default batch size when `numberOfRows` is null: **500 records**.
106
+
107
+ ```apex
108
+ Integer pageSize = context.tableSelection.numberOfRows != null
109
+ ? context.tableSelection.numberOfRows : 500;
110
+ req.setEndpoint('callout:YourNamedCredential/items?limit=' + pageSize + '&offset=0');
111
+ ```
112
+
113
+ There is no automatic `queryMore`. For large datasets, implement batched iteration explicitly and stay under the 100 callout limit per transaction.
114
+
115
+ ## Visualforce verification template
116
+
117
+ Use this to test the adapter without creating a tab, changing Deployment Status, or configuring a list view. Works on any org type.
118
+
119
+ **Apex controller:**
120
+ ```apex
121
+ public class [Object]XController {
122
+ public List<[Object]__x> records { get; set; }
123
+ public [Object]XController() {
124
+ records = Database.query('SELECT ExternalId, Name__c FROM [Object]__x LIMIT 50');
125
+ }
126
+ }
127
+ ```
128
+
129
+ **Visualforce page:**
130
+ ```xml
131
+ <apex:page controller="[Object]XController" title="External Object Records">
132
+ <apex:slds />
133
+ <div class="slds-scope">
134
+ <div class="slds-page-header">
135
+ <h1 class="slds-page-header__title">[Object] Records</h1>
136
+ <p class="slds-text-body_small">Live data via Salesforce Connect — zero copy, no ETL</p>
137
+ </div>
138
+ <apex:pageBlock>
139
+ <apex:pageBlockTable value="{!records}" var="r">
140
+ <apex:column value="{!r.Name__c}" headerValue="Name"/>
141
+ <apex:column value="{!r.ExternalId}" headerValue="External ID"/>
142
+ </apex:pageBlockTable>
143
+ </apex:pageBlock>
144
+ </div>
145
+ </apex:page>
146
+ ```
147
+
148
+ Deploy both files with `sf project deploy start`, then open at `[orgUrl]/apex/[PageName]`. Use dynamic SOQL (`Database.query(...)`) rather than static SOQL — static SOQL against External Objects fails in test context.
149
+
150
+ ## Scenario 5 — Loopback adapter (calls back into the same Salesforce org)
151
+
152
+ Use when the adapter queries the org's own Salesforce REST API and surfaces results as External Objects — no external system involved.
153
+
154
+ **Key pattern:** The Named Credential injects the current user's session token automatically. No hardcoded credentials.
155
+
156
+ **Named Credential — safe to deploy as metadata (no credentials in source):**
157
+ ```xml
158
+ <generateAuthorizationHeader>true</generateAuthorizationHeader>
159
+ <principalType>NamedUser</principalType>
160
+ <protocol>NoAuthentication</protocol>
161
+ ```
162
+ `generateAuthorizationHeader=true` injects `Authorization: Bearer <current session token>` on every callout. This is what makes the loopback work — no credential entry required.
163
+
164
+ **Provider — use `NAMED_PRINCIPAL` (not `ANONYMOUS`):**
165
+ ```apex
166
+ override global List<DataSource.AuthenticationCapability> getAuthenticationCapabilities() {
167
+ return new List<DataSource.AuthenticationCapability>{
168
+ DataSource.AuthenticationCapability.NAMED_PRINCIPAL
169
+ };
170
+ }
171
+ ```
172
+
173
+ **Connection — callout to the org's own REST API:**
174
+ ```apex
175
+ req.setEndpoint('callout:LoopbackOrg/services/data/v66.0/query?q=' +
176
+ EncodingUtil.urlEncode('SELECT Id, Name FROM Account LIMIT 500', 'UTF-8'));
177
+ req.setMethod('GET');
178
+ req.setTimeout(10000);
179
+ // No Authorization header set — Named Credential injects it automatically
180
+ HttpResponse res = new Http().send(req);
181
+
182
+ // REST /query response has a 'records' array, not the top-level array pattern
183
+ Map<String, Object> payload = (Map<String, Object>) JSON.deserializeUntyped(res.getBody());
184
+ List<Object> records = (List<Object>) payload.get('records');
185
+ ```
186
+
187
+ **Test mock** — the session token is unavailable in test context; always gate on `System.Test.isRunningTest()` and return static row data instead of making callouts.