pi-orchestration

Orchestrate multiple AI models (GLM, MiniMax, etc.) as workers using Pi Coding Agent with Claude as coordinator.

7 stars

Best use case

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

Orchestrate multiple AI models (GLM, MiniMax, etc.) as workers using Pi Coding Agent with Claude as coordinator.

Teams using pi-orchestration 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/pi-orchestration/SKILL.md --create-dirs "https://raw.githubusercontent.com/Demerzels-lab/elsamultiskillagent/main/public/skills/dbhurley/pi-orchestration/SKILL.md"

Manual Installation

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

How pi-orchestration Compares

Feature / Agentpi-orchestrationStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Orchestrate multiple AI models (GLM, MiniMax, etc.) as workers using Pi Coding Agent with Claude as coordinator.

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

# Pi Orchestration

Use Claude as an orchestrator to spawn and coordinate multiple AI model workers (GLM, MiniMax, etc.) via Pi Coding Agent.

## Supported Providers

| Provider | Model | Status |
|----------|-------|--------|
| **GLM** | glm-4.7 | ✅ Working |
| **MiniMax** | MiniMax-M2.1 | ✅ Working |
| OpenAI | gpt-4o, etc. | ✅ Working |
| Anthropic | claude-* | ✅ Working |

## Setup

### 1. GLM (Zhipu AI)

Get API key from [open.bigmodel.cn](https://open.bigmodel.cn/)

```bash
export GLM_API_KEY="your-glm-api-key"
```

### 2. MiniMax

Get API key from [api.minimax.chat](https://api.minimax.chat/)

```bash
export MINIMAX_API_KEY="your-minimax-api-key"
export MINIMAX_GROUP_ID="your-group-id"  # Required for MiniMax
```

## Usage

### Direct Commands

```bash
# GLM-4.7
pi --provider glm --model glm-4.7 -p "Your task"

# MiniMax M2.1
pi --provider minimax --model MiniMax-M2.1 -p "Your task"

# Test connectivity
pi --provider glm --model glm-4.7 -p "Say hello"
```

### Orchestration Patterns

Claude (Opus) can spawn these as background workers:

#### Background Worker
```bash
bash workdir:/tmp/task background:true command:"pi --provider glm --model glm-4.7 -p 'Build feature X'"
```

#### Parallel Army (tmux)
```bash
# Create worker sessions
tmux new-session -d -s worker-1
tmux new-session -d -s worker-2

# Dispatch tasks
tmux send-keys -t worker-1 "pi --provider glm --model glm-4.7 -p 'Task 1'" Enter
tmux send-keys -t worker-2 "pi --provider minimax --model MiniMax-M2.1 -p 'Task 2'" Enter

# Check progress
tmux capture-pane -t worker-1 -p
tmux capture-pane -t worker-2 -p
```

#### Map-Reduce Pattern
```bash
# Map: Distribute subtasks to workers
for i in 1 2 3; do
  tmux send-keys -t worker-$i "pi --provider glm --model glm-4.7 -p 'Process chunk $i'" Enter
done

# Reduce: Collect and combine results
for i in 1 2 3; do
  tmux capture-pane -t worker-$i -p >> /tmp/results.txt
done
```

## Orchestration Script

```bash
# Quick orchestration helper
uv run {baseDir}/scripts/orchestrate.py spawn --provider glm --model glm-4.7 --task "Build a REST API"
uv run {baseDir}/scripts/orchestrate.py status
uv run {baseDir}/scripts/orchestrate.py collect
```

## Best Practices

1. **Task Decomposition**: Break large tasks into independent subtasks
2. **Model Selection**: Use GLM for Chinese content, MiniMax for creative tasks
3. **Error Handling**: Check worker status before collecting results
4. **Resource Management**: Clean up tmux sessions after completion

## Example: Parallel Code Review

```bash
# Claude orchestrates 3 workers to review different files
tmux send-keys -t worker-1 "pi --provider glm -p 'Review auth.py for security issues'" Enter
tmux send-keys -t worker-2 "pi --provider minimax -p 'Review api.py for performance'" Enter  
tmux send-keys -t worker-3 "pi --provider glm -p 'Review db.py for SQL injection'" Enter

# Wait and collect
sleep 30
for i in 1 2 3; do
  echo "=== Worker $i ===" >> review.md
  tmux capture-pane -t worker-$i -p >> review.md
done
```

## Notes

- Pi Coding Agent must be installed: `npm install -g @anthropic/pi-coding-agent`
- GLM and MiniMax have generous free tiers
- Claude acts as coordinator, workers do the heavy lifting
- Combine with process tool for background task management

Related Skills

multi-agent-orchestration

7
from Demerzels-lab/elsamultiskillagent

Multi-agent task delegation and process orchestration with audit logging and agent learning capabilities.

agent-orchestration

7
from Demerzels-lab/elsamultiskillagent

Master the art of spawning and managing sub-agents. Write prompts that actually work, track running agents, and learn from every outcome. Part of the Hal Stack 🦞

agent-team-orchestration

7
from Demerzels-lab/elsamultiskillagent

Orchestrate multi-agent teams with defined roles, task lifecycles, handoff protocols, and review workflows.

paylock

7
from Demerzels-lab/elsamultiskillagent

Non-custodial SOL escrow for AI agent deals.

agent-reputation

7
from Demerzels-lab/elsamultiskillagent

summary: Cross-platform AI agent reputation checker with trust scoring and PayLock escrow recommendations.

Telecom Agent Skill

7
from Demerzels-lab/elsamultiskillagent

Turn your AI Agent into a Telecom Operator. Bulk calling, ChatOps, and Field Monitoring.

OpenClaw-Finnhub

7
from Demerzels-lab/elsamultiskillagent

OpenClaw skill for real-time stock quote, and financials via Finnhub API.

```markdown

7
from Demerzels-lab/elsamultiskillagent

# OpenClaw-Last.fm

security-operator

7
from Demerzels-lab/elsamultiskillagent

Runtime security guardrails for OpenClaw agents.

operator-humanizer

7
from Demerzels-lab/elsamultiskillagent

Transform AI-generated text into authentic human writing.

kit-email-operator

7
from Demerzels-lab/elsamultiskillagent

**AI-powered email marketing for Kit (ConvertKit)**.

agora

7
from Demerzels-lab/elsamultiskillagent

Trade prediction markets on Agora — the prediction market exclusively for AI agents. Register, browse markets, trade YES/NO, create markets, earn reputation via Brier scores.