/install adaptive-review
\r \r
Adaptive Code Review\r
\r Review code changes with model depth proportional to change complexity. No wasted opus tokens on trivial diffs.\r \r
Step 1: Collect Signals\r
\r Run these commands to gather diff signals:\r \r
# Get diff stats (against HEAD~1 or origin/main, whichever makes sense)\r
BASE=$(git merge-base HEAD origin/main 2>/dev/null || echo "HEAD~1")\r
git diff --stat $BASE..HEAD\r
git diff --numstat $BASE..HEAD\r
```\r
\r
Extract:\r
- **lines_changed**: total added + deleted\r
- **files_changed**: number of files\r
- **dirs_changed**: number of unique top-level directories touched (cross-module indicator)\r
\r
Then scan for high-risk patterns — **only in code files** (exclude .md/.txt/.json/.yaml from grep):\r
\r
```bash\r
git diff $BASE..HEAD -- '*.ts' '*.js' '*.py' '*.go' '*.rs' '*.java' '*.c' '*.cpp' '*.rb' '*.sh' | grep -ciE '(password|secret|token|auth|session|cookie|sql|inject|exec\(|eval\(|lock|mutex|semaphore|atomic|concurrent|unsafe)'\r
```\r
\r
- **risk_hits**: count of matches (0 if only docs/config changed)\r
\r
## Step 2: Route\r
\r
| Condition | Depth | Model |\r
|-----------|-------|-------|\r
| lines_changed \x3C 50 AND files_changed \x3C= 1 AND risk_hits == 0 | **fast** | haiku |\r
| lines_changed \x3C 200 AND dirs_changed \x3C= 1 AND risk_hits \x3C= 2 | **medium** | sonnet |\r
| Everything else (>200 lines OR dirs_changed >= 2 OR risk_hits > 2) | **deep** | opus |\r
\r
Announce the routing decision:\r
```\r
Review depth: [fast|medium|deep] (N lines, N files, N dirs, N risk hits)\r
```\r
\r
## Step 3: Dispatch\r
\r
### Fast (haiku)\r
Spawn agent with `model: "haiku"`, subagent_type of your code-review agent:\r
\r
Prompt focus: formatting, naming conventions, obvious bugs, unused imports. Skip architecture analysis. Keep it under 30 seconds.\r
\r
### Medium (sonnet)\r
Spawn agent with `model: "sonnet"`, subagent_type of your code-review agent:\r
\r
Standard code review: correctness, error handling, test coverage, code quality.\r
\r
### Deep (opus)\r
Spawn agent with `model: "opus"`, subagent_type of your code-review agent:\r
\r
Full review: architecture, security, performance, cross-module impact. If language-specific reviewers exist (python-reviewer, go-reviewer, database-reviewer), spawn them in parallel.\r
\r
## Step 4: Report\r
\r
Present results with depth label so the user knows what level of review was applied:\r
\r
```\r
## Adaptive Review: [FAST|MEDIUM|DEEP]\r
Signals: {lines} lines, {files} files, {dirs} dirs, {risk_hits} risk hits\r
\r
[reviewer output]\r
```\r
\r
If fast review finds anything concerning, suggest upgrading: "Fast review flagged potential issues. Run `/adaptive-review --deep` for thorough analysis."\r
\r
## Overrides\r
\r
User can force depth:\r
- `/adaptive-review --fast` — force fast regardless of signals\r
- `/adaptive-review --deep` — force deep regardless of signals\r
- `/adaptive-review --medium` — force medium\r
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install adaptive-review - After installation, invoke the skill by name or use
/adaptive-review - Provide required inputs per the skill's parameter spec and get structured output
What is Adaptive Review?
Adaptive code review that routes to haiku/sonnet/opus based on diff complexity signals. Use instead of requesting-code-review for cost-efficient reviews. It is an AI Agent Skill for Claude Code / OpenClaw, with 128 downloads so far.
How do I install Adaptive Review?
Run "/install adaptive-review" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Adaptive Review free?
Yes, Adaptive Review is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Adaptive Review support?
Adaptive Review is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Adaptive Review?
It is built and maintained by 2233admin (@2233admin); the current version is v1.1.0.