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

staged-review

The staged-review command orchestrates a two-stage code review pipeline that first validates code against its specification, then proceeds to quality assessment only if compliance passes. Use this command when you need structured, multi-LLM review of staged changes, recent commits, working tree modifications, or specific file paths, with dispatch to external providers like Codex and Gemini for specialized logic, security, and architectural analysis before synthesis into a unified verdict.

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

staged-review.md

# Staged Review — Two-Stage Pipeline

## 🤖 INSTRUCTIONS FOR CLAUDE

### MANDATORY COMPLIANCE — DO NOT SKIP

**When the user explicitly invokes `/octo:staged-review`, you MUST execute the structured workflow below.** You are PROHIBITED from doing the task directly, skipping the review phases, or deciding the task is "too simple" for this workflow. The user chose this command deliberately — respect that choice.

### EXECUTION MECHANISM — NON-NEGOTIABLE

**You MUST dispatch work to external providers (Codex, Gemini, Antigravity, etc.) for this command. You are PROHIBITED from:**
- ❌ Executing the entire task using only Claude-native tools
- ❌ Using a single Agent subagent instead of multi-provider dispatch
- ❌ Skipping provider dispatch because "I can handle this alone"

**Multi-LLM orchestration is the purpose of this command.** Single-model execution defeats its purpose.

---

🐙 **CLAUDE OCTOPUS ACTIVATED** — Two-Stage Review Pipeline

---

When the user invokes this command (e.g., `/octo:staged-review` or `/octo:staged-review src/auth/`):

## Step 0: Detect governed-workflow mode (skip interactive prompts)

**Before Step 1, check for governed mode.** If a `.todo/claude-octopus/` directory exists in the working tree (set up by the Cruisey `octo` pipeline), this review is running INSIDE the autonomous governed workflow — the human gate is CP3, not here. In that case:

- **Skip the Step 1 "Review Scope" prompt** — the scope is always the full working tree (nothing is committed before CP3). Proceed directly with `git diff` of the working tree.
- **Skip the "Post-Completion — Interactive Next Steps" prompt** — proceed straight to the next phase (CP2 council, or the gatekeeper) without asking.

```bash
test -d .todo/claude-octopus && echo "GOVERNED_MODE" || echo "STANDALONE_MODE"
```

If `STANDALONE_MODE`, run the interactive prompts below as normal. If `GOVERNED_MODE`, do NOT call `AskUserQuestion` at any point in this command.

## Step 1: Determine Review Scope

**(GOVERNED_MODE: skip this prompt — scope = working tree.)** Standalone only:

```javascript
AskUserQuestion({
  questions: [
    {
      question: "What should be reviewed?",
      header: "Review Scope",
      multiSelect: false,
      options: [
        {label: "Staged changes", description: "git diff --cached — what you're about to commit"},
        {label: "Recent commit", description: "Changes in the last commit (HEAD~1..HEAD)"},
        {label: "Working tree", description: "All uncommitted changes"},
        {label: "Specific path", description: "A file or directory (provide path as argument)"}
      ]
    }
  ]
})
```

If invoked with arguments (e.g., `/octo:staged-review src/auth/`), use that path directly and skip the question.

## Step 2: Execute Staged Review

Read and follow the full skill instructions from:
`${HOME}/.claude-octopus/plugin/.claude/skills/skill-staged-review/SKILL.md`

The skill runs two stages:
1. **Stage 1** (Spec Compliance) — Validate against intent contract
2. **Gate check** — Stage 1 must pass before Stage 2
3. **Stage 2** (Code Quality) — Stub detection + multi-LLM quality review (Codex for logic, Gemini for security, Claude for architecture — synthesized into unified findings)
4. **Combined report** — Unified verdict

### Post-Completion — Interactive Next Steps

**GOVERNED_MODE: do NOT ask — proceed straight to the next phase (CP2 council, then gatekeeper) per the governed pipeline. The next-steps prompt below is STANDALONE-only.**

**CRITICAL (standalone only): After the skill completes, you MUST ask the user what to do next.**

```javascript
AskUserQuestion({
  questions: [
    {
      question: "Review complete. What would you like to do?",
      header: "Next Steps",
      multiSelect: false,
      options: [
        {label: "Fix blocking issues", description: "Address the issues flagged in the review"},
        {label: "Run /octo:review", description: "Follow up with full multi-LLM review"},
        {label: "Post to PR", description: "Post the review findings to the open PR"},
        {label: "Done", description: "No further action needed"}
      ]
    }
  ]
})
```

## Related Commands

- `/octo:review` — Expert multi-LLM code review with inline PR comments
- `/octo:deliver` — Full delivery phase with validation and testing
- `/octo:develop` — Development phase with quality gates

## Validation Gates

- Review scope determined (from arguments or user input)
- Skill loaded and executed (not simulated)
- Combined report presented to user
- Next steps offered

### Prohibited Actions

- Simulating the review without running the skill
- Skipping Stage 1 when an intent contract exists
- Ending without presenting next steps **(standalone mode only — in GOVERNED_MODE the next-steps prompt is intentionally skipped; proceed to the next pipeline phase instead)**