@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
@@ -16,13 +16,28 @@ printf '%s\n' "$*" >> "$SF_STUB_LOG"
16
16
 
17
17
  case "$*" in
18
18
  "config get target-org --json")
19
- printf '%s\n' '{"status":0,"result":[{"value":"default-org"}]}'
19
+ if [ "${SF_TEST_NO_DEFAULT:-0}" = "1" ]; then
20
+ printf '%s\n' '{"status":0,"result":[]}'
21
+ else
22
+ printf '%s\n' '{"status":0,"result":[{"value":"default-org"}]}'
23
+ fi
20
24
  ;;
21
25
  "config get target-dev-hub --json")
22
- printf '%s\n' '{"status":0,"result":[{"value":"default-devhub"}]}'
26
+ if [ "${SF_TEST_NO_DEFAULT:-0}" = "1" ]; then
27
+ printf '%s\n' '{"status":0,"result":[]}'
28
+ else
29
+ printf '%s\n' '{"status":0,"result":[{"value":"default-devhub"}]}'
30
+ fi
23
31
  ;;
24
- org\ login\ web*)
25
- printf '%s\n' '{"status":0,"result":{"username":"logged-in@example.com"}}'
32
+ "org list --json")
33
+ if [ "${SF_TEST_HANG:-0}" = "1" ]; then
34
+ sleep 60
35
+ fi
36
+ if [ "${SF_TEST_NO_ORGS:-0}" = "1" ]; then
37
+ printf '%s\n' '{"status":0,"result":{"nonScratchOrgs":[],"scratchOrgs":[]}}'
38
+ else
39
+ printf '%s\n' '{"status":0,"result":{"nonScratchOrgs":[{"alias":"my-org","username":"a@b.com","connectedStatus":"Connected","isDefaultUsername":true}],"scratchOrgs":[]}}'
40
+ fi
26
41
  ;;
27
42
  "data query --query SELECT COUNT() FROM ScratchOrgInfo"*)
28
43
  if [ "${SF_TEST_DEVHUB_ENABLED:-0}" = "1" ]; then
@@ -32,12 +47,18 @@ case "$*" in
32
47
  exit 1
33
48
  fi
34
49
  ;;
50
+ "data query --query SELECT OrganizationType, IsSandbox FROM Organization"*)
51
+ printf '%s\n' "{\"status\":0,\"result\":{\"records\":[{\"OrganizationType\":\"Developer Edition\",\"IsSandbox\":${SF_TEST_SANDBOX:-false}}]}}"
52
+ ;;
53
+ "api request rest /services/data/"*"/tooling/sobjects/DevHubSettings/DevHub"*)
54
+ printf '%s\n' '{"Id":"DevHub","FullName":"DevHub","Metadata":{"enableScratchOrgManagementPref":true,"enablePackaging2":false,"enableScratchOrgSnapshotPref":true,"enableShapeExportPref":false}}'
55
+ ;;
35
56
  "org list limits"*)
36
57
  if [ "${SF_TEST_LIMITS_FAIL:-0}" = "1" ]; then
37
58
  printf '%s\n' '{"status":1,"message":"limits unavailable"}'
38
59
  exit 1
39
60
  fi
40
- printf '%s\n' '{"status":0,"result":[{"name":"ActiveScratchOrgs","remaining":3,"max":3},{"name":"DailyScratchOrgs","remaining":6,"max":6}]}'
61
+ printf '%s\n' "{\"status\":0,\"result\":[{\"name\":\"ActiveScratchOrgs\",\"remaining\":${SF_TEST_ACTIVE_REM:-3},\"max\":${SF_TEST_ACTIVE_MAX:-3}},{\"name\":\"DailyScratchOrgs\",\"remaining\":${SF_TEST_DAILY_REM:-6},\"max\":${SF_TEST_DAILY_MAX:-6}}]}"
41
62
  ;;
42
63
  "org display"*)
43
64
  printf '%s\n' '{"status":0,"result":{"id":"00D000000000001","username":"admin@example.com","instanceUrl":"https://example.my.salesforce.com"}}'
@@ -79,7 +100,7 @@ check "reject disabling the master switch" 2 "cannot be set to false" \
79
100
  "$SCRIPT" explicit-org --pref enableScratchOrgManagementPref=false
80
101
 
81
102
  check "warn for scratch-management apply" 0 "IRREVERSIBLE" \
82
- "$SCRIPT" explicit-org --scratch-management --apply
103
+ env SF_TEST_DEVHUB_ENABLED=1 "$SCRIPT" explicit-org --scratch-management --apply
83
104
 
84
105
  check "propagate status allocation failure" 1 "Could not read org limits" \
85
106
  env SF_TEST_DEVHUB_ENABLED=1 SF_TEST_LIMITS_FAIL=1 "$SCRIPT" explicit-org
@@ -87,23 +108,87 @@ check "propagate status allocation failure" 1 "Could not read org limits" \
87
108
  check "require explicit target for apply" 2 "explicit org" \
88
109
  "$SCRIPT" --enable --apply
89
110
 
90
- check "reject non-Salesforce login origin" 2 "Salesforce hostname" \
91
- "$SCRIPT" explicit-org --instance-url https://attacker.example --login
111
+ # --- new: read current DevHubSettings preferences ---
112
+ check "show-settings renders master pref ON" 0 "enableScratchOrgManagementPref" \
113
+ env SF_TEST_DEVHUB_ENABLED=1 "$SCRIPT" explicit-org --show-settings
114
+ check "show-settings renders packaging OFF" 0 "enablePackaging2 OFF" \
115
+ env SF_TEST_DEVHUB_ENABLED=1 "$SCRIPT" explicit-org --show-settings
92
116
 
93
- check "login-only exits after authentication" 0 "Authenticated" \
117
+ # --- new: pre-flight allocation thresholds ---
118
+ check "threshold WARN under 2 remaining" 0 "WARN" \
119
+ env SF_TEST_DEVHUB_ENABLED=1 SF_TEST_ACTIVE_REM=1 SF_TEST_ACTIVE_MAX=3 "$SCRIPT" explicit-org --allocation
120
+ check "threshold NOTE above 80 percent" 0 "usage at" \
121
+ env SF_TEST_DEVHUB_ENABLED=1 SF_TEST_ACTIVE_REM=0 SF_TEST_ACTIVE_MAX=3 "$SCRIPT" explicit-org --allocation
122
+
123
+ # --- new: sandbox refuses enablement, before any deploy ---
124
+ : > "$LOG_FILE"
125
+ sandbox_out="$(env SF_TEST_DEVHUB_ENABLED=0 SF_TEST_SANDBOX=true "$SCRIPT" explicit-org --scratch-management --apply 2>&1)"
126
+ sandbox_rc=$?
127
+ if [ "$sandbox_rc" -eq 1 ] && printf '%s' "$sandbox_out" | grep -qi "sandbox" && ! grep -Fq "project deploy start" "$LOG_FILE"; then
128
+ pass=$((pass + 1)); printf 'PASS: sandbox refuses enablement without deploying\n'
129
+ else
130
+ fail=$((fail + 1)); printf 'FAIL: sandbox refuses enablement (exit %s)\n%s\n' "$sandbox_rc" "$sandbox_out"
131
+ fi
132
+
133
+ # --- new: org discovery when no default is set ---
134
+ check "org discovery lists authenticated orgs" 2 "my-org" \
135
+ env SF_TEST_NO_DEFAULT=1 SF_TEST_DEVHUB_ENABLED=1 "$SCRIPT"
136
+
137
+ check "list-orgs mode lists authenticated orgs" 0 "my-org" \
138
+ "$SCRIPT" --list-orgs
139
+
140
+ # --- removed: login flags are now unknown options ---
141
+ check "login flag rejected" 2 "Unknown option" \
94
142
  "$SCRIPT" explicit-org --login
