---
name: agent-chain
description: Sequential pipeline orchestration. YAML-defined steps where each step feeds into the next via $INPUT and $ORIGINAL.
user-invocable: true
---

# Agent Chain — Sequential Pipeline

Set up a pipeline-style multi-agent workflow where each step feeds into the next.

## How It Works

```
Step 1: Planner -> "Create plan for: $INPUT" -> outputs plan
Step 2: Builder -> "Implement: $INPUT" -> outputs code
Step 3: Reviewer -> "Review: $INPUT" -> outputs review
```

## Variables

- `$INPUT`: Output of the previous step
- `$ORIGINAL`: User's original prompt

## Pipeline Template

```yaml
steps:
  - agent: planner
    prompt: |
      Create a detailed implementation plan for: $INPUT
      Include file paths, task breakdown, and key decisions.

  - agent: builder
    prompt: |
      Implement the following plan: $INPUT
      Write production-quality code with error handling.

  - agent: reviewer
    prompt: |
      Review this code: $INPUT
      Check: correctness, security, performance, style.
```

## Usage

```bash
pi -e extensions/agent-chain.ts
```

$ARGUMENTS
