Specialist Code Review
Dispatch specialized subagents to review code changes against their domain-specific
best practices (skill indices).
Step 1: Determine Review Scope
Detect the review scope automatically, in this priority order:
- User specified a PR number or URL → use that PR's diff
- Current branch has an open PR →
gh pr diff - Current branch is not main/master →
git diff main...HEAD - Uncommitted changes exist →
git diff HEAD(staged + unstaged; plain
git diff misses anything already staged)
- None of the above → ask the user what to review
Run these checks:
git branch --show-current
gh pr list --head $(git branch --show-current) --json number,url --jq '.[0]'
git status -s
Once scope is determined, get the full diff and save it to a variable for the subagents.
Step 2: Identify Tech Stacks from Diff
Read the full diff and identify which tech stacks are involved based on file paths and content:
| Signal | Tech Stack | Subagent |
|--------|-----------|----------|
| *.swift, *.xib, ios/, SwiftUI/UIKit imports | iOS | ios-dev |
| *.kt, *.kts, android/, Compose/Room imports | Android | android-dev |
| LangChain/LangGraph/OpenAI/Anthropic imports | LLM/AI | ai-engineer |
| *.cypher, Neo4j driver imports, graph schema | Neo4j | neo4j-dev |
| *.py, FastAPI/Flask/Django imports | Python Backend | general-purpose |
| *.ts, *.tsx, *.jsx, React/Next.js imports | Web Frontend | general-purpose |
| docs/gtm/, BRAND.md, marketing copy | Marketing / Brand | marketer |
| *.css, *.scss, design system files | Design | designer |
List all detected stacks and which subagents will be dispatched. If only one stack
is detected, dispatch one agent. If multiple, dispatch them in parallel.
On Codex the last two rows never resolve to their agent — marketer and
designer publish no Codex package — and general-purpose has no Codex
equivalent. All three fall through the ladder in Step 2.25 to the built-in
explorer.
Also extract the key libraries/frameworks used in the diff (e.g., jetpack compose,
swiftui, langgraph, react, room, fastapi). These will be passed to subagents
for documentation lookup.
Step 2.25: Pick a Reviewer for Each Stack
Each specialist agent ships as its own sub-plugin (ios-dev,
android-dev, ai-engineer, neo4j-dev). Users may have
only installed solopreneur (the core plugin), and on Codex none of the four
agents exist yet — only their knowledge skills are published.
For each stack detected in Step 2, take the first rung that works. This is the