Orchestrate multi-stage agent pipelines with dependency management {project-root}/_bmad/core/pipeline/pipeline-config.yaml {project-root}/_bmad-output/pipelines Ask user for pipeline source: 1. Use template (show available templates) 2. Define custom pipeline List templates from config: full_sdlc, quick_flow, analysis_only, design_review, test_suite User selects template Copy template stages to new pipeline definition Ask for pipeline name Ask for stages (agent, parallel, depends_on, outputs) Build pipeline definition Generate pipeline_id: "PIPE-{YYYYMMDD}-{name}" Create pipeline file: {pipeline_dir}/{pipeline_id}.yaml Initialize all stages as "pending" Pipeline created: {pipeline_id} Stages: {stage_count} Estimated duration: {estimate} Run with: PIPELINE run {pipeline_id} Load pipeline from {pipeline_id}.yaml Validate pipeline definition (agents exist, dependencies valid) Set pipeline status to "running" Initialize execution state tracking Find stages where: - Status == "pending" AND - All depends_on stages are "completed" Mark found stages as "queued" Launch agents in parallel using Task tool with run_in_background=true Track agent_ids for each stage Launch agent using Task tool with run_in_background=false Wait for completion For parallel stages: Use TaskOutput to collect results Update stage status based on result (completed/failed) Store outputs in {pipeline_dir}/outputs/{stage_name}/ Mark pipeline as "failed" Mark dependent stages as "skipped" HALT: "Pipeline failed at stage: {stage_name}" Mark dependent stages as "skipped" Continue with non-dependent stages Update pipeline file with current state Mark pipeline as "completed" Pipeline completed: {pipeline_id} Results: {for each stage} - {stage_name}: {status} ({duration}) {end for} Outputs saved to: {pipeline_dir}/outputs/ Load pipeline from {pipeline_id}.yaml (or active-pipeline.yaml) Calculate progress percentage Pipeline: {pipeline_id} Status: {overall_status} Progress: [{progress_bar}] {percentage}% Stages: {for each stage} [{status_icon}] {stage_name} Agents: {agents} Duration: {duration or "pending"} Output: {output_path or "n/a"} {end for} {if running} Currently executing: {current_stage} Estimated remaining: {remaining_estimate} {end if} Scan {pipeline_dir} for pipeline files Load templates from config Available Templates: {for each template} - {template_name}: {description} Stages: {stage_names} {end for} Existing Pipelines: {for each pipeline} - {pipeline_id}: {status} ({created_date}) {end for} Load running pipeline Send abort signal to running agents Mark running stages as "aborted" Mark pipeline as "aborted" Pipeline {pipeline_id} aborted. Completed stages: {completed_count} Aborted stages: {aborted_count} Load failed/aborted pipeline Identify failed/aborted stages Ask user: Retry failed stages or skip? Reset failed stages to "pending" Continue with run logic Mark failed stages as "skipped" Continue with remaining stages