@salesforce/afv-skills 1.68.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 (188) hide show
  1. package/package.json +1 -1
  2. package/skills/afcc-setup-coordinate/SKILL.md +348 -0
  3. package/skills/afcc-setup-coordinate/assets/console-app/AFCC_Service_Console.app-meta.xml +19 -0
  4. package/skills/afcc-setup-coordinate/assets/console-app/Admin.profile-meta.xml +8 -0
  5. package/skills/afcc-setup-coordinate/assets/console-app/Standard.profile-meta.xml +8 -0
  6. package/skills/afcc-setup-coordinate/assets/gap_report_template.md +35 -0
  7. package/skills/afcc-setup-coordinate/assets/org_profile_template.json +16 -0
  8. package/skills/afcc-setup-coordinate/references/gotchas.md +22 -0
  9. package/skills/afcc-setup-coordinate/scripts/audit_org.sh +159 -0
  10. package/skills/agentforce-bot-upgrade/SKILL.md +117 -66
  11. package/skills/agentforce-bot-upgrade/assets/_vendored/agent-spec-template.md +139 -0
  12. package/skills/agentforce-bot-upgrade/references/_vendored/agent-design-and-spec-creation.md +1211 -0
  13. package/skills/agentforce-bot-upgrade/references/_vendored/agent-script-core-language.md +1390 -0
  14. package/skills/agentforce-bot-upgrade/references/_vendored/agent-subagent-map-diagrams.md +341 -0
  15. package/skills/agentforce-bot-upgrade/references/_vendored/agent-user-setup.md +672 -0
  16. package/skills/agentforce-bot-upgrade/references/_vendored/agent-validation-and-debugging.md +904 -0
  17. package/skills/agentforce-bot-upgrade/references/_vendored/agentscript-toolchain.md +112 -0
  18. package/skills/agentforce-bot-upgrade/references/_vendored/architecture-patterns.md +277 -0
  19. package/skills/agentforce-bot-upgrade/references/_vendored/common-control-flow-pitfalls.md +255 -0
  20. package/skills/agentforce-bot-upgrade/references/_vendored/control-flow-actions-sequencing.md +198 -0
  21. package/skills/agentforce-bot-upgrade/references/_vendored/control-flow-lifecycle-side-effects.md +87 -0
  22. package/skills/agentforce-bot-upgrade/references/_vendored/data-library-reference.md +891 -0
  23. package/skills/agentforce-bot-upgrade/references/_vendored/instruction-resolution.md +658 -0
  24. package/skills/agentforce-bot-upgrade/references/_vendored/org-setup-for-adl.md +551 -0
  25. package/skills/agentforce-bot-upgrade/references/_vendored/patterns-by-requirement.md +88 -0
  26. package/skills/agentforce-bot-upgrade/references/_vendored/posture-and-determinism.md +215 -0
  27. package/skills/agentforce-bot-upgrade/references/extraction-blueprint.md +11 -4
  28. package/skills/agentforce-bot-upgrade/references/generate-agent-spec.md +19 -3
  29. package/skills/agentforce-bot-upgrade/references/handoff-output-format.md +82 -52
  30. package/skills/agentforce-bot-upgrade/references/input-contract.md +8 -8
  31. package/skills/agentforce-bot-upgrade/references/mapping-rules.md +19 -6
  32. package/skills/agentforce-bot-upgrade/references/post-conversion-enhancements-reference.md +65 -6
  33. package/skills/agentforce-bot-upgrade/references/quality-checklist.md +4 -4
  34. package/skills/agentforce-bot-upgrade/references/sf-cli-bot-reference.md +17 -3
  35. package/skills/agentforce-hyperclassifier-configure/README.md +24 -0
  36. package/skills/agentforce-hyperclassifier-configure/SKILL.md +111 -0
  37. package/skills/agentforce-hyperclassifier-configure/assets/customer-org.env.example +4 -0
  38. package/skills/agentforce-hyperclassifier-configure/assets/sample_descriptions.json +8 -0
  39. package/skills/agentforce-hyperclassifier-configure/assets/sample_evals.csv +17 -0
  40. package/skills/agentforce-hyperclassifier-configure/references/api-contract.md +41 -0
  41. package/skills/agentforce-hyperclassifier-configure/references/authentication.md +35 -0
  42. package/skills/agentforce-hyperclassifier-configure/references/evaluation.md +46 -0
  43. package/skills/agentforce-hyperclassifier-configure/references/installation.md +35 -0
  44. package/skills/agentforce-hyperclassifier-configure/references/onboarding.md +93 -0
  45. package/skills/agentforce-hyperclassifier-configure/scripts/hcopt/__init__.py +1 -0
  46. package/skills/agentforce-hyperclassifier-configure/scripts/hcopt/client.py +219 -0
  47. package/skills/agentforce-hyperclassifier-configure/scripts/hcopt/eca.py +178 -0
  48. package/skills/agentforce-hyperclassifier-configure/scripts/hcopt/evaluation.py +207 -0
  49. package/skills/agentforce-hyperclassifier-configure/scripts/hcopt/onboarding.py +191 -0
  50. package/skills/agentforce-hyperclassifier-configure/scripts/hcopt/optimizer.py +187 -0
  51. package/skills/agentforce-hyperclassifier-configure/scripts/hyperclassifier.py +111 -0
  52. package/skills/agentforce-hyperclassifier-configure/scripts/report_hyperclassifier.py +149 -0
  53. package/skills/agentforce-hyperclassifier-configure/scripts/setup_hyperclassifier.py +74 -0
  54. package/skills/agentforce-hyperclassifier-configure/scripts/tests/test_hyperclassifier_skill.py +887 -0
  55. package/skills/agentforce-offline-experimentation-run/scripts/btlib/judge.py +23 -31
  56. package/skills/agentforce-offline-experimentation-run/scripts/btlib/messages.py +2 -1
  57. package/skills/agentforce-offline-experimentation-run/scripts/btlib/sfap.py +118 -2
  58. package/skills/agentforce-offline-experimentation-run/scripts/build_report.py +2 -2
  59. package/skills/agentforce-offline-experimentation-run/scripts/resolve-token.sh +9 -2
  60. package/skills/agentforce-offline-experimentation-run/scripts/sfap_replay.py +12 -1
  61. package/skills/commerce-react-storefront-create/SKILL.md +54 -21
  62. package/skills/dx-lifecycle-center/SKILL.md +24 -18
  63. package/skills/dx-lifecycle-center/examples/workflows.md +57 -34
  64. package/skills/dx-lifecycle-center/references/connect-api.md +33 -4
  65. package/skills/dx-lifecycle-center/references/connect-org.md +59 -28
  66. package/skills/dx-lifecycle-center/references/deploy.md +3 -3
  67. package/skills/dx-lifecycle-center/references/hub-org.md +19 -3
  68. package/skills/dx-lifecycle-center/references/list-orgs.md +50 -24
  69. package/skills/dx-lifecycle-center/references/troubleshooting.md +22 -1
  70. package/skills/dx-lifecycle-center/scripts/hub-get.sh +41 -0
  71. package/skills/dx-lifecycle-center/scripts/resolve-environment.sh +151 -4
  72. package/skills/dx-packaging-convert-1gp-to-2gp-create/SKILL.md +63 -0
  73. package/skills/dx-packaging-convert-1gp-to-2gp-create/references/conversion-operations.md +252 -0
  74. package/skills/dx-packaging-move-to-2gp-migrate/SKILL.md +2 -3
  75. package/skills/dx-packaging-move-to-2gp-migrate/references/api-operations.md +10 -7
  76. package/skills/dx-packaging-push-upgrade-configure/README.md +47 -0
  77. package/skills/dx-packaging-push-upgrade-configure/SKILL.md +355 -0
  78. package/skills/dx-packaging-push-upgrade-configure/references/best-practices.md +61 -0
  79. package/skills/dx-packaging-push-upgrade-configure/references/cli-reference.md +148 -0
  80. package/skills/dx-packaging-push-upgrade-configure/references/objects.md +106 -0
  81. package/skills/dx-packaging-push-upgrade-configure/references/soql-recipes.md +144 -0
  82. package/skills/experience-afv-analytics-query/SKILL.md +239 -0
  83. package/skills/experience-afv-analytics-query/references/references.md +176 -0
  84. package/skills/experience-app-mcp-delivery-generate/SKILL.md +142 -0
  85. package/skills/experience-app-mcp-delivery-generate/references/eca-consumer-key.md +26 -0
  86. package/skills/experience-app-mcp-delivery-generate/references/mcp-config-delivery.md +38 -0
  87. package/skills/experience-app-mcp-delivery-generate/references/plugin-format-and-publishing.md +80 -0
  88. package/skills/experience-app-mcp-delivery-generate/scripts/developer_name.mjs +9 -0
  89. package/skills/experience-app-mcp-delivery-generate/scripts/discover_mcp_context.mjs +114 -0
  90. package/skills/experience-app-mcp-delivery-generate/scripts/generate_mcp_config.mjs +27 -0
  91. package/skills/experience-app-mcp-delivery-generate/scripts/generate_plugin.mjs +184 -0
  92. package/skills/experience-app-mcp-delivery-generate/scripts/mcp_config.mjs +57 -0
  93. package/skills/experience-app-mcp-delivery-generate/scripts/preflight.mjs +109 -0
  94. package/skills/experience-app-mcp-delivery-generate/scripts/retrieve_eca_consumer_key.mjs +143 -0
  95. package/skills/experience-app-mcp-generate/SKILL.md +174 -0
  96. package/skills/experience-app-mcp-generate/assets/__ECA_NAME__.eca-meta.xml +7 -0
  97. package/skills/experience-app-mcp-generate/assets/__ECA_NAME__.ecaGlblOauth-meta.xml +15 -0
  98. package/skills/experience-app-mcp-generate/assets/__ECA_NAME__.ecaOauth-meta.xml +6 -0
  99. package/skills/experience-app-mcp-generate/assets/__ECA_NAME__.ecaOauthPlcy-meta.xml +12 -0
  100. package/skills/experience-app-mcp-generate/assets/__ECA_NAME___defaultPolicy.ecaPlcy-meta.xml +7 -0
  101. package/skills/experience-app-mcp-generate/assets/__MCP_SERVER_NAME__.mcpServerDefinition-meta.xml +5 -0
  102. package/skills/experience-app-mcp-generate/references/eca-fields.md +76 -0
  103. package/skills/experience-app-mcp-generate/references/mcp-objects.md +66 -0
  104. package/skills/experience-app-mcp-generate/references/tool-bindings.md +85 -0
  105. package/skills/experience-app-mcp-generate/references/troubleshooting.md +41 -0
  106. package/skills/experience-app-mcp-generate/references/ui-frameworks.md +19 -0
  107. package/skills/experience-app-mcp-generate/references/widget-resources.md +96 -0
  108. package/skills/experience-app-mcp-generate/scripts/activate_server.mjs +166 -0
  109. package/skills/experience-app-mcp-generate/scripts/check_setup_progress.mjs +212 -0
  110. package/skills/experience-app-mcp-generate/scripts/list_sites.mjs +211 -0
  111. package/skills/experience-app-mcp-generate/scripts/merge_tools.mjs +407 -0
  112. package/skills/experience-app-mcp-generate/scripts/preflight.mjs +127 -0
  113. package/skills/experience-app-mcp-generate/scripts/render_eca.mjs +144 -0
  114. package/skills/experience-app-mcp-generate/scripts/render_mcp_server.mjs +64 -0
  115. package/skills/experience-app-mcp-generate/scripts/retrieve_existing_prompts.mjs +145 -0
  116. package/skills/experience-app-mcp-generate/scripts/retrieve_existing_tools.mjs +72 -0
  117. package/skills/experience-app-mcp-generate/scripts/scan_tool_candidates.mjs +195 -0
  118. package/skills/experience-app-mcp-generate/scripts/utils/callback_url.mjs +36 -0
  119. package/skills/experience-app-mcp-generate/scripts/utils/developer_name.mjs +9 -0
  120. package/skills/experience-app-mcp-generate/scripts/utils/eca_check.mjs +156 -0
  121. package/skills/experience-app-mcp-generate/scripts/utils/metadata_path.mjs +13 -0
  122. package/skills/experience-app-mcp-generate/scripts/verify_server.mjs +118 -0
  123. package/skills/experience-cms-content-type-generate/SKILL.md +1 -1
  124. package/skills/nonprofit-fundraising-configure/SKILL.md +1 -1
  125. package/skills/nonprofit-fundraising-configure/references/mcp-invocation.md +52 -4
  126. package/skills/nonprofit-fundraising-configure/references/permission-targeting.md +19 -2
  127. package/skills/platform-custom-field-generate/SKILL.md +24 -16
  128. package/skills/platform-custom-metadata-type-generate/SKILL.md +1 -0
  129. package/skills/platform-custom-setting-generate/SKILL.md +1 -0
  130. package/skills/platform-dataspace-access-configure/SKILL.md +25 -10
  131. package/skills/platform-flexipage-generate/SKILL.md +7 -10
  132. package/skills/platform-flexipage-generate/references/mcp_action_examples.md +42 -38
  133. package/skills/platform-policy-rule-generate/SKILL.md +9 -7
  134. package/skills/platform-policy-rule-generate/references/condition-model.md +3 -3
  135. package/skills/platform-policy-rule-generate/references/conjunction-expression.md +9 -1
  136. package/skills/platform-policy-rule-generate/references/consumer-datacloud-ui.md +9 -1
  137. package/skills/platform-policy-rule-generate/references/examples/ExistsJoinRLS/policyRuleDefinitionSets/ExistsJoinRLS.policyRuleDefinitionSet +1 -2
  138. package/skills/platform-policy-rule-generate/references/examples/FieldReadDeny/policyRuleDefinitionSets/FieldReadDeny.policyRuleDefinitionSet +1 -2
  139. package/skills/platform-policy-rule-generate/references/examples/LastCharactersFieldMasking/policyRuleDefinitionSets/LastCharactersFieldMasking.policyRuleDefinitionSet +1 -2
  140. package/skills/platform-policy-rule-generate/references/examples/PrincipalFieldMatchRLS/policyRuleDefinitionSets/PrincipalFieldMatchRLS.policyRuleDefinitionSet +1 -2
  141. package/skills/platform-policy-rule-generate/references/examples/TaggedObjectAccess/policyRuleDefinitionSets/TaggedObjectAccess.policyRuleDefinitionSet +1 -0
  142. package/skills/platform-policy-rule-generate/references/headless-transport.md +2 -2
  143. package/skills/platform-policy-rule-generate/references/policy-schema-full.md +1 -1
  144. package/skills/platform-policy-rule-generate/references/policy-shapes.md +33 -0
  145. package/skills/platform-policy-rule-generate/references/templates-advanced.md +1 -1
  146. package/skills/platform-policy-rule-generate/references/ui-compatibility.md +5 -5
  147. package/skills/platform-report-generate/SKILL.md +20 -1
  148. package/skills/platform-report-generate/references/summary-formulas-sorting-limits.md +118 -0
  149. package/skills/platform-report-generate/references/verification-checklist.md +12 -0
  150. package/skills/service-digital-engagement-channel-configure/SKILL.md +44 -107
  151. package/skills/service-digital-engagement-channel-configure/assets/messaging_channel_template.xml +2 -0
  152. package/skills/service-digital-engagement-channel-configure/examples/asa_agent_channel.xml +2 -2
  153. package/skills/service-digital-engagement-channel-configure/examples/auth_queue_channel.xml +58 -0
  154. package/skills/service-digital-engagement-channel-configure/examples/omni_flow_channel.xml +2 -2
  155. package/skills/service-digital-engagement-channel-configure/examples/omni_queue_channel.xml +3 -3
  156. package/skills/service-digital-engagement-channel-configure/references/channel_settings.md +18 -14
  157. package/skills/service-digital-engagement-channel-configure/references/onboarding_contract.md +16 -20
  158. package/skills/service-digital-engagement-channel-configure/references/prechat_params.md +10 -0
  159. package/skills/service-digital-engagement-channel-configure/references/recaptcha_handoff.md +38 -0
  160. package/skills/service-digital-engagement-channel-configure/references/user_verification.md +9 -0
  161. package/skills/service-digital-engagement-channel-configure/scripts/check-api-version.sh +4 -4
  162. package/skills/service-digital-engagement-channel-configure/scripts/normalize-channel-name.sh +12 -7
  163. package/skills/service-e911-configure/SKILL.md +242 -0
  164. package/skills/service-itsm-agentic-setup-agent-runtime-access-assign/SKILL.md +1 -1
  165. package/skills/service-itsm-agentic-setup-agentforce-coordinate/SKILL.md +1 -1
  166. package/skills/service-itsm-agentic-setup-agentforce-studio-configure/SKILL.md +1 -1
  167. package/skills/service-itsm-agentic-setup-agentforce-studio-validate/SKILL.md +1 -1
  168. package/skills/service-itsm-agentic-setup-employee-agent-configure/SKILL.md +1 -1
  169. package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/SKILL.md +1 -1
  170. package/skills/service-itsm-agentic-setup-incident-management/SKILL.md +47 -44
  171. package/skills/service-itsm-agentic-setup-incident-management/examples/output-templates.md +110 -83
  172. package/skills/service-itsm-agentic-setup-incident-management/references/manage-incidents-with-ai.md +7 -3
  173. package/skills/service-itsm-agentic-setup-incident-management/references/priority-matrix.md +7 -5
  174. package/skills/service-itsm-agentic-setup-incident-management/references/sla-milestones.md +2 -2
  175. package/skills/service-itsm-agentic-setup-incident-management/references/status-checks.md +437 -0
  176. package/skills/service-itsm-agentic-setup-itsm-agentforce-permset-assign/SKILL.md +1 -1
  177. package/skills/agentforce-bot-upgrade/references/planner-workflow-reference.md +0 -78
  178. package/skills/dx-lifecycle-center/assets/widgets/connect-connected/connect-connected.json +0 -65
  179. package/skills/dx-lifecycle-center/assets/widgets/connect-connected/schema.json +0 -32
  180. package/skills/dx-lifecycle-center/assets/widgets/connect-sign-in/connect-sign-in.json +0 -57
  181. package/skills/dx-lifecycle-center/assets/widgets/connect-sign-in/schema.json +0 -21
  182. package/skills/dx-lifecycle-center/scripts/card-policy.jq +0 -71
  183. package/skills/dx-lifecycle-center/scripts/fill-widget.jq +0 -29
  184. package/skills/dx-lifecycle-center/scripts/widget.sh +0 -28
  185. package/skills/experience-content-media-image-generate/SKILL.md +0 -83
  186. package/skills/experience-content-media-image-generate/scripts/download-image.sh +0 -84
  187. package/skills/experience-content-media-stock-image-search/SKILL.md +0 -193
  188. package/skills/experience-content-media-stock-image-search/scripts/download-stock-image.py +0 -102
