forcedotcom/sf-skills / plugins/builder/dx-devops/skills/dx-devops-pipeline-manage
dx-devops-pipeline-manage
VerifiedUse this skill to manage the full lifecycle of a DevOps Center pipeline — list all pipelines, get a single pipeline's details, create a new pipeline linked to a Git repository, add or remove stages, rename a stage, add or remove Salesforce environments on stages, attach or detach projects, and activate or deactivate the pipeline. Invoke when the user wants to set up a release pipeline, wire promotion stages across integration, UAT, staging, and production orgs, connect environments to stages, attach a project, or activate a continuous delivery pipeline. Uses sf devops pipeline and sf devops stage commands with --json output. DO NOT TRIGGER for work-item lifecycle, promotion or deployment execution, conflict detection, or standalone project creation (separate skills).
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 19.3 KB |
| examples/common-workflows.md | markdown | 6.9 KB |
| references/cli-commands.md | markdown | 12.2 KB |
| references/parsing-patterns.md | markdown | 4.3 KB |
| scripts/check-activation-ready.shexecutable | script | 1.4 KB |
| scripts/validate-org-type.shexecutable | script | 541 B |
| scripts/verify-operation.shexecutable | script | 3.6 KB |
references/parsing-patterns.md
View on GitHub# DevOps Center Pipeline — Parsing, Errors & Auth
jq snippets for parsing `sf devops` JSON output, error-handling reference, the idempotent check-before-create pattern, and authentication requirements. For command flags and JSON schemas, see `references/cli-commands.md`.
## Parsing Stage Chains
Stages form a linked list via `nextStageId` (see the schema in `references/cli-commands.md`). Use these snippets against `pipeline get`:
```bash
# List stage names and IDs with their next pointer
sf devops pipeline get --pipeline-id 1PJWt000000HLUfOAO --json | \
jq -r '.result.stages[] | "\(.name) (\(.id)) -> next: \(.nextStageId)"'
# Find the terminal stage ID (nextStageId is null)
sf devops pipeline get --pipeline-id 1PJWt000000HLUfOAO --json | \
jq -r '.result.stages[] | select(.nextStageId == null) | .id'
# Find a stage ID by name (e.g. to anchor an insert before "Production")
sf devops pipeline get --pipeline-id 1PJWt000000HLUfOAO --json | \
jq -r '.result.stages[] | select(.name == "Production") | .id'
```
---
## Resolve a Pipeline ID by Name
`pipeline list` is the reliable way to turn a pipeline name into an ID (note the `.pipelines[]` wrapper and capitalized `Name`/`Id`):
```bash
PIPELINE_ID=$(sf devops pipeline list --json | \
jq -r '.result.pipelines[] | select(.Name == "Release Pipeline") | .Id' | head -n1)
echo "Pipeline: $PIPELINE_ID"
```
### List Pipelines (name, ID, active state)
`pipeline list` does not carry stages — to show the stage chain, feed each ID into `pipeline get`:
```bash
sf devops pipeline list --json | \
jq -r '.result.pipelines[] | "\(.Name) [\(.IsActive)] (\(.Id))"'
# Release Pipeline [true] (1PJWt000000HLUfOAO)
```
---
## Resolve a Project ID by Name
`project list` returns SObject records under `.result.projects[]` with capitalized fields (`Id`, `Name`):
```bash
sf devops project list --json | jq -r '.result.projects[] | "\(.Id): \(.Name)"'
# Extract a specific project ID by name
sf devops project list --json | \
jq -r '.result.projects[] | select(.Name == "Release Project 1") | .Id'
```
---
## Idempotent Create (Check-Before-Create)
The CLI does not dedupe pipelines. Check for an existing pipeline before creating:
```bash
PIPELINE_NAME="Release Pipeline"
EXISTING_ID=$(sf devops pipeline list --json | \
jq -r ".result.pipelines[] | select(.Name == \"$PIPELINE_NAME\") | .Id" | head -n1)
if [ -n "$EXISTING_ID" ]; then
echo "Pipeline already exists: $EXISTING_ID"
else
sf devops pipeline create \
--name "$PIPELINE_NAME" \
--repo https://github.com/myorg/myrepo \
--json
NEW_ID=$(sf devops pipeline list --json | \
jq -r ".result.pipelines[] | select(.Name == \"$PIPELINE_NAME\") | .Id" | head -n1)
echo "Created new pipeline: $NEW_ID"
fi
```
---
## Error Handling
**Missing required repo (create):**
```json
{ "status": 1, "name": "RequiredFlagsError", "message": "Missing required flag --repo", "exitCode": 1 }
```
**Pipeline not found:**
```json
{ "status": 1, "name": "NOT_FOUND", "message": "Pipeline 0XB000000000999 does not exist or is not accessible", "exitCode": 1 }
```
**Activation without a stage:**
```json
{ "status": 1, "name": "NO_STAGES", "message": "A pipeline must have at least one stage before you can activate it", "exitCode": 1 }
```
**Environment delete on active pipeline:**
```json
{ "status": 1, "name": "PIPELINE_ACTIVE", "message": "The environment must belong to an inactive pipeline", "exitCode": 1 }
```
**Project already attached:**
```json
{ "status": 1, "name": "PROJECT_ALREADY_ATTACHED", "message": "You can attach a project to only one pipeline", "exitCode": 1 }
```
**Authentication failure:**
```json
{ "status": 1, "name": "NoOrgFound", "message": "No org configuration found for target-org. Run 'sf org login web' to authenticate.", "exitCode": 1 }
```
> **Note:** Error `name`/`message` strings are representative — match on the non-zero `status` and the substring of `message`, not exact strings.
---
## Authentication Requirements
All `sf devops pipeline` / `sf devops stage` commands require:
1. **Authenticated org**: `sf org login web` or JWT auth
2. **DevOps Center enabled**: org must have DOCe provisioned
3. **Appropriate permissions**: access to the pipeline, its stages, and connected environments
```bash
sf org display --target-org <alias> --json
```
If auth fails: `sf org login web --set-default --alias <alias>`.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |