parallel-run
Orchestrate parallel agent execution with git worktrees
What this skill does
# 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 in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.