agent-review

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Agent Review

Agent 评审

Get feedback from an external AI agent. Useful for code review, architecture decisions, or getting a second opinion.
从外部AI Agent获取反馈。适用于代码评审、架构决策或获取第二意见。

Running Commands

运行命令

bash
echo "code or prompt" | node .claude/skills/agent-review/query.mjs [options] "Your question"
bash
echo "code or prompt" | node .claude/skills/agent-review/query.mjs [options] "Your question"

or

or

node .claude/skills/agent-review/query.mjs --file <path> [options] "Your question"
undefined
node .claude/skills/agent-review/query.mjs --file <path> [options] "Your question"
undefined

Options

选项

FlagShortDescription
--model <model>
-m
Model or alias (default: gemini)
--file <path>
-f
Read input from file instead of stdin
--lines <start-end>
-l
Extract specific lines from file (e.g., 50-100)
--context <path>
-c
Additional context file (can repeat)
--system <prompt>
-s
Custom system prompt
--temperature <n>
-t
Temperature 0-1 (default: 0.7)
--quiet
-q
Suppress status messages and usage stats
--list
List available models
--json
Output raw JSON response
标识简写描述
--model <model>
-m
模型或别名(默认值:gemini)
--file <path>
-f
从文件读取输入而非标准输入
--lines <start-end>
-l
从文件中提取特定行(例如:50-100)
--context <path>
-c
附加上下文文件(可重复使用)
--system <prompt>
-s
自定义系统提示词
--temperature <n>
-t
温度值0-1(默认值:0.7)
--quiet
-q
抑制状态消息和使用统计
--list
列出可用模型
--json
输出原始JSON响应

Available Models

可用模型

Model IDAliasesProviderNotes
google/gemini-3-pro-preview
gemini
,
g3
OpenRouterDefault - good for external perspective
openai/gpt-5.1-codex
gpt
,
codex
,
gpt5
OpenRouterStrong at code analysis
anthropic/claude-opus-4.5
opus
,
claude-opus
Agent SDKUses local subscription
anthropic/claude-sonnet-4.5
sonnet
,
claude
Agent SDKUses local subscription
Anthropic models route through Claude Agent SDK (uses your Claude subscription). Other models route through OpenRouter API (requires
OPENROUTER_API_KEY
).
模型ID别名提供商说明
google/gemini-3-pro-preview
gemini
,
g3
OpenRouter默认模型 - 适合获取外部视角
openai/gpt-5.1-codex
gpt
,
codex
,
gpt5
OpenRouter擅长代码分析
anthropic/claude-opus-4.5
opus
,
claude-opus
Agent SDK使用本地订阅
anthropic/claude-sonnet-4.5
sonnet
,
claude
Agent SDK使用本地订阅
Anthropic模型通过Claude Agent SDK路由(使用您的Claude订阅)。其他模型通过OpenRouter API路由(需要
OPENROUTER_API_KEY
)。

Environment Variables

环境变量

VariableRequiredDescription
OPENROUTER_API_KEY
For non-Anthropic modelsOpenRouter API key
AGENT_REVIEW_DEFAULT_MODEL
NoOverride default model
变量名是否必填描述
OPENROUTER_API_KEY
非Anthropic模型必填OpenRouter API密钥
AGENT_REVIEW_DEFAULT_MODEL
覆盖默认模型

Examples

示例

Code Review

代码评审

bash
undefined
bash
undefined

Review a file for security issues

Review a file for security issues

cat src/server/auth.ts | node .claude/skills/agent-review/query.mjs
"Review this authentication code for security vulnerabilities"
cat src/server/auth.ts | node .claude/skills/agent-review/query.mjs
"Review this authentication code for security vulnerabilities"

Review with a specific model (using alias)

Review with a specific model (using alias)

node .claude/skills/agent-review/query.mjs -m gpt -f src/utils/parser.ts
"Review this parser for edge cases and error handling"
undefined
node .claude/skills/agent-review/query.mjs -m gpt -f src/utils/parser.ts
"Review this parser for edge cases and error handling"
undefined

Reviewing Specific Lines

评审特定代码行

bash
undefined
bash
undefined

Review a specific function (lines 50-100)

Review a specific function (lines 50-100)

node .claude/skills/agent-review/query.mjs
-f src/server/auth.ts -l 50-100
"Review this authentication function for security issues"
node .claude/skills/agent-review/query.mjs
-f src/server/auth.ts -l 50-100
"Review this authentication function for security issues"

Review a single line

Review a single line

node .claude/skills/agent-review/query.mjs
-f src/utils/parser.ts -l 42
"Is this regex safe from ReDoS attacks?"
undefined
node .claude/skills/agent-review/query.mjs
-f src/utils/parser.ts -l 42
"Is this regex safe from ReDoS attacks?"
undefined

With Context Files

使用上下文文件

bash
undefined
bash
undefined

Review code with type definitions as context

Review code with type definitions as context

node .claude/skills/agent-review/query.mjs
-f src/api/routes.ts
-c src/types/api.ts
-c src/types/models.ts
"Review this API implementation"
node .claude/skills/agent-review/query.mjs
-f src/api/routes.ts
-c src/types/api.ts
-c src/types/models.ts
"Review this API implementation"

