返回顶部
a

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.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.1.0
安全检测
已通过
73
下载量
0
收藏
概述
安装方式
版本历史

adaptive-review

# Adaptive Code Review Review code changes with model depth proportional to change complexity. No wasted opus tokens on trivial diffs. ## Step 1: Collect Signals Run these commands to gather diff signals: ```bash # Get diff stats (against HEAD~1 or origin/main, whichever makes sense) BASE=$(git merge-base HEAD origin/main 2>/dev/null || echo "HEAD~1") git diff --stat $BASE..HEAD git diff --numstat $BASE..HEAD ``` Extract: - **lines_changed**: total added + deleted - **files_changed**: number of files - **dirs_changed**: number of unique top-level directories touched (cross-module indicator) Then scan for high-risk patterns — **only in code files** (exclude .md/.txt/.json/.yaml from grep): ```bash 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)' ``` - **risk_hits**: count of matches (0 if only docs/config changed) ## Step 2: Route | Condition | Depth | Model | |-----------|-------|-------| | lines_changed < 50 AND files_changed <= 1 AND risk_hits == 0 | **fast** | haiku | | lines_changed < 200 AND dirs_changed <= 1 AND risk_hits <= 2 | **medium** | sonnet | | Everything else (>200 lines OR dirs_changed >= 2 OR risk_hits > 2) | **deep** | opus | Announce the routing decision: ``` Review depth: [fast|medium|deep] (N lines, N files, N dirs, N risk hits) ``` ## Step 3: Dispatch ### Fast (haiku) Spawn agent with `model: "haiku"`, subagent_type of your code-review agent: Prompt focus: formatting, naming conventions, obvious bugs, unused imports. Skip architecture analysis. Keep it under 30 seconds. ### Medium (sonnet) Spawn agent with `model: "sonnet"`, subagent_type of your code-review agent: Standard code review: correctness, error handling, test coverage, code quality. ### Deep (opus) Spawn agent with `model: "opus"`, subagent_type of your code-review agent: Full review: architecture, security, performance, cross-module impact. If language-specific reviewers exist (python-reviewer, go-reviewer, database-reviewer), spawn them in parallel. ## Step 4: Report Present results with depth label so the user knows what level of review was applied: ``` ## Adaptive Review: [FAST|MEDIUM|DEEP] Signals: {lines} lines, {files} files, {dirs} dirs, {risk_hits} risk hits [reviewer output] ``` If fast review finds anything concerning, suggest upgrading: "Fast review flagged potential issues. Run `/adaptive-review --deep` for thorough analysis." ## Overrides User can force depth: - `/adaptive-review --fast` — force fast regardless of signals - `/adaptive-review --deep` — force deep regardless of signals - `/adaptive-review --medium` — force medium

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 adaptive-review-1775882943 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 adaptive-review-1775882943 技能

通过命令行安装

skillhub install adaptive-review-1775882943

下载 Zip 包

⬇ 下载 adaptive-review v1.1.0

文件大小: 6.59 KB | 发布时间: 2026-4-12 08:37

v1.1.0 最新 2026-4-12 08:37
Add clawhub install instructions to README

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部