Skip to content
Development
Skill

/dispatch

Shared multi-model CLI dispatch infrastructure for the adv plugin. Houses dispatch.sh, preflight.sh, run-phase.sh, scope.sh, and reviewer prompt templates used by the adv-review agent and adv-* commands.

From plugin
swe-marketplace
2114 skills54 agents5 commands

Claude Code

$ npx -y skills add andisab/swe-marketplace --skill dispatch --agent claude-code

SKILL.md

dispatch.SKILL.md
name: dispatch
description: Shared multi-model CLI dispatch infrastructure for the adv plugin. Houses dispatch.sh, preflight.sh, run-phase.sh, scope.sh, and reviewer prompt templates used by the adv-review agent and adv-* commands.
user-invocable: false

Dispatch Infrastructure

This skill provides shared infrastructure for multi-model CLI dispatch. It is NOT user-invocable — it exists as reference material for the `adv-review` orchestrator agent and the `adv-*` commands.

Available Engines

| Engine | CLI | Non-Interactive Flags | Sandbox Flag | |---|---|---|---| | codex | `codex exec` | `--skip-git-repo-check -C <cwd> --json` (`--full-auto` was removed in Codex CLI 0.163) | `-s read-only` | | codex (`--codex-review`) | `codex review` | `-c model="..."` when a model is set; run from `<cwd>` (no `-C`, `-m` or `--json` in 0.163); the prompt names the git scope, because the scope flags can't be combined with a prompt | `-c sandbox_mode="read-only"` | | gemini | `gemini` | `-p <prompt> --skip-trust -o json` (`--skip-trust` is required for headless runs since Gemini CLI 0.65) | `--approval-mode plan` (read-only; `--sandbox` broke API calls on macOS in 0.65) | | claude | `claude` | `--print --output-format json` | N/A (always sandboxed) |

No model flag is passed unless the caller sets one. Each CLI then uses its own current default. Every engine is asked for JSON, which is where the text, the model that answered and the token counts live: Codex `exec --json` prints JSONL events (`item.completed` with `agent_message` text or `error` warnings, `turn.completed` with usage; no event names the model, so the status line reports the `--model` argument or the pin in `~/.codex/config.toml`), Gemini `-o json` prints one object (`response`, `stats.models` keyed by the model that answered, `warnings`, `error`), and `claude --output-format json` prints one object (`result`, `is_error`, `usage`, `modelUsage`). `codex review` prints a text report, which `codex-review-adapter.py` turns into adv's finding format. Tested with Codex CLI 0.163.0 and Gemini CLI 0.65.0 (October 2026).

Scripts

preflight.sh

**Path**: `${CLAUDE_PLUGIN_ROOT}/skills/dispatch/scripts/preflight.sh`

Combined pre-flight check: dependency verification, engine health checks, and scope resolution in a single call.

# Smart default (uncommitted changes > last commit > full repo)
bash preflight.sh

# Explicit scope modes
bash preflight.sh --commits abc123..def456
bash preflight.sh --since HEAD~5
bash preflight.sh --full
bash preflight.sh --pr 42

**Arguments**:

  • `--commits <range>` — Review a specific commit range.
  • `--since <ref>` — Review changes since a commit/ref.
  • `--full` — Full repo file manifest.
  • `--pr <number|url>` — Review a GitHub pull request's diff, read with `gh pr diff`; nothing is checked out. Needs the `gh` CLI.
  • _(no flags)_ — Smart default: uncommitted changes > last commit > full repo.

**Output**: Single JSON object to stdout:

{
  "deps": {"codex": true, "gemini": true, "claude": true, "jq": true},
  "engines": {
    "codex": {"available": true, "error_type": "none"},
    "gemini": {"available": true, "error_type": "none", "model": ""}
  },
  "scope": {
    "type": "working",
    "files_changed": 5,
    "diff_lines": 120,
    "untracked_files": 2,
    "codex_review": "Review the uncommitted changes in this repository. Run `git diff HEAD` ...",
    "pr": null,
    "content_file": ".claude/reviews/.tmp/scope-content.txt"
  }
}

