@salesforce/afv-skills 1.66.0 → 1.68.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.
- package/README.md +55 -5
- package/package.json +2 -4
- package/skills/agentforce-offline-experimentation-run/SKILL.md +26 -49
- package/skills/agentforce-offline-experimentation-run/scripts/bt_compare.py +81 -0
- package/skills/agentforce-offline-experimentation-run/scripts/bt_fetch.py +358 -0
- package/skills/agentforce-offline-experimentation-run/scripts/bt_patch_agent.py +110 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/__init__.py +34 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/agentpatch.py +483 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/agentsrc.py +565 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/cache.py +95 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/compare.py +617 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/fetch.py +1012 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/judge.py +148 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/messages.py +92 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/patch.py +327 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/redact.py +40 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/results.py +288 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/scoring.py +340 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/sfap.py +238 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/splits.py +136 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/stdm.py +98 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/tokens.py +173 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/units.py +199 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/versions.py +194 -0
- package/skills/agentforce-offline-experimentation-run/scripts/build_report.py +366 -378
- package/skills/agentforce-offline-experimentation-run/scripts/resolve-token.sh +14 -4
- package/skills/agentforce-offline-experimentation-run/scripts/sfap_replay.py +472 -796
- package/skills/commerce-react-storefront-create/SKILL.md +350 -0
- package/skills/consumer-goods-promotion-bo-api-deploy/SKILL.md +2 -2
- package/skills/consumer-goods-promotion-bo-api-deploy/references/generate-and-wire.md +28 -16
- package/skills/consumer-goods-promotion-bo-api-deploy/references/smoke-and-verify.md +18 -1
- package/skills/dx-lifecycle-center/SKILL.md +5 -2
- package/skills/dx-lifecycle-center/assets/widgets/connect-connected/connect-connected.json +65 -0
- package/skills/dx-lifecycle-center/assets/widgets/connect-connected/schema.json +32 -0
- package/skills/dx-lifecycle-center/assets/widgets/connect-sign-in/connect-sign-in.json +57 -0
- package/skills/dx-lifecycle-center/assets/widgets/connect-sign-in/schema.json +21 -0
- package/skills/dx-lifecycle-center/examples/workflows.md +20 -6
- package/skills/dx-lifecycle-center/references/connect-org.md +21 -2
- package/skills/dx-lifecycle-center/references/deploy.md +2 -2
- package/skills/dx-lifecycle-center/references/list-orgs.md +1 -1
- package/skills/dx-lifecycle-center/scripts/card-policy.jq +71 -0
- package/skills/dx-lifecycle-center/scripts/fill-widget.jq +29 -0
- package/skills/dx-lifecycle-center/scripts/widget.sh +28 -0
- package/skills/dx-org-devhub-configure/SKILL.md +85 -84
- package/skills/dx-org-devhub-configure/examples/status-output.md +25 -2
- package/skills/dx-org-devhub-configure/scripts/devhub.sh +265 -140
- package/skills/dx-org-devhub-configure/scripts/test-devhub.sh +100 -15
- package/skills/dx-packaging-move-to-2gp-migrate/SKILL.md +89 -0
- package/skills/dx-packaging-move-to-2gp-migrate/references/api-operations.md +164 -0
- package/skills/dx-scratch-def-configure/SKILL.md +163 -0
- package/skills/dx-scratch-def-configure/examples/confirm-card.md +53 -0
- package/skills/dx-scratch-def-configure/examples/report-recipes.md +100 -0
- package/skills/dx-scratch-def-configure/references/features.json +3270 -0
- package/skills/dx-scratch-def-configure/references/project-scratch-def.schema.json +1841 -0
- package/skills/dx-scratch-def-configure/references/settings-map.json +682 -0
- package/skills/dx-scratch-def-configure/scripts/lib_scratch_def.py +1306 -0
- package/skills/dx-scratch-def-configure/scripts/requirements.txt +3 -0
- package/skills/dx-scratch-def-configure/scripts/scrape_config_values.py +848 -0
- package/skills/education-cloud-domain-configure/SKILL.md +22 -24
- package/skills/education-cloud-domain-configure/references/dependent-features.md +9 -0
- package/skills/education-cloud-domain-configure/references/domain-features.md +15 -0
- package/skills/education-cloud-domain-configure/references/gotchas-extended.md +8 -0
- package/skills/education-cloud-domain-configure/references/setup-widgets.md +123 -0
- package/skills/education-cloud-multi-campus-configure/SKILL.md +1 -1
- package/skills/education-cloud-student-recruitment-agent-configure/SKILL.md +1 -1
- package/skills/experience-design-validate/SKILL.md +1 -1
- package/skills/experience-search-coordinate/SKILL.md +19 -13
- package/skills/experience-search-coordinate/references/content-route.md +79 -1
- package/skills/experience-search-coordinate/references/media-route.md +30 -4
- package/skills/experience-ui-bundle-features-generate/SKILL.md +1 -1
- package/skills/experience-ui-bundle-mfa-configure/SKILL.md +1 -1
- package/skills/field-service-data-capture-migrate/SKILL.md +1 -1
- package/skills/platform-apex-generate/SKILL.md +14 -11
- package/skills/platform-apex-test-generate/SKILL.md +2 -1
- package/skills/platform-datamask-run/SKILL.md +52 -71
- package/skills/platform-datamask-run/references/api-surface.md +10 -4
- package/skills/platform-datamask-run/references/policy-authoring.md +56 -7
- package/skills/platform-datamask-run/references/run-and-abort.md +17 -10
- package/skills/platform-datamask-run/scripts/poll-job.sh +15 -25
- package/skills/platform-dataspace-access-configure/SKILL.md +19 -1
- package/skills/platform-metadata-deploy/README.md +1 -1
- package/skills/platform-metadata-deploy/SKILL.md +114 -15
- package/skills/platform-metadata-deploy/references/agent-deployment-guide.md +3 -4
- package/skills/platform-metadata-deploy/references/orchestration.md +2 -3
- package/skills/platform-metadata-discovery-get/SKILL.md +185 -0
- package/skills/platform-metadata-discovery-get/references/api-map.md +25 -0
- package/skills/platform-metadata-discovery-get/references/h360-routes.md +30 -0
- package/skills/platform-metadata-discovery-get/references/scoped-soql.md +52 -0
- package/skills/platform-metadata-grounding-get/SKILL.md +170 -0
- package/skills/platform-policy-rule-generate/SKILL.md +84 -232
- package/skills/platform-policy-rule-generate/references/condition-model.md +47 -0
- package/skills/platform-policy-rule-generate/references/condition-templates.md +89 -0
- package/skills/platform-policy-rule-generate/references/conjunction-compiler.md +25 -0
- package/skills/platform-policy-rule-generate/references/conjunction-expression.md +22 -0
- package/skills/platform-policy-rule-generate/references/consumer-all.md +9 -0
- package/skills/platform-policy-rule-generate/references/consumer-datacloud-ui.md +91 -0
- package/skills/platform-policy-rule-generate/references/deploy-errors.md +24 -36
- package/skills/platform-policy-rule-generate/references/examples/ExistsJoinRLS/package.xml +12 -0
- package/skills/platform-policy-rule-generate/references/examples/ExistsJoinRLS/policyRuleDefinitionSets/ExistsJoinRLS.policyRuleDefinitionSet +6 -0
- package/skills/platform-policy-rule-generate/references/examples/ExistsJoinRLS/policyRuleDefinitions/ExistsJoinRLS_Rule_1.policyRuleDefinition +91 -0
- package/skills/platform-policy-rule-generate/references/examples/FieldReadDeny/package.xml +12 -0
- package/skills/platform-policy-rule-generate/references/examples/FieldReadDeny/policyRuleDefinitionSets/FieldReadDeny.policyRuleDefinitionSet +6 -0
- package/skills/platform-policy-rule-generate/references/examples/FieldReadDeny/policyRuleDefinitions/FieldReadDeny_Rule_1.policyRuleDefinition +72 -0
- package/skills/platform-policy-rule-generate/references/examples/LastCharactersFieldMasking/package.xml +12 -0
- package/skills/platform-policy-rule-generate/references/examples/LastCharactersFieldMasking/policyRuleDefinitionSets/LastCharactersFieldMasking.policyRuleDefinitionSet +6 -0
- package/skills/platform-policy-rule-generate/references/examples/LastCharactersFieldMasking/policyRuleDefinitions/LastCharactersFieldMasking_Rule_1.policyRuleDefinition +77 -0
- package/skills/platform-policy-rule-generate/references/examples/PrincipalFieldMatchRLS/package.xml +12 -0
- package/skills/platform-policy-rule-generate/references/examples/PrincipalFieldMatchRLS/policyRuleDefinitionSets/PrincipalFieldMatchRLS.policyRuleDefinitionSet +6 -0
- package/skills/platform-policy-rule-generate/references/examples/PrincipalFieldMatchRLS/policyRuleDefinitions/PrincipalFieldMatchRLS_Rule_1.policyRuleDefinition +77 -0
- package/skills/platform-policy-rule-generate/references/examples/TaggedObjectAccess/package.xml +12 -0
- package/skills/platform-policy-rule-generate/references/examples/TaggedObjectAccess/policyRuleDefinitionSets/TaggedObjectAccess.policyRuleDefinitionSet +4 -0
- package/skills/platform-policy-rule-generate/references/examples/TaggedObjectAccess/policyRuleDefinitions/TaggedObjectAccess_Rule_1.policyRuleDefinition +65 -0
- package/skills/platform-policy-rule-generate/references/headless-transport.md +87 -0
- package/skills/platform-policy-rule-generate/references/policy-schema-full.md +17 -10
- package/skills/platform-policy-rule-generate/references/policy-shapes.md +74 -0
- package/skills/platform-policy-rule-generate/references/principal-expression.md +31 -0
- package/skills/platform-policy-rule-generate/references/reference-resolution.md +51 -0
- package/skills/platform-policy-rule-generate/references/resource-expression.md +48 -0
- package/skills/platform-policy-rule-generate/references/runtime-context.md +9 -0
- package/skills/platform-policy-rule-generate/references/templates-access.md +11 -9
- package/skills/platform-policy-rule-generate/references/templates-advanced.md +4 -2
- package/skills/platform-policy-rule-generate/references/templates-record.md +37 -22
- package/skills/platform-policy-rule-generate/references/templates-transform.md +10 -8
- package/skills/platform-policy-rule-generate/references/templates.md +2 -2
- package/skills/platform-policy-rule-generate/references/ui-compatibility.md +35 -17
- package/skills/platform-report-generate/SKILL.md +9 -4
- package/skills/platform-report-generate/references/chart-types.md +26 -2
- package/skills/platform-report-generate/references/column-names.md +43 -0
- package/skills/platform-report-generate/references/errors-and-troubleshooting.md +1 -1
- package/skills/platform-report-generate/references/verification-checklist.md +10 -2
- package/skills/platform-value-set-generate/SKILL.md +19 -19
- package/skills/platform-widget-generate/SKILL.md +25 -51
- package/skills/platform-widget-generate/examples/formulas.json +19 -2
- package/skills/platform-widget-generate/examples/localized-labels.json +57 -0
- package/skills/platform-widget-generate/references/widget-actions.md +29 -0
- package/skills/platform-widget-generate/references/widget-bundle-validation.md +1 -0
- package/skills/platform-widget-generate/references/widget-formulas.md +24 -7
- package/skills/platform-widget-generate/references/widget-gotchas.md +10 -0
- package/skills/platform-widget-generate/references/widget-labels.md +78 -0
- package/skills/platform-widget-generate/references/widget-styling.md +12 -0
- package/skills/sales-call-scoring-configure/SKILL.md +17 -10
- package/skills/sales-call-scoring-configure/scripts/enable-call-scoring.sh +55 -33
- package/skills/service-digital-engagement-channel-configure/SKILL.md +11 -7
- package/skills/service-digital-engagement-channel-configure/assets/messaging_channel_template.xml +33 -0
- package/skills/service-digital-engagement-channel-configure/references/channel_settings.md +123 -16
- package/skills/service-digital-engagement-deployment-configure/SKILL.md +37 -100
- package/skills/service-digital-engagement-deployment-configure/assets/esd_web_update_template.xml +83 -8
- package/skills/service-digital-engagement-deployment-configure/examples/esd_web_prechat_fields.xml +74 -0
- package/skills/service-digital-engagement-deployment-configure/references/connect_api_creation.md +13 -3
- package/skills/service-digital-engagement-deployment-configure/references/deployment_settings.md +13 -78
- package/skills/service-digital-engagement-deployment-configure/references/onboarding_contract.md +5 -6
- package/skills/service-digital-engagement-deployment-configure/references/prechat_forms.md +245 -0
- package/skills/service-itsm-agentic-setup-incident-management/SKILL.md +164 -120
- package/skills/service-itsm-agentic-setup-incident-management/examples/output-templates.md +61 -37
- package/skills/service-itsm-agentic-setup-incident-management/references/audit-tracking.md +42 -0
- package/skills/service-itsm-agentic-setup-incident-management/references/broadcast-communications.md +23 -0
- package/skills/service-itsm-agentic-setup-incident-management/references/email-to-incident.md +23 -0
- package/skills/service-itsm-agentic-setup-incident-management/references/incident-dashboards.md +25 -0
- package/skills/service-itsm-agentic-setup-incident-management/references/incident-persona-psg.md +30 -146
- package/skills/service-itsm-agentic-setup-incident-management/references/incident-preferences.md +32 -136
- package/skills/service-itsm-agentic-setup-incident-management/references/major-incident-management.md +32 -155
- package/skills/service-itsm-agentic-setup-incident-management/references/manage-incidents-with-ai.md +45 -0
- package/skills/service-itsm-agentic-setup-incident-management/references/priority-matrix.md +32 -0
- package/skills/service-itsm-agentic-setup-incident-management/references/service-mgmt-privilege.md +30 -140
- package/skills/service-itsm-agentic-setup-incident-management/references/sla-milestones.md +110 -0
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: dx-org-devhub-configure
|
|
3
|
-
description: "Enable Dev Hub on a Salesforce org
|
|
4
|
-
allowed-tools: Read, Bash(bash), Bash(sf api request rest), Bash(sf data query), Bash(sf org list), Bash(sf
|
|
3
|
+
description: "Enable Dev Hub on a Salesforce org, view its status and scratch org allocation, or read its current DevHubSettings preferences, using the Salesforce CLI (sf). Use when someone wants to turn on or enable Dev Hub, set up an org for scratch orgs or 2GP/unlocked packages, check whether Dev Hub is already enabled, see scratch org allocation (Active/Daily limits, remaining, and a pre-flight warning near the limit), see which Dev Hub preferences (packaging, org shape export, scratch org snapshots) are on or off, configure those preferences, list active scratch orgs, or list authenticated orgs when none is specified. Enabling deploys enableScratchOrgManagementPref, is irreversible, needs a System Administrator (ModifyAllData or ModifyMetadata), and does not work in sandboxes. DO NOT TRIGGER for creating or deleting individual scratch orgs."
|
|
4
|
+
allowed-tools: Read, Bash(bash), Bash(sf api request rest), Bash(sf data query), Bash(sf org list), Bash(sf project deploy), Bash(sf config get), Bash(sf org display), Bash(sf org open), Bash(jq)
|
|
5
5
|
metadata:
|
|
6
|
-
version: "1.
|
|
6
|
+
version: "1.1"
|
|
7
7
|
domains: ["Developer Experience"]
|
|
8
8
|
# DevHubSettings metadata + the Tooling API DevHubSettings endpoint require
|
|
9
|
-
# API 47.0
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
- "dx-org-trial-expiration-check"
|
|
9
|
+
# DevHubSettings base fields need API 47.0+, but enableShapeExportPref needs
|
|
10
|
+
# 55.0+ and enableScratchOrgSnapshotPref needs 61.0+, so the script reads and
|
|
11
|
+
# deploys at 62.0 (see scripts/devhub.sh SETTINGS_API_VERSION).
|
|
12
|
+
minApiVersion: "62.0"
|
|
14
13
|
# Enabling needs ModifyAllData OR ModifyMetadata (either suffices). accessCheck
|
|
15
14
|
# is a flat array with no OR operator, so declaring both would read as AND and
|
|
16
15
|
# could falsely gate an admin holding only one. Declare the canonical
|
|
@@ -27,10 +26,12 @@ metadata:
|
|
|
27
26
|
# Enable Dev Hub & View Scratch Org Allocation
|
|
28
27
|
|
|
29
28
|
Enable **Dev Hub** on a Salesforce org, verify whether it is already on, and see
|
|
30
|
-
the org's **scratch org allocation** (Active and Daily limits
|
|
31
|
-
remain
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
the org's **scratch org allocation** (Active and Daily limits, how many
|
|
30
|
+
remain, and a pre-flight warning when close to the limit) — for the default
|
|
31
|
+
org or a named org. The skill can also read the org's current **DevHubSettings
|
|
32
|
+
preferences**, configure Dev Hub sub-preferences (packaging, org shape export,
|
|
33
|
+
scratch org snapshots), list the active scratch orgs created from a Dev Hub,
|
|
34
|
+
and list which orgs are authenticated when none is specified.
|
|
34
35
|
|
|
35
36
|
Dev Hub is the org feature that lets you **create and manage scratch orgs** and
|
|
36
37
|
**second-generation (2GP) / unlocked packages**.
|
|
@@ -45,7 +46,9 @@ Trigger on requests like:
|
|
|
45
46
|
limit?" / "How many scratch orgs do I have left?"
|
|
46
47
|
- "Turn on packaging / 2GP / unlocked packages" / "Enable org shape export" /
|
|
47
48
|
"Enable scratch org snapshots" (Dev Hub sub-preferences).
|
|
49
|
+
- "Which Dev Hub preferences are turned on?" / "Show my current DevHubSettings."
|
|
48
50
|
- "List the scratch orgs on my Dev Hub."
|
|
51
|
+
- "What orgs do I have authenticated?" / "I didn't pass an org — what's available?"
|
|
49
52
|
|
|
50
53
|
## When NOT to use
|
|
51
54
|
|
|
@@ -55,9 +58,6 @@ Do **not** trigger this skill for:
|
|
|
55
58
|
`sf org create scratch` / `sf org delete scratch`, a different workflow. This
|
|
56
59
|
skill enables the *Dev Hub feature* and reports *allocation*; it does not
|
|
57
60
|
create scratch orgs.
|
|
58
|
-
- **Switching the default/active org** — use `dx-org-switch`.
|
|
59
|
-
- **Trial or org expiration dates** ("when does my org expire") — use
|
|
60
|
-
`dx-org-trial-expiration-check`.
|
|
61
61
|
|
|
62
62
|
## How Dev Hub enablement is determined
|
|
63
63
|
|
|
@@ -80,9 +80,12 @@ ScratchOrgInfo` means Dev Hub is **ON**; an `INVALID_TYPE` error means it is
|
|
|
80
80
|
- **Requires** a user with **ModifyAllData** or **ModifyMetadata** (a **System
|
|
81
81
|
Administrator** has these). A user without them gets `INSUFFICIENT_ACCESS`.
|
|
82
82
|
- **Cannot** be enabled in a **sandbox**, or in an org that has a **registered
|
|
83
|
-
namespace**.
|
|
83
|
+
namespace**. The script checks the org's edition/sandbox facts before an
|
|
84
|
+
`--enable --apply` and refuses (no deploy attempted) if the target is a
|
|
85
|
+
sandbox; there's no reliable CLI signal for a registered namespace, so that
|
|
86
|
+
stays a documented caveat rather than an enforced check.
|
|
84
87
|
- Available in **Developer, Enterprise, Performance, Unlimited**, and **trial**
|
|
85
|
-
editions.
|
|
88
|
+
editions — `status` and `--allocation` show the org's edition when known.
|
|
86
89
|
|
|
87
90
|
## Steps
|
|
88
91
|
|
|
@@ -96,36 +99,45 @@ ScratchOrgInfo` means Dev Hub is **ON**; an `INVALID_TYPE` error means it is
|
|
|
96
99
|
containing this SKILL.md).
|
|
97
100
|
|
|
98
101
|
```bash
|
|
99
|
-
bash "<skill_dir>/scripts/devhub.sh" <alias-or-username> # status: on? + allocation
|
|
102
|
+
bash "<skill_dir>/scripts/devhub.sh" <alias-or-username> # status: on? + edition + allocation
|
|
100
103
|
bash "<skill_dir>/scripts/devhub.sh" # default org (target-org)
|
|
101
|
-
bash "<skill_dir>/scripts/devhub.sh" <org> --allocation # allocation
|
|
104
|
+
bash "<skill_dir>/scripts/devhub.sh" <org> --allocation # allocation + pre-flight warnings
|
|
105
|
+
bash "<skill_dir>/scripts/devhub.sh" <org> --show-settings # current DevHubSettings preferences
|
|
106
|
+
bash "<skill_dir>/scripts/devhub.sh" --list-orgs # authenticated orgs (no org needed)
|
|
102
107
|
bash "<skill_dir>/scripts/devhub.sh" <org> --enable # validate enabling (dry run)
|
|
103
108
|
bash "<skill_dir>/scripts/devhub.sh" <org> --enable --apply # actually enable (irreversible)
|
|
104
109
|
bash "<skill_dir>/scripts/devhub.sh" <org> --list-scratch # list active scratch orgs
|
|
105
|
-
bash "<skill_dir>/scripts/devhub.sh" <alias> --instance-url <url> --enable --apply # log in first, then enable
|
|
106
|
-
bash "<skill_dir>/scripts/devhub.sh" <url> # bare instance URL: log in to it
|
|
107
110
|
```
|
|
108
111
|
|
|
109
|
-
When the user supplies an instance URL (their My Domain, sandbox, or
|
|
110
|
-
pre-release/scratch login URL — e.g.
|
|
111
|
-
`https://my-domain.my.salesforce.com`), pass that exact URL with
|
|
112
|
-
`--instance-url <url>` — the script accepts Salesforce-owned hostnames and logs in with
|
|
113
|
-
`sf org login web --instance-url <url>` and then continues. A bare URL
|
|
114
|
-
positional is accepted as shorthand for the same thing.
|
|
115
|
-
|
|
116
112
|
`<skill_dir>` is the absolute path to the directory containing this SKILL.md.
|
|
117
113
|
|
|
118
114
|
2. **For enablement, default to a dry run first.** Run `--enable` (no `--apply`)
|
|
119
115
|
to validate the deploy, then relay the result. Because enabling is
|
|
120
116
|
**irreversible**, only run `--enable --apply` when the user has clearly asked
|
|
121
117
|
to actually enable Dev Hub. Applied operations require an explicit org alias
|
|
122
|
-
or username; the script refuses to mutate an implicit default org.
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
118
|
+
or username; the script refuses to mutate an implicit default org. The
|
|
119
|
+
script also refuses to enable on a **sandbox** — it checks the org's edition
|
|
120
|
+
facts first and returns an eligibility explanation instead of deploying, and
|
|
121
|
+
`status` on a sandbox reports the same ineligibility. When the target is
|
|
122
|
+
ineligible (a sandbox, or an org with a registered namespace), **declining to
|
|
123
|
+
enable is the correct, complete outcome even if the user explicitly asked to
|
|
124
|
+
apply it** — do not deploy. Give a full answer that (1) states Dev Hub
|
|
125
|
+
**cannot** be enabled on this org, (2) says **why** (a sandbox cannot host a
|
|
126
|
+
Dev Hub; a registered namespace also blocks it), and (3) gives the
|
|
127
|
+
**alternative** — enable Dev Hub on the source **production** org, or a
|
|
128
|
+
**Developer Edition / trial** org, with a **System Administrator**, and use
|
|
129
|
+
that as the Dev Hub. Do not report a scratch-org allocation for an ineligible
|
|
130
|
+
org. If the deploy is rejected for permissions, surface the Setup-UI fallback
|
|
131
|
+
it prints.
|
|
132
|
+
|
|
133
|
+
3. Relay the script output. When an org can't be authenticated, the script
|
|
134
|
+
never logs in on its own — it prints the exact `sf org login web` command as
|
|
135
|
+
guidance; surface that command to the user so they can run it themselves,
|
|
136
|
+
then re-run the skill. When no org and no default are configured, it also
|
|
137
|
+
lists the authenticated orgs it found so the user can pick one. Pick
|
|
138
|
+
optional flags based on the request (see below): `--allocation` for limits
|
|
139
|
+
only, `--show-settings` for current preference values, `--list-orgs` for
|
|
140
|
+
discovery, `--list-scratch` to enumerate scratch orgs, `--packaging` /
|
|
129
141
|
`--snapshots` / `--shape` to turn on sub-preferences, `--json` for automation.
|
|
130
142
|
|
|
131
143
|
## Before you finish
|
|
@@ -134,15 +146,18 @@ Verify these before returning your answer:
|
|
|
134
146
|
|
|
135
147
|
- [ ] **CRITICAL:** Invoked the helper via its **absolute path** (`bash "<skill_dir>/scripts/devhub.sh" …`), never `./scripts/` (the script rejects a non-absolute `$0`).
|
|
136
148
|
- [ ] Did **not** run `--apply` unless the user clearly asked to actually enable Dev Hub or deploy a preference — enabling is **irreversible**.
|
|
137
|
-
- [ ]
|
|
149
|
+
- [ ] Did **not** attempt to log in on the user's behalf — if the org isn't authenticated, relayed the `sf org login web` guidance the script printed instead of running it.
|
|
150
|
+
- [ ] Relayed the script's own output (status/allocation/settings, the pre-flight warnings, the discovered orgs, the sandbox-eligibility refusal, or the login/Setup-UI guidance it printed), rather than substituting a hand-written answer.
|
|
138
151
|
|
|
139
152
|
## Options
|
|
140
153
|
|
|
141
154
|
| Flag | Purpose |
|
|
142
155
|
|------|---------|
|
|
143
|
-
| `--allocation`, `-A` | Show only the scratch org allocation (Active/Daily). |
|
|
156
|
+
| `--allocation`, `-A` | Show only the scratch org allocation (Active/Daily), including pre-flight `WARN`/`NOTE` lines when close to the limit. |
|
|
157
|
+
| `--show-settings`, `-s` | Show the org's current `DevHubSettings` preference values (packaging, snapshots, shape, etc.), ON/OFF. Requires Dev Hub to already be enabled. |
|
|
158
|
+
| `--list-orgs` | List authenticated orgs (alias, username, connected status, default marker). No target org required. |
|
|
144
159
|
| `--list-scratch`, `-l` | List active scratch orgs created from this Dev Hub. |
|
|
145
|
-
| `--enable`, `-e` | Enable Dev Hub (deploys `enableScratchOrgManagementPref=true`). Dry run unless `--apply
|
|
160
|
+
| `--enable`, `-e` | Enable Dev Hub (deploys `enableScratchOrgManagementPref=true`). Dry run unless `--apply`; refuses on a sandbox. |
|
|
146
161
|
| `--configure`, `-c` | Configure sub-preferences without (re)enabling the master switch. Pair with a pref flag. |
|
|
147
162
|
| `--packaging` | `enablePackaging2=true` (Unlocked + 2GP packages). |
|
|
148
163
|
| `--snapshots` | `enableScratchOrgSnapshotPref=true`. |
|
|
@@ -150,8 +165,6 @@ Verify these before returning your answer:
|
|
|
150
165
|
| `--scratch-management` | `enableScratchOrgManagementPref=true` (the Dev Hub switch). |
|
|
151
166
|
| `--pref KEY=VALUE` | Any `DevHubSettings` sub-pref (KEY starts with `enable`, VALUE `true`/`false`). Repeatable. |
|
|
152
167
|
| `--apply` | Actually deploy to the explicit org argument. Default for `--enable`/`--configure` is a validate-only dry run. |
|
|
153
|
-
| `--login` | Authenticate an org first via `sf org login web` (opens a browser), then run the action. |
|
|
154
|
-
| `--instance-url <url>` | Log in to a specific instance (My Domain, sandbox, or pre-release/scratch instance) with `sf org login web --instance-url <url>`. Implies `--login`. |
|
|
155
168
|
| `--json` | Emit machine-readable JSON. |
|
|
156
169
|
| `--fail-if-disabled` | Exit `3` if Dev Hub is not enabled (CI/cron gate). |
|
|
157
170
|
| `--help`, `-h` | Show usage. |
|
|
@@ -171,8 +184,12 @@ keep this workflow lean.
|
|
|
171
184
|
## Structured output for automation (`--json`)
|
|
172
185
|
|
|
173
186
|
Use `--json` in any mode for machine-readable output (no prose). Status returns
|
|
174
|
-
`devHubEnabled`, `status`, and an `allocation` object
|
|
175
|
-
|
|
187
|
+
`devHubEnabled`, `status`, `edition`, `isSandbox`, and an `allocation` object
|
|
188
|
+
(with `usedPct` per limit and a `warnings` array); `--show-settings` returns
|
|
189
|
+
`org` and a `settings` map of preference key → boolean; `--list-orgs` returns
|
|
190
|
+
a normalized array of `{alias, username, connectedStatus, isDefault}`;
|
|
191
|
+
enablement returns `success`, `applied`, and `devHubVerifiedState`.
|
|
192
|
+
Deterministic, no LLM needed.
|
|
176
193
|
|
|
177
194
|
```bash
|
|
178
195
|
bash "<skill_dir>/scripts/devhub.sh" my-devhub --json
|
|
@@ -189,59 +206,41 @@ Hub is not enabled, so a scheduled job can gate on it.
|
|
|
189
206
|
- `2` bad usage or a missing dependency (`sf` or `jq`)
|
|
190
207
|
- `3` Dev Hub is not enabled (only when `--fail-if-disabled` is set)
|
|
191
208
|
|
|
192
|
-
## Authentication
|
|
209
|
+
## Authentication (guidance only)
|
|
193
210
|
|
|
194
|
-
|
|
195
|
-
`--
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
`https://my-domain.my.salesforce.com` placeholder):
|
|
201
|
-
|
|
202
|
-
```bash
|
|
203
|
-
# Log in to a specific instance (My Domain / pre-release / sandbox), then enable:
|
|
204
|
-
bash "<skill_dir>/scripts/devhub.sh" my-alias \
|
|
205
|
-
--instance-url https://my-domain.my.salesforce.com --enable --apply
|
|
206
|
-
|
|
207
|
-
# Bare instance URL as shorthand — logs in to it, then reports status:
|
|
208
|
-
bash "<skill_dir>/scripts/devhub.sh" https://my-domain.my.salesforce.com
|
|
209
|
-
|
|
210
|
-
# Just authenticate an org (no other action):
|
|
211
|
-
bash "<skill_dir>/scripts/devhub.sh" my-alias --login
|
|
212
|
-
```
|
|
213
|
-
|
|
214
|
-
`sf org login web` opens a browser for the OAuth flow; complete it promptly (the
|
|
215
|
-
session times out). A supplied positional (`my-alias`) becomes the CLI alias; a
|
|
216
|
-
positional that looks like a URL (contains `://`) is taken as the
|
|
217
|
-
`--instance-url` to log in to. The script accepts only HTTPS Salesforce-owned
|
|
218
|
-
hostnames for this option. Omit `--instance-url` for standard
|
|
219
|
-
production/DE/trial logins (`login.salesforce.com`). If the browser flow keeps
|
|
220
|
-
timing out, the script prints the `sf org login device` fallback for a
|
|
221
|
-
code-based login.
|
|
222
|
-
|
|
223
|
-
If an org isn't authenticated and no login flag was passed, the script instead
|
|
224
|
-
prints the exact command to log in and re-run — using the instance URL you
|
|
225
|
-
supplied when there is one:
|
|
211
|
+
This skill **never runs an interactive login itself** — it has no `--login` or
|
|
212
|
+
`--instance-url` flag, and it never invokes `sf org login web` or
|
|
213
|
+
`sf org login device`. If the target org can't be queried (not authenticated,
|
|
214
|
+
expired session, wrong instance), the script prints the exact login command as
|
|
215
|
+
copy-paste **guidance** and stops; relay that command to the user and let them
|
|
216
|
+
run it, then re-run the skill:
|
|
226
217
|
|
|
227
218
|
```text
|
|
228
219
|
my-org could not query org (...)
|
|
229
220
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
221
|
+
This org is not authenticated (or the session expired). Authentication is
|
|
222
|
+
a precondition for this skill — run one of these yourself, then re-run:
|
|
223
|
+
sf org login web --alias 'my-org' # prod / DE / trial
|
|
224
|
+
sf org login web --alias <my-alias> --instance-url https://MYDOMAIN.my.salesforce.com # sandbox / My Domain
|
|
225
|
+
List existing logins with: sf org list
|
|
235
226
|
```
|
|
236
227
|
|
|
228
|
+
When no org and no default is configured at all, the script also runs org
|
|
229
|
+
discovery (`--list-orgs`) and lists the authenticated orgs it found, so the
|
|
230
|
+
user can pick one instead of guessing an alias.
|
|
231
|
+
|
|
237
232
|
## Manual fallback (if the script is unavailable)
|
|
238
233
|
|
|
239
234
|
```bash
|
|
240
235
|
# Detect Dev Hub (INVALID_TYPE error means OFF; a count means ON):
|
|
241
236
|
sf data query --query "SELECT COUNT() FROM ScratchOrgInfo" --target-org <org> --json
|
|
242
237
|
|
|
238
|
+
# Read current DevHubSettings preferences (requires Dev Hub already ON):
|
|
239
|
+
sf api request rest "/services/data/v62.0/tooling/sobjects/DevHubSettings/DevHub" \
|
|
240
|
+
--target-org <org> --json
|
|
241
|
+
|
|
243
242
|
# Enable Dev Hub via the Tooling API (what the Setup toggle does; irreversible):
|
|
244
|
-
sf api request rest "/services/data/
|
|
243
|
+
sf api request rest "/services/data/v62.0/tooling/sobjects/DevHubSettings/DevHub" \
|
|
245
244
|
--method PATCH \
|
|
246
245
|
--body '{"FullName":"DevHub","Metadata":{"enableScratchOrgManagementPref":true}}' \
|
|
247
246
|
--target-org <org>
|
|
@@ -250,12 +249,16 @@ sf api request rest "/services/data/v47.0/tooling/sobjects/DevHubSettings/DevHub
|
|
|
250
249
|
|
|
251
250
|
# View scratch org allocation:
|
|
252
251
|
sf org list limits --target-org <org> --json | jq '.result[] | select(.name|test("ScratchOrg"))'
|
|
252
|
+
|
|
253
|
+
# List authenticated orgs:
|
|
254
|
+
sf org list --json
|
|
253
255
|
```
|
|
254
256
|
|
|
255
257
|
## Notes
|
|
256
258
|
|
|
257
259
|
- Requires the Salesforce CLI (`sf`) and `jq` on the PATH, plus at least one
|
|
258
|
-
authenticated org
|
|
260
|
+
authenticated org. This skill only ever prints the `sf org login web`
|
|
261
|
+
command as guidance — it never runs it.
|
|
259
262
|
- After enabling, set the org as your default Dev Hub:
|
|
260
263
|
`sf config set target-dev-hub <org>`.
|
|
261
264
|
- Enabling **packaging** (`enablePackaging2`) requires Dev Hub to be on first —
|
|
@@ -263,5 +266,3 @@ sf org list limits --target-org <org> --json | jq '.result[] | select(.name|test
|
|
|
263
266
|
- Non-admin users still need object access (Read/Create on `ScratchOrgInfo` and
|
|
264
267
|
`ActiveScratchOrg`) to create/view scratch orgs, and the "Create and Update
|
|
265
268
|
Second-Generation Packages" permission to build 2GP/unlocked packages.
|
|
266
|
-
- To *switch* the default org use `dx-org-switch`; to check *expiration* use
|
|
267
|
-
`dx-org-trial-expiration-check`.
|
|
@@ -5,26 +5,49 @@ These are reference only — the script prints the authoritative output at runti
|
|
|
5
5
|
|
|
6
6
|
## Dev Hub is ON (status + allocation)
|
|
7
7
|
|
|
8
|
+
`status` mode prints the enablement line, the org edition, the signup-record
|
|
9
|
+
count, a one-line summary of which preferences are on, and the allocation table.
|
|
10
|
+
|
|
8
11
|
```text
|
|
9
12
|
Dev Hub status for 'MyDevHub':
|
|
10
13
|
Dev Hub: ENABLED (ScratchOrgInfo is queryable)
|
|
14
|
+
Edition: Developer Edition
|
|
11
15
|
Scratch org signup records: 3
|
|
16
|
+
Enabled preferences: enableScratchOrgManagementPref enableScratchOrgSnapshotPref
|
|
12
17
|
|
|
13
18
|
Scratch org allocation for 'MyDevHub':
|
|
14
19
|
Limit Used Remaining Max
|
|
15
|
-
Active scratch orgs
|
|
16
|
-
Daily scratch orgs
|
|
20
|
+
Active scratch orgs 2 1 3
|
|
21
|
+
Daily scratch orgs 5 1 6
|
|
22
|
+
WARN: only 1 active scratch org(s) remaining.
|
|
23
|
+
NOTE: Daily scratch org usage at 83% (5/6).
|
|
17
24
|
|
|
18
25
|
Active = orgs alive right now; Daily = successful creations in a rolling 24h window.
|
|
19
26
|
Allocation is set by the Dev Hub's edition (e.g. Developer/trial 3 & 6;
|
|
20
27
|
Enterprise 40 & 80; Unlimited/Performance 100 & 200) plus any purchased add-on.
|
|
21
28
|
```
|
|
22
29
|
|
|
30
|
+
## Current preferences (`--show-settings`)
|
|
31
|
+
|
|
32
|
+
`--show-settings` prints every `DevHubSettings` preference with an explicit
|
|
33
|
+
ON/OFF, one per line (requires Dev Hub to already be enabled).
|
|
34
|
+
|
|
35
|
+
```text
|
|
36
|
+
DevHub preferences for 'MyDevHub':
|
|
37
|
+
enableScratchOrgManagementPref ON
|
|
38
|
+
enablePackaging2 OFF
|
|
39
|
+
enableScratchOrgSnapshotPref ON
|
|
40
|
+
enableShapeExportPref OFF
|
|
41
|
+
```
|
|
42
|
+
|
|
23
43
|
## Dev Hub is OFF (prints how to enable it)
|
|
24
44
|
|
|
25
45
|
```text
|
|
26
46
|
Dev Hub status for 'my-org':
|
|
27
47
|
Dev Hub: NOT ENABLED
|
|
48
|
+
Detection: ScratchOrgInfo is queryable only when Dev Hub is on. A successful count means ENABLED. An INVALID_TYPE error means NOT ENABLED. Scratch org limits are not used, because they are reported even when Dev Hub is off.
|
|
49
|
+
|
|
50
|
+
Scratch org allocation, Dev Hub preferences, and the scratch org list are not available until Dev Hub is enabled. An empty allocation or a failed exit from those modes means Dev Hub is off, not that the org is unauthenticated.
|
|
28
51
|
|
|
29
52
|
Enable it (deploys enableScratchOrgManagementPref=true; irreversible):
|
|
30
53
|
devhub.sh "my-org" --enable # validate first (dry run)
|