Skip to main content
ClaudeWave
Slash Command3.9k repo starsupdated today

review

The `/octo:review` command executes enhanced multi-LLM code review across Codex, Gemini, and Claude with inline PR comments and escalation capabilities. Use this command when explicit provider diversity, adversarial cross-checking, or stricter escalation workflows are required for pull request validation beyond Claude's native review capabilities.

Install in Claude Code
Copy
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/nyldn/claude-octopus/HEAD/.claude/commands/review.md -o ~/.claude/commands/review.md
Then start a new Claude Code session; the slash command loads automatically.

review.md

# /octo:review

## MANDATORY COMPLIANCE — DO NOT SKIP

**When the user explicitly invokes `/octo:review`, you MUST execute the enhanced multi-provider review workflow below.** You are PROHIBITED from substituting Claude-native `/review`, direct reading, or a single-model review unless the user changes commands.

## Positioning

Three review entry points coexist in Claude Code v2.1.111+ — pick the right one per context:

| Command | Scope | Providers | When |
|---|---|---|---|
| Claude-native `/review` | Single-turn, current diff | Claude only | Ordinary review, one perspective suffices |
| `/ultrareview` (CC v2.1.111+) | Cloud, parallel multi-agent | Claude parallelism | Pre-merge PR review without leaving CC |
| `/octo:review` (this) | Multi-LLM, inline PR comments | Claude + available providers | Provider diversity, adversarial cross-check, stricter escalation |

Use `/octo:review` when the user explicitly wants enhanced multi-LLM review, multiple model opinions, provider diversity, or stricter escalation workflows. If CC v2.1.111+ and the user just says "review this", prefer `/ultrareview` unless provider diversity is specifically requested.

When the user invokes this command (e.g., `/octo:review <arguments>`):

**MANDATORY: Before displaying the banner or starting the review, use the Bash tool to check provider availability:**

```bash
echo "PROVIDER_CHECK_START"
printf "codex:%s\n" "$(command -v codex >/dev/null 2>&1 && echo available || echo missing)"
printf "gemini:%s\n" "$(command -v gemini >/dev/null 2>&1 && echo available || echo missing)"
printf "agy:%s\n" "$(command -v agy >/dev/null 2>&1 && echo available || echo missing)"
printf "perplexity:%s\n" "$([ -n "${PERPLEXITY_API_KEY:-}" ] && echo available || echo missing)"
printf "opencode:%s\n" "$(command -v opencode >/dev/null 2>&1 && echo available || echo missing)"
printf "copilot:%s\n" "$(command -v copilot >/dev/null 2>&1 && echo available || echo missing)"
printf "qwen:%s\n" "$(command -v qwen >/dev/null 2>&1 && echo available || echo missing)"
printf "ollama:%s\n" "$(command -v ollama >/dev/null 2>&1 && curl -sf http://localhost:11434/api/tags >/dev/null 2>&1 && echo available || echo missing)"
printf "openrouter:%s\n" "$([ -n "${OPENROUTER_API_KEY:-}" ] && echo available || echo missing)"
echo "PROVIDER_CHECK_END"
```

Then render the banner from actual provider checks. Do not hand-write or summarize this banner; run this block and display its output exactly. The output MUST include the Antigravity line even when `agy` is missing.

```bash
status_cli() {
  command -v "$1" >/dev/null 2>&1 && echo "Available ✓" || echo "Not installed ✗"
}

status_env() {
  [[ -n "${1:-}" ]] && echo "Configured ✓" || echo "Not configured ✗"
}

codex_status="$(status_cli codex)"
gemini_status="$(status_cli gemini)"
agy_status="$(status_cli agy)"
opencode_status="$(status_cli opencode)"
copilot_status="$(status_cli copilot)"
qwen_status="$(status_cli qwen)"
if command -v ollama >/dev/null 2>&1 && curl -sf http://localhost:11434/api/tags >/dev/null 2>&1; then
  ollama_status="Available ✓"
else
  ollama_status="Not installed ✗"
fi
perplexity_status="$(status_env "${PERPLEXITY_API_KEY:-}")"

cat <<BANNER
🐙 **CLAUDE OCTOPUS ACTIVATED** — Multi-LLM Code Review

Providers:
🔴 Codex CLI: ${codex_status}
🟡 Gemini CLI: ${gemini_status}
🧭 Antigravity CLI: ${agy_status}
🟤 OpenCode: ${opencode_status}
🟢 Copilot CLI: ${copilot_status}
🟠 Qwen CLI: ${qwen_status}
⚫ Ollama: ${ollama_status}
🔵 Claude: Available ✓ — architecture and synthesis
🟣 Perplexity: ${perplexity_status}
BANNER
```

The rendered banner must look like this shape, with ACTUAL statuses:

```
🐙 **CLAUDE OCTOPUS ACTIVATED** — Multi-LLM Code Review

Providers:
🔴 Codex CLI: [Available ✓ / Not installed ✗]
🟡 Gemini CLI: [Available ✓ / Not installed ✗]
🧭 Antigravity CLI: [Available ✓ / Not installed ✗]
🟤 OpenCode: [Available ✓ / Not installed ✗]
🟢 Copilot CLI: [Available ✓ / Not installed ✗]
🟠 Qwen CLI: [Available ✓ / Not installed ✗]
⚫ Ollama: [Available ✓ / Not installed ✗]
🔵 Claude: Available ✓ — architecture and synthesis
🟣 Perplexity: [Configured ✓ / Not configured ✗]
```

**PROHIBITED: Displaying only "🔵 Claude: Available ✓" without checking and listing other providers.**

### EXECUTION MECHANISM — NON-NEGOTIABLE

**You MUST execute this command by calling `orchestrate.sh` as documented below. You are PROHIBITED from:**
- ❌ Doing the work yourself using only Claude-native tools (Agent, Read, Grep, Write)
- ❌ Using a single Claude subagent instead of multi-provider dispatch via orchestrate.sh
- ❌ Skipping orchestrate.sh because "I can do this faster directly"

**Multi-LLM orchestration is the purpose of this command.** If you execute using only Claude, you've violated the command's contract.

---

## Step 1: Ask Clarifying Questions / Context Acquisition

**Determine mode based on session autonomy:**

If `AUTONOMY_MODE` env var is `autonomous`, or session is running headlessly, or `OCTOPUS_WORKFLOW_PHASE` is set (indicating a pipeline context like `/octo:develop` or `/octo:embrace`), skip Q&A and auto-infer with ALL focus areas:
1. Run `git diff --cached` — if non-empty, `target=staged`
2. Run `gh pr view --json number` — if open PR exists, set `target=<pr_number>`
3. Otherwise `target=working-tree`
4. Set `provenance=unknown`, `autonomy=autonomous`, `publish=ask`, `debate=auto`, `history=auto`, `focus=["correctness","security","architecture","tdd"]`

**Otherwise (supervised mode), you MUST use AskUserQuestion to ask these questions:**

```javascript
AskUserQuestion({
  questions: [
    {
      question: "What should be reviewed?",
      header: "Target",
      multiSelect: false,
      options: [
        {label: "Staged changes", description: "git diff --cached — what you're about to commit"},
        {label: "Open PR", description: "Review the current branch's open pull request"},
        {label: "Working tree", description: "All uncommitted changes"},
        {label: "