**Scope types**: `working` (uncommitted changes), `commits` (commit range/since), `full` (file manifest), `pr` (a pull request's diff; `scope.pr` carries `number`, `baseRefName`, `headRefName`, `headRefOid` and `url`).

`scope.codex_review` is the sentence that names a local diff scope for Codex's review mode (see run-phase `--codex-review`). It's empty for `full` and `pr`, where Codex can't read the scope from the repository on disk.

Internally calls `dispatch.sh --health-check` for engine verification, including automatic Gemini flash fallback on quota errors.

run-phase.sh

**Path**: `${CLAUDE_PLUGIN_ROOT}/skills/dispatch/scripts/run-phase.sh`

Parallel dispatch orchestrator for review and cross-examination phases. Handles dispatch, validation, and fallback in a single call.

# Review phase — dispatch 4 reviewers in parallel
bash run-phase.sh --phase review \
  --assignments "quality:codex,implementation:gemini,testing:codex,documentation:gemini" \
  --prompt-dir "$TMP" --output-dir "$TMP" --timeout 300

# Cross-exam phase — dispatch 2 engines in parallel
bash run-phase.sh --phase cross-exam --round 1 \
  --assignments "codex,gemini" \
  --prompt-dir "$TMP" --output-dir "$TMP" --timeout 300

**Arguments**:

  • `--phase <review|cross-exam>` — Required. Phase type.
  • `--assignments <spec>` — Required. Engine assignments.
  • Review: `"quality:codex,implementation:gemini,testing:codex,documentation:gemini"`
  • Cross-exam: `"codex,gemini"` (just engine names)
  • `--prompt-dir <path>` — Directory containing prepared prompt files.
  • `--output-dir <path>` — Directory for output files.
  • `--timeout <seconds>` — Timeout per dispatch (default: 300).
  • `--round <N>` — Cross-exam round number (required for cross-exam phase).
  • `--gemini-model <model>` — Override the Gemini model. By default no model is passed and the CLI uses its own current default.
  • `--codex-review <scope>` — Review phase only. Runs the Codex reviewers through `codex review` instead of `codex exec`. `<scope>` is preflight's `scope.codex_review` sentence; run-phase writes `prompt-<reviewer>.codex-review.md` from the reviewer template with that sentence in place of the diff, and Codex reads the changes from the repository itself. A Codex reviewer that falls back to Claude uses `prompt-<reviewer>.md` (the diff) instead.

**File naming conventions**:

  • Review prompts: `prompt-<reviewer>.md` (e.g., `prompt-quality.md`); Codex review mode adds `prompt-<reviewer>.codex-review.md`

-

Read more
@andisab
Ships withswe-marketplace

A collection of Claude Code plugins for everyday software engineering and knowledge work.

2114 skills54 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
21
Star history of andisab/swe-marketplace on GitHub, a chart by star-history.com

Other skills on swe-marketplace.

agent-dev

agent-dev

Use this skill when creating or refining Claude Code sub-agent definitions. Helps design specialized AI assistants with proper…

command-dev

command-dev

Use this skill when creating or refining custom Claude Code slash commands. Slash commands are user-invoked reusable prompts that…

hook-dev

hook-dev

Use this skill when creating or refining Claude Code hooks. Hooks are shell commands that execute at specific lifecycle events…

mcp-server-dev

mcp-server-dev

Create MCP servers — multi-tool services exposed via Model Context Protocol. Use this skill whenever users mention MCP servers,…

mcp-tool-dev

mcp-tool-dev

Create MCP tools — individual tool functions exposed via Model Context Protocol. Use this skill whenever users mention MCP tools,…

plugin-dev

plugin-dev

Use this skill when creating or refining Claude Code plugins. Plugins are bundled collections of agents, skills, commands, hooks,…

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills11d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc12d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react1d252k
@facebook@facebookInstall Skill

Questions about dispatch.

Which coding agents can use dispatch?
dispatch installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.