parallel-run

Orchestrate parallel agent execution with git worktrees

9 stars

Best use case

parallel-run is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Orchestrate parallel agent execution with git worktrees

Teams using parallel-run should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/parallel-run/SKILL.md --create-dirs "https://raw.githubusercontent.com/jpoutrin/product-forge/main/plugins/product-design/skills/parallel-run/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/parallel-run/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How parallel-run Compares

Feature / Agentparallel-runStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Orchestrate parallel agent execution with git worktrees

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# parallel-run

**Category**: Parallel Development

## Usage

```bash
/parallel-run <parallel-dir> [options]
```

## Arguments

- `<parallel-dir>`: Required - Path to decomposed parallel folder (e.g., `parallel/TS-0042-inventory/`)
- `--validate`: Only validate the directory without executing
- `--status`: Show current execution status

## Purpose

Execute parallel agent development tasks using the `cpo` (Claude Parallel Orchestrator) CLI tool. This command:
1. Validates the parallel directory and manifest.json
2. Executes parallel agents using git worktrees
3. Monitors progress and reports results

## Prerequisites

- Run `/parallel-decompose` first (creates tasks, prompts, manifest.json)
- `cpo` tool installed: `pip install claude-parallel-orchestrator` or `pipx install claude-parallel-orchestrator`
- Git working tree is clean (no uncommitted changes)
- Claude Code CLI available: `claude --version`

---

## Execution Instructions for Claude Code

When this command is run, Claude Code should delegate to the `cpo` CLI tool.

### 0. Parse Arguments

Extract from user input:
- `PARALLEL_DIR`: The parallel directory path
- `VALIDATE_ONLY`: Boolean, true if `--validate` specified
- `STATUS_ONLY`: Boolean, true if `--status` specified

### 1. Check cpo Tool Availability

```bash
cpo --help
```

If `cpo` is not installed, display:
```
ERROR: cpo (Claude Parallel Orchestrator) not found

Install with:
  pip install claude-parallel-orchestrator
  # or
  pipx install claude-parallel-orchestrator

Documentation: https://github.com/jpoutrin/claude-parallel-orchestrator
```

### 2. Handle --validate Option

If `--validate` is specified:

```bash
cpo validate "$PARALLEL_DIR"
```

Display the validation output and stop.

### 3. Handle --status Option

If `--status` is specified:

```bash
cpo status "$PARALLEL_DIR"
```

Display the status output and stop.

### 4. Run Parallel Execution

For default execution (no special flags):

```bash
cpo run "$PARALLEL_DIR"
```

The `cpo run` command will:
1. Validate the manifest.json
2. Create git worktrees for each task
3. Launch Claude agents in parallel (respecting wave dependencies)
4. Monitor progress and handle failures
5. Generate execution logs in `$PARALLEL_DIR/logs/`
6. Create final report in `$PARALLEL_DIR/report.json`

### 5. Monitor and Report Progress

The `cpo run` command outputs progress to stdout. Parse and display:

```
=== Parallel Execution Started ===

Wave 1:
  task-001-users: RUNNING
  task-002-products: RUNNING
  task-003-shared: RUNNING

[... cpo output continues ...]

=== Execution Complete ===

Results:
  Completed: 5/5 tasks
  Failed: 0 tasks

Next step: /parallel-integrate --parallel-dir $PARALLEL_DIR
```

---

## cpo Manifest Format

The `cpo` tool expects `manifest.json` with this structure:

```json
{
  "tech_spec_id": "TS-0042",
  "waves": [
    {
      "number": 1,
      "tasks": [
        {
          "id": "task-001-users",
          "agent": "python-experts:django-expert",
          "prompt_file": "prompts/task-001.txt"
        },
        {
          "id": "task-002-products",
          "agent": "python-experts:django-expert",
          "prompt_file": "prompts/task-002.txt"
        }
      ],
      "validation": "python -c 'from apps.users.models import User'"
    },
    {
      "number": 2,
      "tasks": [
        {
          "id": "task-004-orders",
          "agent": "python-experts:django-expert",
          "prompt_file": "prompts/task-004.txt"
        }
      ],
      "validation": "pytest apps/orders/tests/ -v"
    }
  ]
}
```

**Key fields:**
- `tech_spec_id`: Links to Tech Spec for traceability
- `waves[].number`: Wave execution order (1, 2, 3...)
- `waves[].tasks[].id`: Unique task identifier
- `waves[].tasks[].agent`: Agent type from product-forge (e.g., `python-experts:django-expert`)
- `waves[].tasks[].prompt_file`: Path to task prompt file
- `waves[].validation`: Optional command to validate wave completion

---

## Error Handling

### cpo Not Installed

```
ERROR: cpo command not found

Install with:
  pip install claude-parallel-orchestrator

Or check PATH if already installed:
  which cpo
```

### Invalid Manifest

```
ERROR: manifest.json validation failed

Missing required fields:
  - tech_spec_id
  - waves

Run '/parallel-decompose' to regenerate the manifest.
```

### Execution Failures

The `cpo` tool handles:
1. Agent process failure -> marks task as failed, continues with independent tasks
2. Validation failure -> stops wave, reports error
3. Git conflicts -> aborts with message

Check `$PARALLEL_DIR/logs/` for detailed agent output.
Check `$PARALLEL_DIR/report.json` for execution summary.

---

## Examples

```bash
# Execute parallel tasks (default)
/parallel-run parallel/TS-0042-inventory/

# Validate manifest without executing
/parallel-run parallel/TS-0042-inventory/ --validate

# Check current execution status
/parallel-run parallel/TS-0042-inventory/ --status
```

---

## Related Commands

- `/parallel-setup` - One-time project initialization
- `/parallel-decompose` - Create tasks and prompts (run before this)
- `/parallel-validate-prompts` - Validate prompts have required sections
- `/parallel-integrate` - Verify integration (run after this)

## cpo CLI Reference

For advanced usage, use `cpo` directly:

```bash
# Initialize new parallel directory
cpo init parallel/TS-0042-feature -t TS-0042 -n feature-name

# Validate directory structure
cpo validate parallel/TS-0042-feature

# Run parallel execution
cpo run parallel/TS-0042-feature

# Check execution status
cpo status parallel/TS-0042-feature
```

Related Skills

parallel-ready-django

9
from jpoutrin/product-forge

Audit and prepare a Django codebase for parallel multi-agent development. Use when asked to check if a Django project is ready for parallelization, prepare a repo for multi-agent work, audit codebase structure, set up orchestration infrastructure, or identify blockers for parallel development. Analyzes Django apps, models, migrations, and module boundaries.

parallel-fix-django

9
from jpoutrin/product-forge

Fix Django-specific blockers identified in parallelization readiness assessment

parallel-validate-prompts

9
from jpoutrin/product-forge

Validate and fix parallel prompts for required sections

parallel-task-format

9
from jpoutrin/product-forge

Compact YAML format for defining parallel task specifications with scope, boundaries, and agent assignments. Use when creating task files for parallel development.

parallel-setup

9
from jpoutrin/product-forge

One-time setup of parallel/ directory for multi-agent development

parallel-prompt-generator

9
from jpoutrin/product-forge

Generate agent-ready prompts from existing task specification files. Use when regenerating prompts after editing tasks, updating prompt templates, or preparing tasks for cpo execution.

parallel-integrate

9
from jpoutrin/product-forge

Verify integration after parallel agent execution and generate report

parallel-execution

9
from jpoutrin/product-forge

Execute multiple Claude Code agents in parallel using the cpo CLI tool. Use when running parallel tasks, monitoring execution, or understanding the execution workflow.

parallel-decompose

9
from jpoutrin/product-forge

Decompose PRDs and Tech Specs into parallel-executable tasks with contracts, prompts, and dependency graphs. Use when breaking down a PRD for multi-agent execution.

parallel-agents

9
from jpoutrin/product-forge

Use when parallelizing development, running multiple agents, splitting work across agents, coordinating parallel tasks, or decomposing PRDs for concurrent execution. Breaks work into independent agent workstreams.

zod

9
from jpoutrin/product-forge

Zod schema validation patterns and type inference. Auto-loads when validating schemas, parsing data, validating forms, checking types at runtime, or using z.object/z.string/z.infer in TypeScript.

typescript-import-style

9
from jpoutrin/product-forge

Merge-friendly import formatting (one-per-line, alphabetical). Auto-loads when writing TypeScript/JavaScript imports to minimize merge conflicts in parallel development. Enforces consistent grouping and sorting.