From pako-public-plugin
Multi-phase code review using external AI models (Codex CLI, Gemini CLI, and Pi CLI) with parallel review agents. Use when user wants external model verification, multi-agent code analysis, or autonomous review with fixes. Triggers on requests like "external code review", "multi-agent review", "review with external models", "review with gemini", "review with pi", or "comprehensive code analysis".
How this skill is triggered — by the user, by Claude, or both
Slash command
/pako-public-plugin:external-code-reviewThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Multi-phase code review system using external AI models (Codex, Gemini, and Pi) with parallel specialized agents.
Multi-phase code review system using external AI models (Codex, Gemini, and Pi) with parallel specialized agents.
External tools run in read-only/sandbox mode.
Required CLI tools (at least one external tool recommended):
codex - Codex CLI (OpenAI) - optionalgemini - Gemini CLI (Google) - optional, fallback when codex unavailablepi - Pi CLI (multimodel) - optional, fallback when codex and gemini unavailableConfiguration is resolved with project > user > built-in precedence. This applies to both config.json and agents/*.txt:
| Priority | Location | Scope |
|---|---|---|
| 1 (highest) | ./.claude/external-code-review/ | Project-local |
| 2 | ~/.claude/external-code-review/ | User-global |
| 3 (lowest) | Built-in (skill directory) | Default |
The first level that contains the resource wins — no merging between levels.
Place .txt files in agents/ at either config level to override the built-in review agents. Each .txt file defines one agent — the filename (without extension) becomes the agent name, and the file content is the agent's review prompt.
Resolution order:
./.claude/external-code-review/agents/*.txt — project-local overrides~/.claude/external-code-review/agents/*.txt — user-global overridesagents/ directoryIf at least one .txt file exists at a higher-priority level, all lower-level agents are ignored.
Optional config.json at either config level (project takes precedence over user):
{
"codex_model": "gpt-5.2-codex",
"gemini_model": "",
"pi_model": "",
"pi_thinking": "high",
"external_tool": "auto"
}
| Field | Effect |
|---|---|
codex_model | Pass -c 'model="<value>"' to codex exec |
gemini_model | Pass -m <value> to gemini CLI |
pi_model | Pass --model <value> to pi CLI (supports provider/model format) |
pi_thinking | Pass --thinking <value> to pi CLI (default: high). Values: off, minimal, low, medium, high, xhigh |
pi_options | Additional CLI options as a list of strings, e.g. ["--provider", "openai"]. Safety-related flags are rejected. |
external_tool | Which external tool to use: auto (default), codex, gemini, or pi |
External tool resolution (auto mode):
gemini, pi), use itIf a field is absent or the config file doesn't exist, omit the model flag entirely for that CLI.
IMPORTANT: Always default to Full Review Mode unless the user explicitly says "quick review", "quick", or "fast review". Phrases like "review my code", "run a review", "external code review", or just invoking this skill without qualifiers all mean Full Review. When in doubt, run the full review.
Only if the user explicitly requests a "quick review" or "fast review", skip Phase 1 and Phase 2:
Run all 3 phases as described below.
Launch specialized agents simultaneously using the Agent tool. Agent set is resolved at runtime:
./.claude/external-code-review/agents/*.txt): Highest priority. If at least one .txt file exists, use only those agents.~/.claude/external-code-review/agents/*.txt): Used if no project overrides exist. File name = agent name.| Agent | Focus Area | Prompt File |
|---|---|---|
| quality | Bugs, security, race conditions, error handling | agents/quality.txt |
| implementation | Goal achievement, requirement coverage, integration | agents/implementation.txt |
| testing | Test coverage, quality, edge cases, fake tests | agents/testing.txt |
| simplification | Over-engineering, excessive abstraction, unused code | agents/simplification.txt |
| documentation | README, CLAUDE.md, breaking changes | agents/documentation.txt |
Before running the review, verify you're on a feature branch with committed changes:
git branch --show-current
git status
git log main..HEAD --oneline
If on main/master branch:
git checkout -b review/code-review-$(date +%Y%m%d)If there are uncommitted changes:
git add -A && git commit -m "wip: changes for review"If no commits ahead of base branch:
git log main..HEAD --oneline
git diff main...HEAD
Save the diff output — you'll pass it to the review agents.
Agent resolution — project > user > built-in:
./.claude/external-code-review/agents/ contains any .txt files (use Glob)~/.claude/external-code-review/agents/ for .txt files.txt files, use the built-in agents/*.txt.txt file wins — all lower levels are ignoredThe file name (without .txt) becomes the agent name.
Launch ALL resolved agents in parallel using the Agent tool. Each agent receives the git diff and its specialized prompt.
project_dir = ./.claude/external-code-review/agents/
user_dir = ~/.claude/external-code-review/agents/
builtin_dir = agents/ (relative to skill)
project_agents = Glob(project_dir/*.txt)
user_agents = Glob(user_dir/*.txt)
if project_agents is not empty:
agent_dir = project_dir
agents = [filename without .txt for each file in project_agents]
elif user_agents is not empty:
agent_dir = user_dir
agents = [filename without .txt for each file in user_agents]
else:
agent_dir = builtin_dir
agents = [quality, implementation, testing, simplification, documentation]
For each agent in agents:
Read <agent_dir>/<agent>.txt
Agent(prompt = agent_prompt + "\n\nCode changes to review:\n" + git_diff)
After all agents complete, collect their findings. For each finding:
git commit -m "fix: address code review findings"Loop: Re-run Phase 1 agents to verify fixes didn't introduce new issues. Continue until zero confirmed issues found in an iteration.
IMPORTANT: Pre-existing issues (linter errors, failed tests) should also be fixed.
Run the external review script via Bash:
python scripts/run_review.py --branch main
Options:
# Force specific tool
python scripts/run_review.py --branch main --external-tool gemini
python scripts/run_review.py --branch main --external-tool pi
# With previous context (dismissed findings)
python scripts/run_review.py --branch main --previous-context "..."
The script runs the external tool in read-only mode and prints findings to stdout.
Read the script output. For EACH finding:
Categorize as:
--previous-contextWhen you disagree with a non-trivial finding, engage in a structured debate instead of dismissing it:
Build the discussion context — a structured exchange of the finding and your counter-argument:
## Finding: <summary>
**External reviewer:** <original finding with location and reasoning>
**Claude (round 1):** <your counter-argument — reference specific code, explain why it's safe/correct>
Run the script in discussion mode:
python scripts/run_review.py --branch main --discuss --discussion-context "<exchange>"
Parse the external reviewer's response. For each disputed finding they will respond with:
If the external reviewer maintains with new evidence you find compelling → fix the issue. If you still disagree → append your new counter-argument to the discussion context and run step 2 again.
Continue until all disputes are resolved (WITHDRAW/COMPROMISE/fix) or max 10 discussion rounds reached.
If max rounds reached without resolution, Claude makes the final call — dismiss or fix based on the accumulated evidence. Log the full exchange and the decision rationale in the review report.
Important: Only enter discussion for findings that are substantive and where the external reviewer might have a point. Clearly invalid findings (wrong file, misread code) should be dismissed via --previous-context without discussion.
After fixing valid issues and resolving discussions:
If valid issues were fixed:
If all remaining findings were dismissed:
--previous-context containing dismissal explanationsIf the external tool finds nothing new:
git commit -m "fix: address external review findings"Max review iterations: 3 (separate from the 10-round discussion limit per finding).
Same as Phase 1 but:
After all phases complete, output structured report:
# Code Review Report
## Summary
- Files reviewed: N
- Issues found: X (Y fixed, Z false positives)
- External review findings: A (B valid, C invalid)
## Phase 1: First Review
### Quality Agent
- [FIXED] Issue description
- [FALSE POSITIVE] Finding explanation
## Phase 2: External Review
- [VALID] Finding + fix applied
- [INVALID] Finding + rationale
- [DISCUSSED → FIXED] Finding + discussion summary (N rounds)
- [DISCUSSED → WITHDRAWN] Finding withdrawn by external reviewer (N rounds)
- [DISCUSSED → DISMISSED] Finding + full exchange + Claude's decision rationale (max rounds reached)
## Phase 3: Final Review
- No critical/major issues remaining
## Commits
- abc123: fix: address code review findings
- def456: fix: address external review findings
Agent prompts are resolved with project > user > built-in precedence (see Configuration Hierarchy above).
Project overrides: ./.claude/external-code-review/agents/*.txt
User overrides: ~/.claude/external-code-review/agents/*.txt
Built-in defaults: agents/ directory:
agents/quality.txt - Quality & security reviewagents/implementation.txt - Goal achievement verificationagents/testing.txt - Test coverage analysisagents/simplification.txt - Over-engineering detectionagents/documentation.txt - Documentation updatesThe script scripts/run_review.py is a thin wrapper that runs external tools only:
python scripts/run_review.py [options]
Options:
--branch, -b Base branch for diff (default: main)
--external-tool External tool: auto (default), codex, gemini, or pi
--codex-model Codex model override
--gemini-model Gemini model override
--pi-model Pi model override (supports provider/model format)
--pi-thinking Pi thinking level: off, minimal, low, medium, high, xhigh
--pi-options Additional Pi CLI options
--previous-context Dismissed findings from prior iterations
--discuss Discussion mode: debate disputed findings
--discussion-context The dispute exchange (findings + counter-arguments)
--sandbox read-only, Gemini: -s, Pi: --tools read,grep,find,ls)npx claudepluginhub rashpile/pako-pubmarket --plugin pako-public-pluginRuns a structured code review using Codex, Claude, or other engines as a closeout check before commit or ship.
Runs cross-model code reviews using the external Codex CLI tool from a Claude session. Catches bugs that single-model self-review would miss by leveraging a different reviewer architecture.
Orchestrates multi-agent code review with Codex CLI, Gemini CLI, and five Claude specialist subagents (security, performance, logic, regression, robustness) then synthesizes findings into verified fixes. Use for deep reviews, second opinions, or council reviews on PRs, commits, or branches.