---
name: pipeline
description: Configurable pipeline orchestrator for sequencing Omagy stages.
---

# Pipeline Skill

`/omagy:pipeline` is the configurable pipeline orchestrator for Omagy. It
sequences stages through a uniform stage-result contract, with `.omagy` state
persistence and resume support.

## Default Autopilot Pipeline

The default pipeline sequences:

```text
deep-interview -> ralplan -> ultragoal (+ team if needed) -> code-review -> ultraqa
```

`/omagy:team` is conditional: use it only inside an active Ultragoal story when
independent lanes or broad verification make coordinated parallel execution
useful. Explicit legacy Ralph pipelines remain available through custom stage
names, but Ralph is not the advertised default pipeline loop.

## Configuration

Pipeline parameters are configurable per run:

| Parameter | Default | Description |
|-----------|---------|-------------|
| `maxRalphIterations` | 10 | Quality-gate retry ceiling; legacy option name retained for parity with OMX |
| `workerCount` | 2 | Number of team workers when the team stage is inserted |
| `agentType` | `executor` | Agent type hint for team workers |

## Stage Interface

Every stage records a stage result:

```json
{
  "stage": "code-review",
  "status": "completed",
  "artifacts": {
    "review_verdict": {
      "final_recommendation": "APPROVE",
      "architecture_status": "CLEAR"
    }
  }
}
```

Stages receive accumulated `handoff_artifacts` from prior stages and record
status, artifacts, and optional duration.

## Built-in Stages

- **deep-interview**: Requirements clarification and ambiguity gate.
- **ralplan**: Consensus planning. Skips only when planning artifacts already
  exist and carries any deep-interview spec paths forward for traceability.
- **ultragoal**: Durable goal-mode execution with `.omagy` ledgers. Launch
  `/omagy:team` only from inside an Ultragoal story when parallel lanes are
  warranted.
- **code-review**: Merge-readiness review gate.
- **ultraqa**: Adversarial QA gate after a clean review; docs-only or trivially
  non-runtime changes may record an explicit skip reason.
- **team-exec** and **ralph-verify**: Legacy/custom adapters retained for
  explicit non-default pipelines.

## State Management

Pipeline state persists at `.omagy/state/pipeline-state.json`. The HUD and
workflow status read this state through the Omagy mode-state system.

- On start:
  `omagy pipeline start --input '{"task":"..."}' --json`
- On stage transitions:
  `omagy pipeline record-stage --input '{"stage":"<name>","status":"completed","artifacts":{...}}' --json`
- On completion:
  `omagy pipeline complete --json`
- On cancellation:
  `omagy pipeline cancel --json`

## Recommended Flow

1. Start the pipeline with `omagy pipeline start`.
2. Run `omagy pipeline next --json` to get the current stage handoff.
3. Execute the matching `/omagy:<stage>` skill.
4. Record that stage with concrete artifacts.
5. Continue until the pipeline records `current_phase=complete`.

## Relationship to Other Modes

- **autopilot**: Autopilot may use pipeline as its execution engine.
- **team**: Optional execution engine inside an Ultragoal story when parallel
  lanes are needed.
- **ultragoal**: Default durable execution stage.
- **ralph**: Available only for explicit legacy/custom pipelines.
- **ralplan**: Pipeline planning runs RALPLAN consensus planning.
