pipeline

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Pipeline Skill

Pipeline Skill

$pipeline
is the configurable pipeline orchestrator for OMX. It sequences stages through a uniform
PipelineStage
interface, with state persistence and resume support.
$pipeline
是面向OMX的可配置流水线编排器。它通过统一的
PipelineStage
接口编排各阶段的执行顺序,支持状态持久化和断点续跑。

Default Autopilot Pipeline

默认Autopilot流水线

The canonical OMX pipeline sequences:
RALPLAN (consensus planning) -> team-exec (Codex CLI workers) -> ralph-verify (architect verification)
标准OMX流水线的执行顺序为:
RALPLAN (consensus planning) -> team-exec (Codex CLI workers) -> ralph-verify (architect verification)

Configuration

配置

Pipeline parameters are configurable per run:
ParameterDefaultDescription
maxRalphIterations
10Ralph verification iteration ceiling
workerCount
2Number of Codex CLI team workers
agentType
executor
Agent type for team workers
流水线参数支持每次运行单独配置:
参数默认值描述
maxRalphIterations
10Ralph校验迭代次数上限
workerCount
2Codex CLI团队执行器的数量
agentType
executor
团队执行器的Agent类型

Stage Interface

阶段接口

Every stage implements the
PipelineStage
interface:
typescript
interface PipelineStage {
  readonly name: string;
  run(ctx: StageContext): Promise<StageResult>;
  canSkip?(ctx: StageContext): boolean;
}
Stages receive a
StageContext
with accumulated artifacts from prior stages and return a
StageResult
with status, artifacts, and duration.
每个阶段都实现了
PipelineStage
接口:
typescript
interface PipelineStage {
  readonly name: string;
  run(ctx: StageContext): Promise<StageResult>;
  canSkip?(ctx: StageContext): boolean;
}
各阶段会接收包含之前阶段所有产出物的
StageContext
对象,返回包含执行状态、产出物和运行时长的
StageResult
对象。

Built-in Stages

内置阶段

  • ralplan: Consensus planning (planner + architect + critic). Skips only when both
    prd-*.md
    and
    test-spec-*.md
    planning artifacts already exist, and carries any
    deep-interview-*.md
    spec paths forward for traceability.
  • team-exec: Team execution via Codex CLI workers. Always the OMX execution backend.
  • ralph-verify: Ralph verification loop with configurable iteration count.
  • ralplan:共识规划(规划器 + 架构师 + 评审器)。仅当
    prd-*.md
    test-spec-*.md
    规划产出物都已存在时才会跳过,同时会携带所有
    deep-interview-*.md
    需求文档路径用于后续溯源。
  • team-exec:通过Codex CLI执行器实现团队协作执行,是固定的OMX执行后端。
  • ralph-verify:Ralph校验循环,支持配置迭代次数。

State Management

状态管理

Pipeline state persists via the ModeState system at
.omx/state/pipeline-state.json
. The HUD renders pipeline phase automatically. Resume is supported from the last incomplete stage.
  • On start:
    state_write({mode: "pipeline", active: true, current_phase: "stage:ralplan"})
  • On stage transitions:
    state_write({mode: "pipeline", current_phase: "stage:<name>"})
  • On completion:
    state_write({mode: "pipeline", active: false, current_phase: "complete"})
流水线状态通过ModeState系统持久化存储在
.omx/state/pipeline-state.json
路径下。HUD会自动渲染流水线当前执行阶段,支持从最后一个未完成的阶段断点续跑。
  • 启动时
    state_write({mode: "pipeline", active: true, current_phase: "stage:ralplan"})
  • 阶段切换时
    state_write({mode: "pipeline", current_phase: "stage:<name>"})
  • 执行完成时
    state_write({mode: "pipeline", active: false, current_phase: "complete"})

API

API

typescript
import {
  runPipeline,
  createAutopilotPipelineConfig,
  createRalplanStage,
  createTeamExecStage,
  createRalphVerifyStage,
} from './pipeline/index.js';

const config = createAutopilotPipelineConfig('build feature X', {
  stages: [
    createRalplanStage(),
    createTeamExecStage({ workerCount: 3, agentType: 'executor' }),
    createRalphVerifyStage({ maxIterations: 15 }),
  ],
});

const result = await runPipeline(config);
typescript
import {
  runPipeline,
  createAutopilotPipelineConfig,
  createRalplanStage,
  createTeamExecStage,
  createRalphVerifyStage,
} from './pipeline/index.js';

const config = createAutopilotPipelineConfig('build feature X', {
  stages: [
    createRalplanStage(),
    createTeamExecStage({ workerCount: 3, agentType: 'executor' }),
    createRalphVerifyStage({ maxIterations: 15 }),
  ],
});

const result = await runPipeline(config);

Relationship to Other Modes

与其他模式的关联

  • autopilot: Autopilot can use pipeline as its execution engine (v0.8+)
  • team: Pipeline delegates execution to team mode (Codex CLI workers)
  • ralph: Pipeline delegates verification to ralph (configurable iterations)
  • ralplan: Pipeline's first stage runs RALPLAN consensus planning
  • autopilot:Autopilot模式可将pipeline作为其执行引擎(v0.8及以上版本)
  • team:流水线将执行任务委托给team模式(Codex CLI执行器)
  • ralph:流水线将校验任务委托给ralph(支持配置迭代次数)
  • ralplan:流水线的第一个阶段会运行RALPLAN共识规划