agent-review
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAgent 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"
undefinednode .claude/skills/agent-review/query.mjs --file <path> [options] "Your question"
undefinedOptions
选项
| Flag | Short | Description |
|---|---|---|
| | Model or alias (default: gemini) |
| | Read input from file instead of stdin |
| | Extract specific lines from file (e.g., 50-100) |
| | Additional context file (can repeat) |
| | Custom system prompt |
| | Temperature 0-1 (default: 0.7) |
| | Suppress status messages and usage stats |
| List available models | |
| Output raw JSON response |
| 标识 | 简写 | 描述 |
|---|---|---|
| | 模型或别名(默认值:gemini) |
| | 从文件读取输入而非标准输入 |
| | 从文件中提取特定行(例如:50-100) |
| | 附加上下文文件(可重复使用) |
| | 自定义系统提示词 |
| | 温度值0-1(默认值:0.7) |
| | 抑制状态消息和使用统计 |
| 列出可用模型 | |
| 输出原始JSON响应 |
Available Models
可用模型
| Model ID | Aliases | Provider | Notes |
|---|---|---|---|
| | OpenRouter | Default - good for external perspective |
| | OpenRouter | Strong at code analysis |
| | Agent SDK | Uses local subscription |
| | Agent SDK | Uses local subscription |
Anthropic models route through Claude Agent SDK (uses your Claude subscription).
Other models route through OpenRouter API (requires ).
OPENROUTER_API_KEY| 模型ID | 别名 | 提供商 | 说明 |
|---|---|---|---|
| | OpenRouter | 默认模型 - 适合获取外部视角 |
| | OpenRouter | 擅长代码分析 |
| | Agent SDK | 使用本地订阅 |
| | Agent SDK | 使用本地订阅 |
Anthropic模型通过Claude Agent SDK路由(使用您的Claude订阅)。其他模型通过OpenRouter API路由(需要)。
OPENROUTER_API_KEYEnvironment Variables
环境变量
| Variable | Required | Description |
|---|---|---|
| For non-Anthropic models | OpenRouter API key |
| No | Override default model |
| 变量名 | 是否必填 | 描述 |
|---|---|---|
| 非Anthropic模型必填 | OpenRouter API密钥 |
| 否 | 覆盖默认模型 |
Examples
示例
Code Review
代码评审
bash
undefinedbash
undefinedReview 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"
"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 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"
"Review this parser for edge cases and error handling"
undefinednode .claude/skills/agent-review/query.mjs -m gpt -f src/utils/parser.ts
"Review this parser for edge cases and error handling"
"Review this parser for edge cases and error handling"
undefinedReviewing Specific Lines
评审特定代码行
bash
undefinedbash
undefinedReview 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"
-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"
-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?"
-f src/utils/parser.ts -l 42
"Is this regex safe from ReDoS attacks?"
undefinednode .claude/skills/agent-review/query.mjs
-f src/utils/parser.ts -l 42
"Is this regex safe from ReDoS attacks?"
-f src/utils/parser.ts -l 42
"Is this regex safe from ReDoS attacks?"
undefinedWith Context Files
使用上下文文件
bash
undefinedbash
undefinedReview 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"
-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"
-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"
-f src/components/UserProfile.tsx
-c src/hooks/useUser.ts
"Review this React component for performance issues"
undefinednode .claude/skills/agent-review/query.mjs
-f src/components/UserProfile.tsx
-c src/hooks/useUser.ts
"Review this React component for performance issues"
-f src/components/UserProfile.tsx
-c src/hooks/useUser.ts
"Review this React component for performance issues"
undefinedArchitecture Feedback
架构反馈
bash
undefinedbash
undefinedGet 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?"
"What are the potential issues with this architecture?"
undefinedcat docs/design-proposal.md | node .claude/skills/agent-review/query.mjs
"What are the potential issues with this architecture?"
"What are the potential issues with this architecture?"
undefinedCustom 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
undefinedbash
undefinedLower 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"
"Analyze the time complexity"
node .claude/skills/agent-review/query.mjs -t 0.2 -f src/algo.ts
"Analyze the time complexity"
"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"
"Suggest ways to improve the user experience"
undefinednode .claude/skills/agent-review/query.mjs -t 0.9 -f src/ui.tsx
"Suggest ways to improve the user experience"
"Suggest ways to improve the user experience"
undefinedUsing Anthropic Models (Local Subscription)
使用Anthropic模型(本地订阅)
bash
undefinedbash
undefinedUses 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"
"Analyze the time complexity and suggest optimizations"
undefinednode .claude/skills/agent-review/query.mjs -m opus -f complex-algorithm.ts
"Analyze the time complexity and suggest optimizations"
"Analyze the time complexity and suggest optimizations"
undefinedQuiet Mode (for scripting)
静默模式(用于脚本)
bash
undefinedbash
undefinedSuppress 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 .
"List security issues as JSON array") echo "$REVIEW" | jq .
undefinedREVIEW=$(node .claude/skills/agent-review/query.mjs -q -f src/auth.ts
"List security issues as JSON array") echo "$REVIEW" | jq .
"List security issues as JSON array") echo "$REVIEW" | jq .
undefinedOutput
输出
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.0108This helps track token consumption and costs for OpenRouter requests. Use to suppress.
--quiet响应文本将输出到标准输出。响应结束后,使用统计信息会显示在标准错误输出中:
Tokens: 189 in / 871 out (1060 total)
Cost: $0.0108这有助于跟踪OpenRouter请求的令牌消耗和成本。使用参数可抑制该信息。
--quietWhen 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 to review specific functions without sending the entire file (saves tokens)
-l - Use to include type definitions or related files for better context
-c - Use for more focused/deterministic responses,
-t 0.2for creative suggestions-t 0.8 - 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"