Plans, schedules, and monitors Salesforce package push upgrades from a Dev Hub. Finds subscriber orgs, validates target version, builds batched rollout, generates CSV, runs sf CLI commands after confirmation, and monitors push jobs.
Ships in sf-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Plan and drive a Salesforce package push upgrade end-to-end: find subscriber orgs, resolve the
target version, batch a schedule per best practices, generate the org CSV, run the sf CLI
push-upgrade commands after explicit confirmation, and monitor the results.
Push upgrades change a package in the customer's org without their action. This is outward-facing
and hard to reverse. The default posture of this skill is generate → preview → confirm → run:
never call push-upgrade schedule or push-upgrade abort until the user has seen the batch plan and
the org list and said go. See references/best-practices.md before scheduling anything to production.
Gather these from the user's request; parse identifiers loosely wherever they appear:
033 → the package ID (MetadataPackageId for queries, --package for list).04t → the target package version ID (--package for schedule).0DV → an existing push request ID (jump straight to Phase 5, monitoring).If the Dev Hub is not given, assume the default Dev Hub owns the package and verify by querying rather than prompting up front:
sf config get target-dev-hub --json. If none is set, skip to step 3.033/04t
(or SELECT Id, Name FROM MetadataPackage if only a name is known). If it returns the package,
you've confirmed ownership and done Phase 1 in one step — proceed, naming the resolved Dev Hub.sf org list --json and ask the user which Dev Hub owns the package, then re-probe.This keeps the happy path unattended while still catching a wrong/empty hub before any subscriber query or plan. Push upgrade objects and commands run against the Dev Hub / package-owning org, not a subscriber org.
Establish these before doing anything else; ask only for what you can't infer:
--migrate-to-2gp).
sf org display --target-org <devhub> --json. If it fails, tell the
user to run sf org login web --alias <devhub> and wait.Do not assume security-review/enablement status — if the user hasn't confirmed it, note it as a prerequisite they must verify, and continue building the plan (it's still valid).
Goal: end with a confirmed 033 package ID and a 04t target version ID that is a valid push target.
If the Dev Hub was resolved via the default-hub probe in Inputs above, that probe already ran this resolution query — you may already have the package/version in hand. Don't re-query; pick up at validation (step 2).
sf data query --target-org <devhub> \
--query "SELECT Id, MetadataPackageId, Name, MajorVersion, MinorVersion, PatchVersion, BuildNumber, ReleaseState, IsDeprecated FROM MetadataPackageVersion WHERE Id = '<04t>'"
ReleaseState = Released (not Beta) and IsDeprecated = false. The CLI requires an
active, non-beta version.sf data query --target-org <devhub> \
--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"
See references/objects.md for full field lists.
Query PackageSubscriber on the Dev Hub / License Management Org to discover who has the package
installed and at what version. OrgKey is the org ID that goes in the CSV.
Baseline query (installed subscribers on production orgs, below the target version):
sf data query --target-org <devhub> \
--query "SELECT OrgKey, OrgName, OrgStatus, OrgType, InstanceName, MetadataPackageVersionId, InstalledStatus, HasRestrictionEnabled FROM PackageSubscriber WHERE MetadataPackageId = '<033>' AND InstalledStatus = 'i'"
Then apply the eligibility filters — this is where the skill adds judgment. Walk the user through:
InstalledStatus = 'i' ('u' = uninstalled/not installed).MetadataPackageVersionId equals the target 04t,
and resolve each subscriber's version numbers so you push only to orgs strictly below the target.
Push upgrades can't downgrade; an org already at the target is a silent no-op (request/job
report Succeeded, no error), not a detectable failure — so filter these out up front.OrgType. Best practice is to pilot in sandboxes first, then
production. Offer to split the list by OrgType.OrgStatus is Active/Demo/Free/Inactive/Trial, and is independent of
OrgType (a Production org can be Trial/Demo/Free). Typically exclude only Inactive
(OrgStatus != 'Inactive'); do not whitelist = 'Active' or you'll silently drop live
non-Active production subscribers.HasRestrictionEnabled = true or CustomUpgradeType = 'BlockedBySubscriber'. Pushing to a
restricted org will error; filter them out up front and report the count.Report a summary table (counts by OrgType, by current version, restricted/excluded) so the user can
sanity-check the population before batching. See references/soql-recipes.md for ready-to-run variants.
Do not write any .csv file in this phase. The plan is the only deliverable here — CSVs are a
Phase 4 action, created only after the user approves and you are about to run schedule. Before you
end this turn, confirm you have written at most one file (the plan itself); if you find yourself
about to call a file-write tool with a .csv path, stop — that belongs in Phase 4, not here.
Do not dump every org into one request. Propose a batch plan grounded in
references/best-practices.md:
InstanceName/time zone where possible. --start-time is UTC — state the local-time intent
and the UTC value you computed.Produce a concrete plan the user approves, e.g.:
Batch Population Count Local target --start-time (UTC)
0 Sandboxes (pilot) 12 immediate (omit -t)
1 Prod, AMER off-peak 80 Tue 02:00 PT 2026-08-11T09:00:00
2 Prod, EMEA off-peak 140 Wed 02:00 CEST 2026-08-12T00:00:00
3 Prod, APAC off-peak 60 Thu 02:00 AEST 2026-08-12T16:00:00
...
Convert each batch with the UTC offset in force on the push date, not the region's standard offset
(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
October). Regions east of UTC cross the date line: 02:00 local on Thursday is Wednesday in UTC, so
the UTC date in --start-time is the day before the local date. Show both in the plan.
For each batch, show the org-ID CSV inline as a fenced code block — one OrgKey per line, no
header, one org ID per row — labeled with the filename it will be saved under (e.g.
push-batch-1-amer.csv). Confirm the contents with the user. Don't create the .csv files while
planning; write them in Phase 4, only once the user approves and you are about to run schedule.
Show the exact commands and the org counts, then wait for explicit confirmation before running any
schedule. Once approved, write each batch's CSV file (contents exactly as confirmed in Phase 3), then
run one command per batch:
sf package push-upgrade schedule \
--target-dev-hub <devhub> \
--package <04t-target-version> \
--org-file push-batch-1-amer.csv \
--start-time "2026-08-11T09:00:00"
Notes and variants:
--start-time to run as soon as possible.--org-list <id1,id2,...> instead of --org-file for a handful of orgs.--migrate-to-2gp (required when the target orgs have the 1GP
version installed).schedule returns a 0DV push request ID — capture every one; you need them to
monitor and to abort.After scheduling, record the batch → 0DV mapping for the user (a small table).
Prefer the CLI for status; it takes the 15-char 0DV from schedule directly (no need to expand
the ID). Only drop to SOQL for per-org detail, errors, or a durable status rollup.
Not every failure yields a queryable row. A request rejected at schedule time (e.g. an ineligible/non-subscriber org id →
INVALID_OPERATION) is stranded atCreatedwith zeroPackagePushJobrows, so the SOQL below returns nothing. Its only trace isschedule's own output/exit code and a local<cwd>/job_errors/push_request_<id>_errors.logfile — pair SOQL polling with checkingschedule's result; don't read "no job rows" as "nothing went wrong."
Report one request — the primary status check:
sf package push-upgrade report --target-dev-hub <devhub> --push-request-id <0DV>
List all requests for the package (033):
sf package push-upgrade list --target-dev-hub <devhub> --package <033> --scheduled-last-days 30
Filter with --status — the CLI enum is Created | Cancelled | Pending | In Progress | Failed | Succeeded (note the CLI uses Cancelled/In Progress; the object picklist uses
Canceled/InProgress — see references/objects.md). Add --show-push-migrations-only for migrations.
When reading either command programmatically, add --json and parse the stable keys — do not scrape
the human table (its columns, including the Num Orgs * counts, are display-only and vary by CLI
version). See references/cli-reference.md → "Surviving CLI drift".
The 0DV returned by schedule is 15 characters. The CLI accepts it as-is, but for direct object
queries there are two gotchas the live run exposed:
4A2) to build the 18-char Id — it varies per record.Id LIKE '<0DV>%' is not supported on ID fields — it errors.Resolve the canonical 18-char Id once (a 15-char value is valid in an Id = filter), then reuse it:
sf data query --target-org <devhub> --json \
--query "SELECT Id, Status FROM PackagePushRequest WHERE Id = '<0DV>'"
Status rollup (durable source) — for "how many orgs succeeded/failed," query the jobs directly rather than relying on CLI table decorations:
sf data query --target-org <devhub> \
--query "SELECT Status, COUNT(Id) total FROM PackagePushJob WHERE PackagePushRequestId = '<0DV-18char>' GROUP BY Status"
From that rollup, report progress explicitly — don't just echo the raw counts:
(Succeeded + Failed) / total — the fraction of orgs Salesforce has finished
attempting. State how many remain Pending/InProgress.Succeeded / (Succeeded + Failed) — the quality signal. Divide by orgs attempted,
not total, or still-queued orgs will drag the number down and read like failures.The job Status picklist is Created | Pending | InProgress | Succeeded | Failed | Canceled (the object
uses InProgress/Canceled — one word — unlike the CLI's In Progress/Cancelled).
Per-org detail and errors — go to the objects when a request shows failures. One PackagePushJob
is created per org; failures attach PackagePushError rows:
sf data query --target-org <devhub> \
--query "SELECT Id, SubscriberOrganizationKey, Status, StartTime, EndTime FROM PackagePushJob WHERE PackagePushRequestId = '<0DV-18char>'"
sf data query --target-org <devhub> \
--query "SELECT PackagePushJobId, ErrorSeverity, ErrorType, ErrorTitle, ErrorMessage, ErrorDetails FROM PackagePushError WHERE PackagePushJobId IN (SELECT Id FROM PackagePushJob WHERE PackagePushRequestId = '<0DV-18char>')"
ErrorType values include DeployError, ApexTestFailure, LockingFailure, IneligibleUpgrade.
Summarize failures by ErrorType so the user can decide whether to re-push a subset.
Staggering only pays off if you act on a bad batch before the next one runs. After each batch:
abort
any next batch already sitting in Pending. You cannot abort a request that's already
InProgress or completed (see Abort below), so the real lever is the unstarted batch, never the
running one — never promise to stop a batch that's already executing.ErrorType before you decide — not every failure means stop.
LockingFailure / IneligibleUpgrade are often transient or filterable (org temporarily
busy, or an org slipped to/above the target). Usually safe to re-push the affected subset
after retrying or excluding them, without halting the plan.DeployError / ApexTestFailure usually signal a real defect in the version. Stop the
rollout, fix the package, cut and validate a new version, and restart — don't re-push the
same build and expect a different result.OrgKeys
(PackagePushJob WHERE Status = 'Failed') once the cause is understood or a fix is shipped, then
re-run Phase 4 for just that list.A Succeeded request/job is the request's own view. For real proof, verify the installed version:
PackageSubscriber; the row's MetadataPackageVersionId should equal the
target 04t. This snapshot can briefly race the push (a check moments after Succeeded may still
show the old version) — re-query rather than concluding it failed.
sf data query --target-org <devhub> --json \
--query "SELECT OrgKey, MetadataPackageVersionId, SystemModstamp FROM PackageSubscriber WHERE MetadataPackageId = '<033>' AND OrgKey = '<orgId>'"
InstalledSubscriberPackage. Note SubscriberPackage.NamespacePrefix can't be filtered in the
WHERE clause; select it and filter client-side:
sf data query --target-org <subscriber-org> --use-tooling-api --json \
--query "SELECT SubscriberPackage.Name, SubscriberPackage.NamespacePrefix, SubscriberPackageVersionId, SubscriberPackageVersion.MajorVersion, SubscriberPackageVersion.MinorVersion, SubscriberPackageVersion.PatchVersion, SubscriberPackageVersion.BuildNumber FROM InstalledSubscriberPackage"
Abort — only requests in Created or Pending can be aborted (an in-progress/completed one can't).
Takes the 15-char 0DV directly:
sf package push-upgrade abort --target-dev-hub <devhub> --push-request-id <0DV>
Confirm with the user before aborting.
Write a single, focused plan the user can act on — not an exhaustive report:
.csv files while
planning — the plan stays the single deliverable. The files are only created at schedule time (Phase 4).schedule or abort without showing the command + affected org count and getting a yes.Succeeded (no PackagePushError), it
does not fail — so exclude same-version orgs up front instead of relying on a failure to catch them.--start-time is UTC — always show the local-time intent alongside the UTC value you send.HasRestrictionEnabled = true) before scheduling; don't let the request
fail on them.abort any next batch still Pending) until the errors are triaged — an
InProgress or completed batch can't be stopped, so the only lever is the unstarted one.references/cli-reference.md — verified sf package push-upgrade subcommands and flags.references/objects.md — field reference for PackageSubscriber, PackagePushRequest, PackagePushJob,
PackagePushError, MetadataPackageVersion.references/soql-recipes.md — ready-to-run subscriber and monitoring queries.references/best-practices.md — timing, testing, staggering, and communication guidance.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
salesforce-packaging, push-upgrade, 2gp, dev-hub, subscriber-orgs
/sf-skills:dx-packaging-push-upgrade-configurefrom sf-skills
sf-skills@sf-skills-plugin is listed by ccmalcom/sf-skills-plugin — review the source before installing
npx claudepluginhub ccmalcom/sf-skills-plugin --plugin sf-skills3 plugins in 2 repositories ship this exact skill · first indexed Nov 12, 2026
266 skills in this plugin
/afcc-setup-coordinateOrchestrates end-to-end headless setup of Agentforce Contact Center (AFCC) on a Salesforce org. Scans the org first, presents a delta plan for approval, then sequentially provisions demo users, Omni-Channel base settings, a human queue with routing config and members, presence statuses, permission sets, a PSTN voice number, and an active PstnVoice MessagingChannel wired to the queue. Interactive at key decision points — never assumes country, number type, queue names, or user counts. TRIGGER: set up AFCC, configure Agentforce Contact Center, stand up voice contact center, AFCC migration setup, provision AFCC org headlessly./agentforce-architecture-analyzeDeclared architecture snapshot for one Agentforce agent: planner, topics, actions, flows, Apex, prompt templates, and NGA plugins. Renders a human-readable architecture document and Mermaid invocation graph from design-time metadata (not runtime audit rows). TRIGGER when user asks to describe, diagram, inventory, audit, document, or diff (e.g. v3 vs v5) the architecture / action tree / topic structure / tool inventory of a specific agent by agent API name in a specific org. DO NOT TRIGGER for runtime session traces, conversation transcripts, generation timings, or gateway audit chains — this skill reads design-time metadata only (use agentforce-d360-analyze for session traces).Other plugins' skills for the same job