# Dispatch Parallel

> Fan out N independent tasks to parallel subagents, collect their results, optionally synthesize. Use when another skill needs work that decomposes into independent pieces — review passes with different lenses, multi-file searches, multi-source data gathering. Composed by skills like blunder-hunt, pr-review, polish, journal.

- **Type:** Skill
- **Install:** `agentstack add skill-momentmaker-kaijutsu-dispatch-parallel`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [momentmaker](https://agentstack.voostack.com/s/momentmaker)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [momentmaker](https://github.com/momentmaker)
- **Source:** https://github.com/momentmaker/kaijutsu/tree/main/skills/core/dispatch-parallel
- **Website:** https://kaijutsu.dev/

## Install

```sh
agentstack add skill-momentmaker-kaijutsu-dispatch-parallel
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# dispatch-parallel

Sequential subtask execution wastes wall-clock time when subtasks are independent. This primitive captures the pattern of "decompose, dispatch, collect, synthesize" so other skills don't have to restate it.

## When to invoke

- A parent skill needs to run K independent passes / lenses / searches
- The subtasks are read-only or write to disjoint state
- Per-subtask cost dominates over coordination cost
- The outputs can be merged or deduplicated post-hoc

Do **not** invoke when:
- Subtasks share mutable state
- Order matters (use sequential composition instead)
- The work is small enough that one agent finishes faster than spawning N

## The pattern

### 1. Decompose

Split the parent task into K self-contained subtasks. Each subtask must:
- Have a clear input (what to look at)
- Have a clear lens (what to look for)
- Produce a structured output (list of findings, list of facts, etc.)
- Be runnable without seeing the other subtasks' outputs

If you can't write a one-paragraph brief for a subtask, it's not decomposed enough.

### 2. Dispatch (per agent platform)

| Agent | Subagent primitive |
| --- | --- |
| Claude Code | `Task` tool with `subagent_type: general-purpose` (or specialized) — multiple Task calls in a single response run in parallel |
| OpenAI Codex CLI | `codex agents spawn` (where supported) or sequential with explicit context resets |
| Google Antigravity CLI | `activate_skill` + delegated subtasks where supported; otherwise sequential |

When the platform supports parallel calls in a single turn, use them. Otherwise, fall back to sequential — still apply the decompose/collect pattern, just lose the wall-clock win.

### 3. Collect

Each subagent returns a structured output. Aggregate into a single list. Tag every item with which subagent produced it (`subagent_id`, `lens`, etc.) so dedup and synthesis can preserve provenance.

### 4. Synthesize

Pick the synthesis pattern based on what the parent skill needs:

- **Merge** — take the union of all outputs. Use when each subagent searches disjoint territory.
- **Dedupe** — group equivalent items, keep the highest-confidence variant. Use for findings where the same issue might be spotted by multiple lenses.
- **Vote** — items present in N+ subagent outputs are high-confidence. Use for adversarial review where agreement = signal.
- **Pick best** — when each subagent produced a competing answer (e.g., draft prose), score them and pick. Often paired with `multi-model-synth`.

## Output shape

```
## dispatch-parallel: 

| Subagent | Lens / Subtask | Items | Wall time |
|---|---|---|---|
| 1 | data correctness | 4 | 8s |
| 2 | error handling | 3 | 11s |
| 3 | integration | 5 | 9s |

Synthesized ():
- ...
```

## JSON sidecar

When invoked under a `--json` flag (or when the parent skill requests structured output), emit alongside the markdown:

```json
{
  "skill": "dispatch-parallel",
  "version": "0.1.0",
  "task": "",
  "synthesis": "dedupe",
  "subagents": [
    {"id": 1, "lens": "data correctness", "items": [...], "wall_ms": 8000},
    ...
  ],
  "synthesized": [...]
}
```

## Hard rules

- **Never share mutable state** between subagents. Each receives its own context, its own files-to-read, its own scratch space. Mutating shared files concurrently produces undefined results and is forbidden.
- **Read-only of in-flux data is also racy.** If subagent A reads `file.go` while subagent B is writing it (e.g., parallel review of a workspace where some other process is editing), A may see an inconsistent snapshot. Either freeze the inputs (snapshot the directory) before dispatching, or restrict subagents to immutable inputs (specific git refs, frozen text passed via prompt).
- **Always tag the source.** Every item in the synthesized output carries a `subagent_id` (and `lens` if the subagents had different lenses). Provenance enables debugging when synthesis goes wrong.
- **Time-bound subagents.** A subagent that hangs blocks the whole synthesis. Set an explicit timeout (suggested default 5 min). On timeout, flag and continue with the others.
- **Dispatch is non-recursive by default.** A subagent should not spawn more parallel subagents unless the parent skill explicitly authorizes depth > 1.
- **Idempotent subtasks only.** If a subtask retries, its repeated execution must not change disk state or external systems.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [momentmaker](https://github.com/momentmaker)
- **Source:** [momentmaker/kaijutsu](https://github.com/momentmaker/kaijutsu)
- **License:** MIT
- **Homepage:** https://kaijutsu.dev/

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-momentmaker-kaijutsu-dispatch-parallel
- Seller: https://agentstack.voostack.com/s/momentmaker
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