Review component with its hooks as context

Review component with its hooks as context

node .claude/skills/agent-review/query.mjs
-f src/components/UserProfile.tsx
-c src/hooks/useUser.ts
"Review this React component for performance issues"
undefined
node .claude/skills/agent-review/query.mjs
-f src/components/UserProfile.tsx
-c src/hooks/useUser.ts
"Review this React component for performance issues"
undefined

Architecture Feedback

架构反馈

bash
undefined
bash
undefined

Get feedback on a proposed design

Get feedback on a proposed design

cat docs/design-proposal.md | node .claude/skills/agent-review/query.mjs
"What are the potential issues with this architecture?"
undefined
cat docs/design-proposal.md | node .claude/skills/agent-review/query.mjs
"What are the potential issues with this architecture?"
undefined

Custom System Prompt

自定义系统提示词

bash
node .claude/skills/agent-review/query.mjs \
  -f src/api/routes.ts \
  -s "You are a security expert specializing in API design" \
  "Audit this API for OWASP top 10 vulnerabilities"
bash
node .claude/skills/agent-review/query.mjs \
  -f src/api/routes.ts \
  -s "You are a security expert specializing in API design" \
  "Audit this API for OWASP top 10 vulnerabilities"

Temperature Control

温度值控制

bash
undefined
bash
undefined

Lower temperature for more deterministic analysis

Lower temperature for more deterministic analysis

node .claude/skills/agent-review/query.mjs -t 0.2 -f src/algo.ts
"Analyze the time complexity"
node .claude/skills/agent-review/query.mjs -t 0.2 -f src/algo.ts
"Analyze the time complexity"

Higher temperature for creative suggestions

Higher temperature for creative suggestions

node .claude/skills/agent-review/query.mjs -t 0.9 -f src/ui.tsx
"Suggest ways to improve the user experience"
undefined
node .claude/skills/agent-review/query.mjs -t 0.9 -f src/ui.tsx
"Suggest ways to improve the user experience"
undefined

Using Anthropic Models (Local Subscription)

使用Anthropic模型(本地订阅)

bash
undefined
bash
undefined

Uses Claude Agent SDK - no API credits consumed

Uses Claude Agent SDK - no API credits consumed

node .claude/skills/agent-review/query.mjs -m opus -f complex-algorithm.ts
"Analyze the time complexity and suggest optimizations"
undefined
node .claude/skills/agent-review/query.mjs -m opus -f complex-algorithm.ts
"Analyze the time complexity and suggest optimizations"
undefined

Quiet Mode (for scripting)

静默模式(用于脚本)

bash
undefined
bash
undefined

Suppress all status messages, only output the response

Suppress all status messages, only output the response

REVIEW=$(node .claude/skills/agent-review/query.mjs -q -f src/auth.ts
"List security issues as JSON array") echo "$REVIEW" | jq .
undefined
REVIEW=$(node .claude/skills/agent-review/query.mjs -q -f src/auth.ts
"List security issues as JSON array") echo "$REVIEW" | jq .
undefined

Output

输出

The response text is written to stdout. After the response, usage stats are shown on stderr:
Tokens: 189 in / 871 out (1060 total)
Cost: $0.0108
This helps track token consumption and costs for OpenRouter requests. Use
--quiet
to suppress.
响应文本将输出到标准输出。响应结束后,使用统计信息会显示在标准错误输出中:
Tokens: 189 in / 871 out (1060 total)
Cost: $0.0108
这有助于跟踪OpenRouter请求的令牌消耗和成本。使用
--quiet
参数可抑制该信息。

When to Use

适用场景

  • Code Review: Get a second opinion on code quality, security, or performance
  • Architecture Decisions: Validate design choices with another perspective
  • Bug Analysis: Share error context and get debugging suggestions
  • Documentation Review: Check if docs are clear and complete
  • Test Coverage: Identify missing test cases
  • 代码评审:获取关于代码质量、安全性或性能的第二意见
  • 架构决策:从另一个视角验证设计选择
  • Bug分析:分享错误上下文并获取调试建议
  • 文档评审:检查文档是否清晰完整
  • 测试覆盖:识别缺失的测试用例

Tips

使用技巧

  • Default model (Gemini 3 Pro) is recommended for most external reviews
  • Use Anthropic models when you want consistency with Claude's style
  • Use
    -l
    to review specific functions without sending the entire file (saves tokens)
  • Use
    -c
    to include type definitions or related files for better context
  • Use
    -t 0.2
    for more focused/deterministic responses,
    -t 0.8
    for creative suggestions
  • Pipe code directly for quick reviews:
    cat file.ts | node ... "review this"
  • 推荐使用默认模型(Gemini 3 Pro)进行大多数外部评审
  • 当您希望保持与Claude风格一致时,使用Anthropic模型
  • 使用
    -l
    参数评审特定函数,无需发送整个文件(节省令牌)
  • 使用
    -c
    参数包含类型定义或相关文件以提供更好的上下文
  • 使用
    -t 0.2
    获取更聚焦/确定的响应,使用
    -t 0.8
    获取创意建议
  • 直接管道传输代码以快速评审:
    cat file.ts | node ... "review this"