Token导航 LogoToken导航TokenDH.com
前端设计需要联网github未标认证来源可访问clear审计异常

code-review-router代码审查路由器

Agent Skill

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

总安装

494

周安装

21

GitHub Stars

120

下载量

173
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:code-review-router(代码审查路由器)
来源仓库:https://github.com/win4r/agent-skills-code-review-router
仓库路径:skills/code-review-router
安装命令:
npx skills add https://github.com/win4r/agent-skills-code-review-router --skill code-review-router
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/win4r/agent-skills-code-review-router --skill code-review-router

简介

Code Review Router 根据变更特征智能路由至最优 CLI 引擎(Gemini 或 Codex)执行审查。

  • 适用于混合使用多种 AI 工具的团队,自动选择最适合当前任务的审查者。
  • 首先验证是否为 git 仓库,非仓库环境立即终止并提示初始化。
  • 不适用于文档校对或第三方代码审查等超出控制范围的场景。
  • code-review-router 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Code Review Router

Routes code reviews to the optimal CLI (Gemini or Codex) based on change characteristics.

When NOT to Use This Skill

  • For non-code reviews (documentation proofreading, prose editing)
  • When reviewing external/third-party code you don't control
  • For commit message generation (use a dedicated commit skill)
  • When you need a specific reviewer (use that CLI directly)

Step 0: Environment Check

Verify we're in a git repository:

git rev-parse --git-dir 2>/dev/null || echo "NOT_A_GIT_REPO"

If not a git repo: Stop and inform the user: "This directory is not a git repository. Initialize with git init or navigate to a repo."

Step 1: Prerequisites Check

Verify both CLIs are available:

# Check for Gemini CLI
which gemini || echo "GEMINI_NOT_FOUND"

# Check for Codex CLI
which codex || echo "CODEX_NOT_FOUND"

If neither CLI is found: Stop and inform the user they need to install at least one:

  • Gemini: Check Google's Gemini CLI installation docs
  • Codex: Check OpenAI's Codex CLI installation docs

If only one CLI is available: Use that CLI (no routing needed).

If both are available: Proceed with routing analysis.

Step 2: Analyze Git Diff

Run these commands to gather diff statistics:

# Get diff stats (staged + unstaged)
git --no-pager diff --stat HEAD 2>/dev/null || git --no-pager diff --stat

# Get full diff for pattern analysis
git --no-pager diff HEAD 2>/dev/null || git --no-pager diff

# Count changed files
git --no-pager diff --name-only HEAD 2>/dev/null | wc -l

# Count total changed lines
git --no-pager diff --numstat HEAD 2>/dev/null | awk '{added+=$1; removed+=$2} END {print added+removed}'

If no changes detected: Report "Nothing to review - no uncommitted changes found." and stop.

Step 3: Calculate Complexity Score

Initialize complexity_score = 0, then add points:

ConditionPointsDetection Method
Files changed > 10+2`git diff --name-only \wc -l`
Files changed > 20+3(additional, total +5)
Lines changed > 300+2git diff --numstat sum
Lines changed > 500+3(additional, total +5)
Multiple directories touched+1Count unique dirs in changed files
Test files included+1Files matching *test*, *spec*
Config files changed+1Files: *.config.*, *.json, *.yaml, *.yml, *.toml
Database/schema changes+2Files: *migration*, *schema*, *.sql, prisma/*
API route changes+2Files in api/, routes/, containing endpoint, handler
Service layer changes+2Files in services/, *service*, *provider*

Step 4: Detect Language & Framework

Analyze file extensions and content patterns:

Primary Language Detection

.ts, .tsx     → TypeScript
.js, .jsx     → JavaScript
.py           → Python
.go           → Go
.rs           → Rust
.java         → Java
.rb           → Ruby
.php          → PHP
.cs           → C#
.swift        → Swift
.kt           → Kotlin

Framework Detection (check imports/file patterns)

React/Next.js    → "import React", "from 'react'", "next.config", pages/, app/
Vue              → ".vue" files, "import Vue", "from 'vue'"
Angular          → "angular.json", "@angular/core"
Django           → "django", "models.py", "views.py", "urls.py"
FastAPI          → "from fastapi", "FastAPI("
Express          → "express()", "from 'express'"
NestJS           → "@nestjs/", "*.module.ts", "*.controller.ts"
Rails            → "Gemfile" with rails, app/controllers/
Spring           → "springframework", "@RestController"

Security-Sensitive Patterns

Detect by file path OR code content:

File paths:

**/auth/**
**/security/**
**/*authentication*
**/*authorization*
**/middleware/auth*