@@ -0,0 +1,355 @@
1
+ ---
2
+ name: dx-packaging-push-upgrade-configure
3
+ description: "Use this skill to plan, schedule, and monitor Salesforce package push upgrades from a Dev Hub. Finds subscriber orgs via the PackageSubscriber object, resolves and validates the target package version, builds a best-practice batched schedule (pilot sandboxes, then staggered off-peak production batches), generates the per-batch org-ID CSV, and — only after explicit confirmation — runs the sf package push-upgrade CLI commands, then monitors PackagePushRequest, PackagePushJob, and PackagePushError. Supports 2GP managed, unlocked, and 1GP-to-2GP push migrations. TRIGGER when the user wants to push a package upgrade to subscribers, find who has a package installed and at what version, batch a rollout by region, or schedule, monitor, or abort a push upgrade. DO NOT TRIGGER for post-install configuration of an installed package (use dx-pkg-post-install-configure), creating or versioning a package, or installing a package into one org."
4
+ metadata:
5
+ version: "1.0"
6
+ domains: ["Developer Experience"]
7
+ relatedSkills:
8
+ - "dx-pkg-post-install-configure"
9
+ cliTools:
10
+ - tool: ["sf"]
11
+ semver: ">=2.0.0"
12
+ accessCheck: "UserPermissions.PermissionsPackaging2"
13
+ ---
14
+
15
+ Plan and drive a Salesforce **package push upgrade** end-to-end: find subscriber orgs, resolve the
16
+ target version, batch a schedule per best practices, generate the org CSV, run the `sf` CLI
17
+ `push-upgrade` commands **after explicit confirmation**, and monitor the results.
18
+
19
+ Push upgrades change a package **in the customer's org without their action**. This is outward-facing
20
+ and hard to reverse. The default posture of this skill is **generate → preview → confirm → run**:
21
+ never call `push-upgrade schedule` or `push-upgrade abort` until the user has seen the batch plan and
22
+ the org list and said go. See `references/best-practices.md` before scheduling anything to production.
23
+
24
+ ## Inputs
25
+
26
+ Gather these from the user's request; parse identifiers loosely wherever they appear:
27
+ - A token starting with `033` → the package ID (`MetadataPackageId` for queries, `--package` for `list`).
28
+ - A token starting with `04t` → the target package **version** ID (`--package` for `schedule`).
29
+ - A token starting with `0DV` → an existing push request ID (jump straight to Phase 5, monitoring).
30
+ - A Dev Hub **alias or username** → the org the push-upgrade objects and commands run against.
31
+
32
+ If the Dev Hub is not given, **assume the default Dev Hub owns the package and verify by querying**
33
+ rather than prompting up front:
34
+ 1. Read the default from `sf config get target-dev-hub --json`. If none is set, skip to step 3.
35
+ 2. Probe that hub for the package — reuse Phase 1's resolution query against the given `033`/`04t`
36
+ (or `SELECT Id, Name FROM MetadataPackage` if only a name is known). If it returns the package,
37
+ you've confirmed ownership and done Phase 1 in one step — proceed, naming the resolved Dev Hub.
38
+ 3. Only if the probe **fails** (no matching rows, or an auth/permission error), fall back to asking:
39
+ run `sf org list --json` and ask the user which Dev Hub owns the package, then re-probe.
40
+
41
+ This keeps the happy path unattended while still catching a wrong/empty hub before any subscriber
42
+ query or plan. Push upgrade objects and commands run against the **Dev Hub / package-owning org**, not
43
+ a subscriber org.
44
+
45
+ ---
46
+
47
+ ## Phase 0 — Confirm scope and prerequisites
48
+
49
+ Establish these before doing anything else; ask only for what you can't infer:
50
+
51
+ 1. **Package type** — 2GP managed, unlocked, or a 1GP→2GP migration (`--migrate-to-2gp`).
52
+ - 2GP managed push upgrades require the package to have **passed AppExchange security review**,
53
+ and the feature must be enabled via a **Salesforce Partner Support case**. Unlocked packages
54
+ have push upgrades enabled by default.
55
+ 2. **Dev Hub is authenticated** — `sf org display --target-org <devhub> --json`. If it fails, tell the
56
+ user to run `sf org login web --alias <devhub>` and wait.
57
+ 3. **Permission** — scheduling needs the *Create and Update Second-Generation Packages* user permission
58
+ on the Dev Hub. If a later command fails with an auth/permission error, surface that as the likely cause.
59
+
60
+ Do not assume security-review/enablement status — if the user hasn't confirmed it, note it as a
61
+ prerequisite they must verify, and continue building the plan (it's still valid).
62
+
63
+ ---
64
+
65
+ ## Phase 1 — Resolve the package and target version
66
+
67
+ Goal: end with a confirmed **033 package ID** and a **04t target version ID** that is a valid push target.
68
+
69
+ > If the Dev Hub was resolved via the default-hub probe in **Inputs** above, that probe already ran
70
+ > this resolution query — you may already have the package/version in hand. Don't re-query; pick up at
71
+ > validation (step 2).
72
+
73
+ 1. If only the 04t is known, resolve its package and version number:
74
+ ```bash
75
+ sf data query --target-org <devhub> \
76
+ --query "SELECT Id, MetadataPackageId, Name, MajorVersion, MinorVersion, PatchVersion, BuildNumber, ReleaseState, IsDeprecated FROM MetadataPackageVersion WHERE Id = '<04t>'"
77
+ ```
78
+ 2. Validate the target version is a legal push target:
79
+ - `ReleaseState = Released` (not `Beta`) and `IsDeprecated = false`. The CLI requires an
80
+ **active, non-beta** version.
81
+ - It must be **higher** than the versions subscribers currently run (Phase 2 confirms this).
82
+ - Push upgrades follow the **same manageability rules** as customer-initiated upgrades — you can't
83
+ push a change a normal upgrade couldn't make (e.g. deleting components, deprecated-then-removed).
84
+ 3. If the user only gave a 033, list candidate versions so they can pick the target:
85
+ ```bash
86
+ sf data query --target-org <devhub> \
87
+ --query "SELECT Id, Name, MajorVersion, MinorVersion, PatchVersion, BuildNumber, ReleaseState FROM MetadataPackageVersion WHERE MetadataPackageId = '<033>' AND ReleaseState = 'Released' ORDER BY MajorVersion DESC, MinorVersion DESC, PatchVersion DESC, BuildNumber DESC"
88
+ ```
89
+
90
+ See `references/objects.md` for full field lists.
91
+
92
+ ---
93
+
94
+ ## Phase 2 — Find subscriber orgs (PackageSubscriber)
95
+
96
+ Query `PackageSubscriber` **on the Dev Hub / License Management Org** to discover who has the package
97
+ installed and at what version. `OrgKey` is the org ID that goes in the CSV.
98
+
99
+ Baseline query (installed subscribers on production orgs, below the target version):
100
+ ```bash
101
+ sf data query --target-org <devhub> \
102
+ --query "SELECT OrgKey, OrgName, OrgStatus, OrgType, InstanceName, MetadataPackageVersionId, InstalledStatus, HasRestrictionEnabled FROM PackageSubscriber WHERE MetadataPackageId = '<033>' AND InstalledStatus = 'i'"
103
+ ```
104
+
105
+ Then apply the **eligibility filters** — this is where the skill adds judgment. Walk the user through:
106
+
107
+ - **Currently installed only** — `InstalledStatus = 'i'` (`'u'` = uninstalled/not installed).
108
+ - **Not already on the target** — exclude rows whose `MetadataPackageVersionId` equals the target 04t,
109
+ and resolve each subscriber's version numbers so you push only to orgs strictly *below* the target.
110
+ Push upgrades can't downgrade; an org **already at** the target is a **silent no-op** (request/job
111
+ report `Succeeded`, no error), not a detectable failure — so filter these out up front.
112
+ - **Production vs sandbox** — `OrgType`. Best practice is to pilot in **sandboxes** first, then
113
+ production. Offer to split the list by `OrgType`.
114
+ - **Org status** — `OrgStatus` is `Active`/`Demo`/`Free`/`Inactive`/`Trial`, and is **independent of
115
+ `OrgType`** (a Production org can be `Trial`/`Demo`/`Free`). Typically exclude only `Inactive`
116
+ (`OrgStatus != 'Inactive'`); do **not** whitelist `= 'Active'` or you'll silently drop live
117
+ non-`Active` production subscribers.
118
+ - **Respect subscriber restrictions** — if the package lets subscribers block push upgrades, skip rows
119
+ where `HasRestrictionEnabled = true` or `CustomUpgradeType = 'BlockedBySubscriber'`. Pushing to a
120
+ restricted org will error; filter them out up front and report the count.
121
+
122
+ Report a summary table (counts by `OrgType`, by current version, restricted/excluded) so the user can
123
+ sanity-check the population before batching. See `references/soql-recipes.md` for ready-to-run variants.
124
+
125
+ ---
126
+
127
+ ## Phase 3 — Build the batched schedule (best practices)
128
+
129
+ **Do not write any `.csv` file in this phase.** The plan is the only deliverable here — CSVs are a
130
+ Phase 4 action, created only after the user approves and you are about to run `schedule`. Before you
131
+ end this turn, confirm you have written at most one file (the plan itself); if you find yourself
132
+ about to call a file-write tool with a `.csv` path, stop — that belongs in Phase 4, not here.
133
+
134
+ Do **not** dump every org into one request. Propose a batch plan grounded in
135
+ `references/best-practices.md`:
136
+
137
+ - **Pilot first.** Batch 0 = your own test orgs and/or customer **sandboxes**. Recommend a soak period
138
+ (a week+ for sandboxes) before production.
139
+ - **Stagger production.** Start small (e.g. 50–100 orgs of 1,000), grow batches only after clean runs.
140
+ - **Off-peak, by time zone.** Schedule each batch for the subscribers' local late-evening/night; group
141
+ by `InstanceName`/time zone where possible. `--start-time` is **UTC** — state the local-time intent
142
+ and the UTC value you computed.
143
+ - **Avoid risky windows.** No month/quarter/year-end; wait **3–4 weeks after a major Salesforce
144
+ release** before major pushes; avoid Salesforce maintenance windows.
145
+
146
+ Produce a concrete plan the user approves, e.g.:
147
+
148
+ ```text
149
+ Batch Population Count Local target --start-time (UTC)
150
+ 0 Sandboxes (pilot) 12 immediate (omit -t)
151
+ 1 Prod, AMER off-peak 80 Tue 02:00 PT 2026-08-11T09:00:00
152
+ 2 Prod, EMEA off-peak 140 Wed 02:00 CEST 2026-08-12T00:00:00
153
+ 3 Prod, APAC off-peak 60 Thu 02:00 AEST 2026-08-12T16:00:00
154
+ ...
155
+ ```
156
+
157
+ Convert each batch with the UTC offset in force **on the push date**, not the region's standard offset
158
+ (e.g. PDT is UTC−7 and CEST is UTC+2 in summer; AEST is UTC+10 until Sydney moves to AEDT, UTC+11, in
159
+ October). Regions east of UTC cross the date line: 02:00 local on Thursday is **Wednesday** in UTC, so
160
+ the UTC date in `--start-time` is the day before the local date. Show both in the plan.
161
+
162
+ For each batch, show the org-ID CSV **inline as a fenced code block** — one `OrgKey` per line, no
163
+ header, one org ID per row — labeled with the filename it will be saved under (e.g.
164
+ `push-batch-1-amer.csv`). Confirm the contents with the user. Don't create the `.csv` files while
165
+ planning; write them in Phase 4, only once the user approves and you are about to run `schedule`.
166
+
167
+ ---
168
+
169
+ ## Phase 4 — Schedule (confirm, then run)
170
+
171
+ **Show the exact commands and the org counts, then wait for explicit confirmation** before running any
172
+ `schedule`. Once approved, write each batch's CSV file (contents exactly as confirmed in Phase 3), then
173
+ run one command per batch:
174
+
175
+ ```bash
176
+ sf package push-upgrade schedule \
177
+ --target-dev-hub <devhub> \
178
+ --package <04t-target-version> \
179
+ --org-file push-batch-1-amer.csv \
180
+ --start-time "2026-08-11T09:00:00"
181
+ ```
182
+
183
+ Notes and variants:
184
+ - Omit `--start-time` to run **as soon as possible**.
185
+ - Use `--org-list <id1,id2,...>` instead of `--org-file` for a handful of orgs.
186
+ - For a **1GP→2GP push migration**, add `--migrate-to-2gp` (required when the target orgs have the 1GP
187
+ version installed).
188
+ - Each successful `schedule` returns a **`0DV` push request ID** — capture every one; you need them to
189
+ monitor and to abort.
190
+
191
+ After scheduling, record the batch → `0DV` mapping for the user (a small table).
192
+
193
+ ---
194
+
195
+ ## Phase 5 — Monitor, triage, and abort
196
+
197
+ **Prefer the CLI for status; it takes the 15-char `0DV` from `schedule` directly** (no need to expand
198
+ the ID). Only drop to SOQL for per-org detail, errors, or a durable status rollup.
199
+
200
+ > **Not every failure yields a queryable row.** A request rejected at **schedule time** (e.g. an
201
+ > ineligible/non-subscriber org id → `INVALID_OPERATION`) is stranded at `Created` with **zero
202
+ > `PackagePushJob` rows**, so the SOQL below returns nothing. Its only trace is `schedule`'s own
203
+ > output/exit code and a local `<cwd>/job_errors/push_request_<id>_errors.log` file — pair SOQL polling
204
+ > with checking `schedule`'s result; don't read "no job rows" as "nothing went wrong."
205
+
206
+ **Report** one request — the primary status check:
207
+ ```bash
208
+ sf package push-upgrade report --target-dev-hub <devhub> --push-request-id <0DV>
209
+ ```
210
+
211
+ **List** all requests for the package (033):
212
+ ```bash
213
+ sf package push-upgrade list --target-dev-hub <devhub> --package <033> --scheduled-last-days 30
214
+ ```
215
+ Filter with `--status` — the CLI enum is `Created | Cancelled | Pending | In Progress | Failed |
216
+ Succeeded` (note the CLI uses `Cancelled`/`In Progress`; the **object** picklist uses
217
+ `Canceled`/`InProgress` — see `references/objects.md`). Add `--show-push-migrations-only` for migrations.
218
+
219
+ When reading either command programmatically, add `--json` and parse the stable keys — do **not** scrape
220
+ the human table (its columns, including the `Num Orgs *` counts, are display-only and vary by CLI
221
+ version). See `references/cli-reference.md` → "Surviving CLI drift".
222
+
223
+ ### Dropping to SOQL — resolve the full 18-char Id first
224
+
225
+ The `0DV` returned by `schedule` is **15 characters**. The CLI accepts it as-is, but for direct object
226
+ queries there are two gotchas the live run exposed:
227
+ - **Do not** guess the 3-char suffix (e.g. appending `4A2`) to build the 18-char Id — it varies per record.
228
+ - **`Id LIKE '<0DV>%'` is not supported** on ID fields — it errors.
229
+
230
+ Resolve the canonical 18-char Id once (a 15-char value **is** valid in an `Id =` filter), then reuse it:
231
+ ```bash
232
+ sf data query --target-org <devhub> --json \
233
+ --query "SELECT Id, Status FROM PackagePushRequest WHERE Id = '<0DV>'"
234
+ ```
235
+
236
+ **Status rollup (durable source)** — for "how many orgs succeeded/failed," query the jobs directly
237
+ rather than relying on CLI table decorations:
238
+ ```bash
239
+ sf data query --target-org <devhub> \
240
+ --query "SELECT Status, COUNT(Id) total FROM PackagePushJob WHERE PackagePushRequestId = '<0DV-18char>' GROUP BY Status"
241
+ ```
242
+
243
+ From that rollup, **report progress explicitly** — don't just echo the raw counts:
244
+
245
+ - **% complete** = `(Succeeded + Failed) / total` — the fraction of orgs Salesforce has finished
246
+ attempting. State how many remain `Pending`/`InProgress`.
247
+ - **% success** = `Succeeded / (Succeeded + Failed)` — the quality signal. Divide by orgs *attempted*,
248
+ **not** `total`, or still-queued orgs will drag the number down and read like failures.
249
+ - **Across batches**, report the *overall rollout* as **% complete = orgs attempted / total planned**
250
+ (e.g. 40 of 80 = 50%), keeping per-batch **% success** separate. Don't headline a single blended
251
+ "% now on the target version" — attempted-vs-planned and succeeded-vs-attempted are different signals,
252
+ and collapsing them misstates where the rollout stands.
253
+
254
+ The job `Status` picklist is `Created | Pending | InProgress | Succeeded | Failed | Canceled` (the object
255
+ uses `InProgress`/`Canceled` — one word — unlike the CLI's `In Progress`/`Cancelled`).
256
+
257
+ **Per-org detail and errors** — go to the objects when a request shows failures. One `PackagePushJob`
258
+ is created per org; failures attach `PackagePushError` rows:
259
+ ```bash
260
+ sf data query --target-org <devhub> \
261
+ --query "SELECT Id, SubscriberOrganizationKey, Status, StartTime, EndTime FROM PackagePushJob WHERE PackagePushRequestId = '<0DV-18char>'"
262
+
263
+ sf data query --target-org <devhub> \
264
+ --query "SELECT PackagePushJobId, ErrorSeverity, ErrorType, ErrorTitle, ErrorMessage, ErrorDetails FROM PackagePushError WHERE PackagePushJobId IN (SELECT Id FROM PackagePushJob WHERE PackagePushRequestId = '<0DV-18char>')"
265
+ ```
266
+ `ErrorType` values include `DeployError`, `ApexTestFailure`, `LockingFailure`, `IneligibleUpgrade`.
267
+ Summarize failures by `ErrorType` so the user can decide whether to re-push a subset.
268
+
269
+ ### Decide: continue, hold, or re-push (when the failure rate is high)
270
+
271
+ Staggering only pays off if you **act on a bad batch before the next one runs**. After each batch:
272
+
273
+ 1. **Gate the next batch on this batch's result.** Compute the batch's failure rate from the rollup
274
+ above. If it exceeds your tolerance for the blast radius — a reasonable default is **≥10–20%**,
275
+ tighter for large batches — **hold the rollout**: do **not** schedule the next batch, and `abort`
276
+ any next batch already sitting in `Pending`. You **cannot** abort a request that's already
277
+ `InProgress` or completed (see Abort below), so the real lever is the *unstarted* batch, never the
278
+ running one — never promise to stop a batch that's already executing.
279
+ 2. **Triage by `ErrorType` before you decide — not every failure means stop.**
280
+ - `LockingFailure` / `IneligibleUpgrade` are often **transient or filterable** (org temporarily
281
+ busy, or an org slipped to/above the target). Usually safe to **re-push the affected subset**
282
+ after retrying or excluding them, without halting the plan.
283
+ - `DeployError` / `ApexTestFailure` usually signal a **real defect in the version**. Stop the
284
+ rollout, fix the package, cut and validate a **new version**, and restart — don't re-push the
285
+ same build and expect a different result.
286
+ 3. **Re-push a subset, not everyone.** Build a fresh CSV of only the failed `OrgKey`s
287
+ (`PackagePushJob WHERE Status = 'Failed'`) once the cause is understood or a fix is shipped, then
288
+ re-run Phase 4 for just that list.
289
+
290
+ ### Confirm the upgrade actually landed
291
+
292
+ A `Succeeded` request/job is the request's own view. For real proof, verify the **installed version**:
293
+
294
+ - **On the Dev Hub** — re-query `PackageSubscriber`; the row's `MetadataPackageVersionId` should equal the
295
+ target 04t. This snapshot can briefly **race** the push (a check moments after `Succeeded` may still
296
+ show the old version) — re-query rather than concluding it failed.
297
+ ```bash
298
+ sf data query --target-org <devhub> --json \
299
+ --query "SELECT OrgKey, MetadataPackageVersionId, SystemModstamp FROM PackageSubscriber WHERE MetadataPackageId = '<033>' AND OrgKey = '<orgId>'"
300
+ ```
301
+ - **Inside the subscriber org** (ground truth, if you can authenticate to it) — check
302
+ `InstalledSubscriberPackage`. Note `SubscriberPackage.NamespacePrefix` **can't be filtered** in the
303
+ WHERE clause; select it and filter client-side:
304
+ ```bash
305
+ sf data query --target-org <subscriber-org> --use-tooling-api --json \
306
+ --query "SELECT SubscriberPackage.Name, SubscriberPackage.NamespacePrefix, SubscriberPackageVersionId, SubscriberPackageVersion.MajorVersion, SubscriberPackageVersion.MinorVersion, SubscriberPackageVersion.PatchVersion, SubscriberPackageVersion.BuildNumber FROM InstalledSubscriberPackage"
307
+ ```
308
+
309
+ **Abort** — only requests in `Created` or `Pending` can be aborted (an in-progress/completed one can't).
310
+ Takes the 15-char `0DV` directly:
311
+ ```bash
312
+ sf package push-upgrade abort --target-dev-hub <devhub> --push-request-id <0DV>
313
+ ```
314
+ Confirm with the user before aborting.
315
+
316
+ ---
317
+
318
+ ## Output discipline
319
+
320
+ Write a single, focused plan the user can act on — not an exhaustive report:
321
+ - Include only the sections the request calls for. Discovery-only, verification-only, or hold/abort
322
+ requests do **not** need a batch schedule — don't invent one.
323
+ - State each computed number once (%, counts, decisions). One triage table beats five per-error sections.
324
+ - Give each command block once. Don't emit speculative re-schedule/re-query blocks for steps the user
325
+ hasn't reached unless they asked for the forward plan.
326
+ - Show CSV contents inline as fenced code blocks, and do **not** write separate `.csv` files while
327
+ planning — the plan stays the single deliverable. The files are only created at schedule time (Phase 4).
328
+ - Lead with the decision, then a one-to-two-sentence reason. Cut restatement.
329
+
330
+ ## Guardrails
331
+
332
+ - **Never** run `schedule` or `abort` without showing the command + affected org count and getting a yes.
333
+ - The target version must be **active, non-beta, released, non-deprecated**. Push upgrades **can't
334
+ downgrade**, so the target must be **≥** each org's installed version. An org **already at** the
335
+ target is a **silent no-op** — the request and its job report `Succeeded` (no `PackagePushError`), it
336
+ does **not** fail — so exclude same-version orgs up front instead of relying on a failure to catch them.
337
+ - `--start-time` is **UTC** — always show the local-time intent alongside the UTC value you send.
338
+ - Filter out restricted orgs (`HasRestrictionEnabled = true`) before scheduling; don't let the request
339
+ fail on them.
340
+ - **Hold the rollout on a bad batch.** If a batch's failure rate exceeds your threshold, do not schedule
341
+ the next batch (and `abort` any next batch still `Pending`) until the errors are triaged — an
342
+ `InProgress` or completed batch can't be stopped, so the only lever is the unstarted one.
343
+ - Push upgrades can affect customer **data**, not just metadata. If the version includes destructive or
344
+ integration-breaking changes (validation rules, formula fields, removed components), call it out and
345
+ push to sandboxes first.
346
+ - New/changed components are assigned **only to admins** by default. If the version adds features users
347
+ need, remind the user to ship a **post-install script + permission set** (see best-practices).
348
+
349
+ ## References
350
+
351
+ - `references/cli-reference.md` — verified `sf package push-upgrade` subcommands and flags.
352
+ - `references/objects.md` — field reference for PackageSubscriber, PackagePushRequest, PackagePushJob,
353
+ PackagePushError, MetadataPackageVersion.
354
+ - `references/soql-recipes.md` — ready-to-run subscriber and monitoring queries.
355
+ - `references/best-practices.md` — timing, testing, staggering, and communication guidance.
@@ -0,0 +1,61 @@
1
+ # Push upgrade best practices
2
+
3
+ Source: Salesforce "Push Upgrade Best Practices" (2GP dev guide). Push upgrades change a package in a
4
+ customer's org **without their action** — poor planning "can result in significant customer
5
+ satisfaction issues," and buggy upgrades can affect **data**, not just metadata.
6
+
7
+ ---
8
+
9
+ ## Timing & scheduling
10
+
11
+ - Give customers an **upgrade timeline** up front: when and how often you'll push.
12
+ - **Avoid disruptive windows**: month-end, quarter-end, year-end, audit cycles, and any period when the
13
+ customer lacks staff to verify.
14
+ - Schedule for the customer's **off-peak hours** (late evening/night). Account for time zones —
15
+ **group orgs by time zone** (use `InstanceName` as a proxy) and schedule each group separately.
16
+ `--start-time` is **UTC**; convert deliberately.
17
+ - Steer clear of **Salesforce maintenance windows**, and ideally **wait 3–4 weeks after a major
18
+ Salesforce release** before pushing major upgrades.
19
+
20
+ ## Testing (a higher bar than customer-pulled upgrades)
21
+
22
+ - Push to **your own test orgs first**, then log in and verify.
23
+ - Where possible, push to **customer sandboxes first** and allow **a week or more** to test, validate,
24
+ and fix before touching production.
25
+ - Add an **Apex test-on-install** for basic sanity checks during the upgrade.
26
+
27
+ ## Staggering / batching
28
+
29
+ - **Don't push to everyone at once.** Staggering protects support capacity and catches issues early.
30
+ - Start with **small production batches** (e.g. 50–100 of 1,000 customers); enlarge batches only after
31
+ clean runs build confidence.
32
+
33
+ ## Customer trust & communication
34
+
35
+ - You are responsible for ensuring customer orgs **aren't adversely affected**.
36
+ - Avoid changes that can break customer integrations (new **validation rules**, **formula fields**,
37
+ removed components). If unavoidable, **test thoroughly and communicate well in advance**.
38
+ - **Enhancing an existing feature:** use a **post-install script** to auto-assign new components via
39
+ **permission sets** — by default, new/changed components are assigned **only to admins**.
40
+ - **Brand-new features:** do **not** auto-assign. Coordinate with org admins on access and rollout timing.
41
+
42
+ ---
43
+
44
+ ## Eligibility reminders
45
+
46
+ - **2GP managed:** must have **passed AppExchange security review**; enable via a **Partner Community
47
+ support case**. Manageability rules for normal upgrades also apply to pushes.
48
+ - **Unlocked:** enabled by default.
49
+ - Target version must be **active, non-beta, released, non-deprecated**, and **strictly higher** than
50
+ each target org's installed version.
51
+ - **Subscriber restrictions:** if a subscriber has restricted push upgrades
52
+ (`HasRestrictionEnabled = true` / `CustomUpgradeType = 'BlockedBySubscriber'`), exclude them — the
53
+ request errors on restricted orgs.
54
+
55
+ ## A sane rollout template
56
+
57
+ 1. Push to internal test orgs → verify by logging in.
58
+ 2. Push to customer **sandboxes** → soak ≥ 1 week.
59
+ 3. Production **pilot** batch (50–100), off-peak, one time zone → monitor `PackagePushJob`/`PackagePushError`.
60
+ 4. Grow production batches by time zone, off-peak, avoiding risky windows, only after clean runs.
61
+ 5. Ship a post-install script + permission set if the version adds features users need immediately.
@@ -0,0 +1,148 @@
1
+ # `sf package push-upgrade` — CLI reference
2
+
3
+ Verified against `@salesforce/cli` 2.145.6 (`sf package push-upgrade <cmd> --help`). Re-run
4
+ `--help` to confirm flags on newer CLI versions. All commands target the **Dev Hub / package-owning
5
+ org** via `-v/--target-dev-hub` (or the `target-dev-hub` config var).
6
+
7
+ Common global flags on every subcommand: `--json`, `--flags-dir <dir>`, `--api-version <value>`.
8
+
9
+ ### Surviving CLI drift
10
+
11
+ The CLI has two output contracts with **opposite** stability — treat them differently:
12
+
13
+ - **`--json`** is the machine contract. Keys map to the `PackagePushRequest` API fields and change
14
+ rarely (with deprecation). **Parse this** whenever the skill reads output programmatically. The
15
+ documented key sets below were captured from live `--json` runs.
16
+ - **The human table** is display-only. Column order, labels, and even which columns appear (e.g. the
17
+ `Num Orgs *` decorations) are presentation and can change in any CLI release. **Never parse the
18
+ table.**
19
+ - **Flags** can also change. If a command errors or output looks unexpected, run
20
+ `sf package push-upgrade <cmd> --help` to re-verify against the installed CLI version rather than
21
+ trusting this file — this reference is a snapshot, `--help` is ground truth.
22
+ - For counts/rollups the skill needs, prefer **direct object queries** (`PackagePushJob GROUP BY
23
+ Status`) over anything the CLI only surfaces in its table — object fields are the stable source.
24
+
25
+ ---
26
+
27
+ ## schedule — create a push upgrade request
28
+
29
+ ```bash
30
+ sf package push-upgrade schedule -v <devhub> -p <04t> [-l <orgIds> | -f <csv>] [-t <UTC>] [--migrate-to-2gp]
31
+ ```
32
+
33
+ | Flag | Required | Meaning |
34
+ |------|----------|---------|
35
+ | `-p, --package <04t>` | yes | Package **version** ID (starts `04t`) the orgs are upgraded **to**. Must be an active, non-beta version. |
36
+ | `-v, --target-dev-hub <alias>` | yes | Dev Hub that owns the package. |
37
+ | `-l, --org-list <ids>` | one of -l/-f | Comma-separated subscriber org IDs to upgrade. |
38
+ | `-f, --org-file <csv>` | one of -l/-f | CSV file, **one org ID per line, no header**. All listed orgs must have a version **lower** than `--package`. |
39
+ | `-t, --start-time <UTC>` | no | Earliest UTC datetime Salesforce should attempt the upgrade, e.g. `"2026-08-11T09:00:00"`. Omit to start ASAP. |
40
+ | `--migrate-to-2gp` | no | Push-migrate orgs that have the **1GP** version installed to the converted 2GP version. |
41
+
42
+ Returns a **push request ID** (starts `0DV`). Capture it.
43
+
44
+ **Output (verified via `--json`).** `result` is a single object with keys `PushRequestId` (the `0DV` —
45
+ note the key is `PushRequestId`, not `Id`), `ScheduledStartTime`, and `Status`. A freshly scheduled
46
+ request comes back with status **`Pending`** (not `Created`) when a future `--start-time` is set. Parse
47
+ `PushRequestId` from `--json` rather than scraping the table. **`ScheduledStartTime` is populated only
48
+ when you pass `--start-time`** — for an ASAP schedule (no `--start-time`) it can be **absent/null** in
49
+ the response, so don't rely on it being present in the immediate case.
50
+
51
+ Examples:
52
+ ```bash
53
+ # At a specific time, from a CSV
54
+ sf package push-upgrade schedule --package 04txyz --start-time "2024-12-06T21:00:00" \
55
+ --org-file upgrade-orgs.csv --target-dev-hub myHub
56
+
57
+ # As soon as possible
58
+ sf package push-upgrade schedule --package 04txyz --org-file upgrade-orgs.csv --target-dev-hub myHub
59
+
60
+ # 1GP -> 2GP push migration
61
+ sf package push-upgrade schedule --migrate-to-2gp --package 04txyz \
62
+ --start-time "2024-12-06T21:00:00" --org-file upgrade-orgs.csv --target-dev-hub myHub
63
+ ```
64
+
65
+ **Schedule-time validation failures write a local log and create no job rows.** If `schedule` rejects
66
+ the request — e.g. `INVALID_OPERATION: The specified SubscriberOrganizationKey is not eligible to
67
+ receive this upgrade` for a non-subscriber or otherwise ineligible org id — the CLI writes an error log
68
+ to `<cwd>/job_errors/push_request_<id>_errors.log` (relative to your **current working directory**, so
69
+ it can land in your repo), and the resulting `PackagePushRequest` is stranded at `Created` with **zero
70
+ `PackagePushJob` rows**. Nothing is queryable: `PackagePushJob`/`PackagePushError` return no rows for
71
+ this failure mode, so the request's error lives **only** in `schedule`'s exit code / stderr / `--json`
72
+ output and that local log file. Check `schedule`'s own result — don't rely on SOQL polling to reveal a
73
+ schedule-time rejection.
74
+
75
+ ---
76
+
77
+ ## list — status of push requests for a package
78
+
79
+ ```bash
80
+ sf package push-upgrade list -v <devhub> -p <033> [-l <days>] [-s <status>] [--show-push-migrations-only]
81
+ ```
82
+
83
+ | Flag | Required | Meaning |
84
+ |------|----------|---------|
85
+ | `-p, --package <033>` | yes | **Package** ID (starts `033`, not the 04t version) to report on. |
86
+ | `-v, --target-dev-hub <alias>` | yes* | Dev Hub. Not required if `target-dev-hub` config is set. |
87
+ | `-l, --scheduled-last-days <n>` | no | Only requests scheduled within the last *n* days. |
88
+ | `-s, --status <value>` | no | Filter by `Created`, `Cancelled`, `Pending`, `In Progress`, `Failed`, or `Succeeded`. |
89
+ | `--show-push-migrations-only` | no | Only 1GP→2GP push-migration requests. |
90
+
91
+ All filters are AND-ed. Example:
92
+ ```bash
93
+ sf package push-upgrade list --package 033xyz --scheduled-last-days 30 --target-dev-hub myHub
94
+ ```
95
+
96
+ **Output — parse `--json`, not the table.** `--json` `result` is an **array** of records; each record's
97
+ stable keys (verified via `--json`): `Id`, `PackageVersionId`, `PackageVersion`, `Status`,
98
+ `ScheduledStartTime`, `StartTime`, `EndTime`, `IsMigration`. The human table additionally shows
99
+ display-only decorations such as `Num Orgs Scheduled` / `Num Orgs Upgraded Fail` / `Num Orgs Upgraded
100
+ Success` and a version name/number — these are **not** in `--json` and their columns/labels can change
101
+ between CLI versions. For a durable per-status org rollup, query `PackagePushJob GROUP BY Status`
102
+ (see `soql-recipes.md`) rather than scraping the table.
103
+
104
+ ---
105
+
106
+ ## report — detail for one push request
107
+
108
+ ```bash
109
+ sf package push-upgrade report -v <devhub> -i <0DV>
110
+ ```
111
+
112
+ | Flag | Required | Meaning |
113
+ |------|----------|---------|
114
+ | `-i, --push-request-id <0DV>` | yes | The request ID returned by `schedule`. |
115
+ | `-v, --target-dev-hub <alias>` | yes* | Dev Hub (or config var). |
116
+
117
+ **Output — parse `--json`.** `--json` `result` is a **single object** with stable keys (verified):
118
+ `Id`, `PackageVersionId`, `PackageVersion`, `Status`, `ScheduledStartTime`, `StartTime`, `EndTime`,
119
+ `DurationSeconds`. (Note the shape differs from `list`: `report` returns one object with
120
+ `DurationSeconds`; `list` returns an array with `IsMigration`.) `report` gives request-level status
121
+ only — for per-org detail and errors, go to `PackagePushJob` / `PackagePushError`.
122
+
123
+ ---
124
+
125
+ ## abort — cancel a scheduled push request
126
+
127
+ ```bash
128
+ sf package push-upgrade abort -v <devhub> -i <0DV>
129
+ ```
130
+
131
+ | Flag | Required | Meaning |
132
+ |------|----------|---------|
133
+ | `-i, --push-request-id <0DV>` | yes | Request to cancel. |
134
+ | `-v, --target-dev-hub <alias>` | yes* | Dev Hub (or config var). |
135
+
136
+ Only requests with status **`Created` or `Pending`** can be aborted. In-progress or completed
137
+ requests cannot.
138
+
139
+ ---
140
+
141
+ ## Enablement / eligibility (from docs)
142
+
143
+ - **2GP managed:** available only for packages that **passed AppExchange security review**; enable the
144
+ feature by logging a **Salesforce Partner Community support case**. CLI + API (no UI).
145
+ - **Unlocked:** push upgrades enabled by default. CLI + API.
146
+ - **1GP managed:** API + UI only (no CLI schedule); use `--migrate-to-2gp` when pushing the converted
147
+ 2GP version onto 1GP installs.
148
+ - Scheduling requires the **Create and Update Second-Generation Packages** user permission.