Synthèse automatique
Active Dev Hub sur une org Salesforce, vérifie son état et son allocation de scratch orgs, et lit ou configure les préférences DevHubSettings via la CLI sf.
Points forts
- Détection fiable de l'activation de Dev Hub via une requête sur ScratchOrgInfo plutôt que via les limites de l'org
- Couvre le cycle complet : activation, contrôle d'allocation (limites Active/Daily et avertissement avant seuil), préférences et liste des scratch orgs actives
- Documente clairement les prérequis : API 62.0, rôle System Administrator (ModifyAllData ou ModifyMetadata), incompatibilité avec les sandboxes
- Périmètre explicite : ne se déclenche pas pour créer ou supprimer une scratch org individuelle
Limites
- L'activation est irréversible et exige des permissions administrateur, ce qui limite l'usage aux orgs de développement dédiées
- Le contenu fourni est tronqué, donc les détails d'implémentation du script devhub.sh et des sous-préférences ne sont pas entièrement vérifiables
- Suppose une org déjà authentifiée et une CLI sf installée ; aucune gestion des erreurs d'authentification n'est décrite
À utiliser lorsqu'un administrateur ou développeur Salesforce veut activer Dev Hub, vérifier s'il est déjà actif ou consulter son allocation et ses préférences de scratch orgs.
Ne pas l'utiliser pour créer, supprimer ou gérer une scratch org individuelle, ni pour des orgs sandbox où Dev Hub ne peut pas être activé.
Analyse de sécurité
PrudenceNo exfiltration, obfuscation, destructive filesystem commands, or secret handling; every SF command shown in the manual fallback is a plain metadata/query operation with clear intent. The risk is moderate rather than low because the primary path executes an unaudited bundled shell script and one code path performs a permanently irreversible mutation on a production org, albeit behind strong guardrails (dry-run default, explicit-org requirement, sandbox refusal). Rating as caution pending review of the actual script contents.
- •The skill's core workflow requires executing a bundled helper script (scripts/devhub.sh) whose contents are not included in the reviewed material, so its actual behavior (arguments, temp files, network calls, error handling) could not be verified. The documented manual fallback uses only benign `sf`/`jq` CLI invocations, but the script itself should be audited before publishing.
- •Includes an irreversible mutating action: a Tooling API PATCH to DevHubSettings that turns Dev Hub on permanently. This is a legitimate administrative operation, but it permanently changes the customer's production org and cannot be undone.
- •Uses Bash plus authenticated `sf` CLI/network access against a real Salesforce org (including System Administrator privileges). The skill mitigates this well — dry-run default, refuses implicit default org for mutations, refuses sandbox targets, and explicitly declines to run `sf org login` on the user's behalf — but the tool surface is intrinsically powerful.
- •Explicitly instructs the agent to refuse an apply even when the user explicitly asks for it (sandbox/namespace case). This is a defensible safety guardrail rather than a jailbreak, but it does override user intent and is worth noting.
- •The skill invokes an external bundled script (`scripts/devhub.sh`) whose actual contents are not part of the provided SKILL.md; the security posture depends on the un-audited script body.
- •Performs an irreversible org mutation (deploying `enableScratchOrgManagementPref=true`, and PATCH to the Tooling API `DevHubSettings` in the manual fallback) — legitimate but destructive-adjacent; the helper mitigates with dry-run default, explicit-org requirement, and sandbox refusal, but the raw manual fallback command is not itself guarded.
- •Uses powerful tooling (arbitrary bash, sf api/deploy) against live Salesforce orgs; scope is documented but broad.
Exemples
Enable Dev Hub on my default Salesforce org and confirm it worked.How many scratch orgs can I still create today on my Dev Hub org? Show the Active and Daily limits and how many remain.List the orgs I have authenticated with sf, then show which DevHubSettings preferences are enabled on my Dev Hub.name: dx-org-devhub-configure 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." 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) metadata: version: "1.1" domains: ["Developer Experience"]
DevHubSettings metadata + the Tooling API DevHubSettings endpoint require
DevHubSettings base fields need API 47.0+, but enableShapeExportPref needs
55.0+ and enableScratchOrgSnapshotPref needs 61.0+, so the script reads and
deploys at 62.0 (see scripts/devhub.sh SETTINGS_API_VERSION).
minApiVersion: "62.0"
Enabling needs ModifyAllData OR ModifyMetadata (either suffices). accessCheck
is a flat array with no OR operator, so declaring both would read as AND and
could falsely gate an admin holding only one. Declare the canonical
System-Administrator perm; the OR alternative stays documented in the
description and body.
accessCheck: "UserPermissions.ModifyAllData" cliTools: - tool: ["jq"] semver: ">=1.6.0" - tool: ["sf"] semver: ">=2.0.0"
Enable Dev Hub & View Scratch Org Allocation
Enable Dev Hub on a Salesforce org, verify whether it is already on, and see the org's scratch org allocation (Active and Daily limits, how many remain, and a pre-flight warning when close to the limit) — for the default org or a named org. The skill can also read the org's current DevHubSettings preferences, configure Dev Hub sub-preferences (packaging, org shape export, scratch org snapshots), list the active scratch orgs created from a Dev Hub, and list which orgs are authenticated when none is specified.
Dev Hub is the org feature that lets you create and manage scratch orgs and second-generation (2GP) / unlocked packages.
When to use
Trigger on requests like:
- "Enable Dev Hub" / "Turn on Dev Hub" / "Set up this org for scratch orgs."
- "Is Dev Hub enabled on my org?" / "Check if Dev Hub is on."
- "How many scratch orgs can I create?" / "What's my scratch org allocation / limit?" / "How many scratch orgs do I have left?"
- "Turn on packaging / 2GP / unlocked packages" / "Enable org shape export" / "Enable scratch org snapshots" (Dev Hub sub-preferences).
- "Which Dev Hub preferences are turned on?" / "Show my current DevHubSettings."
- "List the scratch orgs on my Dev Hub."
- "What orgs do I have authenticated?" / "I didn't pass an org — what's available?"
When NOT to use
Do not trigger this skill for:
- Creating or deleting an individual scratch org — that is
sf org create scratch/sf org delete scratch, a different workflow. This skill enables the Dev Hub feature and reports allocation; it does not create scratch orgs.
How Dev Hub enablement is determined
The standard object ScratchOrgInfo is provisioned and becomes queryable
only when Dev Hub is enabled. So a successful SELECT COUNT() FROM ScratchOrgInfo means Dev Hub is ON; an INVALID_TYPE error means it is
OFF. This is the reliable signal.
Do not infer enablement from
sf org list limitsalone: it reportsActiveScratchOrgs/DailyScratchOrgsrows even on orgs where Dev Hub is off, so limits show allocation but not enablement.
How enabling works (important)
- The Dev Hub master switch is the deployable Metadata API field
DevHubSettings.enableScratchOrgManagementPref. There is noenableDevHubfield and no dedicatedsfcommand to turn it on — deploying this setting is exactly what the Setup toggle does. - Enabling is irreversible — once on, Dev Hub cannot be turned off.
- Requires a user with ModifyAllData or ModifyMetadata (a System
Administrator has these). A user without them gets
INSUFFICIENT_ACCESS. - Cannot be enabled in a sandbox, or in an org that has a registered
namespace. The script checks the org's edition/sandbox facts before an
--enable --applyand refuses (no deploy attempted) if the target is a sandbox; there's no reliable CLI signal for a registered namespace, so that stays a documented caveat rather than an enforced check. - Available in Developer, Enterprise, Performance, Unlimited, and trial
editions —
statusand--allocationshow the org's edition when known.
Steps
-
CRITICAL: Run the bundled helper script, which handles Dev Hub detection, the enablement deploy (with a safe dry-run default), allocation math, and structured output, and works on macOS and Linux. Always invoke it by absolute path from the skill directory — never
./scripts/, which resolves against the user's current directory and will either run the wrong script or fail. The script self-checks this: if$0is not absolute it exits with a usage error, so pass the full path to<skill_dir>(the directory containing this SKILL.md).bash "<skill_dir>/scripts/devhub.sh" <alias-or-username> # status: on? + edition + allocation bash "<skill_dir>/scripts/devhub.sh" # default org (target-org) bash "<skill_dir>/scripts/devhub.sh" <org> --allocation # allocation + pre-flight warnings bash "<skill_dir>/scripts/devhub.sh" <org> --show-settings # current DevHubSettings preferences bash "<skill_dir>/scripts/devhub.sh" --list-orgs # authenticated orgs (no org needed) bash "<skill_dir>/scripts/devhub.sh" <org> --enable # validate enabling (dry run) bash "<skill_dir>/scripts/devhub.sh" <org> --enable --apply # actually enable (irreversible) bash "<skill_dir>/scripts/devhub.sh" <org> --list-scratch # list active scratch orgs<skill_dir>is the absolute path to the directory containing this SKILL.md. -
For enablement, default to a dry run first. Run
--enable(no--apply) to validate the deploy, then relay the result. Because enabling is irreversible, only run--enable --applywhen the user has clearly asked to actually enable Dev Hub. Applied operations require an explicit org alias or username; the script refuses to mutate an implicit default org. The script also refuses to enable on a sandbox — it checks the org's edition facts first and returns an eligibility explanation instead of deploying, andstatuson a sandbox reports the same ineligibility. When the target is ineligible (a sandbox, or an org with a registered namespace), declining to enable is the correct, complete outcome even if the user explicitly asked to apply it — do not deploy. Give a full answer that (1) states Dev Hub cannot be enabled on this org, (2) says why (a sandbox cannot host a Dev Hub; a registered namespace also blocks it), and (3) gives the alternative — enable Dev Hub on the source production org, or a Developer Edition / trial org, with a System Administrator, and use that as the Dev Hub. Do not report a scratch-org allocation for an ineligible org. If the deploy is rejected for permissions, surface the Setup-UI fallback it prints. -
Relay the script output. When an org can't be authenticated, the script never logs in on its own — it prints the exact
sf org login webcommand as guidance; surface that command to the user so they can run it themselves, then re-run the skill. When no org and no default are configured, it also lists the authenticated orgs it found so the user can pick one. Pick optional flags based on the request (see below):--allocationfor limits only,--show-settingsfor current preference values,--list-orgsfor discovery,--list-scratchto enumerate scratch orgs,--packaging/--snapshots/--shapeto turn on sub-preferences,--jsonfor automation.
Before you finish
Verify these before returning your answer:
- [ ] CRITICAL: Invoked the helper via its absolute path (
bash "<skill_dir>/scripts/devhub.sh" …), never./scripts/(the script rejects a non-absolute$0). - [ ] Did not run
--applyunless the user clearly asked to actually enable Dev Hub or deploy a preference — enabling is irreversible. - [ ] Did not attempt to log in on the user's behalf — if the org isn't authenticated, relayed the
sf org login webguidance the script printed instead of running it. - [ ] 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.
Options
| Flag | Purpose |
|------|---------|
| --allocation, -A | Show only the scratch org allocation (Active/Daily), including pre-flight WARN/NOTE lines when close to the limit. |
| --show-settings, -s | Show the org's current DevHubSettings preference values (packaging, snapshots, shape, etc.), ON/OFF. Requires Dev Hub to already be enabled. |
| --list-orgs | List authenticated orgs (alias, username, connected status, default marker). No target org required. |
| --list-scratch, -l | List active scratch orgs created from this Dev Hub. |
| --enable, -e | Enable Dev Hub (deploys enableScratchOrgManagementPref=true). Dry run unless --apply; refuses on a sandbox. |
| --configure, -c | Configure sub-preferences without (re)enabling the master switch. Pair with a pref flag. |
| --packaging | enablePackaging2=true (Unlocked + 2GP packages). |
| --snapshots | enableScratchOrgSnapshotPref=true. |
| --shape | enableShapeExportPref=true. |
| --scratch-management | enableScratchOrgManagementPref=true (the Dev Hub switch). |
| --pref KEY=VALUE | Any DevHubSettings sub-pref (KEY starts with enable, VALUE true/false). Repeatable. |
| --apply | Actually deploy to the explicit org argument. Default for --enable/--configure is a validate-only dry run. |
| --json | Emit machine-readable JSON. |
| --fail-if-disabled | Exit 3 if Dev Hub is not enabled (CI/cron gate). |
| --help, -h | Show usage. |
--enable may be combined with sub-pref flags to enable and configure at once
(e.g. --enable --packaging --apply). If omitted, the org defaults to
target-org, then target-dev-hub.
Output examples
The script prints the authoritative output at runtime. If you need to calibrate
what an enabled-vs-disabled status transcript looks like (including the
allocation table and the enable/Setup-UI guidance), read
examples/status-output.md — otherwise skip it to
keep this workflow lean.
Structured output for automation (--json)
Use --json in any mode for machine-readable output (no prose). Status returns
devHubEnabled, status, edition, isSandbox, and an allocation object
(with usedPct per limit and a warnings array); --show-settings returns
org and a settings map of preference key → boolean; --list-orgs returns
a normalized array of {alias, username, connectedStatus, isDefault};
enablement returns success, applied, and devHubVerifiedState.
Deterministic, no LLM needed.
bash "<skill_dir>/scripts/devhub.sh" my-devhub --json
# {"org":"my-devhub","devHubEnabled":true,"status":"enabled", ... }
--fail-if-disabled exits 3 (and prints an ALERT: line to stderr) if Dev
Hub is not enabled, so a scheduled job can gate on it.
Exit codes
0success1an org could not be queried, or a deploy failed (auth/connection/deploy)2bad usage or a missing dependency (sforjq)3Dev Hub is not enabled (only when--fail-if-disabledis set)
Authentication (guidance only)
This skill never runs an interactive login itself — it has no --login or
--instance-url flag, and it never invokes sf org login web or
sf org login device. If the target org can't be queried (not authenticated,
expired session, wrong instance), the script prints the exact login command as
copy-paste guidance and stops; relay that command to the user and let them
run it, then re-run the skill:
my-org could not query org (...)
This org is not authenticated (or the session expired). Authentication is
a precondition for this skill — run one of these yourself, then re-run:
sf org login web --alias 'my-org' # prod / DE / trial
sf org login web --alias <my-alias> --instance-url https://MYDOMAIN.my.salesforce.com # sandbox / My Domain
List existing logins with: sf org list
When no org and no default is configured at all, the script also runs org
discovery (--list-orgs) and lists the authenticated orgs it found, so the
user can pick one instead of guessing an alias.
Manual fallback (if the script is unavailable)
# Detect Dev Hub (INVALID_TYPE error means OFF; a count means ON):
sf data query --query "SELECT COUNT() FROM ScratchOrgInfo" --target-org <org> --json
# Read current DevHubSettings preferences (requires Dev Hub already ON):
sf api request rest "/services/data/v62.0/tooling/sobjects/DevHubSettings/DevHub" \
--target-org <org> --json
# Enable Dev Hub via the Tooling API (what the Setup toggle does; irreversible):
sf api request rest "/services/data/v62.0/tooling/sobjects/DevHubSettings/DevHub" \
--method PATCH \
--body '{"FullName":"DevHub","Metadata":{"enableScratchOrgManagementPref":true}}' \
--target-org <org>
# Or enable in the UI: Setup > Quick Find > "Dev Hub" > turn Enable Dev Hub On.
# View scratch org allocation:
sf org list limits --target-org <org> --json | jq '.result[] | select(.name|test("ScratchOrg"))'
# List authenticated orgs:
sf org list --json
Notes
- Requires the Salesforce CLI (
sf) andjqon the PATH, plus at least one authenticated org. This skill only ever prints thesf org login webcommand as guidance — it never runs it. - After enabling, set the org as your default Dev Hub:
sf config set target-dev-hub <org>. - Enabling packaging (
enablePackaging2) requires Dev Hub to be on first —--enable --packaginghandles the ordering in a single deploy. - Non-admin users still need object access (Read/Create on
ScratchOrgInfoandActiveScratchOrg) to create/view scratch orgs, and the "Create and Update Second-Generation Packages" permission to build 2GP/unlocked packages.
Du fichier au premier essai
Le téléchargement contient exactement le contenu affiché sur cette fiche. Cette copie peut différer de la dernière version du dépôt source.
Consulter la source et ses fichiers annexesCe téléchargement contient uniquement SKILL.md. Les scripts, références, modèles et dépendances éventuels ne sont pas inclus. Récupérez les fichiers nécessaires depuis la source en conservant leur arborescence avant de poursuivre.
1. Télécharger le fichier
Télécharger SKILL.mdDepuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/enable-dev-hub-view-scratch-orgs-mvvwbp4k/SKILL.md, ou utilisez la commande suivante. Ce dossier sert à examiner la skill avant son installation.
Commande pour macOS/Linux ou WSL : un shell POSIX et curl sont nécessaires. Sous Windows sans WSL, utilisez le bouton de téléchargement et créez le dossier manuellement.
mkdir -p '.skill-downloads/enable-dev-hub-view-scratch-orgs-mvvwbp4k' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/enable-dev-hub-view-scratch-orgs-mvvwbp4k/download' --output '.skill-downloads/enable-dev-hub-view-scratch-orgs-mvvwbp4k/SKILL.md.part' && mv '.skill-downloads/enable-dev-hub-view-scratch-orgs-mvvwbp4k/SKILL.md.part' '.skill-downloads/enable-dev-hub-view-scratch-orgs-mvvwbp4k/SKILL.md'2. Vérifier les prérequis
Lisez SKILL.md avant de l’utiliser. Si le fichier cite des scripts ou services externes, examinez-les et préparez les accès nécessaires dans votre environnement de test.
Outils déclarés par l’auteur (à vérifier dans votre agent) : 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)
Aucune section de prérequis reconnue dans ce fichier. Cela ne signifie pas qu’il est autonome : les bibliothèques, outils et accès peuvent être cités ailleurs dans le contenu ou dans le dépôt source.
Les plateformes de la fiche sont des indications du catalogue. Les chemins ci-dessous suivent la documentation des outils ; ils ne prouvent pas que cette skill y a été exécutée. Aucune version minimale de ces outils n’est attestée pour cette fiche.
3. Charger la skill
Après vérification, copiez le dossier complet dans le projet avec l’une des commandes ci-dessous, puis ouvrez une nouvelle session de l’outil. La commande s’arrête si un dossier du même nom existe déjà : comparez les fichiers avant de le remplacer.
Claude Code
test -f '.skill-downloads/enable-dev-hub-view-scratch-orgs-mvvwbp4k/SKILL.md' && test -s '.skill-downloads/enable-dev-hub-view-scratch-orgs-mvvwbp4k/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/dx-org-devhub-configure' && cp -R '.skill-downloads/enable-dev-hub-view-scratch-orgs-mvvwbp4k' '.claude/skills/dx-org-devhub-configure'Codex
test -f '.skill-downloads/enable-dev-hub-view-scratch-orgs-mvvwbp4k/SKILL.md' && test -s '.skill-downloads/enable-dev-hub-view-scratch-orgs-mvvwbp4k/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/dx-org-devhub-configure' && cp -R '.skill-downloads/enable-dev-hub-view-scratch-orgs-mvvwbp4k' '.agents/skills/dx-org-devhub-configure'OpenSkills
OpenSkills doit déjà être installé. La procédure locale install/read est contrôlée avec OpenSkills 1.5.0, qui exige Node.js ≥ 20.6.0. Aucun slug du catalogue n’est résolu automatiquement.
Installation officielle d’OpenSkillsopenskills install './.skill-downloads/enable-dev-hub-view-scratch-orgs-mvvwbp4k'openskills read 'enable-dev-hub-view-scratch-orgs-mvvwbp4k'La lecture doit afficher le contenu du fichier installé et son dossier de base. Elle ne lance ni la skill ni ses dépendances.
Pour un agent qui lit AGENTS.md, synchronisez ensuite l’index. Cette commande modifie AGENTS.md : relisez le diff avant de l’utiliser.
openskills syncMode manuel ou autre outil : joignez SKILL.md à une conversation, ou ouvrez-le dans un agent capable de lire les fichiers. Ajoutez les ressources annexes nécessaires. Il n’existe pas de dossier universel reconnu par tous les outils.
4. Faire un premier essai
Utilisez une entrée courte et fictive : un endpoint d’API, un petit document ou un brief d’interface. Dans une nouvelle conversation, joignez le fichier ou donnez son chemin à l’agent, puis adaptez cette demande :
Lis .skill-downloads/enable-dev-hub-view-scratch-orgs-mvvwbp4k/SKILL.md et applique ses instructions à cet exemple : [décrire une entrée de test]. Indique les fichiers, dépendances ou accès qui manquent. Produis le résultat demandé par la skill sans inventer de données ni exécuter de script non examiné.Résultat attendu : une sortie correspondant aux instructions de la skill, ou une liste précise des prérequis manquants. Une simple confirmation de lecture ne valide pas le premier usage. Si une ressource externe est indisponible, ce parcours reste à tester.
Configurer un canal de discussion avec SecretRefs
DevOps
Configurez des canaux de discussion avec des commandes non interactives, les secrets étant uniquement des SecretRefs. Couvre les étapes de collecte, modification, réparation et vérification.
Enquêter sur les échecs CI de ClickHouse
DevOps
Investigue un échec CI de ClickHouse de bout en bout à partir d'une URL de PR ou de rapport S3. Récupère les tests échoués, classe flaky vs vraie régression, et cherche des issues/fixes existants.
Revue de PR Ansible
DevOps
Examine une PR Ansible selon le processus standardisé du projet, incluant la validation des changelogs, la couverture de tests et le suivi des commentaires.