Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

code-reviewer代码审查员

Agent Skill

code-reviewer 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

294

周安装

12

GitHub Stars

4

下载量

95
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/accolver/skill-maker --skill code-reviewer

简介

code-reviewer 提供结构化代码审查,识别缺陷并给出可操作的修复建议,涵盖安全、性能、可维护性和测试覆盖等维度。

  • 适用于评估现有代码、diff 或 PR 的潜在问题,帮助开发者在合并前做出决策而非模糊反馈。
  • 每项发现均按类型分类、标记严重程度,并提供具体修复方案,提升审查效率与质量。
  • 安装命令为 npx skills add https://github.com/accolver/skill-maker --skill code-reviewer,需具备代码读取权限。
  • 注意:不适用于从零编写代码或架构设计,仅限审查已有实现。

SKILL.md

Code Reviewer

Overview

Perform thorough, structured code reviews that catch real issues and provide actionable feedback. Every finding is categorized by type, assigned a severity level, and paired with a concrete fix suggestion. The goal is a review that a developer can act on immediately — not vague observations.

When to use

  • The task is evaluating existing code, a diff, or a pull request for defects and risks.
  • The user wants findings, severity, rationale, and fix suggestions rather than new implementation.
  • The review scope includes bugs, security, performance, maintainability, or test coverage.
  • The output should help a developer decide what to change before merging or shipping.

Do NOT use when:

  • The user wants code written from scratch.
  • The task is primarily architecture planning or a refactor proposal with no review target.
  • The user only wants formatting or lint cleanup that an automated tool should handle.

Response format

Always structure the final response with these top-level sections, in this order:

  1. Summary — state the task, scope, and main conclusion in 1-3 sentences.
  2. Decision / Approach — state the key classification, assumptions, or chosen path.
  3. Artifacts — provide the primary deliverable(s) for this skill. Use clear subheadings for multiple files, commands, JSON payloads, queries, or documents.
  4. Validation — state checks performed, important risks, caveats, or unresolved questions.
  5. Next steps — list concrete follow-up actions, or write None if nothing remains.

Rules:

  • Do not omit a section; write None when a section does not apply.
  • If files are produced, list each file path under Artifacts before its contents.
  • If commands, JSON, SQL, YAML, or code are produced, put each artifact in fenced code blocks with the correct language tag when possible.
  • Keep section names exactly as written above so output stays predictable across skills.

Workflow

1. Understand Context

Before reviewing line-by-line, understand the big picture:

  • What does this code do? Read the PR description, commit messages, or ask.
  • What language/framework? Adjust expectations to the ecosystem's conventions.
  • What's the scope? A 10-line utility function gets different scrutiny than a 500-line auth module.
  • Are there tests? Note their presence or absence early.

Output: A 1-2 sentence summary of what the code is doing and its context.

2. Scan for Bugs and Logic Errors

Read through the code looking for correctness issues:

  • Off-by-one errors in loops and array access
  • Null/undefined dereferences
  • Incorrect boolean logic or operator precedence
  • Missing return statements or unreachable code
  • Race conditions in concurrent code
  • Incorrect error propagation

For each bug found, note the exact line, what's wrong, and what the fix is.

3. Check Security

Systematically check for common vulnerability classes:

  • Injection: SQL, command, XSS, template injection — any place user input reaches a sink
  • Authentication/Authorization: Missing auth checks, privilege escalation paths
  • Data exposure: Secrets in code, verbose error messages, logging sensitive data
  • Insecure defaults: Disabled TLS verification, permissive CORS, weak crypto
  • Input validation: Missing or insufficient validation of external input

Security findings are almost always critical or high severity.

4. Evaluate Performance

Look for patterns that will cause performance problems at scale:

  • N+1 queries: Database calls inside loops
  • Unbounded operations: Missing pagination, loading entire tables
  • Unnecessary work: Redundant computations, repeated parsing
  • Missing caching: Expensive operations that could be cached
  • Algorithmic complexity: O(n^2) or worse where O(n) or O(n log n) is possible
  • Resource leaks: Unclosed connections, file handles, streams

5. Assess Style and Readability

Check that the code is clear and follows conventions:

  • Consistent naming (camelCase, snake_case — match the project)
  • Functions and variables have descriptive names
  • No deeply nested conditionals (> 3 levels)
  • Comments explain "why", not "what"
  • Dead code or commented-out code removed
  • Consistent error handling patterns

Style findings are typically low or info severity.

6. Check Maintainability

Evaluate long-term code health:

  • Function length: Functions over 50 lines likely need extraction
  • Cyclomatic complexity: Too many branches = hard to test and reason about
  • Magic numbers/strings: Unnamed constants scattered through code
  • Coupling: Does this code depend on too many other modules?
  • Testability: Can this code be unit tested without mocking the world?
  • Duplication: Copy-pasted logic that should be extracted

7. Produce Structured Report

Compile all findings into the output format below. Order findings by severity (critical first, info last). Include a summary section with overall assessment.

Code Review Summary

Context: [1-2 sentence summary of what the code does] Overall Assessment: [PASS | PASS WITH CONCERNS | NEEDS CHANGES | REJECT] Findings: [N critical, N high, N medium, N low, N info]

Findings

[SEVERITY] [CATEGORY]: [Brief title]