95
- if grep -Fq "data query" "$LOG_FILE"; then
96
- fail=$((fail + 1))
97
- printf 'FAIL: login-only queried org status\n'
143
+ check "instance-url flag rejected" 2 "Unknown option" \
144
+ "$SCRIPT" explicit-org --instance-url https://x.my.salesforce.com
145
+
146
+ # --- new: show-settings refuses when Dev Hub is OFF ---
147
+ check "show-settings refuses when Dev Hub off" 1 "no DevHubSettings to read" \
148
+ env SF_TEST_DEVHUB_ENABLED=0 "$SCRIPT" explicit-org --show-settings
149
+
150
+ # --- new: daily-limit NOTE threshold (only active was covered before) ---
151
+ check "threshold NOTE daily above 80 percent" 0 "Daily scratch org usage at" \
152
+ env SF_TEST_DEVHUB_ENABLED=1 SF_TEST_DAILY_REM=1 SF_TEST_DAILY_MAX=6 "$SCRIPT" explicit-org --allocation
153
+
154
+ # --- new: list-orgs with no authenticated orgs ---
155
+ check "list-orgs reports none authenticated" 0 "No orgs are authenticated" \
156
+ env SF_TEST_NO_ORGS=1 "$SCRIPT" --list-orgs
157
+
158
+ # A hung CLI must not hold the caller for the full stub sleep.
159
+ hang_start=$(date +%s)
160
+ hang_out="$(env SF_TEST_HANG=1 "$SCRIPT" --list-orgs 2>&1)"
161
+ hang_rc=$?
162
+ hang_elapsed=$(( $(date +%s) - hang_start ))
163
+ if [ "$hang_rc" -eq 1 ] && [ "$hang_elapsed" -lt 35 ] && printf '%s' "$hang_out" | grep -Fq "Could not list authenticated orgs"; then
164
+ pass=$((pass + 1)); printf 'PASS: list-orgs bounds a hung sf org list (%ss)\n' "$hang_elapsed"
98
165
  else
99
- pass=$((pass + 1))
100
- printf 'PASS: login-only skipped org status\n'
166
+ fail=$((fail + 1)); printf 'FAIL: list-orgs bounds a hung sf org list (exit %s, %ss)\n%s\n' "$hang_rc" "$hang_elapsed" "$hang_out"
101
167
  fi
102
168
 
169
+ # --- new: JSON fidelity for the added fields ---
170
+ check "status JSON reports edition" 0 "\"edition\": \"Developer Edition\"" \
171
+ env SF_TEST_DEVHUB_ENABLED=1 "$SCRIPT" explicit-org --json
172
+ check "status JSON reports isSandbox false (not null) for non-sandbox" 0 "\"isSandbox\": false" \
173
+ env SF_TEST_DEVHUB_ENABLED=1 SF_TEST_SANDBOX=false "$SCRIPT" explicit-org --json
174
+ check "status JSON reports isSandbox true for sandbox" 0 "\"isSandbox\": true" \
175
+ env SF_TEST_DEVHUB_ENABLED=1 SF_TEST_SANDBOX=true "$SCRIPT" explicit-org --json
176
+ check "allocation JSON emits warnings array near limit" 0 "\"warnings\"" \
177
+ env SF_TEST_DEVHUB_ENABLED=1 SF_TEST_ACTIVE_REM=1 SF_TEST_ACTIVE_MAX=3 "$SCRIPT" explicit-org --allocation --json
178
+ check "show-settings JSON emits settings map" 0 "enableScratchOrgSnapshotPref" \
179
+ env SF_TEST_DEVHUB_ENABLED=1 "$SCRIPT" explicit-org --show-settings --json
180
+ check "list-orgs JSON emits normalized array" 0 "\"isDefault\"" \
181
+ "$SCRIPT" --list-orgs --json
182
+
183
+ # --- new: a not-enabled sandbox is flagged as ineligible in status ---
184
+ check "status flags sandbox as unable to host Dev Hub" 0 "cannot host Dev Hub" \
185
+ env SF_TEST_DEVHUB_ENABLED=0 SF_TEST_SANDBOX=true "$SCRIPT" explicit-org
186
+
187
+ # --- safety: cleanup trap treats TMPDIR content as data ---
103
188
  unsafe_tmp="$WORK_DIR/unsafe'; touch $MARKER; #"
104
189
  mkdir -p "$unsafe_tmp"
105
190
  check "cleanup trap does not execute TMPDIR content" 0 "Dry run passed" \
106
- env TMPDIR="$unsafe_tmp" "$SCRIPT" explicit-org --packaging
191
+ env SF_TEST_DEVHUB_ENABLED=1 TMPDIR="$unsafe_tmp" "$SCRIPT" explicit-org --packaging
107
192
  if [ -e "$MARKER" ]; then
108
193
  fail=$((fail + 1))