Code patterns (in diff content):

password\s*=
api_key\s*=
secret\s*=
Bearer\s+
JWT
\.env
credentials
private_key
access_token

Config files:

.env*
*credentials*
*secrets*
*.pem
*.key

Step 5: Apply Routing Decision Tree

Routing Priority Order (evaluate top-to-bottom, first match wins):

Priority 1: Pattern-Based Rules (Hard Rules)

PatternRouteReason
Security-sensitive files/code detectedCodexRequires careful security analysis
Files > 20 OR lines > 500CodexLarge changeset needs thorough review
Database migrations or schema changesCodexArchitectural risk
API/service layer modificationsCodexBackend architectural changes
Changes span 3+ top-level directoriesCodexMulti-service impact
Complex TypeScript (generics, type utilities)CodexType system complexity
Pure frontend only (jsx/tsx/vue/css/html)GeminiSimpler, visual-focused review
Python ecosystem (py, Django, FastAPI)GeminiStrong Python support
Documentation only (md/txt/rst)GeminiSimple text review

Priority 2: Complexity Score (if no pattern matched)

ScoreRouteReason
≥ 6CodexHigh complexity warrants deeper analysis
< 6GeminiModerate complexity, prefer speed

Priority 3: Default

Gemini (faster feedback loop for unclear cases)

Step 6: Execute Review

Explain Routing Decision

Before executing, output:

## Code Review Routing

**Changes detected:**
- Files: [X] files changed
- Lines: [Y] lines modified
- Primary language: [language]
- Framework: [framework or "none detected"]

**Complexity score:** [N]/10
- [List contributing factors]

**Routing decision:** [Gemini/Codex]
- Reason: [primary reason for choice]

**Executing review...**

CLI Commands

Note: Gemini receives the diff via stdin (piped), while Codex has a dedicated review subcommand that reads the git context directly. If debugging, check that git diff HEAD produces output before running Gemini.

For Gemini:

# Pipe diff to Gemini with review prompt
git --no-pager diff HEAD | gemini -p "Review this code diff for: 1) Code quality issues, 2) Best practices violations, 3) Potential bugs, 4) Security concerns, 5) Performance issues. Provide specific, actionable feedback."

For Codex:

# Use dedicated 'review' subcommand for non-interactive code review
# Note: --uncommitted and [PROMPT] are mutually exclusive
codex review --uncommitted

Step 7: Handle Failures with Fallback

If the chosen CLI fails (non-zero exit or error output):

  1. Report the failure: [Primary CLI] failed: [error message] Attempting fallback to [other CLI]...
  2. Try the alternative CLI
  3. If fallback also fails: Both review CLIs failed. - Gemini error: [error] - Codex error: [error] Please check CLI installations and try manually.

Step 8: Format Output

Present the review results clearly:

## Code Review Results

**Reviewed by:** [Gemini/Codex]
**Routing:** [brief reason]

---

[CLI output here]

---

**Review complete.** [X files, Y lines analyzed]

Quick Reference

Change TypeRouteReason
React component stylingGeminiPure frontend
Django view updateGeminiPython ecosystem
Single bug fix < 50 linesGeminiSimple change
New API endpoint + testsCodexArchitectural
Auth system changesCodexSecurity-sensitive
Database migrationCodexSchema change
Multi-service refactorCodexHigh complexity
TypeScript type overhaulCodexComplex types

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

28.51%
按下载量换算49

Codex

19.75%
按下载量换算34

windsurf

17.41%
按下载量换算30

trae

12.39%
按下载量换算21

OpenCode

7.48%
按下载量换算13

weavefox

3.13%
按下载量换算5

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills