Merge pull request #1551 from luanngosodadigital/feat/add-opencode-reviewer

feat: add OpenCode as a peer reviewer in /gsd:review
This commit is contained in:
Tom Boucher
2026-04-02 20:08:20 -04:00
committed by GitHub
2 changed files with 21 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
--- ---
name: gsd:review name: gsd:review
description: Request cross-AI peer review of phase plans from external AI CLIs description: Request cross-AI peer review of phase plans from external AI CLIs
argument-hint: "--phase N [--gemini] [--claude] [--codex] [--all]" argument-hint: "--phase N [--gemini] [--claude] [--codex] [--opencode] [--all]"
allowed-tools: allowed-tools:
- Read - Read
- Write - Write
@@ -11,7 +11,7 @@ allowed-tools:
--- ---
<objective> <objective>
Invoke external AI CLIs (Gemini, Claude, Codex) to independently review phase plans. Invoke external AI CLIs (Gemini, Claude, Codex, OpenCode) to independently review phase plans.
Produces a structured REVIEWS.md with per-reviewer feedback that can be fed back into Produces a structured REVIEWS.md with per-reviewer feedback that can be fed back into
planning via /gsd:plan-phase --reviews. planning via /gsd:plan-phase --reviews.
@@ -29,6 +29,7 @@ Phase number: extracted from $ARGUMENTS (required)
- `--gemini` — Include Gemini CLI review - `--gemini` — Include Gemini CLI review
- `--claude` — Include Claude CLI review (uses separate session) - `--claude` — Include Claude CLI review (uses separate session)
- `--codex` — Include Codex CLI review - `--codex` — Include Codex CLI review
- `--opencode` — Include OpenCode review (uses model from user's OpenCode config)
- `--all` — Include all available CLIs - `--all` — Include all available CLIs
</context> </context>

View File

@@ -19,6 +19,7 @@ command -v gemini >/dev/null 2>&1 && echo "gemini:available" || echo "gemini:mis
command -v claude >/dev/null 2>&1 && echo "claude:available" || echo "claude:missing" command -v claude >/dev/null 2>&1 && echo "claude:available" || echo "claude:missing"
command -v codex >/dev/null 2>&1 && echo "codex:available" || echo "codex:missing" command -v codex >/dev/null 2>&1 && echo "codex:available" || echo "codex:missing"
command -v coderabbit >/dev/null 2>&1 && echo "coderabbit:available" || echo "coderabbit:missing" command -v coderabbit >/dev/null 2>&1 && echo "coderabbit:available" || echo "coderabbit:missing"
command -v opencode >/dev/null 2>&1 && echo "opencode:available" || echo "opencode:missing"
``` ```
Parse flags from `$ARGUMENTS`: Parse flags from `$ARGUMENTS`:
@@ -26,6 +27,7 @@ Parse flags from `$ARGUMENTS`:
- `--claude` → include Claude - `--claude` → include Claude
- `--codex` → include Codex - `--codex` → include Codex
- `--coderabbit` → include CodeRabbit - `--coderabbit` → include CodeRabbit
- `--opencode` → include OpenCode
- `--all` → include all available - `--all` → include all available
- No flags → include all available - No flags → include all available
@@ -35,6 +37,7 @@ No external AI CLIs found. Install at least one:
- gemini: https://github.com/google-gemini/gemini-cli - gemini: https://github.com/google-gemini/gemini-cli
- codex: https://github.com/openai/codex - codex: https://github.com/openai/codex
- claude: https://github.com/anthropics/claude-code - claude: https://github.com/anthropics/claude-code
- opencode: https://opencode.ai (leverages GitHub Copilot subscription models)
Then run /gsd:review again. Then run /gsd:review again.
``` ```
@@ -141,6 +144,14 @@ Note: CodeRabbit reviews the current git diff/working tree — it does not accep
coderabbit review --prompt-only 2>/dev/null > /tmp/gsd-review-coderabbit-{phase}.md coderabbit review --prompt-only 2>/dev/null > /tmp/gsd-review-coderabbit-{phase}.md
``` ```
**OpenCode (via GitHub Copilot):**
```bash
cat /tmp/gsd-review-prompt-{phase}.md | opencode run - 2>/dev/null > /tmp/gsd-review-opencode-{phase}.md
if [ ! -s /tmp/gsd-review-opencode-{phase}.md ]; then
echo "OpenCode review failed or returned empty output." > /tmp/gsd-review-opencode-{phase}.md
fi
```
If a CLI fails, log the error and continue with remaining CLIs. If a CLI fails, log the error and continue with remaining CLIs.
Display progress: Display progress:
@@ -160,7 +171,7 @@ Combine all review responses into `{phase_dir}/{padded_phase}-REVIEWS.md`:
```markdown ```markdown
--- ---
phase: {N} phase: {N}
reviewers: [gemini, claude, codex, coderabbit] reviewers: [gemini, claude, codex, coderabbit, opencode]
reviewed_at: {ISO timestamp} reviewed_at: {ISO timestamp}
plans_reviewed: [{list of PLAN.md files}] plans_reviewed: [{list of PLAN.md files}]
--- ---
@@ -191,6 +202,12 @@ plans_reviewed: [{list of PLAN.md files}]
--- ---
## OpenCode Review
{opencode review content}
---
## Consensus Summary ## Consensus Summary
{synthesize common concerns across all reviewers} {synthesize common concerns across all reviewers}