← Back to Skills Marketplace
2233admin

Adaptive Review

by 2233admin · GitHub ↗ · v1.1.0 · MIT-0
cross-platform ✓ Security Clean
128
Downloads
0
Stars
0
Active Installs
2
Versions
Install in OpenClaw
/install adaptive-review
Description
Adaptive code review that routes to haiku/sonnet/opus based on diff complexity signals. Use instead of requesting-code-review for cost-efficient reviews.
README (SKILL.md)

\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
Usage Guidance
This skill appears coherent: it only scans your git diff and routes review work to a smaller or larger reviewer depending on the signals. Before installing or running it, consider these points: - Data exposure: adaptive-review will send diffs to whichever model/endpoint it spawns (haiku/sonnet/opus or any configured local endpoint). If those are remote cloud models, your code (including secrets contained in diffs) will be transmitted to that provider. If your repo contains sensitive data, either use a local/self-hosted endpoint (SKILL-openclaw.md guidance) or avoid running deep reviews against cloud models. - Secret handling: the grep intentionally targets code files and excludes .md/.json/.yaml, which reduces false positives but may miss secrets in config files. If your secrets live in config files, adjust the scan or add pre-checks to mask/remove secrets before review. - Overrides: users can force depths (--fast/--medium/--deep). A fast review may miss architecture/security issues; the skill sensibly recommends upgrading when fast finds potential issues. - Test first: try the skill on a non-sensitive repository to verify how your platform performs subagent/model calls and to confirm which endpoints actually receive the diff payloads. - Endpoint/config hygiene: if you use the OpenClaw/local variant, ensure the endpoints you configure are trustworthy and that any API keys are rotated and scoped appropriately. If you want stricter safety: restrict the skill to local/self-hosted models only, extend the grep to include config files you use for secrets, or add a preflight that blocks reviews when known secret patterns are present.
Capability Analysis
Type: OpenClaw Skill Name: adaptive-review Version: 1.1.0 The adaptive-review skill is a utility designed to optimize code review costs by routing diffs to different LLM models (Haiku, Sonnet, Opus, or local models) based on complexity signals. It uses standard git commands and grep to analyze local repository changes (SKILL.md, SKILL-openclaw.md) and does not exhibit any signs of data exfiltration, malicious execution, or prompt injection. The logic is transparently documented and aligns with its stated purpose of cost-efficient code analysis.
Capability Assessment
Purpose & Capability
Name/description claim adaptive routing of code reviews; SKILL.md only requires git diff and greps code files, then routes to lightweight/medium/heavy reviewers. No unrelated binaries, credentials, or config paths are requested.
Instruction Scope
Runtime instructions are focused on collecting git diff signals and grepping code files for risk keywords, then spawning subagents/models. This is appropriate for a review router, but it does mean full diffs (and any discovered matches) will be sent to the chosen model/endpoint when a review runs — a privacy / data-exfiltration consideration depending on which remote models/endpoints you use.
Install Mechanism
Instruction-only skill with no install spec and no code files to execute; lowest install risk. README suggests optional git clone but that's typical and not required by the runtime instructions.
Credentials
The skill declares no required env vars or credentials. The OpenClaw/local variant documents optional environment variables for local endpoints — appropriate for the stated purpose. There are no unexplained credential requests. You should still validate any model endpoint/API keys you provide before use.
Persistence & Privilege
always is false, no privileged persistence requested, and autonomous invocation is the platform default. The skill does not attempt to modify other skills or system settings.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install adaptive-review
  3. After installation, invoke the skill by name or use /adaptive-review
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.1.0
Add clawhub install instructions to README
v1.0.0
Routes code review to haiku/sonnet/opus based on diff complexity signals. ~85% cost savings vs always-opus.
Metadata
Slug adaptive-review
Version 1.1.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 2
Frequently Asked Questions

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.

💬 Comments