109
194
  printf 'FAIL: cleanup trap executed TMPDIR content\n'
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: dx-packaging-convert-1gp-to-2gp-create
3
+ description: "Use this skill when users want to convert a managed-released 1GP package to a 2GP package with `sf package convert`, verify the converted package version and its code coverage, and optionally promote it to released. TRIGGER when: the user asks to convert a 1GP managed package to 2GP, create a converted 2GP package version from a released 1GP version, check whether a converted version passed code coverage, or troubleshoot an `sf package convert` failure. DO NOT TRIGGER for: migrating subscriber orgs from 1GP to 2GP, finalizing the irreversible move to 2GP development (use dx-packaging-move-to-2gp-migrate), creating or promoting native 2GP package versions that were not converted from 1GP, or enabling Dev Hub (use dx-org-devhub-configure)."
4
+ metadata:
5
+ relatedSkills:
6
+ - dx-org-devhub-configure
7
+ - dx-packaging-move-to-2gp-migrate
8
+ version: "1.0.0"
9
+ accessCheck: "UserPermissions.CreatePackaging"
10
+ cliTools:
11
+ - tool:
12
+ - "sf"
13
+ semver: ">=2.0.0"
14
+ domains:
15
+ - "Developer Experience"
16
+ ---
17
+
18
+
19
+ # Convert 1GP to 2GP
20
+
21
+ ## When to Use This Skill
22
+
23
+ Convert a managed-released 1GP package to 2GP with `sf package convert` when requested by an ISV. This workflow gathers and validates both Salesforce CLI org aliases, confirms the permanent Dev Hub association, runs conversion with `--code-coverage`, verifies the resulting 08c, 0Ho, 05i, and 04t records, and determines whether the converted beta version passed the code-coverage check required for promotion. After a successful conversion, it asks whether the customer wants to promote the verified version and, on an explicit yes, promotes and verifies it. It does not migrate subscriber orgs or finalize the irreversible Move-to-2GP development cutover.
24
+
25
+ ## Critical Constraints
26
+
27
+ **Preconditions:**
28
+
29
+ - The latest Salesforce CLI must be installed and the customer must be in a Salesforce DX project containing sfdx-project.json. (check: `SalesforceCliAndProjectAvailable`)
30
+ - The customer's Partner Business Org must have Dev Hub and second-generation managed packaging enabled, and its authenticated CLI alias must resolve successfully. (check: `DevHubOrgAuthenticated`)
31
+ - The 1GP packaging org must be authenticated with Salesforce CLI and its alias must resolve successfully. The namespace of the 1GP package must be linked to the selected Dev Hub. (check: `PackagingOrgAuthenticatedAndNamespaceLinked`)
32
+ - The source package must have at least one managed-released 1GP version. Source API-version eligibility is evaluated by the conversion command and is handled only if Salesforce returns that error. (check: `ManagedReleasedPackageVersionEligible`)
33
+ - The customer must choose either an installation key or installation-key bypass. Never ask the customer to paste an installation key into chat or store it in skill output. (check: `InstallationProtectionChoiceProvided`)
34
+
35
+ **Operational rules:**
36
+
37
+ - CONVERSATION RULE: ask exactly one question per turn and wait for the customer's answer before asking the next question. Never combine a confirmation, a command request, and a list of additional inputs in one message. When the customer must run a command, provide only that command and ask for its sanitized result; continue after they respond.
38
+ Start with collect-conversion-details and gather only the identity and package inputs sequentially: Dev Hub alias, 1GP packaging-org alias, 033 package ID, and package namespace. Do not ask about project, version mode, installation protection, wait time, definition file, seed metadata, unpackaged metadata, or apexTestAccess yet. Then run validate-salesforce-cli → validate-devhub-alias → validate-packaging-org-alias → validate-source-package → collect-conversion-options → validate-project-and-namespace → collect-conversion-settings → confirm-conversion-preflight → convert-package → verify-conversion-request → verify-code-coverage. After an explicit yes to the promotion question, continue to promote-converted-version → verify-promoted-version.
39
+ OPTION QUESTIONS: after identifying the package and released source version, ask every configurable option separately, exactly one question per turn. Show that question's default in brackets and accept either a specific answer or the word `default`. A `default` response applies only to the current question; never apply a bundle of defaults or skip later questions. Ask separately for: source version, DX project, installation protection, wait time, definition file changes, seed-metadata availability, unpackaged-metadata availability, and apexTestAccess permission sets. Ask for a seed-metadata directory path only when the customer says seed metadata exists, and for an unpackaged-metadata directory path only when the customer says packaged Apex tests need unpackaged metadata. The option defaults are latest released major.minor; create a new `<namespace>-conversion` project in the current working directory; installation-key bypass; wait 20 minutes; no changes to the project's default definition file; no seed metadata; no unpackaged metadata; and no apexTestAccess permission sets. Before creating a project, state the exact target path. Never silently reuse an existing project from an earlier conversation or run. The permanent Dev Hub association has no default and must be confirmed separately. Do not ask the customer which API version created the source 1GP version.
40
+ PROJECT DEFINITION FILE: create or validate the selected DX project before asking the remaining conversion-setting questions. Resolve and show the exact `<project-directory>/config/project-scratch-def.json` path and its current non-secret contents. Then ask: "Would you like to add or update anything in this definition file for conversion? [default: no changes]" Do not ask the customer to provide a definition-file path. Include `--definition-file` only when the customer confirms the file is required for conversion.
41
+ SEED METADATA: first ask: "Do you have seed metadata to include in the conversion? [default: no]" If the answer is no or `default`, omit `--seed-metadata` and continue. If the answer is yes, ask in the next turn for the exact seed-metadata directory path, validate it, and use that path.
42
+ UNPACKAGED METADATA: after the seed-metadata question, ask: "Do your packaged Apex tests need metadata that is not part of the package in order to run? For example, test-only Apex classes, custom objects or fields, or permission sets that must not ship in the package. [default: no]" If the answer is no or `default`, leave sfdx-project.json unchanged for unpackaged metadata and continue. If the answer is yes, ask in the next turn for the directory path relative to the DX project root, then confirm that the directory exists and contains source-format metadata. Explain the difference when the customer is unsure: seed metadata is deployed so the package metadata itself can deploy, while unpackaged metadata is deployed to the build org only so packaged Apex tests can run for code coverage, and it is never included in the converted package. There is no `sf package convert` flag for unpackaged metadata. Salesforce CLI reads `unpackagedMetadata.path` from the sfdx-project.json packageDirectories entry for this package, and only when `--code-coverage` is set, which this workflow always uses. That entry must have a `package` value that resolves through packageAliases to the converted package's 0Ho ID. On the first conversion, Salesforce CLI adds a packageAliases entry named after the 1GP package when it creates the converted package, so set `package` to the exact name Salesforce CLI uses for that alias; read it from the Dev Hub with `sf data query --use-tooling-api --target-org <devhub-alias> --query "SELECT Name FROM SubscriberPackage WHERE Id = '<033>'"`. On a later conversion, use the existing packageAliases entry or the 0Ho ID. The same `package` requirement applies to apexTestAccess. Show the customer the exact proposed change to that packageDirectories entry, for example `"package": "<package-name>", "unpackagedMetadata": { "path": "<directory>" }`, and update sfdx-project.json only after they confirm. Preserve every other setting in the file. If that entry already declares `package` or `unpackagedMetadata`, show the current values and ask whether to keep or change them instead of proposing a duplicate. When the customer also provides apexTestAccess permission sets, show both changes to the entry together in one proposal.
43
+ Treat the two aliases as different org roles. The Dev Hub alias owns the new converted Package2 and cannot be changed after the first conversion for this 1GP package. The packaging-org alias identifies the source 1GP DE org and is also required for supported org-shape and metadata troubleshooting. If an alias is missing, guide the customer through `sf org login web --alias <alias>` (add `--set-default-dev-hub` for the Dev Hub), then rerun the exact `sf org display` validation. Do not continue until the customer confirms the displayed org IDs match the intended organizations.
44
+ ALIAS DISCOVERY AND AUTHENTICATION: both orgs are required for conversion. Handle one org role at a time. Ask the customer for the packaging-org alias and Dev Hub alias if not already provided; never invent or select an alias. Run `sf org list --json` to check what is authenticated. If an alias is missing, give the customer the exact login command and wait: `sf org login web --alias <packaging-org-alias>` for the packaging org, and `sf org login web --alias <devhub-alias> --set-default-dev-hub` for the Dev Hub. For a nonstandard login domain, append a customer-provided `--instance-url <url>`. After login, require `sf org display --target-org <alias> --json`; show the alias, username, org ID, and instance URL and ask the customer to confirm the intended org. Never ask for or expose an access token, authorization URL, session ID, or credential file.
45
+ AUTHENTICATED TERMINAL: run org discovery, login, validation, package queries, conversion, and reporting in one CLI environment and operating-system user profile. The agent may run the displayed login command locally when browser OAuth is supported; otherwise the customer runs it and all remaining commands in their terminal. Never split validation and conversion across environments. Require a successful `sf org display --target-org <alias> --json` for each alias in the chosen environment. Immediately before conversion, require successful `sf org display` checks for both aliases in that same environment. When chat-local OAuth succeeded, run conversion in that chat-local environment. On the fallback path, present the conversion command with the instruction: "Run this in the same authenticated terminal where both org display checks succeeded." Do not describe an arbitrary new shell as authenticated merely because it can access the project.
46
+ Success requires all of the following: the conversion request reaches Status=Success; Package2Id, Package2VersionId, and SubscriberPackageVersionId are present; the converted version report shows ConvertedFromVersionId; and HasPassedCodeCoverageCheck is true. The converted version remains beta until the customer explicitly chooses promotion.
47
+ SUCCESS RESPONSE: give the customer a complete converted-package summary: source package name, namespace, 033 ID, source version and source 04t; Dev Hub alias and org ID; 08c request ID and status; Package2 name and 0Ho ID; Package2Version 05i ID; SubscriberPackageVersion 04t ID; converted version number; beta/released state; ConvertedFromVersionId; code-coverage percentage and HasPassedCodeCoverageCheck; metadata file count, total metadata size, and whether metadata was removed; build duration when available; installation URL; and any non-secret warnings. State explicitly that the converted version is still beta before promotion.
48
+ If and only if `HasPassedCodeCoverageCheck` is true, end the success response with exactly one question: "Would you like to promote this converted package version now?" If the customer says yes, run `sf package version promote` with the verified 04t and Dev Hub alias, then verify the same 04t reports `IsReleased=true`. Promotion is irreversible, so never infer consent. If the customer says no, leave the version beta. If coverage did not pass, do not offer promotion.
49
+ PROMOTION RESPONSE: after verified promotion, give the customer the complete package details again, including all conversion identifiers and source version details, the converted version number, code coverage, metadata counts and size, build duration, installation URL, and `Release state: Released`. State that promotion succeeded and do not ask the promotion question again.
50
+ CLI COMMAND CONTRACT — run from the validated Salesforce DX project. Validate each org separately with `sf org display --target-org <alias> --json`. Start conversion with `sf package convert --package <033> --target-dev-hub <devhub-alias> --code-coverage --wait 20 --json` plus exactly one of `--installation-key-bypass` or `--installation-key <enter-key-locally>`. Append `--patch-version <major.minor.patch>`, `--definition-file <path>`, or `--seed-metadata <directory>` only when the customer selected those options. Unpackaged metadata is never passed as a flag; it comes from the confirmed `unpackagedMetadata` setting in sfdx-project.json, so run conversion from the DX project root where that relative path resolves. Never place an installation key in chat, logs, generated files, or a command the agent executes on the customer's behalf.
51
+ If the convert command returns before completion, preserve its 08c ID and run `sf package version create report --package-create-request-id <08c> --target-dev-hub <devhub-alias> --json`; do not start a duplicate conversion. Once an 08c ID is available, use this report command immediately and then approximately every two minutes until the request reaches Success or Error. After every report, give the customer a short update containing the 08c ID, current status, and any non-secret status details returned by the CLI. Do not say that the same CLI process is still being monitored when request-report polling is available. After Status=Success, run `sf package version report --package <04t> --target-dev-hub <devhub-alias> --verbose --json` and require both a populated ConvertedFromVersionId and HasPassedCodeCoverageCheck=true.
52
+ TROUBLESHOOTING — do not proactively ask for or confirm the source package version's API version. If conversion returns an error that the selected 1GP version was created with an unsupported API version, tell the customer to upload a new managed-released 1GP version using API 57.0 or later, then retry conversion with that newly released version. For a RecordType dependency, declare the RecordType under object settings in a scratch-org definition file and retry with `--definition-file <path>`. For an org-shape error, run `sf org delete shape --target-org <packaging-org-alias>`, then `sf org create shape --target-org <packaging-org-alias>`, and retry once; recurring org-shape errors go to Salesforce Partner Support. For packaged Apex test or code-coverage errors, add required permission sets through `apexTestAccess` and the package name in sfdx-project.json, then retry. For a StandardValueSet or picklist-value error, retrieve the named StandardValueSet from the packaging org using the official Metadata API workflow, place only StandardValueSet metadata under the seed-metadata directory, and retry with `--seed-metadata <directory>`. When packaged Apex tests fail because test-only metadata that is not in the package is missing, configure unpackaged metadata as described above and retry. If the CLI reports that the un-packaged metadata directory does not exist, correct `unpackagedMetadata.path` so it is relative to the DX project root and retry from that root. If the CLI reports that unpackagedMetadata or apexTestAccess can't be resolved because the packageDirectories entry doesn't specify the package parameter, add `package` to that entry and retry. If it reports that the specified package isn't a valid package ID or package alias, set `package` to the packageAliases entry that maps to the converted 0Ho ID, or to the 0Ho ID itself, and retry; find the 0Ho ID with `sf package list --target-dev-hub <devhub-alias> --json`. If unpackaged metadata is configured but tests still fail as though it were missing, update Salesforce CLI, because older versions can ignore an unresolvable setting instead of reporting it. For unsupported metadata, report the metadata types named by the CLI; the customer must remove them from the source package or wait for managed 2GP support. For "namespace is not owned by the Dev Hub," stop and ask the customer to link the package namespace in Dev Hub Setup under Namespace Registries → Link Namespace. Revalidate both aliases in the same CLI environment, then retry conversion once. For authentication, project, or installation-protection errors, return to the matching validation step.
53
+ Retry conversion at most once after a documented remediation and prerequisite revalidation. For a timeout, poll the existing 08c request instead of converting again. When the CLI returns an internal Salesforce error identifier without a documented customer remediation, tell the customer that conversion failed with that identifier and that the failure could be intermittent. First confirm that no active 08c request exists, revalidate both aliases and the unchanged inputs, then retry the same conversion exactly once. If the retry returns the same identifier or message, stop and recommend a Salesforce Partner Support case. For any repeated or otherwise unclassified error, prepare a sanitized support bundle containing the CLI version, timestamp, exact redacted command, full sanitized output, 033/source-04t/08c identifiers, both org IDs and instance URLs, reproduction steps, relevant project configuration, and business impact. Never include installation keys, access tokens, session IDs, internal systems, or undocumented workarounds.
54
+
55
+ ## Verification Checklist
56
+
57
+ After every write operation, confirm the effect by re-reading state:
58
+
59
+ - After `convert-package`: call `verify-conversion-request`
60
+ - After `verify-conversion-request`: call `verify-code-coverage`
61
+ - After `promote-converted-version`: call `verify-promoted-version`
62
+
63
+ Read [Operations reference](references/conversion-operations.md) before executing this workflow. It contains the original operation definitions, dependencies, inputs, and verification instructions.
@@ -0,0 +1,252 @@
1
+ # Convert 1GP to 2GP Operations Reference
2
+
3
+ Operations grouped by purpose. Use these as the building blocks for the workflow in SKILL.md.
4
+
5
+ ## Summary
6
+
7
+ | Operation | Purpose | Status | Call | Depends on |
8
+ |-----------|---------|--------|------|------------|
9
+ | `collect-conversion-details` | validate | implemented | — | — |
10
+ | `validate-salesforce-cli` | validate | implemented | — | `collect-conversion-details` |
11
+ | `validate-devhub-alias` | validate | implemented | — | `validate-salesforce-cli` |
12
+ | `validate-packaging-org-alias` | validate | implemented | — | `validate-devhub-alias` |
13
+ | `validate-source-package` | validate | implemented | — | `validate-packaging-org-alias` |
14
+ | `collect-conversion-options` | validate | implemented | — | `validate-source-package` |
15
+ | `validate-project-and-namespace` | validate | implemented | — | `collect-conversion-options` |
16
+ | `collect-conversion-settings` | validate | implemented | — | `validate-project-and-namespace` |
17
+ | `confirm-conversion-preflight` | validate | implemented | — | `collect-conversion-settings` |
18
+ | `convert-package` | write | implemented | — | `confirm-conversion-preflight` |
19
+ | `verify-conversion-request` | verify | implemented | — | `convert-package` |
20
+ | `verify-code-coverage` | verify | implemented | — | `verify-conversion-request` |
21
+ | `promote-converted-version` | write | implemented | — | `verify-code-coverage` |
22
+ | `verify-promoted-version` | verify | implemented | — | `promote-converted-version` |
23
+ | `prepare-support-escalation` | validate | implemented | — | `convert-package` |
24
+
25
+ ## Dependency graph
26
+
27
+ ```mermaid
28
+ graph TD
29
+ collect_conversion_details["collect-conversion-details (validate)"]
30
+ validate_salesforce_cli["validate-salesforce-cli (validate)"]
31
+ validate_devhub_alias["validate-devhub-alias (validate)"]
32
+ validate_packaging_org_alias["validate-packaging-org-alias (validate)"]
33
+ validate_source_package["validate-source-package (validate)"]
34
+ collect_conversion_options["collect-conversion-options (validate)"]
35
+ validate_project_and_namespace["validate-project-and-namespace (validate)"]
36
+ collect_conversion_settings["collect-conversion-settings (validate)"]
37
+ confirm_conversion_preflight["confirm-conversion-preflight (validate)"]
38
+ convert_package["convert-package (write)"]
39
+ verify_conversion_request["verify-conversion-request (verify)"]
40
+ verify_code_coverage["verify-code-coverage (verify)"]
41
+ promote_converted_version["promote-converted-version (write)"]
42
+ verify_promoted_version["verify-promoted-version (verify)"]
43
+ prepare_support_escalation["prepare-support-escalation (validate)"]
44
+ collect_conversion_details --> validate_salesforce_cli
45
+ validate_salesforce_cli --> validate_devhub_alias
46
+ validate_devhub_alias --> validate_packaging_org_alias
47
+ validate_packaging_org_alias --> validate_source_package
48
+ validate_source_package --> collect_conversion_options
49
+ collect_conversion_options --> validate_project_and_namespace
50
+ validate_project_and_namespace --> collect_conversion_settings
51
+ collect_conversion_settings --> confirm_conversion_preflight
52
+ confirm_conversion_preflight --> convert_package
53
+ convert_package --> verify_conversion_request
54
+ verify_conversion_request --> verify_code_coverage
55
+ verify_code_coverage --> promote_converted_version
56
+ promote_converted_version --> verify_promoted_version
57
+ convert_package --> prepare_support_escalation
58
+ ```
59
+
60
+ ## Write operations
61
+
62
+ ### `convert-package`
63
+
64
+ Run the official Salesforce CLI package conversion from the validated DX project. Always include `--code-coverage`, the validated 033 package ID and Dev Hub alias, one installation-protection flag, and a wait duration. Salesforce CLI selects the latest released major.minor version unless the customer supplies `--patch-version major.minor.patch`. Add `--definition-file` and `--seed-metadata` only when required. Unpackaged metadata for packaged Apex tests has no flag; Salesforce CLI applies the confirmed `unpackagedMetadata` setting from sfdx-project.json.
65
+
66
+ **Status:** `implemented`
67
+
68
+ **Inputs:**
69
+
70
+ - `package_id` *(`String`)* — Validated managed 1GP package ID beginning with 033.
71
+ - `devhub_alias` *(`String`)* — Validated Dev Hub alias.
72
+ - `wait_minutes` *(`Integer`)* — Minutes for Salesforce CLI to wait before returning an in-progress request.
73
+ - `patch_version` *(`String`)* — Optional released major.minor.patch value.
74
+ - `definition_file` *(`String`)* — Source - output of collect-conversion-settings; the displayed project definition-file path only when the customer confirmed it is required.
75
+ - `seed_metadata_directory` *(`String`)* — Source - output of collect-conversion-settings; populated only after the customer confirmed seed metadata exists and supplied a validated directory path.
76
+
77
+ **Depends on:** `confirm-conversion-preflight`
78
+
79
+ **Rollback:** none. Package conversion does not alter the original 1GP package, but the association between this package and the selected Dev Hub cannot be transferred or changed. Do not attempt automatic cleanup or reassignment.
80
+
81
+ ### `promote-converted-version`
82
+
83
+ After code coverage passes and the customer explicitly says yes to the promotion question, promote the verified converted subscriber package version from beta to released. Never promote a different 04t and never infer consent from the original conversion request.
84
+
85
+ **Status:** `implemented`
86
+
87
+ **Inputs:**
88
+
89
+ - `subscriber_package_version_id` *(`String`)* — Source - output of verify-code-coverage; converted 04t whose coverage check passed.
90
+ - `devhub_alias` *(`String`)* — Validated Dev Hub alias used for conversion.
91
+ - `promotion_confirmed` *(`Boolean`)* — True only when the customer explicitly answered yes to the promotion question after conversion succeeded.
92
+
93
+ **Depends on:** `verify-code-coverage`
94
+
95
+ **Rollback:** none. Package-version promotion to Released is irreversible.
96
+
97
+ ## Verify operations
98
+
99
+ ### `verify-conversion-request`
100
+
101
+ Retrieve the Package2VersionCreateRequest identified by the 08c conversion request ID. Confirm it reached Success and returned the Package2, Package2Version, SubscriberPackageVersion, and converted-from identifiers. If the request is still pending, repeat this same report command approximately every two minutes, give the customer a status update after each report, and never start another conversion.
102
+
103
+ **Status:** `implemented`
104
+
105
+ **Inputs:**
106
+
107
+ - `request_id` *(`String`)* — Package version creation request ID beginning with 08c.
108
+ - `devhub_alias` *(`String`)* — Validated Dev Hub alias.
109
+
110
+ **Depends on:** `convert-package`
111
+
112
+ ### `verify-code-coverage`
113
+
114
+ Retrieve the converted subscriber package version and verify that code coverage was calculated and passed. HasPassedCodeCoverageCheck must be true for the converted beta version to qualify for promotion. Also confirm ConvertedFromVersionId is populated, proving this is a converted version.
115
+
116
+ **Status:** `implemented`
117
+
118
+ **Inputs:**
119
+
120
+ - `subscriber_package_version_id` *(`String`)* — Converted subscriber package version ID beginning with 04t.
121
+ - `devhub_alias` *(`String`)* — Validated Dev Hub alias.
122
+
123
+ **Depends on:** `verify-conversion-request`
124
+
125
+ ### `verify-promoted-version`
126
+
127
+ Re-read the promoted subscriber package version and require IsReleased to be true. Then present the complete package details again with the release state shown as Released.
128
+
129
+ **Status:** `implemented`
130
+
131
+ **Inputs:**
132
+
133
+ - `subscriber_package_version_id` *(`String`)* — Source - output of promote-converted-version.
134
+ - `devhub_alias` *(`String`)* — Validated Dev Hub alias used for promotion.
135
+
136
+ **Depends on:** `promote-converted-version`
137
+
138
+ ## Other operations
139
+
140
+ ### `collect-conversion-details`
141
+
142
+ Collect only the non-secret identity and package inputs needed for initial discovery: Dev Hub alias, 1GP packaging-org alias, 033 package ID, and package namespace. Defer every configurable conversion option until released versions have been queried.
143
+
144
+ **Status:** `implemented`
145
+
146
+ ### `validate-salesforce-cli`
147
+
148
+ Silently confirm Salesforce CLI is installed before using it. Do not make the customer confirm the CLI version or narrate this check unless the CLI is missing or a command fails because an update is required.
149
+
150
+ **Status:** `implemented`
151
+
152
+ **Depends on:** `collect-conversion-details`
153
+
154
+ ### `validate-devhub-alias`
155
+
156
+ Resolve the customer-provided Dev Hub alias and display its authenticated org identity. Confirm the alias points to the intended PBO/Dev Hub before package conversion permanently associates the converted package with it.
157
+
158
+ **Status:** `implemented`
159
+
160
+ **Inputs:**
161
+
162
+ - `devhub_alias` *(`String`)* — Dev Hub alias supplied during collect-conversion-details.
163
+
164
+ **Depends on:** `validate-salesforce-cli`
165
+
166
+ ### `validate-packaging-org-alias`
167
+
168
+ Resolve the customer-provided 1GP packaging-org alias and display its authenticated org identity. Confirm it is the source packaging org for the 033 package.
169
+
170
+ **Status:** `implemented`
171
+
172
+ **Inputs:**
173
+
174
+ - `packaging_org_alias` *(`String`)* — Packaging-org alias supplied during collect-conversion-details.
175
+
176
+ **Depends on:** `validate-devhub-alias`
177
+
178
+ ### `validate-source-package`
179
+
180
+ Query the 1GP packaging org through Salesforce CLI Tooling API to confirm the 033 package has at least one managed-released version and to identify the released versions available for conversion. For the default path, Salesforce CLI converts the latest released major.minor. For patch mode, confirm the requested major.minor.patch appears in this result before conversion.
181
+
182
+ **Status:** `implemented`
183
+
184
+ **Inputs:**
185
+
186
+ - `packaging_org_alias` *(`String`)* — Source - output of validate-packaging-org-alias.
187
+ - `package_id` *(`String`)* — Source - output of collect-conversion-details.
188
+
189
+ **Depends on:** `validate-packaging-org-alias`
190
+
191
+ ### `collect-conversion-options`
192
+
193
+ After released versions are known, collect the source-version choice and DX-project choice. Ask each option separately. Every option question displays its own default, and `default` applies only to that one question. Never silently reuse a DX project.
194
+
195
+ **Status:** `implemented`
196
+
197
+ **Inputs:**
198
+
199
+ - `released_versions` *(`List<Object>`)* — Source - output of validate-source-package.
200
+
201
+ **Depends on:** `validate-source-package`
202
+
203
+ ### `validate-project-and-namespace`
204
+
205
+ Confirm the working directory is a Salesforce DX project and its sfdx-project.json contains the 1GP namespace. When the customer selected a new project, create it with the official Salesforce CLI project-generation command, then update sfdx-project.json before conversion. The namespace must already be linked to the selected Dev Hub.
206
+
207
+ **Status:** `implemented`
208
+
209
+ **Inputs:**
210
+
211
+ - `project_directory` *(`String`)* — Source - output of collect-conversion-options.
212
+ - `namespace` *(`String`)* — Source - output of collect-conversion-details; namespace registered by the 1GP package and linked to the Dev Hub.
213
+
214
+ **Depends on:** `collect-conversion-options`
215
+
216
+ ### `collect-conversion-settings`
217
+
218
+ After the DX project and its default definition file are available, ask each remaining conversion-setting question separately. Show the actual definition-file path instead of asking the customer to discover it. Ask for a seed-metadata directory only when the customer confirms that seed metadata exists, and for an unpackaged-metadata directory only when the customer confirms that packaged Apex tests need it.
219
+
220
+ **Status:** `implemented`
221
+
222
+ **Inputs:**
223
+
224
+ - `definition_file_path` *(`String`)* — Source - output of validate-project-and-namespace; exact path to the project's default config/project-scratch-def.json.
225
+
226
+ **Depends on:** `validate-project-and-namespace`
227
+
228
+ ### `confirm-conversion-preflight`
229
+
230
+ Present the final preflight summary and require explicit confirmation of the permanent Dev Hub association, mandatory code coverage, installation-protection choice, and optional conversion inputs.
231
+
232
+ **Status:** `implemented`
233
+
234
+ **Inputs:**
235
+
236
+ - `devhub_org_id` *(`String`)* — Validated Dev Hub org ID.
237
+ - `packaging_org_id` *(`String`)* — Validated 1GP packaging-org ID.
238
+ - `package_id` *(`String`)* — Managed 1GP package ID beginning with 033.
239
+
240
+ **Depends on:** `collect-conversion-settings`
241
+
242
+ ### `prepare-support-escalation`
243
+
244
+ For an unresolved, internal, or repeatedly failing conversion, assemble a sanitized Partner Support bundle without using internal Salesforce systems. Include complete CLI output and stack traces, exact commands with secrets removed, error identifiers, package and request IDs, both org IDs and instance URLs, CLI version, timestamp with time zone, reproduction steps, relevant project configuration, business impact, and customer expectations.
245
+
246
+ **Status:** `implemented`
247
+
248
+ **Inputs:**
249
+
250
+ - `conversion_errors` *(`List<String>`)* — Sanitized errors from the conversion or request report.
251
+
252
+ **Depends on:** `convert-package`
@@ -0,0 +1,88 @@
1
+ ---
2
+ name: dx-packaging-move-to-2gp-migrate
3
+ description: "Use this skill when users want to finalize the irreversible, one-way Move-to-2GP cutover for a converted 1GP managed package — afterward, new major/minor 1GP versions can NEVER be created. Also use when an ISV admin asks to move a 1GP package to 2GP development. TRIGGER when: the user asks to move, finalize, or complete the move of a converted 1GP managed package to 2GP development, asks how to move a package to 2GP, or asks whether their converted package is eligible to move to 2GP. DO NOT TRIGGER for: converting a 1GP package to 2GP in the first place, creating or promoting 2GP package versions, packaging UI bundles (use experience-ui-bundle-2gp-deploy), enabling Dev Hub (use dx-org-devhub-configure), or post-install configuration (use dx-pkg-post-install-configure)."
4
+ metadata:
5
+ relatedSkills:
6
+ - dx-org-devhub-configure
7
+ - dx-pkg-post-install-configure
8
+ - experience-ui-bundle-2gp-deploy
9
+ version: "1.1"
10
+ accessCheck: "UserPermissions.CreatePackaging"
11
+ cliTools:
12
+ - tool:
13
+ - "sf"
14
+ semver: ">=2.0.0"
15
+ domains:
16
+ - "Developer Experience"
17
+ ---
18
+
19
+
20
+ # Move to 2GP Development
21
+
22
+ ## When to Use This Skill
23
+
24
+ Finalize the irreversible, one-way Move-to-2GP cutover for a converted 1GP managed package — afterward, new major/minor 1GP versions can NEVER be created. Use when an ISV admin asks to move a 1GP package to 2GP development. The agent dispatches the finalize directly via the packaging Connect API (POST /connect/packaging/package/{packageId}/finalize-move-to-2gp, shipped 266) after clearing the eligibility + conversion/subscriber-migration-testing gates and obtaining the three explicit affirmations the endpoint requires; it then wire-verifies the result against PackageConversion.EndDate (read-only Tooling exposure, shipped 264).
25
+
26
+ ## Workflow
27
+
28
+ ---
29
+ BACKEND / VERSIONING MECHANICS (relocated from the discover card — describe-only, never shown on the card):
30
+ - FINALIZE DISPATCH (266+): the agent-dispatchable path is the packaging Connect API POST /services/data/v69.0/connect/packaging/package/{packageId}/finalize-move-to-2gp (operationId finalizeMoveTo2gp), which runs against the 1GP DE org. The endpoint enforces the CreatePackaging edit-access gate, requires all three affirmation flags true, and verifies the {packageId} in the URL matches the package the org is currently converting — a mismatch returns 400. On success it finalizes the conversion, after which PackageConversion.EndDate is set (observable via verify-finalize-on-packaging-org). It performs the same finalize action that was previously available only through the Setup UI's Move-to-2GP dialog.
31
+ - PRE-266 HISTORY / FALLBACK: before 266 no public agent-dispatchable API existed — finalize was available only as a Setup-page action the user completed in the browser, with no stable programmatic contract. The fallback delivers the user to the package's Setup detail page at `/udd/AllPackage/viewAllPackage.apexp` (any authenticated browser session to the packaging org reaches it), which hosts the "Move to Second-Generation Managed Packaging" dialog and its Proceed action. This remains the fallback for orgs on a pre-266 release.
32
+ - CANNOT-CREATE BOUNDARY, MECHANICS: after finalize, new major/minor 1GP versions cannot be created — neither via `sf package1 version create` nor via the major/minor upload flow on viewAllPackage.apexp; all new major/minor innovation must use 2GP via `sf package version create`. Customers running on prior 1GP versions are unaffected.
33
+ - PATCH EXCEPTION (surface conversationally only when the user asks e.g. "can I still cut a patch?"): PATCH versions of major.minor versions that existed BEFORE finalize remain permitted, to hotfix 1GP subscribers not yet migrated to 2GP. This exception is intentionally NOT part of the affirmation prompt the user confirms (the Setup dialog uses the same headline framing) — never put it in the affirmation.
34
+ - ELIGIBILITY GATE (3-part proactive pre-check, two-org query): (a) the 1GP package's highest Released major.minor version, queried from the 1GP DE org via MetadataPackageVersion; (b) a corresponding 2GP-converted Package2Version at the same major.minor on DevHub, AND that 2GP version is Released; (c) no native 2GP version exists yet on DevHub (its presence means Move-to-2GP already happened — early exit). Parts (b)/(c) are the DevHub-side pre-check: run them when DevHub is authenticated to give the user a clear up-front answer; if (a) or (b) fails, surface what's missing + the fix (typically promote the converted 2GP version to Released). When DevHub is unavailable, this proactive check is skipped and the finalize endpoint enforces the same eligibility server-side (→ 400 on mismatch). DevHub eligibility queries hit the Package2 / Package2Version 0Ho-prefix entity.
35
+ - PRE-FLIGHT (mandatory): Salesforce docs state "Before you complete your move to 2GP package development, it's critical that you thoroughly test package conversions and subscriber migrations first." Never invoke the manual step without explicit user affirmation that conversion + subscriber-migration testing is complete.
36
+ - RELEASE HISTORY (both milestones shipped): 264 exposed the PackageConversion object read-only via the Tooling API (available when packaging is enabled for the org), lighting up verify-finalize-on-packaging-org as an EndDate-based wire-verify. 266 shipped the Connect API finalize endpoint POST /services/data/v69.0/connect/packaging/package/{packageId}/finalize-move-to-2gp (operationId finalizeMoveTo2gp), driven by the 1GP MetadataPackage Id (033-prefix) with the three affirmation flags in the request body; finalize-move-to-2gp dispatches invocation.kind: rest, is status: implemented, and the skill is now fully agent-driveable end-to-end. The manual browser fallback path is retained only as a pre-266 fallback.
37
+ - WIRE-VERIFICATION (264+): the canonical post-finalize signal is PackageConversion.EndDate (non-null) on the 1GP DE org, queryable via the read-only Tooling exposure shipped in 264. The finalize endpoint's own response also returns finalizedAt + conversionId directly. Move-to-2GP does NOT auto-create a native (non-converted) Package2Version on DevHub — native versions are created later by a separate user-driven `sf package version create`, so their absence immediately post-finalize is expected, not a failure signal (i.e. there is no Package2Version-based wire-verify; EndDate is the reliable signal). verify-finalize-by-user-confirmation remains available as an optional human cross-check but is no longer the only verification surface.
38
+ - ORG REACHABILITY (auth mechanism is agent's choice, not `sf`-specific): only the 1GP DE (packaging) org is genuinely required — it backs the 266 Connect finalize endpoint, the read-only PackageConversion wire-verify (264), the 1GP-side eligibility query (MetadataPackageVersion), and the browser Setup page for the pre-266 fallback. Reachability can come from an `sf` alias OR any valid bearer token for the org (raw REST); the skill is not coupled to the `sf` CLI. The DevHub org (Package2 / Package2Version) is OPTIONAL — it only enables the proactive eligibility pre-check; when it is absent the finalize endpoint still validates eligibility server-side (a not-yet-converted/not-promoted package → 400), so the skill can proceed DevHub-less. This also sidesteps the multi-org-auth burden of skills that hard-require two authenticated orgs.
39
+
40
+ ## Critical Constraints
41
+
42
+ **Preconditions:**
43
+
44
+ - REQUIRED: the 1GP DE (packaging) org must be reachable with valid credentials. This is the one org the finalize path needs — an `sf` alias is the convenient way to authenticate, but the skill is NOT coupled to the `sf` CLI: any caller that can present a valid bearer token for this org (e.g. a raw REST call) works equally. The 1GP DE org hosts MetadataPackageVersion (the authoritative highest-Released 1GP version for the eligibility gate), is the org the finalize Connect API endpoint (266) runs against, hosts the read-only PackageConversion Tooling exposure (264) the wire-verify queries, and is the org the pre-266 manual browser fallback opens. (check: `PackagingOrgAuthenticated`)
45
+ - OPTIONAL (recommended): authenticating the DevHub org lets the agent proactively pre-check eligibility before dispatching finalize — the converted 2GP Package2Version at the matching major.minor exists and is Released (Package2 + Package2Version live on DevHub). It is NOT a hard prerequisite: if DevHub is unavailable the skill can still finalize, because the Connect endpoint validates eligibility server-side and returns a 400 with a specific reason (e.g. version mismatch) when the latest released version has not been converted + promoted. Skipping the pre-check trades a clear up-front message for a server-side reject; it does not make the workflow unsafe (the irreversibility is gated by the three affirmations, not by DevHub). (check: `DevHubOrgAuthenticated`)
46
+ - User must have the CreatePackaging user permission (which implies CustomizeApplication) plus dev-org ownership of the package. This is the exact edit-access gate the finalize Connect endpoint enforces server-side — the same edit-access check the package's Setup detail page applies. A caller lacking it gets a 403 from the endpoint before any state is inspected (note: sysadmins do NOT clear this gate — edit access is org-dev scoped, not sysadmin-scoped). (check: `UserPermissions.CreatePackaging`)
47
+ - Package conversion testing must be complete. Per the Salesforce documentation, "Before you complete your move to 2GP package development, it's critical that you thoroughly test package conversions and subscriber migrations first." An agent MUST explicitly confirm this with the user before proceeding to the finalize step. See "Test Converted Packages and Subscriber Migrations" (linked from the workflow doc) for the testing checklist. (check: `ConversionTestingComplete`)
48
+ - Source files for the package's latest converted version should be retrieved before finalize. Per the docs, the user runs `sf package version retrieve --package 04tXXX --output-dir my-folder --target-dev-hub <devhub>` to retrieve, then edits sfdx-project.json's versionName, versionNumber, and ancestorVersion. This is preparatory work for ongoing 2GP development AFTER finalize, but the doc places it in the workflow sequence — the agent should remind the user. (check: `PackageSourceRetrievedAndProjectFileUpdated`)
49
+
50
+ **Operational rules:**
51
+
52
+ - AT START — the finalize path needs ONE org: the 1GP DE (packaging) org, reachable with valid credentials. A DevHub org is OPTIONAL-but-recommended, used only to proactively pre-check eligibility. Auth is not coupled to the `sf` CLI: an `sf` alias is convenient, but any valid bearer token for the org works for a raw REST call. Ask the user for the packaging-org alias (and, if they want the eligibility pre-check, the DevHub alias) at the start if not already provided; `sf org list --json` confirms what's authed. If the packaging org is missing, instruct the user to make it reachable (e.g. `sf org login web --alias <name>`) and wait. If only DevHub is missing you may still finalize — skip the DevHub-side eligibility queries and rely on the endpoint's server-side validation (a not-yet-converted/not-promoted package returns a 400 with a specific reason), and tell the user the proactive pre-check was skipped.
53
+ MULTI-ORG DISPATCH (read once, important): this workflow spans two orgs — the 1GP DE (packaging) org and the DevHub org. Each step's `invocation` block carries a `target_org` field naming which org the call must hit (`{packaging_org_alias}` vs `{devhub_alias}`); route each call to the org its `target_org` names rather than assuming a single org for the whole workflow. Route to the DevHub org: discover-package-on-devhub, check-eligibility-2gp-converted-released, and check-already-done. Route to the packaging org: check-eligibility-1gp-released, finalize-move-to-2gp, and verify-finalize-on-packaging-org. If your execution channel can only reach one connected org at a time, run each off-target read-only step against the org named in its `target_org` before dispatching the finalize against the packaging org; a CLI-driven runner can map that routing onto its own tooling. A step sent to the wrong org returns empty or misleading results.
54
+ TWO ROOT INTENTS — pick by user phrasing.
55
+ INTENT A — "tell me how to move my package to 2GP" (planning /
56
+ education): walk the user through the full sequence —
57
+ discover-package-on-devhub → check-eligibility-1gp-released →
58
+ check-eligibility-2gp-converted-released → check-already-done →
59
+ remind-of-prerequisites (testing, source retrieval) → describe the
60
+ manual finalize step in Setup. Treat this as a planning
61
+ conversation, NOT a dispatch action.
62
+ - INTENT B — "do the move-to-2GP step now" (action request):
63
+ discover-package-on-devhub → check-eligibility-1gp-released →
64
+ check-eligibility-2gp-converted-released → check-already-done →
65
+ confirm-affirmations → finalize-move-to-2gp (direct Connect API
66
+ dispatch) → verify-finalize-on-packaging-org (wire-verify against
67
+ PackageConversion.EndDate) → verify-finalize-by-user-confirmation
68
+ (optional cross-check). The finalize step now dispatches the
69
+ packaging Connect API POST directly against the 1GP DE org — the
70
+ agent does NOT open a browser tab in the normal path. It MUST
71
+ still obtain the three explicit affirmations in confirm-affirmations
72
+ first (the endpoint requires all three flags true and rejects the
73
+ call otherwise), then POST, then wire-verify EndDate. The manual
74
+ browser fallback path is retained only as a fallback for orgs on a
75
+ pre-266 release (see finalize-move-to-2gp.invocation.fallback).
76
+ - HARD STOP CONTRACT: this workflow is irrevocable. Per the documentation's "After you click Proceed, you can no longer create new major or minor versions in the packaging org." An agent MUST NOT instruct the user to click Proceed in Setup until ALL THREE of the following have been explicitly confirmed: (a) conversion testing is done, (b) subscriber migration testing is done, (c) the user understands the irreversibility. Skipping any of these is a contract violation regardless of how the user phrased the original request.
77
+ EARLY EXIT: if check-already-done returns ≥1 row (a Package2Version exists with ConvertedFromVersionId = NULL), the move-to-2GP has ALREADY been completed — or the package was 2GP-native to start with. Report this to the user and stop. Do NOT proceed to affirmations or finalize.
78
+ ELIGIBILITY GATING: if check-eligibility-1gp-released returns no Released 1GP version, OR if check-eligibility-2gp-converted-released returns no matching Released 2GP-converted version at the same major.minor, the user is NOT eligible to Move to 2GP. Surface the specific missing piece and what to do — typically "you need to promote 2GP version X.Y to Released before you can move-to-2GP." If DevHub is not authenticated, skip the proactive 2GP eligibility query and rely on the endpoint's server-side validation instead — the finalize call returns a 400 with a specific reason (e.g. version mismatch) when the latest released version has not been converted + promoted; relay that message to the user.
79
+ RELEASE HISTORY (both milestones now shipped — describe-only, not an ongoing constraint): 264 shipped the read-only PackageConversion Tooling exposure, lighting up verify-finalize-on-packaging-org (EndDate-based wire-verify). 266 shipped the finalize Connect API — finalize-move-to-2gp now dispatches POST /services/data/v69.0/connect/packaging/package/{packageId}/finalize-move-to-2gp against the 1GP DE org (invocation.kind: rest, operationId finalizeMoveTo2gp, MCP-enabled). The endpoint requires the three affirmation flags (acknowledgedIrrevocable / acknowledgedTestingComplete / acknowledgedSourceRetrieved) all true in the request body, mirroring the Setup dialog's checkboxes — this is the load-bearing safety gate, so the confirm-affirmations step remains mandatory. For orgs still on a pre-266 release, the manual browser fallback applies.
80
+ Only the 1GP DE (packaging) org is required for the finalize dispatch + wire-verify. The DevHub org is optional — used only for the proactive eligibility pre-check; the endpoint validates eligibility server-side regardless.
81
+
82
+ ## Verification Checklist
83
+
84
+ After every write operation, confirm the effect by re-reading state:
85
+
86
+ - After `finalize-move-to-2gp`: call `verify-finalize-on-packaging-org` directly (normal 266+ path) OR `verify-finalize-by-user-confirmation` then `verify-finalize-on-packaging-org` (pre-266 manual fallback only).
87
+
88
+ Read [Operations reference](references/api-operations.md) before executing this workflow. It contains the original operation definitions, dependencies, inputs, and verification instructions.