Location: [file:line or description of where] Issue: [What's wrong and why it matters] Suggestion: [Specific code or approach to fix it]

- problematic code
+ suggested fix

[Repeat for each finding, ordered by severity]

Recommendations

[2-3 sentences on the most important things to address before merging]

Also produce a structured `findings.json`:

{ "summary": { "context": "Brief description", "overall_assessment": "NEEDS CHANGES", "total_findings": 5, "by_severity": { "critical": 1, "high": 1, "medium": 2, "low": 1, "info": 0 }, "by_category": { "security": 1, "bug": 1, "performance": 1, "style": 1, "maintainability": 1 } }, "findings": [ { "severity": "critical", "category": "security", "title": "SQL injection via unsanitized user input", "location": "app/db.py:42", "issue": "User input is concatenated directly into SQL query string", "suggestion": "Use parameterized queries instead of string concatenation", "fix_diff": "- cursor.execute(f\"SELECT * FROM users WHERE id = {user_id}\")\n+ cursor.execute(\"SELECT * FROM users WHERE id = %s\", (user_id,))" } ] }


## Example

**Input code to review:**

def get_user_orders(db, user_id): query = "SELECT * FROM orders WHERE user_id = " + user_id results = db.execute(query) orders = [] for row in results: product = db.execute(f"SELECT name FROM products WHERE id = {row['product_id']}") orders.append({"order": row, "product": product[0]["name"]}) return orders


**Review output:**

## Code Review Summary

**Context**: Function retrieves a user's orders with product names from a
database. **Overall Assessment**: NEEDS CHANGES **Findings**: 1 critical, 1
high, 1 medium, 0 low, 0 info

## Findings

### CRITICAL SECURITY: SQL injection via string concatenation

**Location**: Line 2 **Issue**: `user_id` is concatenated directly into the SQL
query. An attacker can inject arbitrary SQL (e.g.,
`1 OR 1=1; DROP TABLE orders`). This is the #1 web application vulnerability
(OWASP A03:2021). **Suggestion**: Use parameterized queries.
  • query = "SELECT * FROM orders WHERE user_id = " + user_id

+ query = "SELECT * FROM orders WHERE user_id = %s" + results = db.execute(query, (user_id,))


### HIGH PERFORMANCE: N+1 query pattern

**Location**: Lines 4-6 **Issue**: For each order row, a separate database query
fetches the product name. With 100 orders, this executes 101 queries instead
of 2. This will degrade linearly with data volume. **Suggestion**: Use a JOIN or
batch query.
  • for row in results:
  • product = db.execute(f"SELECT name FROM products WHERE id = {row['product_id']}")
  • orders.append({"order": row, "product": product[0]["name"]})

+ query = """ + SELECT o.*, p.name as product_name + FROM orders o JOIN products p ON o.product_id = p.id + WHERE o.user_id = %s + """ + results = db.execute(query, (user_id,)) + orders = [{"order": row, "product": row["product_name"]} for row in results]


### MEDIUM BUG: No error handling for empty results

**Location**: Line 7 **Issue**: If `product` query returns empty results,
`product[0]["name"]` will raise an IndexError. This is likely when products are
deleted but orders remain. **Suggestion**: Add a guard for empty results.
  • orders.append({"order": row, "product": product[0]["name"]})

+ product_name = product[0]["name"] if product else "Unknown Product" + orders.append({"order": row, "product": product_name})


## Recommendations

Fix the SQL injection immediately — it's a critical security vulnerability. Then
refactor the N+1 query pattern with a JOIN, which will also eliminate the empty
result bug. Add parameterized queries throughout.

---

## Common Mistakes

| Mistake                                      | Fix                                                                               |
| -------------------------------------------- | --------------------------------------------------------------------------------- |
| Vague findings like "this could be improved" | Always state WHAT is wrong, WHY it matters, and HOW to fix it                     |
| Missing severity levels                      | Every finding needs critical/high/medium/low/info                                 |
| Reviewing only for style, ignoring security  | Follow the full workflow: bugs → security → performance → style → maintainability |
| Suggesting fixes without showing code        | Include diff-style code suggestions for non-trivial fixes                         |
| Treating all issues as equal priority        | Order by severity; developers should fix critical/high first                      |
| Reviewing code you don't understand          | Ask for context first; state assumptions explicitly                               |
| Nitpicking style in code with critical bugs  | Focus on what matters most; don't bury critical findings in style noise           |

## Key Principles

1. **Be specific, not vague** — "Line 42 has an SQL injection because user_id is
   concatenated into the query" beats "watch out for security issues." Every
   finding must point to a specific location and explain the concrete problem.

2. **Always suggest a complete fix** — Identifying a problem without a solution
   is only half the job. Include code diffs or clear instructions for every
   finding above info severity. A fix must be concrete enough that a developer
   can implement it without guessing — show the actual code change, not just
   "add error handling." If the fix requires imports, setup, or configuration
   changes, include those too.

3. **Explain the why** — Developers learn and prioritize better when they
   understand consequences. "This N+1 pattern will execute 1001 queries for 1000
   rows" is more compelling than "this is an N+1 query."

4. **Prioritize ruthlessly** — A review with 3 critical findings and 2 high
   findings is more useful than one with 47 low-severity style nits. Lead with
   what matters.

5. **Categorize consistently** — Use the severity and category system for every
   finding. This lets developers filter, triage, and track review feedback
   systematically.

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

36.58%
按下载量换算35

Claude

28.99%
按下载量换算28

Cursor

19.19%
按下载量换算18

Gemini CLI

9.91%
按下载量换算9

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills