← 返回 Skills 市场
2233admin

Adaptive Review

作者 2233admin · GitHub ↗ · v1.1.0 · MIT-0
cross-platform ✓ 安全检测通过
128
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install 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.
使用说明 (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
安全使用建议
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.
功能分析
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.
能力评估
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.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install adaptive-review
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /adaptive-review 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
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.
元数据
Slug adaptive-review
版本 1.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

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. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 128 次。

如何安装 Adaptive Review?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install adaptive-review」即可一键安装,无需额外配置。

Adaptive Review 是免费的吗?

是的,Adaptive Review 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Adaptive Review 支持哪些平台?

Adaptive Review 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Adaptive Review?

由 2233admin(@2233admin)开发并维护,当前版本 v1.1.0。

💬 留言讨论