| name | pipeline-orchestrator |
| description | Use when a super-agent (coding-agent, docs-agent, startup-agent) needs to execute a multi-stage pipeline defined in JSON - resolves template variables, manages sequential/parallel/chain stage execution, enforces quality gates, and passes data between stages via file outputs |
Pipeline Orchestrator
I'm using the pipeline-orchestrator skill to execute a multi-stage pipeline.
Iron Law
NO STAGE ADVANCES WITHOUT VERIFIED OUTPUTS FROM THE PREVIOUS STAGE.
Input Contract
Receive a pipeline JSON object with:
name — pipeline identifier
description — what this pipeline produces
mode — interactive (all gates active) or autonomous (skip approval gates)
stages — ordered array of stage definitions
context — user's original request/description (passed by the calling agent)
Execution Protocol
1. Initialize
- Read the pipeline JSON (passed inline or from a
references/pipelines/*.json file)
- Resolve template variables in all
outputs paths:
{date} → YYYY-MM-DD (today)
{name} → slugified pipeline name or user-provided name
{project} → current directory name
- Create a task list from stages using TodoWrite
- Announce: "Executing pipeline: {name} — {description}"
- List all stages with descriptions for the user
2. Execute Stages (sequential order)
For each stage in stages:
Type: skill
- Announce: "Stage {id}: {description}"
- Resolve
inputs — interpolate ${stage_id.outputs.key} from prior stage outputs
- Invoke the skill via the Skill tool (path format:
category/skill-name)
- Verify declared
outputs exist on disk (Read or Glob)
- Record outputs for downstream interpolation
Type: skill-chain
- Announce: "Stage {id}: {description} ({n} skills in sequence)"
- For each skill in
skills array:
- Invoke via Skill tool
- Pass context from the previous skill in the chain
- Verify final outputs exist
Type: parallel
- Announce: "Stage {id}: {description} — dispatching {n} parallel branches"
- Validate branches are independent (no shared output paths)
- Dispatch each branch as a subagent using the Task tool:
- Each branch gets its own resolved inputs
- Branch prompt includes: skill(s) to invoke, inputs, expected outputs
- Follow
dispatching-parallel-agents constraints: focused, self-contained, specific
- Wait for all branches to complete
- Review branch results for conflicts
- Verify all declared outputs exist
3. Enforce Gates
When a stage has a gate:
approval gate
- Interactive mode: Present the gate prompt to the user via AskUserQuestion. Options: "Continue" / "Review changes" / "Abort pipeline"
- Autonomous mode: Skip, log "Gate skipped (autonomous mode)"
quality gate
- Dispatch a code-reviewer subagent using
requesting-code-review pattern
- Review feedback: fix Critical issues immediately, fix Important before proceeding
- Both modes: always enforce quality gates
verification gate
- Use
verification-before-completion pattern: run verification commands, require evidence
- Both modes: always enforce verification gates
4. Handle Failures
If any stage fails:
- Stop the pipeline immediately
- Report: "Pipeline {name} failed at stage {stage_id}: {error}"
- List completed stages and their outputs
- List remaining stages that were not executed
- Do NOT attempt to continue past a failed stage
5. Complete
After all stages succeed:
- Announce: "Pipeline {name} completed successfully"
- List all outputs with their file paths
- If the pipeline context suggests finishing a branch, offer
finishing-a-development-branch
Variable Interpolation
Outputs from prior stages are available via ${stage_id.outputs.key}:
${brainstorm.outputs.design_doc} → resolves to the actual file path
${plan.outputs.plan_file} → resolves to the plan's file path
If a referenced variable doesn't exist, fail the stage with a clear error message.
Integration
- Called by:
coding-agent, docs-agent, startup-agent
- Uses:
requesting-code-review, verification-before-completion, finishing-a-development-branch, dispatching-parallel-agents
- Never called directly by users — always invoked by a super-agent
Red Flags
- Never skip a
quality or verification gate, even in autonomous mode
- Never advance past a stage whose outputs don't exist
- Never run parallel branches that share output files
- Never guess output paths — always verify with Glob or Read