
dx-devops-promote
Use this skill to drive the full DevOps Center promotion workflow for work items and pipeline stages — validate preconditions, prepare work items, optionally combine work items that share metadata, promote one or more work items or an entire stage to a target pipeline stage, and complete the promotion to finalize the deployment. TRIGGER when the user wants to promote a work item, advance changes to the next environment or stage, combine work items for a single promotion, or move metadata through the release pipeline. The mandatory validate step runs automatically at the start. DO NOT TRIGGER for work item creation or status updates (use dx-devops-work-item-manage), for conflict detection, or for polling an existing promotion's status.
- Installs
- 2.3K
- Last 24h
- +10
- Trending rank
- #8584
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/forcedotcom/sf-skills --skill dx-devops-promote- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads dx-devops-promote automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
DevOps Center Promotion
Drives the full promotion workflow in DevOps Center — validate, prepare, optionally combine, promote, and complete — moving work items through the release pipeline. Provides headless, --json-driven, idempotent operations for autonomous release workflows in CI. Every promotion begins with a mandatory validate step.
Scope
- In scope: Validate promotion preconditions, prepare a work item, combine work items that share metadata into one promotion, promote one or more work items or an entire source stage to a target stage, and complete the promotion
- Out of scope: Work item creation/status updates (use
dx-devops-work-item-manage), conflict detection, polling an existing promotion's status, pipeline or project setup (separate skills)
Required Inputs
Gather or infer before proceeding:
- Promotion target: one or more specific work items, or all approved work items in a source stage
- Target stage ID (required for every promotion command — validate, prepare, combine, promote, and complete):
--target-stage-id— the pipeline stage to promote to - Work item ID(s) or source stage ID — depending on the promotion target.
sf devops promotetakes--work-item-id(repeatable) XOR--stage-id - For combined promotion: a parent work item ID and one or more child work item IDs that share metadata
- Target org:
--target-org <alias>(required unless thetarget-orgconfig variable is set)
Defaults unless specified:
- Output format:
--jsonfor headless consumption - Test level: omit
--test-levelfor development-stage deploys (defaults toNoTestRun); useRunLocalTestsfor production-stage deploys with Apex
If the user gives a clear request ("promote work item 1fkxx… to stage 1QVxx…", "promote the QA stage to UAT", "combine these work items and promote"), proceed once you have the required IDs.
Workflow
All operations use sf devops CLI commands with --json output. Validate ALWAYS runs first. All promotion commands are keyed on record IDs, not work item names — resolve names to IDs first if needed.
Phase 1 — Authenticate and Validate
-
Verify org authentication before any operation:
sf org display --json- If it fails, instruct the user to run
sf org login web --set-default --alias <alias> - Pass
--target-org <alias>on every subsequent command (required unless thetarget-orgconfig variable is set)
- If it fails, instruct the user to run
-
Run the mandatory validate step — this is non-negotiable and always runs before prepare/combine/promote.
sf devops promotion validaterequires the target stage (-t/--target-stage-id) and one or more-i/--work-item-id:# Capture the output — Phase 2 derives the combine decision from it deterministically. VALIDATE_JSON=$(sf devops promotion validate --work-item-id <id> --target-stage-id <target-stage-id> --target-org <alias> --json)- Validates whether the work item(s) can be promoted to the target stage — checks for VCS and object-permission errors (including the associated-PR requirement) before a promotion is attempted
- Repeat
--work-item-idto validate multiple work items in one call - Success:
status == 0and.result.success == true— proceed - If validation fails (non-zero exit; e.g.
VCS_ERROR: No pull request exists…, with.result.errorType/.result.errorDetailsset), STOP. Report the error and do not proceed. If it references metadata overlap, resolve the conflict before retrying - Shared components: when
.result.combineDetailsis non-null, the work items share metadata — validate returns the parent/child grouping andsuggestions. This is the authoritative signal for the Phase 2 combine decision (see step 4); do not guess whether to combine — the Phase 2 script reads.result.combineDetailsfromVALIDATE_JSON
Phase 2 — Prepare (and optionally Combine)
-
Prepare the work item for promotion:
sf devops work-item prepare --work-item-id <id> --target-stage-id <target-stage-id> --target-org <alias> --json--target-stage-idis required — the same target stage the work item will be promoted to- Idempotent: re-running a prepared work item is safe — treat as success
-
Combine work items — ONLY when the Phase 1 validate step reported shared components (
.result.combineDetailsnon-null) or the work items otherwise have dependencies and must promote as one unit. Do not eyeball the JSON — derive the decision and the parent/child IDs deterministically from the saved validate output (VALIDATE_JSON):# COMBINE == "true" only when validate returned a combineDetails block. COMBINE=$(printf '%s' "$VALIDATE_JSON" | jq -r '(.result.combineDetails != null)') if [ "$COMBINE" = "true" ]; then PARENT_ID=$(printf '%s' "$VALIDATE_JSON" | jq -r '.result.combineDetails.parentWorkitemId') # one --child-work-item-id arg per child, safe for use as a flag array CHILD_ARGS=() while IFS= read -r cid; do CHILD_ARGS+=(--child-work-item-id "$cid"); done < <( printf '%s' "$VALIDATE_JSON" | jq -r '.result.combineDetails.childWorkitemsId[]') fiThen combine using those derived values (skip this command entirely when
COMBINEis not"true"):sf devops work-item combine \ --parent-work-item-id "$PARENT_ID" \ "${CHILD_ARGS[@]}" \ --target-stage-id <stage-id> \ --target-org <alias> \ --jsonCHILD_ARGSexpands to one--child-work-item-id <id>pair per child work item- The parent work item is the primary item that continues through the pipeline; child changes merge into the parent's branch during promotion
- After combining, promote the parent work item ID in step 5
Phase 3 — Promote
- Promote to the target stage — exactly one of
--work-item-idor--stage-idmust be provided;--target-stage-idis always required. Pass--skip-validationONLY when the Phase 1 validate step completed successfully in the current session for every work item being promoted. Otherwise, OMIT the flag and let the CLI run its built-in validation:- Promote one or more specific work items (repeat
--work-item-idper item; use the parent's ID for a combined promotion). Include the--skip-validationline ONLY if Phase 1 validate passed this session; otherwise drop that line:sf devops promote \ --work-item-id <id> \ --target-stage-id <target-stage-id> \ --skip-validation \ --target-org <alias> \ --json - Or promote all approved work items from a source stage (again, include the
--skip-validationline only if Phase 1 validate passed this session):sf devops promote \ --stage-id <source-stage-id> \ --target-stage-id <target-stage-id> \ --skip-validation \ --target-org <alias> \ --json - Why conditional:
sf devops promote's built-in pre-promote validation runs the same checks as the Phase 1sf devops promotion validatestep (including the associated-PR requirement). When the full workflow ran sequentially this session, that validation already passed, so--skip-validationonly eliminates a redundant re-run. But if the agent resumed mid-workflow, promotion was invoked without a preceding Phase 1 validate, or Phase 1 was not run for every work item being promoted, DO NOT pass--skip-validation— bypassing it there would skip validation entirely with no prior guard - Add
--deploy-allto deploy all metadata in the branch rather than only changes not yet in the target stage - Add
--test-level RunLocalTests(orRunSpecifiedTests --tests <names>) for production-stage deploys that include Apex - The deploy runs asynchronously — capture the returned promotion/deploy identifier from the JSON
.result
- Promote one or more specific work items (repeat
Phase 4 — Complete and Report
-
Complete the promotion to finalize — advances the work items in the target stage:
sf devops promotion complete --target-stage-id <target-stage-id> --target-org <alias> --json- Run after the promote deploy succeeds to mark the promotion done in the target stage
--target-stage-idis required (same target stage the work items were promoted to)
-
Report the outcome:
- Confirm the CLI returned status 0 for each step
- Report the promotion/deploy identifier and note that async deploy completion is tracked separately
- Do NOT block or busy-wait inside this skill — surface the identifier and return
- State the promotion clearly: e.g., "Work item promotion initiated (source stage → target stage). Deploy ID: <id>. Poll this ID to confirm deploy completion, then run promotion complete."
Rules / Constraints
| Constraint | Rationale |
|---|---|
| Validate ALWAYS runs first | Guarantees preconditions are met before any mutation; skipping it can corrupt pipeline state |
All sf devops commands must use --json | Structured output is required for headless consumption; human-readable output is unreliable to parse |
| Commands are keyed on record IDs, not names | --work-item-id, --stage-id, --target-stage-id, --parent/--child-work-item-id all take IDs; resolve names to IDs first |
--target-stage-id required for every promotion command (validate, prepare, combine, promote, complete) | The target stage is mandatory; the promotion has no destination without it |
Exactly one of --work-item-id or --stage-id on promote | These flags are mutually exclusive; promote either specific items or a whole source stage |
Pass --skip-validation on promote ONLY if Phase 1 validate passed this session | The CLI's built-in pre-promote validation runs the same checks (including the associated-PR requirement) as the Phase 1 promotion validate step. Skipping is safe only when that validation already ran successfully this session; if the agent resumed mid-workflow or promotion was invoked without a preceding validate, OMIT the flag so the CLI validates |
| Deploy runs async — capture and report the identifier | The promote deploy does not complete synchronously; completion is tracked separately |
| Do NOT busy-wait for deploy completion in this skill | Polling is a separate concern; blocking here wastes turns and risks timeouts |
| Combine only when work items share metadata/dependencies | Combining is for conflict-prone or dependent items, not a default for every multi-item promotion |
| Prepare is idempotent | Retry-safe for CI; re-running a completed prepare is a no-op |
| Never use interactive prompts | Skills run headless; all inputs must be CLI flags |
| Pass IDs as CLI flags, never interpolate into shell strings | Prevents prompt/command injection via crafted identifiers |
Gotchas
| Issue | Resolution |
|---|---|
| Validation fails | STOP — do not prepare/combine/promote. Report the non-zero status / error message; if metadata overlap, resolve the conflict before retrying |
| No default org set | Run sf org display --json; if it fails, instruct user to run sf org login web --set-default |
| Passing a work item name instead of an ID | Promotion commands need record IDs; resolve names via sf devops work-item list --project-id <id> --json | jq -r '.result.workItems[] | select(.subject == "<WI-subject>") | .id' |
Both --work-item-id and --stage-id supplied | They are mutually exclusive; pick specific work items OR a source stage, not both |
Missing --target-stage-id | Required on every promotion command (validate, prepare, combine, promote, complete); obtain the target stage ID from the pipeline configuration |
| Combined promotion promotes the wrong item | After work-item combine, promote the parent work item ID — children merge into the parent's branch |
| Treating the deploy as synchronous | The promote deploy is async; capture the identifier and confirm completion before running promotion complete |
| Production deploy fails on Apex coverage | Set --test-level RunLocalTests (or RunSpecifiedTests --tests <names>) for production-stage promotions with Apex |
| Deploy fails with conflict | A conflict slipped past validate; resolve the metadata conflict, then re-validate and retry |
Output Expectations
Deliverables vary by operation:
- Validate:
.result.successplus, when work items share metadata,.result.combineDetails/.result.suggestions. A non-zero exit (with.result.errorType/.result.errorDetails) means the work item cannot be promoted to the target stage - Prepare / combine: confirmation that the work item(s) are staged (combine returns the parent/child grouping)
- Promote: an async deploy identifier and confirmation that the promotion deploy was initiated
- Promotion complete: confirmation the work items advanced in the target stage
Outputs are derived from sf devops work-item, sf devops promote, and sf devops promotion complete CLI commands. Async deploy completion is NOT produced by the promote call — poll the returned identifier separately before completing.
Cross-Skill Integration
| When | Action |
|---|---|
| Work item must be created or moved to a promotable status first | Delegate to dx-devops-work-item-manage |
| Validation reports metadata overlap / conflict | Resolve the metadata conflict before retrying |
| The promote deploy identifier must be polled to confirm completion | Poll the returned identifier separately, then run sf devops promotion complete |
Reference File Index
| File | When to read |
|---|---|
references/cli-commands.md | When you need detailed CLI flag documentation, JSON output schemas, or error-handling patterns for validate/prepare/combine/promote/complete |
examples/promotion-workflows.md | When the user's request matches a common pattern (single work item promotion, combined promotion, whole-stage promotion, validate-first gate) |
FAQ
What does the dx-devops-promote skill do?
Use this skill to drive the full DevOps Center promotion workflow for work items and pipeline stages — validate preconditions, prepare work items, optionally combine work items that share metadata, promote one or more work items or an entire stage to a target pipeline stage, and complete the promotion to finalize the deployment. TRIGGER when the user wants to promote a work item, advance changes to the next environment or stage, combine work items for a single promotion, or move metadata through the release pipeline. The mandatory validate step runs automatically at the start. DO NOT TRIGGER for work item creation or status updates (use dx-devops-work-item-manage), for conflict detection, or for polling an existing promotion's status.
How do I install dx-devops-promote?
Run npx skills add https://github.com/forcedotcom/sf-skills --skill dx-devops-promote in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/dx-devops-promote/ (personal) or .claude/skills/dx-devops-promote/ (project).
Which AI agents can use dx-devops-promote?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is dx-devops-promote safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains dx-devops-promote?
It is published by forcedotcom in forcedotcom/sf-skills. It has 2,285 recorded installs.
More from forcedotcom/sf-skills
platform-apex-generate
forcedotcom/sf-skills
Primary Apex authoring skill for class generation, refactoring, and review. ALWAYS ACTIVATE when the user mentions Apex, .cls, triggers, or asks to create/refactor a class (service, selector, domain, batch, queueable, schedulable, invocable, DTO, utility, interface, abstract, exception, REST resource). Use this skill for requests involving SObject CRUD, mapping collections, fetching related records, scheduled jobs, batch jobs, trigger design, @AuraEnabled controllers, @RestResource endpoints, custom REST APIs, or code review of existing Apex.
platform-apex-test-generate
forcedotcom/sf-skills
Use to generate and validate Apex test classes with TestDataFactory patterns, bulk testing (251+ records), mocking, assertions, and disciplined test-fix loops. Use when creating Apex test classes (for triggers, services, controllers, batch jobs, queueables, and callouts), improving coverage, debugging or fixing failing Apex tests, or running test/coverage analysis. Triggers on Test.cls files, sf apex run test, coverage reports. Do NOT trigger for production Apex (use platform-apex-generate) or Jest/LWC tests.
platform-apex-test-run
forcedotcom/sf-skills
Apex test execution, coverage analysis, and test-fix loops with 120-point scoring. Use when the user runs Apex tests, checks code coverage, fixes failing tests, or touches Test.cls / Test.cls files. DO NOT TRIGGER when writing Apex production code (use platform-apex-generate), Agentforce agent testing (use agentforce-test), or Jest/LWC tests (use experience-lwc-generate).
platform-apex-logs-debug
forcedotcom/sf-skills
Salesforce debug log analysis and troubleshooting with 100-point scoring. TRIGGER when: user analyzes debug logs, hits governor limits, reads stack traces, or touches .log files from Salesforce orgs. DO NOT TRIGGER when: running Apex tests (use platform-apex-test-run), generating or fixing Apex code (use platform-apex-generate), or Agentforce session tracing (use agentforce-observe).
platform-soql-query
forcedotcom/sf-skills
Use when the user needs SOQL/SOSL authoring or optimization: natural-language-to-query generation, relationship queries, aggregates, query-plan/selectivity analysis, and performance or safety improvements. TRIGGER when the user writes, optimizes, or debugs SOQL/SOSL, touches .soql files, or asks about relationship queries, aggregates, or query performance. DO NOT TRIGGER for bulk data operations (use platform-data-manage), Apex DML logic (use platform-apex-generate), or report/dashboard queries.
platform-metadata-deploy
forcedotcom/sf-skills
Salesforce DevOps automation using sf CLI v2. TRIGGER when: user deploys metadata, validates a deploy or does a dry-run, deploys to a Production org, quick-deploys a validated job ID, ships/promotes to prod, creates/manages scratch orgs or sandboxes, sets up CI/CD pipelines, or troubleshoots deployment errors with sf project deploy. DO NOT TRIGGER when: writing Apex code, building LWC components (use experience-lwc-generate), creating metadata definitions (use platform-custom-object-generate), deleting metadata from an org (use platform-destructive-deploy), or querying org data (use platform-data-manage).
Popular devops & cloud skills
microsoft-foundry
microsoft/azure-skills
Build, deploy, evaluate, optimize, fine-tune, and manage Microsoft Foundry agents, models, and resources end to end. USE FOR: foundry, azd ai agent, azd provision/deploy, hosted agent scaffold/develop/run/deploy/troubleshoot, prompt agent create, managed harness agent create, GitHub Copilot harness agent, create agent, update agent, add tool to agent, invoke agent, agent insights, evaluate agent, batch eval, continuous eval, continuous monitoring, agent CI/CD, optimize prompt, improve prompt, optimize agent instructions, Agent Optimizer scaffold, dataset curation from traces, deploy model, model fine-tuning (SFT/DPO/RFT), Foundry project, RBAC, role assignment, permissions, quota, capacity, region, deployment failure, AI Services, create Foundry resource, knowledge index, customize deployment, onboard, availability, training-data, grader, distillation, large file upload. DO NOT USE FOR: Azure Functions, App Service, general Azure deploy (use azure-deploy), general Azure prep (use azure
azure-diagnostics
microsoft/azure-skills
Debug Azure production issues on Azure using AppLens, Azure Monitor, resource health, and safe triage. WHEN: debug production issues, troubleshoot app service, app service high CPU, app service deployment failure, troubleshoot container apps, container app 503 or target port mismatch, troubleshoot functions, function telemetry missing or stopped after a config/connection-string change, troubleshoot AKS, VM RDP, Linux SSH, VM black screen, can't connect to VM, reset VM password, NSG or firewall blocking, kubectl cannot connect, kube-system/CoreDNS failures, pod pending, crashloop, node not ready, upgrade failures, analyze logs, KQL, insights, image pull failures, cold start issues, health probe failures, resource health, root cause of errors, troubleshoot event hubs, troubleshoot service bus, messaging SDK error, AMQP connection failure, message lock lost, lock renewal during long-running processing, service bus dead letter.
azure-prepare
microsoft/azure-skills
Prepare azd-based Azure projects for deployment: generates azure.yaml, infrastructure (Bicep/Terraform), and Dockerfiles for the Azure Developer CLI (azd) workflow. USE ONLY when the user explicitly wants to use azd as the deployment tool, or the project already has an azure.yaml file. DO NOT USE FOR: non-azd deployments, Python App Service code-only deploys (use python-appservice-deploy), or cross-cloud migration (use azure-cloud-migrate). WHEN: prepare app for azd, create azure.yaml, set up azd infrastructure, modernize app for Azure with azd, deploy with azd, function app, timer trigger, service bus trigger, event-driven function, managed identity, generate Bicep, generate Terraform, create and deploy to Azure.
azure-ai
microsoft/azure-skills
Use for Azure AI: Search, Speech, OpenAI, Document Intelligence. Helps with search, vector/hybrid search, speech-to-text, text-to-speech, transcription, OCR. WHEN: AI Search, query search, vector search, hybrid search, semantic search, speech-to-text, text-to-speech, transcribe, OCR, convert text to speech.
azure-deploy
microsoft/azure-skills
Execute Azure deployments for ALREADY-PREPARED applications that have existing .azure/deployment-plan.md and infrastructure files. DO NOT use this skill when the user asks to CREATE a new application — use azure-prepare instead. This skill runs azd up, azd deploy, terraform apply, and az deployment commands with built-in error recovery. Requires .azure/deployment-plan.md from azure-prepare and validated status from azure-validate. WHEN: "run azd up", "run azd deploy", "execute deployment", "push to production", "push to cloud", "go live", "ship it", "bicep deploy", "terraform apply", "publish to Azure", "launch on Azure". DO NOT USE WHEN: "create and deploy", "build and deploy", "create a new app", "set up infrastructure", "create and deploy to Azure using Terraform" — use azure-prepare for these.
azure-validate
microsoft/azure-skills
Pre-deployment validation for Azure readiness. Run deep checks on configuration, infrastructure (Bicep or Terraform), RBAC role assignments, managed identity permissions, and prerequisites before deploying. WHEN: validate my app, check deployment readiness, run preflight checks, verify configuration, check if ready to deploy, validate azure.yaml, validate Bicep, test before deploying, troubleshoot deployment errors, validate Azure Functions, validate function app, validate serverless deployment, verify RBAC roles, check role assignments, review managed identity permissions, what-if analysis, validate Container Apps deployment.